From 432248cbf12ee7ee1e1b799291e71f3adc098e9f Mon Sep 17 00:00:00 2001 From: yury Date: Thu, 17 Sep 2015 12:48:58 +0000 Subject: [PATCH] * Removed lot of unused vars. git-svn-id: trunk@31732 - --- compiler/aggas.pas | 3 --- compiler/aopt.pas | 2 +- compiler/aoptobj.pas | 2 -- compiler/arm/aasmcpu.pas | 3 --- compiler/arm/aoptcpu.pas | 7 ++----- compiler/arm/cpupara.pas | 1 - compiler/arm/hlcgcpu.pas | 1 - compiler/arm/narminl.pas | 1 - compiler/arm/narmmat.pas | 1 - compiler/arm/rgcpu.pas | 6 +----- compiler/assemble.pas | 2 ++ compiler/cutils.pas | 2 -- compiler/ncgadd.pas | 2 +- compiler/ncgcal.pas | 3 +-- compiler/ncgcon.pas | 1 - compiler/ncgmem.pas | 1 - compiler/ncgrtti.pas | 2 +- compiler/ncgutil.pas | 1 - compiler/ncnv.pas | 3 --- compiler/nmat.pas | 1 - compiler/ogcoff.pas | 2 -- compiler/options.pas | 2 +- compiler/pdecobj.pas | 2 -- compiler/pgenutil.pas | 7 +------ compiler/pinline.pas | 4 ---- compiler/pstatmnt.pas | 1 - compiler/psub.pas | 2 -- compiler/scanner.pas | 2 -- compiler/symdef.pas | 8 +------- compiler/symsym.pas | 2 -- compiler/systems/t_win.pas | 2 ++ compiler/widestr.pas | 2 ++ 32 files changed, 16 insertions(+), 65 deletions(-) diff --git a/compiler/aggas.pas b/compiler/aggas.pas index 4302353e0b..7848c34aca 100644 --- a/compiler/aggas.pas +++ b/compiler/aggas.pas @@ -623,9 +623,6 @@ implementation i,pos,l : longint; InlineLevel : cardinal; last_align : longint; - co : comp; - sin : single; - d : double; {$ifdef cpuextended} e : extended; {$endif cpuextended} diff --git a/compiler/aopt.pas b/compiler/aopt.pas index 68637bf4c2..5b281b212f 100644 --- a/compiler/aopt.pas +++ b/compiler/aopt.pas @@ -331,7 +331,7 @@ Unit aopt; procedure TAsmScheduler.SchedulerPass1; var - p,hp1,hp2 : tai; + p : tai; begin p:=BlockStart; while p<>BlockEnd Do diff --git a/compiler/aoptobj.pas b/compiler/aoptobj.pas index ff9d98beca..aade258ba3 100644 --- a/compiler/aoptobj.pas +++ b/compiler/aoptobj.pas @@ -859,8 +859,6 @@ Unit AoptObj; procedure TAOptObj.UpdateUsedRegs(p : Tai); - var - i : TRegisterType; begin { this code is based on TUsedRegs.Update to avoid multiple passes through the asmlist, the code is duplicated here } diff --git a/compiler/arm/aasmcpu.pas b/compiler/arm/aasmcpu.pas index 5be230563b..d5d3a88d0d 100644 --- a/compiler/arm/aasmcpu.pas +++ b/compiler/arm/aasmcpu.pas @@ -945,12 +945,10 @@ implementation penalty, lastinspos, { increased for every data element > 4 bytes inserted } - currentsize, extradataoffset, curop : longint; curtai, inserttai : tai; - ai_label : tai_label; curdatatai,hp,hp2 : tai; curdata : TAsmList; l : tasmlabel; @@ -1322,7 +1320,6 @@ implementation procedure ensurethumbencodings(list: TAsmList); var curtai: tai; - op2reg: TRegister; begin { Do Thumb 16bit transformations to form valid instruction forms } curtai:=tai(list.first); diff --git a/compiler/arm/aoptcpu.pas b/compiler/arm/aoptcpu.pas index 3fc493195b..3c4a2fd639 100644 --- a/compiler/arm/aoptcpu.pas +++ b/compiler/arm/aoptcpu.pas @@ -2632,8 +2632,7 @@ Implementation function TCpuThumb2AsmOptimizer.PeepHoleOptPass1Cpu(var p: tai): boolean; var hp : taicpu; - hp1,hp2 : tai; - oldreg : TRegister; + //hp1,hp2 : tai; begin result:=false; if inherited PeepHoleOptPass1Cpu(p) then @@ -2760,10 +2759,8 @@ Implementation procedure TCpuThumb2AsmOptimizer.PeepHoleOptPass2; var p,hp1,hp2: tai; - l,l2 : longint; + l : longint; condition : tasmcond; - hp3: tai; - WasLast: boolean; { UsedRegs, TmpUsedRegs: TRegSet; } begin diff --git a/compiler/arm/cpupara.pas b/compiler/arm/cpupara.pas index 582dc2b18a..3bbfa6c9f2 100644 --- a/compiler/arm/cpupara.pas +++ b/compiler/arm/cpupara.pas @@ -218,7 +218,6 @@ unit cpupara; var i: longint; sym: tsym; - fpufield: boolean; begin if handle_common_ret_in_param(def,pd,result) then exit; diff --git a/compiler/arm/hlcgcpu.pas b/compiler/arm/hlcgcpu.pas index 2966b1f8b7..29f058f566 100644 --- a/compiler/arm/hlcgcpu.pas +++ b/compiler/arm/hlcgcpu.pas @@ -63,7 +63,6 @@ implementation var tmpref, href : treference; - extrareg : boolean; l : TAsmLabel; begin reference_reset_base(href,voidpointertype,NR_R0,0,sizeof(pint)); diff --git a/compiler/arm/narminl.pas b/compiler/arm/narminl.pas index 97979e17b1..6667d0afc4 100644 --- a/compiler/arm/narminl.pas +++ b/compiler/arm/narminl.pas @@ -380,7 +380,6 @@ implementation procedure tarminlinenode.second_abs_long; var opsize : tcgsize; - hp : taicpu; begin if GenerateThumbCode then begin diff --git a/compiler/arm/narmmat.pas b/compiler/arm/narmmat.pas index 7f4d36523a..adafb30aee 100644 --- a/compiler/arm/narmmat.pas +++ b/compiler/arm/narmmat.pas @@ -393,7 +393,6 @@ implementation procedure tarmunaryminusnode.second_float; var - op: tasmop; pf: TOpPostfix; begin secondpass(left); diff --git a/compiler/arm/rgcpu.pas b/compiler/arm/rgcpu.pas index 260806b049..1612ddc597 100644 --- a/compiler/arm/rgcpu.pas +++ b/compiler/arm/rgcpu.pas @@ -174,7 +174,6 @@ unit rgcpu; var tmpref : treference; helplist : TAsmList; - l : tasmlabel; hreg : tregister; immshift: byte; a: aint; @@ -283,8 +282,6 @@ unit rgcpu; function trgcpu.do_spill_replace(list:TAsmList;instr:tai_cpu_abstract_sym;orgreg:tsuperregister;const spilltemp:treference):boolean; - var - b : byte; begin result:=false; if abs(spilltemp.offset)>4095 then @@ -611,8 +608,7 @@ unit rgcpu; procedure trgintcputhumb.add_cpu_interferences(p: tai); var r : tregister; - i, - hr : longint; + i : longint; begin if p.typ=ait_instruction then begin diff --git a/compiler/assemble.pas b/compiler/assemble.pas index 293bc0ced9..a111039a59 100644 --- a/compiler/assemble.pas +++ b/compiler/assemble.pas @@ -1711,7 +1711,9 @@ Implementation pdata : pointer; ssingle : single; ddouble : double; + {$if defined(cpuextended) and defined(FPC_HAS_TYPE_EXTENDED)} eextended : extended; + {$endif} ccomp : comp; tmp : word; begin diff --git a/compiler/cutils.pas b/compiler/cutils.pas index 9f47c26ac1..bd9faa1bfa 100644 --- a/compiler/cutils.pas +++ b/compiler/cutils.pas @@ -895,8 +895,6 @@ implementation PopCntData : array[0..15] of byte = (0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4); function PopCnt(AValue : Byte): Byte; - var - i : SizeInt; begin Result:=PopCntData[AValue and $f]+PopCntData[(AValue shr 4) and $f]; end; diff --git a/compiler/ncgadd.pas b/compiler/ncgadd.pas index 98007a640c..6626d5761a 100644 --- a/compiler/ncgadd.pas +++ b/compiler/ncgadd.pas @@ -86,9 +86,9 @@ interface *****************************************************************************} procedure tcgaddnode.pass_left_right; +{$if defined(x86) and not defined(llvm)} var tmpreg : tregister; -{$if defined(x86) and not defined(llvm)} pushedfpu : boolean; {$endif x86 and not llvm} begin diff --git a/compiler/ncgcal.pas b/compiler/ncgcal.pas index c0ff626568..d1bea9a54e 100644 --- a/compiler/ncgcal.pas +++ b/compiler/ncgcal.pas @@ -261,7 +261,6 @@ implementation procedure tcgcallparanode.secondcallparan; var - href : treference; pushaddr: boolean; begin if not(assigned(parasym)) then @@ -858,7 +857,6 @@ implementation regs_to_save_mm : Tcpuregisterset; href : treference; pop_size : longint; - vmtoffset : aint; pvreg : tregister; oldaktcallnode : tcallnode; retlocitem: pcgparalocation; @@ -868,6 +866,7 @@ implementation callref: boolean; {$ifdef vtentry} sym : tasmsymbol; + vmtoffset : aint; {$endif vtentry} {$ifdef SUPPORT_SAFECALL} cgpara : tcgpara; diff --git a/compiler/ncgcon.pas b/compiler/ncgcon.pas index ae20a17627..6c712265c5 100644 --- a/compiler/ncgcon.pas +++ b/compiler/ncgcon.pas @@ -543,7 +543,6 @@ implementation procedure tcgguidconstnode.pass_generate_code; var lastlabel : tasmlabel; - i : longint; entry : PHashSetItem; datatcb : ttai_typedconstbuilder; begin diff --git a/compiler/ncgmem.pas b/compiler/ncgmem.pas index 82e4a8d0cd..d8cedd5df5 100644 --- a/compiler/ncgmem.pas +++ b/compiler/ncgmem.pas @@ -223,7 +223,6 @@ implementation sym : tsym; st : tsymtable; hp : pnode; - hp2 : tnode; extraoffset : tcgint; begin sym:=nil; diff --git a/compiler/ncgrtti.pas b/compiler/ncgrtti.pas index 272970b569..70ceb5f7ac 100644 --- a/compiler/ncgrtti.pas +++ b/compiler/ncgrtti.pas @@ -1403,7 +1403,7 @@ implementation var t:Tenumsym; syms:tfplist; - h,i,p:longint; + i:longint; rttitypesym: ttypesym; rttidef: trecorddef; begin diff --git a/compiler/ncgutil.pas b/compiler/ncgutil.pas index a197320d09..d98b3f7088 100644 --- a/compiler/ncgutil.pas +++ b/compiler/ncgutil.pas @@ -783,7 +783,6 @@ implementation paraloc : pcgparalocation; href : treference; sizeleft : aint; - alignment : longint; tempref : treference; {$ifdef mips} tmpreg : tregister; diff --git a/compiler/ncnv.pas b/compiler/ncnv.pas index 1a09932b8a..1f7ef30b2e 100644 --- a/compiler/ncnv.pas +++ b/compiler/ncnv.pas @@ -1087,9 +1087,6 @@ implementation para : tcallparanode; hp : tstringconstnode; ws : pcompilerwidestring; - newblock : tblocknode; - newstat : tstatementnode; - restemp : ttempcreatenode; sa : ansistring; cw : tcompilerwidechar; l : SizeUInt; diff --git a/compiler/nmat.pas b/compiler/nmat.pas index 6181aa4b0c..282fd841ab 100644 --- a/compiler/nmat.pas +++ b/compiler/nmat.pas @@ -933,7 +933,6 @@ implementation function tunaryminusnode.pass_1 : tnode; var procname: string[31]; - fdef : tdef; begin result:=nil; firstpass(left); diff --git a/compiler/ogcoff.pas b/compiler/ogcoff.pas index d380047453..d249f74d5b 100644 --- a/compiler/ogcoff.pas +++ b/compiler/ogcoff.pas @@ -2184,7 +2184,6 @@ const pemagic : array[0..3] of byte = ( bssExeSec, idataExeSec, tlsExeSec : TExeSection; - tlsdir : TlsDirectory; hassymbols, writeDbgStrings : boolean; @@ -2504,7 +2503,6 @@ const pemagic : array[0..3] of byte = ( var exesec:TExeSection; objsec,textsec:TObjSection; - objsym:TObjSymbol; objreloc:TObjRelocation; i,j:longint; begin diff --git a/compiler/options.pas b/compiler/options.pas index 100bc3dfac..6858dfff86 100644 --- a/compiler/options.pas +++ b/compiler/options.pas @@ -215,7 +215,7 @@ const procedure SplitLine (var OrigString: TCmdStr; const Placeholder: TCmdStr; var RemainderString: TCmdStr); var - I, L: longint; + I: longint; HS2: TCmdStr; begin RemainderString := ''; diff --git a/compiler/pdecobj.pas b/compiler/pdecobj.pas index 5f2fa8e73a..ae383461b9 100644 --- a/compiler/pdecobj.pas +++ b/compiler/pdecobj.pas @@ -1301,8 +1301,6 @@ implementation old_current_structdef: tabstractrecorddef; old_current_genericdef, old_current_specializedef: tstoreddef; - hrecst: trecordsymtable; - fsym: tfieldvarsym; old_parse_generic: boolean; list: TFPObjectList; s: String; diff --git a/compiler/pgenutil.pas b/compiler/pgenutil.pas index 4875f5d745..05fafb17ce 100644 --- a/compiler/pgenutil.pas +++ b/compiler/pgenutil.pas @@ -416,15 +416,10 @@ uses found, first, err : boolean; - errval, i, gencount : longint; def : tstoreddef; - generictype : ttypesym; - generictypelist : tfphashobjectlist; - prettyname,specializename : ansistring; - ufinalspecializename, - countstr,genname,ugenname,finalspecializename : string; + countstr,genname,ugenname : string; srsym : tsym; st : tsymtable; begin diff --git a/compiler/pinline.pas b/compiler/pinline.pas index 6c83df2784..5958c18b2f 100644 --- a/compiler/pinline.pas +++ b/compiler/pinline.pas @@ -412,10 +412,6 @@ implementation function new_function : tnode; var - newstatement : tstatementnode; - newblock : tblocknode; - temp : ttempcreatenode; - para : tcallparanode; p1,p2 : tnode; classh : tobjectdef; srsym : tsym; diff --git a/compiler/pstatmnt.pas b/compiler/pstatmnt.pas index 8d07f6536b..6d35e05057 100644 --- a/compiler/pstatmnt.pas +++ b/compiler/pstatmnt.pas @@ -1041,7 +1041,6 @@ implementation function _asm_statement : tnode; var asmstat : tasmnode; - Marker : tai; reg : tregister; asmreader : tbaseasmreader; entrypos : tfileposinfo; diff --git a/compiler/psub.pas b/compiler/psub.pas index a04e64b732..a819593f40 100644 --- a/compiler/psub.pas +++ b/compiler/psub.pas @@ -1212,7 +1212,6 @@ implementation templist : TAsmList; headertai : tai; i : integer; - varsym : tabstractnormalvarsym; {RedoDFA : boolean;} procedure delete_marker(anode: tasmnode); @@ -2040,7 +2039,6 @@ implementation old_current_specializedef: tstoreddef; pdflags : tpdflags; pd,firstpd : tprocdef; - s : string; begin { save old state } old_current_procinfo:=current_procinfo; diff --git a/compiler/scanner.pas b/compiler/scanner.pas index 3cd8f08179..c10c3f72b0 100644 --- a/compiler/scanner.pas +++ b/compiler/scanner.pas @@ -2215,8 +2215,6 @@ type var hs : string; mac : tmacro; - l : longint; - w : integer; exprvalue: texprvalue; begin current_scanner.skipspace; diff --git a/compiler/symdef.pas b/compiler/symdef.pas index 2e8d67f027..0b6461f55d 100644 --- a/compiler/symdef.pas +++ b/compiler/symdef.pas @@ -1241,16 +1241,11 @@ implementation function make_mangledname(const typeprefix:TSymStr;st:TSymtable;const suffix:TSymStr):TSymStr; var - s,hs, + s, prefix : TSymStr; - oldlen, - newlen, - i : longint; crc : dword; - hp : tparavarsym; begin prefix:=''; - hp:=nil; if not assigned(st) then internalerror(200204212); { sub procedures } @@ -3170,7 +3165,6 @@ implementation var res: PHashSetItem; oldsymtablestack: tsymtablestack; - savesymtab: tsymtable; begin if not assigned(current_module) then internalerror(2011071101); diff --git a/compiler/symsym.pas b/compiler/symsym.pas index 45a623c4a9..57d5ca8d09 100644 --- a/compiler/symsym.pas +++ b/compiler/symsym.pas @@ -2182,8 +2182,6 @@ implementation constructor tparavarsym.ppuload(ppufile:tcompilerppufile); - var - b : byte; begin inherited ppuload(paravarsym,ppufile); paranr:=ppufile.getword; diff --git a/compiler/systems/t_win.pas b/compiler/systems/t_win.pas index cf89332d59..58c30e7d2f 100644 --- a/compiler/systems/t_win.pas +++ b/compiler/systems/t_win.pas @@ -111,6 +111,7 @@ implementation resourcefileclass : nil; resflags : []; ); +{$ifdef x86_64} res_win64_gorc_info : tresinfo = ( id : res_win64_gorc; @@ -121,6 +122,7 @@ implementation resourcefileclass : nil; resflags : []; ); +{$endif x86_64} Procedure GlobalInitSysInitUnitName(Linker : TLinker); diff --git a/compiler/widestr.pas b/compiler/widestr.pas index e76125a548..19a9c5c12b 100644 --- a/compiler/widestr.pas +++ b/compiler/widestr.pas @@ -346,9 +346,11 @@ unit widestr; function charlength(p: pchar; len: sizeint): sizeint; + {$IFDEF FPC_HAS_CPSTRING} var p2: pchar; i, chars, codepointlen: sizeint; + {$ENDIF FPC_HAS_CPSTRING} begin {$IFDEF FPC_HAS_CPSTRING} if len=0 then