From 5d74e0578a9a0b3f1eb199cadae41b84e014ef4b Mon Sep 17 00:00:00 2001 From: paul Date: Mon, 21 Jan 2013 01:24:36 +0000 Subject: [PATCH] compiler: remove unused variables and unneeded assignments git-svn-id: trunk@23467 - --- compiler/cgobj.pas | 2 -- compiler/fppu.pas | 1 - compiler/ncgcal.pas | 2 -- compiler/ncgcnv.pas | 4 ++-- compiler/ncnv.pas | 1 - compiler/ngenutil.pas | 2 -- compiler/nset.pas | 1 - compiler/optcse.pas | 2 +- compiler/options.pas | 2 +- compiler/pexpr.pas | 1 - compiler/pmodules.pas | 2 +- compiler/symtable.pas | 4 +--- compiler/x86/itx86int.pas | 21 ++++++++------------- compiler/x86/rax86.pas | 1 - 14 files changed, 14 insertions(+), 32 deletions(-) diff --git a/compiler/cgobj.pas b/compiler/cgobj.pas index 0840ff1c5b..79eef19180 100644 --- a/compiler/cgobj.pas +++ b/compiler/cgobj.pas @@ -1848,8 +1848,6 @@ implementation procedure tcg.a_loadmm_loc_reg(list: TAsmList; size: tcgsize; const loc: tlocation; const reg: tregister;shuffle : pmmshuffle); - var - tmpreg: tregister; begin case loc.loc of LOC_MMREGISTER,LOC_CMMREGISTER: diff --git a/compiler/fppu.pas b/compiler/fppu.pas index b9507e6bc0..4b9c3047f6 100644 --- a/compiler/fppu.pas +++ b/compiler/fppu.pas @@ -947,7 +947,6 @@ var var b : byte; newmodulename : string; - ns: string; begin { read interface part } repeat diff --git a/compiler/ncgcal.pas b/compiler/ncgcal.pas index 6ea88b586d..385bfa73a3 100644 --- a/compiler/ncgcal.pas +++ b/compiler/ncgcal.pas @@ -493,8 +493,6 @@ implementation procedure tcgcallnode.copy_back_paras; var - hp, - hp2 : tnode; ppn : tcallparanode; begin ppn:=tcallparanode(left); diff --git a/compiler/ncgcnv.pas b/compiler/ncgcnv.pas index 73d93f5de0..498f7716af 100644 --- a/compiler/ncgcnv.pas +++ b/compiler/ncgcnv.pas @@ -513,9 +513,9 @@ interface end; procedure Tcgtypeconvnode.second_nil_to_methodprocvar; - + {$ifdef jvm} var r:Treference; - + {$endif} begin {$ifdef jvm} {$ifndef nounsupported} diff --git a/compiler/ncnv.pas b/compiler/ncnv.pas index 9cc9a427c8..035a148ae9 100644 --- a/compiler/ncnv.pas +++ b/compiler/ncnv.pas @@ -1996,7 +1996,6 @@ implementation function ttypeconvnode.typecheck_proc_to_procvar : tnode; var pd : tabstractprocdef; - nestinglevel : byte; begin result:=nil; pd:=tabstractprocdef(left.resultdef); diff --git a/compiler/ngenutil.pas b/compiler/ngenutil.pas index 1570373966..899f045cfa 100644 --- a/compiler/ngenutil.pas +++ b/compiler/ngenutil.pas @@ -264,7 +264,6 @@ implementation stat: tstatementnode; block: tnode; psym: tsym; - tcinitproc: tprocdef; begin result:=maybe_insert_trashing(pd,n); if target_info.system in systems_typed_constants_node_init then @@ -291,7 +290,6 @@ implementation if (psym.typ<>procsym) or (tprocsym(psym).procdeflist.count<>1) then internalerror(2011040301); - tcinitproc:=tprocdef(tprocsym(psym).procdeflist[0]); addstatement(stat,ccallnode.create(nil,tprocsym(psym), pd.struct.symtable,nil,[])); end; diff --git a/compiler/nset.pas b/compiler/nset.pas index 7ff5407234..eeadf13326 100644 --- a/compiler/nset.pas +++ b/compiler/nset.pas @@ -861,7 +861,6 @@ implementation procedure tcasenode.printnodetree(var t: text); var - hp : tbinarynode; i : longint; begin write(t,printnodeindention,'('); diff --git a/compiler/optcse.pas b/compiler/optcse.pas index db8f805b8e..d3f1a6578d 100644 --- a/compiler/optcse.pas +++ b/compiler/optcse.pas @@ -133,7 +133,7 @@ unit optcse; end; var - i,j : longint; + i : longint; begin result:=fen_false; { don't add the tree below an untyped const parameter: there is diff --git a/compiler/options.pas b/compiler/options.pas index 84a3bfb03a..4ee707da20 100644 --- a/compiler/options.pas +++ b/compiler/options.pas @@ -2738,8 +2738,8 @@ var abi : tabi; {$if defined(arm) or defined(avr)} cpuflag : tcpuflags; -{$endif defined(arm) or defined(avr)} hs : string; +{$endif defined(arm) or defined(avr)} begin option:=coption.create; disable_configfile:=false; diff --git a/compiler/pexpr.pas b/compiler/pexpr.pas index cf686bd87e..45c0e610d4 100644 --- a/compiler/pexpr.pas +++ b/compiler/pexpr.pas @@ -226,7 +226,6 @@ implementation hdef : tdef; temp : ttempcreatenode; newstatement : tstatementnode; - procinfo : tprocinfo; begin { Properties are not allowed, because the write can be different from the read } diff --git a/compiler/pmodules.pas b/compiler/pmodules.pas index 17a5b54e00..7085b9339f 100644 --- a/compiler/pmodules.pas +++ b/compiler/pmodules.pas @@ -1011,7 +1011,7 @@ type force_init_final : boolean; init_procinfo, finalize_procinfo : tcgprocinfo; - i,idx : longint; + i : longint; ag : boolean; finishstate : tfinishstate; globalstate : tglobalstate; diff --git a/compiler/symtable.pas b/compiler/symtable.pas index 197c8d7178..741d616385 100644 --- a/compiler/symtable.pas +++ b/compiler/symtable.pas @@ -1023,7 +1023,7 @@ implementation procedure tabstractrecordsymtable.addfieldlist(list: tfpobjectlist; maybereorder: boolean); var - fieldvs, insertfieldvs, bestfieldvs: tfieldvarsym; + fieldvs, insertfieldvs: tfieldvarsym; base, fieldoffset, space, insertfieldsize, insertfieldoffset, bestinsertfieldoffset, bestspaceleft: asizeint; i, j, bestfieldindex: longint; globalfieldalignment, @@ -2991,7 +2991,6 @@ implementation function search_system_proc(const s: TIDString): tprocdef; var srsym: tsym; - pd: tprocdef; begin srsym:=tsym(systemunit.find(s)); if not assigned(srsym) and @@ -3238,7 +3237,6 @@ implementation function search_struct_member(pd : tabstractrecorddef;const s : string):tsym; { searches n in symtable of pd and all anchestors } var - srsym : tsym; srsymtable : tsymtable; begin { in case this is a formal class, first find the real definition } diff --git a/compiler/x86/itx86int.pas b/compiler/x86/itx86int.pas index 1199159576..9bf81abd25 100644 --- a/compiler/x86/itx86int.pas +++ b/compiler/x86/itx86int.pas @@ -60,22 +60,17 @@ implementation function findreg_by_intname(const s:string):integer; var - i,p : integer; - s1: string; - l,r,m: integer; begin {Binary search.} - p:=0; - i := (high(tregisterindex) + 1) shr 1; - l := 0; - r := high(tregisterindex) + 1; - while l < r do - begin - m := (l + r) div 2; - if int_regname_table[int_regname_index[m]] < s then l := m + 1 - else r := m; - end; + l := 0; + r := high(tregisterindex) + 1; + while l < r do + begin + m := (l + r) div 2; + if int_regname_table[int_regname_index[m]] < s then l := m + 1 + else r := m; + end; if int_regname_table[int_regname_index[r]]=s then findreg_by_intname:=int_regname_index[r] diff --git a/compiler/x86/rax86.pas b/compiler/x86/rax86.pas index 66cf6ed496..a258c9bf76 100644 --- a/compiler/x86/rax86.pas +++ b/compiler/x86/rax86.pas @@ -345,7 +345,6 @@ var memrefsize: integer; memopsize: integer; memoffset: asizeint; - s1: string; begin ExistsMemRefNoSize := false; ExistsMemRef := false;