Prechádzať zdrojové kódy

* Removed unused local vars.

git-svn-id: trunk@40183 -
yury 6 rokov pred
rodič
commit
4357caaad8

+ 4 - 3
compiler/aarch64/aasmcpu.pas

@@ -592,7 +592,6 @@ implementation
 
     function simple_ref_type(op: tasmop; size:tcgsize; oppostfix: toppostfix; const ref: treference): tsimplereftype;
       var
-        maxoffs: asizeint;
         accesssize: longint;
       begin
         result:=sr_internal_illegal;
@@ -922,8 +921,8 @@ implementation
 
 
     procedure BuildInsTabCache;
-      var
-        i : longint;
+//      var
+//        i : longint;
       begin
 (*        new(instabcache);
         FillChar(instabcache^,sizeof(tinstabcache),$ff);
@@ -1006,6 +1005,7 @@ implementation
 *)
 
     procedure insertpcrelativedata(list,listtoinsert : TAsmList);
+(*
       var
         curinspos,
         penalty,
@@ -1021,6 +1021,7 @@ implementation
         l : tasmlabel;
         doinsert,
         removeref : boolean;
+*)
       begin
 (*
         curdata:=TAsmList.create;

+ 0 - 2
compiler/aarch64/aoptcpu.pas

@@ -146,8 +146,6 @@ Implementation
 
 
   function TCpuAsmOptimizer.PeepHoleOptPass1Cpu(var p: tai): boolean;
-    var
-      next1: tai;
     begin
       result := false;
       if p.typ=ait_instruction then

+ 1 - 4
compiler/aarch64/cgcpu.pas

@@ -1127,18 +1127,15 @@ implementation
 
     procedure tcgaarch64.a_bit_scan_reg_reg(list: TAsmList; reverse: boolean; srcsize, dstsize: tcgsize; src, dst: TRegister);
       var
-        bitsize,
-        signbit: longint;
+        bitsize: longint;
       begin
         if srcsize in [OS_64,OS_S64] then
           begin
             bitsize:=64;
-            signbit:=6;
           end
         else
           begin
             bitsize:=32;
-            signbit:=5;
           end;
         { source is 0 -> dst will have to become 255 }
         list.concat(taicpu.op_reg_const(A_CMP,src,0));

+ 0 - 1
compiler/aarch64/ncpucnv.pas

@@ -142,7 +142,6 @@ implementation
   procedure taarch64typeconvnode.second_int_to_bool;
     var
       resflags: tresflags;
-      hlabel: tasmlabel;
     begin
       if (nf_explicit in flags) and
          not(left.expectloc in [LOC_FLAGS,LOC_JUMP]) then

+ 0 - 1
compiler/aarch64/ncpuinl.pas

@@ -128,7 +128,6 @@ implementation
     procedure taarch64inlinenode.second_abs_long;
       var
         opsize : tcgsize;
-        hp : taicpu;
       begin
         secondpass(left);
         opsize:=def_cgsize(left.resultdef);

+ 0 - 1
compiler/aarch64/racpugas.pas

@@ -933,7 +933,6 @@ Unit racpugas;
         j  : longint;
         hs : string;
         maxlen : longint;
-        icond : tasmcond;
       Begin
         { making s a value parameter would break other assembler readers }
         hs:=s;

+ 0 - 1
compiler/aasmcnst.pas

@@ -1726,7 +1726,6 @@ implementation
    function ttai_typedconstbuilder.begin_dynarray_const(arrdef:tdef;var startlab:tasmlabel;out arrlengthloc:ttypedconstplaceholder):tasmlabofs;
      var
        dynarray_symofs: asizeint;
-       elesize: word;
      begin
        result.lab:=startlab;
        result.ofs:=0;

+ 1 - 6
compiler/i386/aoptcpu.pas

@@ -153,7 +153,6 @@ end;
 procedure TCPUAsmOptimizer.PrePeepHoleOpts;
 var
   p,hp1: tai;
-  l: aint;
   tmpRef: treference;
 begin
   p := BlockStart;
@@ -207,10 +206,6 @@ var
   hp3,hp4: tai;
   v:aint;
 
-  TmpRef: TReference;
-
-  TmpBool1, TmpBool2: Boolean;
-
   function GetFinalDestination(asml: TAsmList; hp: taicpu; level: longint): boolean;
   {traces sucessive jumps to their final destination and sets it, e.g.
    je l1                je l3
@@ -815,7 +810,7 @@ end;
 
 procedure TCPUAsmOptimizer.PostPeepHoleOpts;
 var
-  p,hp1,hp2: tai;
+  p,hp1: tai;
 begin
   p := BlockStart;
   ClearUsedRegs;

+ 0 - 2
compiler/nadd.pas

@@ -2964,10 +2964,8 @@ implementation
 
     function taddnode.first_adddynarray : tnode;
       var
-        p: tnode;
         newstatement : tstatementnode;
         tempnode (*,tempnode2*) : ttempcreatenode;
-        cmpfuncname: string;
         para: tcallparanode;
       begin
         result:=nil;

+ 0 - 4
compiler/ncgrtti.pas

@@ -1291,8 +1291,6 @@ implementation
             tcb.free;
           end;
 
-        var
-          riif : byte;
         begin
            write_header(tcb,def,tkRecord);
            { need extra reqalign record, because otherwise the u32 int will
@@ -1439,8 +1437,6 @@ implementation
         procedure objectdef_rtti(def: tobjectdef);
 
           procedure objectdef_rtti_fields(def:tobjectdef);
-          var
-            riif : byte;
           begin
             { - for compatiblity with record RTTI we need to write a terminator-
                 Nil pointer for initrtti as well for objects

+ 0 - 3
compiler/ninl.pas

@@ -4747,8 +4747,6 @@ implementation
 
        var
          procname : String;
-         c : longint;
-         n,
          newn,
          datan,
          datacountn,
@@ -4949,7 +4947,6 @@ implementation
          n,
          arrn,
          firstn : tnode;
-         startidx,
          i : longint;
          arrconstr : tarrayconstructornode;
          newstatement : tstatementnode;

+ 0 - 1
compiler/ogbase.pas

@@ -275,7 +275,6 @@ interface
      private
        FData       : TDynamicArray;
        FSecOptions : TObjSectionOptions;
-       FComdatSelection : TObjSectionComdatSelection;
        FCachedFullName : pshortstring;
        FSizeLimit : TObjSectionOfs;
        procedure SetSecOptions(Aoptions:TObjSectionOptions);

+ 0 - 1
compiler/options.pas

@@ -3671,7 +3671,6 @@ var
   env: ansistring;
   i : tfeature;
   j : longint;
-  abi : tabi;
   tmplist : TCmdStrList;
   cmditem,
   tmpcmditem : TCmdStrListItem;

+ 1 - 2
compiler/pdecsub.pas

@@ -2960,8 +2960,7 @@ const
       }
       var
         p     : longint;
-        name,
-        other : TIDString;
+        name : TIDString;
         po_comp : tprocoptions;
         tokenloc : TFilePosInfo;
       begin

+ 4 - 1
compiler/psub.pas

@@ -2132,9 +2132,12 @@ implementation
         old_current_genericdef,
         old_current_specializedef: tstoreddef;
         pdflags    : tpdflags;
-        def,pd,firstpd : tprocdef;
+        pd,firstpd : tprocdef;
+{$ifdef genericdef_for_nested}
+        def : tprocdef;
         srsym : tsym;
         i : longint;
+{$endif genericdef_for_nested}
       begin
          { save old state }
          old_current_procinfo:=current_procinfo;

+ 0 - 1
compiler/rgobj.pas

@@ -489,7 +489,6 @@ unit rgobj;
     procedure Trgobj.dispose_reginfo;
       var
         i : cardinal;
-        j : longint;
       begin
         if reginfo<>nil then
           begin

+ 1 - 3
compiler/symdef.pas

@@ -1553,9 +1553,7 @@ implementation
         s: string;
         list: TFPObjectList;
         def: tdef;
-        sym,srsym : tsym;
-        srsymtable : tsymtable;
-        entry : tgenericdummyentry;
+        sym : tsym;
       begin
         { search the symtable from first to last; the helper to use will be the
           last one in the list }

+ 1 - 2
compiler/x86/aasmcpu.pas

@@ -2399,7 +2399,7 @@ implementation
     function process_ea_ref_16(const input:toper;out output:ea;rfield:longint):boolean;
       var
         sym   : tasmsymbol;
-        md,s,rv  : byte;
+        md,s  : byte;
         base,
         o     : longint;
         ir,br : Tregister;
@@ -3726,7 +3726,6 @@ implementation
     procedure build_spilling_operation_type_table;
       var
         opcode : tasmop;
-        i      : integer;
       begin
         new(operation_type_table);
         fillchar(operation_type_table^,sizeof(toperation_type_table),byte(operand_read));

+ 2 - 1
compiler/x86/agx86int.pas

@@ -66,7 +66,7 @@ implementation
     const
       line_length = 70;
       max_tokens : longint = 25;
-
+(*
       wasm_cpu_name : array[tcputype] of string = (
 {$if defined(x86_64)}
         'IA64',        // cpu_none,
@@ -100,6 +100,7 @@ implementation
         '686'       // cpu_PentiumM
 {$endif}
       );
+*)
       secnames : array[TAsmSectiontype] of string[4] = ('','',
         'CODE','DATA','DATA','DATA','BSS','TLS',
         '','','','','','',

+ 8 - 5
compiler/x86/aoptx86.pas

@@ -250,8 +250,6 @@ unit aoptx86;
 
 
     function InstrReadsFlags(p: tai): boolean;
-      var
-        l: longint;
       begin
         InstrReadsFlags := true;
         case p.typ of
@@ -1033,7 +1031,6 @@ unit aoptx86;
       var
         TmpUsedRegs : TAllUsedRegs;
         hp1,hp2 : tai;
-        alloc ,dealloc: tai_regalloc;
       begin
         result:=false;
         if MatchOpType(taicpu(p),top_reg,top_reg) and
@@ -2148,8 +2145,10 @@ unit aoptx86;
 
 
     function TX86AsmOptimizer.OptPass1Sub(var p : tai) : boolean;
+{$ifdef i386}
       var
         hp1 : tai;
+{$endif i386}
       begin
         Result:=false;
         { * change "subl $2, %esp; pushw x" to "pushl x"}
@@ -2390,7 +2389,10 @@ unit aoptx86;
     function TX86AsmOptimizer.OptPass2MOV(var p : tai) : boolean;
       var
        TmpUsedRegs : TAllUsedRegs;
-       hp1,hp2,hp3: tai;
+       hp1,hp2: tai;
+{$ifdef x86_64}
+       hp3: tai;
+{$endif x86_64}
       begin
         Result:=false;
         if MatchOpType(taicpu(p),top_reg,top_reg) and
@@ -3316,7 +3318,6 @@ unit aoptx86;
     function TX86AsmOptimizer.OptPass1AND(var p : tai) : boolean;
       var
         hp1 : tai;
-        RegName1, RegName2: string;
         MaskLength : Cardinal;
       begin
         Result:=false;
@@ -3666,7 +3667,9 @@ unit aoptx86;
     function TX86AsmOptimizer.PostPeepholeOptCall(var p : tai) : Boolean;
       var
         hp1 : tai;
+{$ifndef x86_64}
         hp2 : taicpu;
+{$endif x86_64}
       begin
         Result:=false;
 {$ifndef x86_64}

+ 0 - 2
compiler/x86/nx86inl.pas

@@ -1225,8 +1225,6 @@ implementation
 
 
     procedure tx86inlinenode.second_int_real;
-      var
-        extrareg : TRegister;
       begin
         if use_vectorfpu(resultdef) then
           begin

+ 0 - 3
compiler/x86/nx86mat.pas

@@ -692,9 +692,7 @@ DefaultDiv:
     procedure tx86shlshrnode.second_mmx;
       var
         op         : TAsmOp;
-        cmpop      : boolean;
         mmxbase    : tmmxtype;
-        hreg,
         hregister  : tregister;
       begin
         secondpass(left);
@@ -704,7 +702,6 @@ DefaultDiv:
         if codegenerror then
           exit;
 
-        cmpop:=false;
         op:=A_NOP;
 
         mmxbase:=mmx_type(left.resultdef);

+ 0 - 1
compiler/x86/nx86set.pas

@@ -260,7 +260,6 @@ implementation
       procedure tx86casenode.genjmptreeentry(p : pcaselabel;parentvalue : TConstExprInt);
         var
           lesslabel,greaterlabel : tasmlabel;
-          less,greater : pcaselabel;
           cond_gt: TResFlags;
           cmplow : Boolean;
         begin

+ 3 - 4
compiler/x86_64/cpupara.pas

@@ -402,7 +402,7 @@ unit cpupara;
 
     function finalize_aggregate_classification(calloption: tproccalloption; def: tdef; words: longint; var classes: tx64paraclasses): longint;
       var
-        i, j, vecsize, maxvecsize: longint;
+        i, vecsize, maxvecsize: longint;
       begin
         { Workaround: It's not immediately possible to determine if a Double is
           by itself or is part of an aligned vector. If the latter, correct the
@@ -566,7 +566,7 @@ unit cpupara;
 
     function try_build_homogeneous_aggregate(def: tdef; words: longint; var classes: tx64paraclasses): longint;
       var
-        i, vecsize, maxvecsize, veccount, num: longint;
+        i, vecsize, maxvecsize, veccount: longint;
         size, byte_offset: aint;
         vs: TFieldVarSym;
         checkalignment: Boolean;
@@ -1043,7 +1043,7 @@ unit cpupara;
     { Returns the size of a single element in the aggregate, or the entire vector, if it is one of these types, 0 otherwise }
     function is_simd_vector_type_or_homogeneous_aggregate(calloption: tproccalloption; def: tdef; varspez: tvarspez): aint;
       var
-        numclasses,i,vecsize,veccount,maxvecsize,elementsize,tempsize:longint;
+        numclasses,i,vecsize,veccount,maxvecsize:longint;
         classes: tx64paraclasses;
         firstclass: tx64paraclasstype;
       begin
@@ -1614,7 +1614,6 @@ unit cpupara;
         varalign,
         paraalign  : longint;
         use_ms_abi : boolean;
-        elementsize: asizeint; { for HVAs and HFAs under vectorcall }
       begin
         paraalign:=get_para_align(p.proccalloption);
         use_ms_abi:=x86_64_use_ms_abi(p.proccalloption);