Browse Source

* Removed lot of unused local vars. It is useful to turn on the notes in options. :)

git-svn-id: trunk@44053 -
yury 5 years ago
parent
commit
1b3a3a7983

+ 0 - 2
compiler/aasmcnst.pas

@@ -827,8 +827,6 @@ implementation
 
 
    destructor tai_aggregatetypedconst.destroy;
-     var
-       ai: tai_abstracttypedconst;
      begin
        fvalues.free;
        inherited destroy;

+ 1 - 1
compiler/aoptobj.pas

@@ -2419,7 +2419,7 @@ Unit AoptObj;
 
     procedure TAOptObj.PeepHoleOptPass1;
       var
-        p,hp1,hp2,hp3 : tai;
+        p : tai;
         stoploop, FirstInstruction, JumpOptsAvailable: boolean;
       begin
         JumpOptsAvailable := CanDoJumpOpts();

+ 2 - 4
compiler/cutils.pas

@@ -1632,11 +1632,10 @@ implementation
 
     function LengthSleb128(a: int64) : byte;
       var
-        b, size: byte;
+        b: byte;
         more: boolean;
       begin
         more := true;
-        size := sizeof(a)*8;
         result:=0;
         repeat
           b := a and $7f;
@@ -1677,12 +1676,11 @@ implementation
 
     function EncodeSleb128(a: int64;out buf;len : byte) : byte;
       var
-        b, size: byte;
+        b: byte;
         more: boolean;
         pbuf : pbyte;
       begin
         more := true;
-        size := sizeof(a)*8;
         result:=0;
         pbuf:=@buf;
         repeat

+ 0 - 1
compiler/dbgstabx.pas

@@ -299,7 +299,6 @@ implementation
       currsectype  : TAsmSectiontype;
       hp, inclinsertpos, last : tai;
       infile : tinputfile;
-      i,
       linenr, stabx_func_level,
       nolineinfolevel: longint;
       nextlineisfunstart: boolean;

+ 0 - 4
compiler/hlcgobj.pas

@@ -1623,13 +1623,9 @@ implementation
 
   procedure thlcgobj.a_load_const_subsetref(list: TAsmlist; tosubsetsize: tdef; a: tcgint; const sref: tsubsetreference);
     var
-      tmpref: treference;
       tmpsref: tsubsetreference;
       tmpreg: tregister;
       slopt: tsubsetloadopt;
-      newdef: tdef;
-      newbytesize: longint;
-      loval, hival: longint;
     begin
       if sref.bitlen>AIntBits then
         begin

+ 1 - 3
compiler/i386/aoptcpu.pas

@@ -127,9 +127,7 @@ unit aoptcpu;
 
     function TCPUAsmOPtimizer.PeepHoleOptPass1Cpu(var p: tai): boolean;
       var
-        hp1,hp2 : tai;
-        hp3,hp4: tai;
-        v:aint;
+        hp1 : tai;
       begin
         result:=False;
         case p.Typ Of

+ 0 - 2
compiler/i386/n386flw.pas

@@ -284,7 +284,6 @@ procedure ti386tryfinallynode.pass_generate_code;
     oldBreakLabel : tasmlabel;
     oldflowcontrol,tryflowcontrol : tflowcontrol;
     is_safecall: boolean;
-    hreg: tregister;
     sym : tasmsymbol;
   begin
     if (target_info.system<>system_i386_win32) then
@@ -300,7 +299,6 @@ procedure ti386tryfinallynode.pass_generate_code;
     breakfinallylabel:=nil;
     exceptlabel:=nil;
     safecalllabel:=nil;
-    hreg:=NR_NO;
     is_safecall:=implicitframe and (current_procinfo.procdef.proccalloption=pocall_safecall);
 
     { check if child nodes do a break/continue/exit }

+ 0 - 1
compiler/link.pas

@@ -376,7 +376,6 @@ Implementation
         i,j  : longint;
         ImportLibrary : TImportLibrary;
         ImportSymbol  : TImportSymbol;
-        cmdstritem: TCmdStrListItem;
       begin
         with hp do
          begin

+ 0 - 2
compiler/mips/cpugas.pas

@@ -90,8 +90,6 @@ unit cpugas;
       end;
 
     procedure TMIPSGNUAssembler.WriteExtraHeader;
-      var
-        i : longint;
       begin
         if not (cs_asm_pre_binutils_2_25 in current_settings.globalswitches) then
           writer.AsmWriteln(#9'.module nomips16');

+ 2 - 0
compiler/ncgmem.pas

@@ -857,7 +857,9 @@ implementation
          temp : longint;
          hreg : tregister;
          indexdef : tdef;
+         {$if defined(cpu8bitalu) or defined(cpu16bitalu)}
          i : Integer;
+         {$endif}
       begin
          paraloc1.init;
          paraloc2.init;

+ 1 - 1
compiler/ncgrtti.pas

@@ -1860,7 +1860,7 @@ implementation
       end;
 
     var
-      count,i,len: word;
+      count,i: word;
       attr : trtti_attribute;
       tbltcb : ttai_typedconstbuilder;
       tbllab : tasmlabel;

+ 0 - 5
compiler/pgenutil.pas

@@ -453,16 +453,11 @@ uses
 
     function generate_specialization_phase1(out context:tspecializationcontext;genericdef:tdef;parsedtype:tdef;symname:string;parsedpos:tfileposinfo):tdef;
       var
-        pt2 : tnode;
         found,
-        first,
         err : boolean;
         i,
         gencount : longint;
-        def : tstoreddef;
         countstr,genname,ugenname : string;
-        srsym : tsym;
-        st : tsymtable;
         tmpstack : tfpobjectlist;
       begin
         context:=nil;

+ 0 - 2
compiler/powerpc/agppcmpw.pas

@@ -727,8 +727,6 @@ interface
       consttype : taiconst_type;
       do_line,DoNotSplitLine,
       quoted   : boolean;
-      sin      : single;
-      d        : double;
 
     begin
       if not assigned(p) then

+ 0 - 4
compiler/powerpc/cpupara.pas

@@ -630,11 +630,7 @@ unit cpupara;
     function tcpuparamanager.create_varargs_paraloc_info(p : tabstractprocdef; side: tcallercallee; varargspara:tvarargsparalist):longint;
       var
         cur_stack_offset: aword;
-        parasize, l: longint;
         curintreg, firstfloatreg, curfloatreg, curmmreg: tsuperregister;
-        i : integer;
-        hp: tparavarsym;
-        paraloc: pcgparalocation;
       begin
         init_values(curintreg,curfloatreg,curmmreg,cur_stack_offset);
         firstfloatreg:=curfloatreg;

+ 0 - 2
compiler/powerpc/nppcmat.pas

@@ -93,8 +93,6 @@ implementation
          procedure genOrdConstNodeDiv;
          const
              negops : array[boolean] of tasmop = (A_NEG, A_NEGO);
-         var
-             divreg : tregister;
          begin
              if (tordconstnode(right).value = 0) then begin
                  internalerror(2005061701);

+ 0 - 1
compiler/powerpc/rappcgas.pas

@@ -142,7 +142,6 @@ Unit rappcgas;
         l : tcgint;
         relsym: string;
         asmsymtyp: tasmsymtype;
-        isflags: tindsymflags;
 
       begin
         Consume(AS_LPAREN);

+ 0 - 1
compiler/ppcgen/agppcgas.pas

@@ -497,7 +497,6 @@ unit agppcgas;
     procedure TPPCAIXAssembler.WriteAsmList;
       var
         cur_sectype : TAsmSectionType;
-        cur_list : TAsmList;
         hal : tasmlisttype;
         hp : tai;
         max_al : longint;

+ 0 - 4
compiler/ppcgen/cgppc.pas

@@ -563,7 +563,6 @@ unit cgppc;
         );
     var
       ref2: TReference;
-      tmpreg: tregister;
       op: TAsmOp;
     begin
       if not (fromsize in [OS_8..OS_INT,OS_S8..OS_SINT]) then
@@ -812,9 +811,6 @@ unit cgppc;
       AutoDirectTOCLimit = (high(smallint) div sizeof(pint)) - 500;
     var
       tmpref: treference;
-      { can have more than 16384 (32 bit) or 8192 (64 bit) toc entries and, as
-        as consequence, toc subsections -> 5 extra characters for the number}
-      tocsecname: string[length('tocsubtable')+5];
       nlsymname: string;
       newsymname: ansistring;
       sym: TAsmSymbol;

+ 0 - 1
compiler/ppcgen/ngppccnv.pas

@@ -72,7 +72,6 @@ implementation
         hreg2    : tregister;
 {$ifndef cpu64bitalu}
         href     : treference;
-        oldloc   : tlocation;
 {$endif not cpu64bitalu}
         resflags : tresflags;
         opsize   : tcgsize;

+ 2 - 8
compiler/psabiehpi.pas

@@ -622,7 +622,7 @@ implementation
       var
         cgpara1: tcgpara;
         pd: tprocdef;
-        action, ReRaiseLandingPad: TPSABIEHAction;
+        ReRaiseLandingPad: TPSABIEHAction;
         psabiehprocinfo: tpsabiehprocinfo;
       begin
         if not(fc_catching_exceptions in flowcontrol) and
@@ -686,17 +686,11 @@ implementation
       var
         catchstartlab : tasmlabel;
         begincatchres,
-        typeidres,
         paraloc1: tcgpara;
         pd: tprocdef;
-        landingpadstructdef,
-        landingpadtypeiddef: tdef;
         rttisym: TAsmSymbol;
         rttidef: tdef;
-        rttiref: treference;
-        wrappedexception,
-        exceptiontypeidreg,
-        landingpadres: tregister;
+        wrappedexception: tregister;
         exceptloc: tlocation;
         indirect: boolean;
         otherunit: boolean;

+ 0 - 3
compiler/symtable.pas

@@ -4263,10 +4263,8 @@ implementation
 
     function search_best_objectpascal_helper(const name: string;pd : tdef;contextclassh : tabstractrecorddef;out srsym: tsym;out srsymtable: tsymtable):boolean;
       var
-        s : string;
         list : TFPObjectList;
         i : integer;
-        st : tsymtable;
         odef : tobjectdef;
       begin
         result:=false;
@@ -4287,7 +4285,6 @@ implementation
 
     function search_last_objectpascal_helper(pd : tdef;contextclassh : tabstractrecorddef;out odef : tobjectdef):boolean;
       var
-        s : string;
         list : TFPObjectList;
         i : integer;
       begin

+ 0 - 1
compiler/systems/t_beos.pas

@@ -171,7 +171,6 @@ end;
 Constructor TLinkerBeos.Create;
 var
   s : string;
-  i : integer;
 begin
   Inherited Create;
   s:=GetEnvironmentVariable('BELIBRARIES');

+ 0 - 12
compiler/x86/aasmcpu.pas

@@ -3095,9 +3095,6 @@ implementation
         codes : pchar;
         c     : byte;
         len     : shortint;
-        len_ea_data: shortint;
-        len_ea_data_evex: shortint;
-        mref_offset: asizeint;
         ea_data : ea;
         exists_evex: boolean;
         exists_vex: boolean;
@@ -3108,17 +3105,12 @@ implementation
         exists_l256: boolean;
         exists_l512: boolean;
         exists_EVEXW1: boolean;
-        pmref_operand: poper;
 {$ifdef x86_64}
         omit_rexw : boolean;
 {$endif x86_64}
       begin
 
         len:=0;
-        len_ea_data := 0;
-        len_ea_data_evex:= 0;
-        mref_offset := 0;
-        pmref_operand := nil;
 
         codes:=@p^.code[0];
         exists_vex := false;
@@ -3716,7 +3708,6 @@ implementation
         EVEXx: byte;
         EVEXv: byte;
         EVEXll: byte;
-        EVEXw0: byte;
         EVEXw1: byte;
         EVEXz   : byte;
         EVEXaaa : byte;
@@ -3823,7 +3814,6 @@ implementation
         EVEXx    := 0;
         EVEXv    := 0;
         EVEXll   := 0;
-        EVEXw0   := 0;
         EVEXw1   := 0;
         EVEXz    := 0;
         EVEXaaa  := 0;
@@ -4902,8 +4892,6 @@ implementation
       AsmOp: TasmOp;
       i,j: longint;
       insentry  : PInsEntry;
-      codes : pchar;
-      c     : byte;
 
       MRefInfo: TMemRefSizeInfo;
       SConstInfo: TConstSizeInfo;

+ 1 - 1
compiler/x86/aoptx86.pas

@@ -5087,7 +5087,7 @@ unit aoptx86;
 
     function TX86AsmOptimizer.OptPass2SUB(var p: tai): Boolean;
       var
-        hp1, hp2: tai; NewRef: TReference;
+        hp1: tai; NewRef: TReference;
       begin
         { Change:
             subl/q $x,%reg1

+ 0 - 1
compiler/x86/rax86.pas

@@ -441,7 +441,6 @@ procedure Tx86Instruction.AddReferenceSizes;
   operand is a register }
 var
   operand2,i,j,k : longint;
-  t: topsize;
   s : tasmsymbol;
   so : aint;
   ExistsMemRefNoSize: boolean;

+ 0 - 3
compiler/x86/rax86int.pas

@@ -307,9 +307,6 @@ Unit Rax86int;
         forcelabel : boolean;
         srsym : tsym;
         srsymtable : TSymtable;
-        scomment: string;
-        schar: char;
-        old_commentstyle: tcommentstyle;
       begin
         actoperextention := '';