2
0
Эх сурвалжийг харах

* Removed/ifdefed/commented unused local variables.

git-svn-id: trunk@11430 -
yury 17 жил өмнө
parent
commit
fcceb9cfa1

+ 1 - 1
compiler/aopt.pas

@@ -109,7 +109,7 @@ Unit aopt;
     Procedure TAsmOptimizer.BuildLabelTableAndFixRegAlloc;
     Procedure TAsmOptimizer.BuildLabelTableAndFixRegAlloc;
     { Builds a table with the locations of the labels in the TAsmList.       }
     { Builds a table with the locations of the labels in the TAsmList.       }
     { Also fixes some RegDeallocs like "# %eax released; push (%eax)"           }
     { Also fixes some RegDeallocs like "# %eax released; push (%eax)"           }
-    Var p, hp1, hp2: tai;
+    Var p{, hp1, hp2}: tai;
         UsedRegs: TRegSet;
         UsedRegs: TRegSet;
         LabelIdx : longint;
         LabelIdx : longint;
     Begin
     Begin

+ 2 - 0
compiler/aoptda.pas

@@ -62,11 +62,13 @@ Unit aoptda;
     { Analyzes the Data Flow of an assembler list. Analyses the reg contents     }
     { Analyzes the Data Flow of an assembler list. Analyses the reg contents     }
     { for the instructions between blockstart and blockend. Returns the last pai }
     { for the instructions between blockstart and blockend. Returns the last pai }
     { which has been processed                                                   }
     { which has been processed                                                   }
+    {
     Var
     Var
         CurProp: TPaiProp;
         CurProp: TPaiProp;
         UsedRegs: TUsedRegs;
         UsedRegs: TUsedRegs;
         p, hp, NewBlockStart : tai;
         p, hp, NewBlockStart : tai;
         TmpReg: TRegister;
         TmpReg: TRegister;
+    }
     Begin
     Begin
     {!!!!!!!!!!
     {!!!!!!!!!!
       p := BlockStart;
       p := BlockStart;

+ 7 - 1
compiler/aoptobj.pas

@@ -377,11 +377,13 @@ Unit AoptObj;
         End;
         End;
 
 
       Function TPaiProp.RegInSequence(Reg, which: TRegister): Boolean;
       Function TPaiProp.RegInSequence(Reg, which: TRegister): Boolean;
+      {
       Var p: Tai;
       Var p: Tai;
           RegsChecked: TRegSet;
           RegsChecked: TRegSet;
           content: TContent;
           content: TContent;
           Counter: Byte;
           Counter: Byte;
           TmpResult: Boolean;
           TmpResult: Boolean;
+      }
       Begin
       Begin
       {!!!!!!!!!!1
       {!!!!!!!!!!1
         RegsChecked := [];
         RegsChecked := [];
@@ -429,8 +431,10 @@ Unit AoptObj;
                   TInstrSinceLastMod);
                   TInstrSinceLastMod);
       { Destroys the contents of the register Reg in the PPaiProp p1, as well as }
       { Destroys the contents of the register Reg in the PPaiProp p1, as well as }
       { the contents of registers are loaded with a memory location based on Reg }
       { the contents of registers are loaded with a memory location based on Reg }
+      {
       Var TmpWState, TmpRState: Byte;
       Var TmpWState, TmpRState: Byte;
           Counter: TRegister;
           Counter: TRegister;
+      }
       Begin
       Begin
       {!!!!!!!
       {!!!!!!!
         Reg := RegMaxSize(Reg);
         Reg := RegMaxSize(Reg);
@@ -469,8 +473,10 @@ Unit AoptObj;
       { destroys all registers which possibly contain a reference to Ref, WhichReg }
       { destroys all registers which possibly contain a reference to Ref, WhichReg }
       { is the register whose contents are being written to memory (if this proc   }
       { is the register whose contents are being written to memory (if this proc   }
       { is called because of a "mov?? %reg, (mem)" instruction)                    }
       { is called because of a "mov?? %reg, (mem)" instruction)                    }
+      {
       Var RefsEq: TRefCompare;
       Var RefsEq: TRefCompare;
           Counter: TRegister;
           Counter: TRegister;
+      }
       Begin
       Begin
       {!!!!!!!!!!!
       {!!!!!!!!!!!
         WhichReg := RegMaxSize(WhichReg);
         WhichReg := RegMaxSize(WhichReg);
@@ -547,7 +553,7 @@ Unit AoptObj;
       End;
       End;
 
 
       Procedure TPaiProp.DestroyAllRegs(var InstrSinceLastMod: TInstrSinceLastMod);
       Procedure TPaiProp.DestroyAllRegs(var InstrSinceLastMod: TInstrSinceLastMod);
-      Var Counter: TRegister;
+      {Var Counter: TRegister;}
       Begin {initializes/desrtoys all registers}
       Begin {initializes/desrtoys all registers}
       {!!!!!!!!!
       {!!!!!!!!!
         For Counter := LoGPReg To HiGPReg Do
         For Counter := LoGPReg To HiGPReg Do

+ 1 - 1
compiler/arm/aasmcpu.pas

@@ -1279,7 +1279,7 @@ implementation
        * required to have unspecified size in the instruction too...)
        * required to have unspecified size in the instruction too...)
       }
       }
       var
       var
-        i,j,asize,oprs : longint;
+        i,{j,}asize{,oprs} : longint;
         siz : array[0..3] of longint;
         siz : array[0..3] of longint;
       begin
       begin
         Matches:=100;
         Matches:=100;

+ 0 - 1
compiler/arm/narmcon.pas

@@ -57,7 +57,6 @@ interface
         floattype2ait:array[tfloattype] of taitype=
         floattype2ait:array[tfloattype] of taitype=
           (ait_real_32bit,ait_real_64bit,ait_real_80bit,ait_comp_64bit,ait_comp_64bit,ait_real_128bit);
           (ait_real_32bit,ait_real_64bit,ait_real_80bit,ait_comp_64bit,ait_comp_64bit,ait_real_128bit);
       var
       var
-         hp1 : tai;
          lastlabel : tasmlabel;
          lastlabel : tasmlabel;
          realait : taitype;
          realait : taitype;
          hiloswapped : boolean;
          hiloswapped : boolean;

+ 3 - 7
compiler/arm/raarmgas.pas

@@ -262,9 +262,7 @@ Unit raarmgas;
 
 
       procedure read_index(require_rbracket : boolean);
       procedure read_index(require_rbracket : boolean);
         var 
         var 
-          i : longint; 
-          w : word; 
-          recname : string; 
+          recname : string;
           o_int,s_int : aint;
           o_int,s_int : aint;
         begin
         begin
           case actasmtoken of
           case actasmtoken of
@@ -651,7 +649,7 @@ Unit raarmgas;
         tempreg : tregister;
         tempreg : tregister;
         ireg : tsuperregister;
         ireg : tsuperregister;
         hl : tasmlabel;
         hl : tasmlabel;
-        ofs : longint;
+        {ofs : longint;}
         registerset : tcpuregisterset;
         registerset : tcpuregisterset;
       Begin
       Begin
         expr:='';
         expr:='';
@@ -928,9 +926,7 @@ Unit raarmgas;
           PF_B,PF_D,PF_E,PF_P,PF_T,PF_H,PF_S);
           PF_B,PF_D,PF_E,PF_P,PF_T,PF_H,PF_S);
 
 
       var
       var
-        len,
-        j,
-        sufidx : longint;
+        j  : longint;
         hs : string;
         hs : string;
         maxlen : longint;
         maxlen : longint;
         icond : tasmcond;
         icond : tasmcond;

+ 0 - 1
compiler/cfileutl.pas

@@ -298,7 +298,6 @@ implementation
     function TCachedDirectory.FileExistsCaseAware(const path, fn: TCmdStr; out FoundName: TCmdStr):boolean;
     function TCachedDirectory.FileExistsCaseAware(const path, fn: TCmdStr; out FoundName: TCmdStr):boolean;
       var
       var
         entry : PCachedDirectoryEntry;
         entry : PCachedDirectoryEntry;
-        Attr  : Longint;
       begin
       begin
         if (tf_files_case_aware in source_info.flags) then
         if (tf_files_case_aware in source_info.flags) then
           begin
           begin

+ 0 - 2
compiler/nadd.pas

@@ -2356,8 +2356,6 @@ implementation
          hp      : tnode;
          hp      : tnode;
 {$endif addstringopt}
 {$endif addstringopt}
          rd,ld   : tdef;
          rd,ld   : tdef;
-         newstatement : tstatementnode;
-         temp    : ttempcreatenode;
          i       : longint;
          i       : longint;
          lt,rt   : tnodetype;
          lt,rt   : tnodetype;
       begin
       begin

+ 4 - 0
compiler/ncgcal.pas

@@ -510,7 +510,9 @@ implementation
         tmpcgsize,
         tmpcgsize,
         cgsize    : tcgsize;
         cgsize    : tcgsize;
         retloc    : tlocation;
         retloc    : tlocation;
+{$ifdef cpu64bitaddr}
         ref       : treference;
         ref       : treference;
+{$endif cpu64bitaddr}
 {$ifndef x86}
 {$ifndef x86}
         hregister : tregister;
         hregister : tregister;
 {$endif not x86}
 {$endif not x86}
@@ -873,7 +875,9 @@ implementation
 {$ifdef vtentry}
 {$ifdef vtentry}
         sym : tasmsymbol;
         sym : tasmsymbol;
 {$endif vtentry}
 {$endif vtentry}
+{$ifdef x86_64}
         cgpara : tcgpara;
         cgpara : tcgpara;
+{$endif x86_64}
       begin
       begin
          if not assigned(procdefinition) or
          if not assigned(procdefinition) or
             not procdefinition.has_paraloc_info then
             not procdefinition.has_paraloc_info then

+ 1 - 1
compiler/ncgcon.pas

@@ -548,7 +548,7 @@ implementation
         var
         var
            hp1         : tai;
            hp1         : tai;
            lastlabel   : tasmlabel;
            lastlabel   : tasmlabel;
-           i, diff     : longint;
+           i           : longint;
            neededtyp   : taiconst_type;
            neededtyp   : taiconst_type;
         begin
         begin
           location_reset(location,LOC_CREFERENCE,OS_NO);
           location_reset(location,LOC_CREFERENCE,OS_NO);

+ 0 - 1
compiler/ogcoff.pas

@@ -2036,7 +2036,6 @@ const pemagic : array[0..3] of byte = (
       var
       var
         objsec : TObjSection;
         objsec : TObjSection;
         i      : longint;
         i      : longint;
-        b      : boolean;
       begin
       begin
         with texesection(p) do
         with texesection(p) do
           begin
           begin

+ 2 - 0
compiler/options.pas

@@ -2080,7 +2080,9 @@ function check_configfile(const fn:string;var foundfn:string):boolean;
   end;
   end;
 
 
 var
 var
+{$ifdef Unix}
   hs,
   hs,
+{$endif Unix}
   configpath : string;
   configpath : string;
 begin
 begin
   foundfn:=fn;
   foundfn:=fn;

+ 0 - 2
compiler/pmodules.pas

@@ -249,7 +249,6 @@ implementation
     Procedure InsertResourceInfo(ResourcesUsed : boolean);
     Procedure InsertResourceInfo(ResourcesUsed : boolean);
 
 
     var
     var
-      I            : Integer;
       ResourceInfo : TAsmList;
       ResourceInfo : TAsmList;
 
 
     begin
     begin
@@ -1280,7 +1279,6 @@ implementation
 
 
     procedure insert_export(sym : TObject;arg:pointer);
     procedure insert_export(sym : TObject;arg:pointer);
       var
       var
-        hp : texported_item;
         i : longint;
         i : longint;
         item : TCmdStrListItem;
         item : TCmdStrListItem;
       begin
       begin

+ 1 - 1
compiler/ppu.pas

@@ -466,7 +466,7 @@ end;
 
 
 procedure tppufile.readdata(var b;len:integer);
 procedure tppufile.readdata(var b;len:integer);
 var
 var
-  p,pmax,pbuf : pchar;
+  p,pbuf : pchar;
   left : integer;
   left : integer;
 begin
 begin
   p:=pchar(@b);
   p:=pchar(@b);

+ 2 - 0
compiler/pstatmnt.pas

@@ -1157,7 +1157,9 @@ implementation
     function assembler_block : tnode;
     function assembler_block : tnode;
       var
       var
         p : tnode;
         p : tnode;
+{$ifndef arm}
         locals : longint;
         locals : longint;
+{$endif arm}
         srsym : tsym;
         srsym : tsym;
       begin
       begin
          { Rename the funcret so that recursive calls are possible }
          { Rename the funcret so that recursive calls are possible }

+ 0 - 2
compiler/scanner.pas

@@ -472,7 +472,6 @@ implementation
     function isdef(var valuedescr: String): Boolean;
     function isdef(var valuedescr: String): Boolean;
       var
       var
         hs    : string;
         hs    : string;
-        mac   : tmacro;
       begin
       begin
         current_scanner.skipspace;
         current_scanner.skipspace;
         hs:=current_scanner.readid;
         hs:=current_scanner.readid;
@@ -490,7 +489,6 @@ implementation
     function isnotdef(var valuedescr: String): Boolean;
     function isnotdef(var valuedescr: String): Boolean;
       var
       var
         hs    : string;
         hs    : string;
-        mac   : tmacro;
       begin
       begin
         current_scanner.skipspace;
         current_scanner.skipspace;
         hs:=current_scanner.readid;
         hs:=current_scanner.readid;

+ 0 - 3
compiler/symdef.pas

@@ -2884,7 +2884,6 @@ implementation
     constructor tprocdef.ppuload(ppufile:tcompilerppufile);
     constructor tprocdef.ppuload(ppufile:tcompilerppufile);
       var
       var
         i,aliasnamescount : longint;
         i,aliasnamescount : longint;
-        item : TCmdStrListItem;
         level : byte;
         level : byte;
       begin
       begin
          inherited ppuload(procdef,ppufile);
          inherited ppuload(procdef,ppufile);
@@ -3908,8 +3907,6 @@ implementation
 
 
 
 
     procedure tobjectdef.buildderefimpl;
     procedure tobjectdef.buildderefimpl;
-      var
-         i : longint;
       begin
       begin
          inherited buildderefimpl;
          inherited buildderefimpl;
          if not (df_copied_def in defoptions) then
          if not (df_copied_def in defoptions) then