Parcourir la source

* Removed lot of unused vars.

git-svn-id: trunk@31732 -
yury il y a 10 ans
Parent
commit
432248cbf1

+ 0 - 3
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}

+ 1 - 1
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

+ 0 - 2
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 }

+ 0 - 3
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);

+ 2 - 5
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

+ 0 - 1
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;

+ 0 - 1
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));

+ 0 - 1
compiler/arm/narminl.pas

@@ -380,7 +380,6 @@ implementation
     procedure tarminlinenode.second_abs_long;
       var
         opsize : tcgsize;
-        hp : taicpu;
       begin
         if GenerateThumbCode then
           begin

+ 0 - 1
compiler/arm/narmmat.pas

@@ -393,7 +393,6 @@ implementation
 
     procedure tarmunaryminusnode.second_float;
       var
-        op: tasmop;
         pf: TOpPostfix;
       begin
         secondpass(left);

+ 1 - 5
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

+ 2 - 0
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

+ 0 - 2
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;

+ 1 - 1
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

+ 1 - 2
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;

+ 0 - 1
compiler/ncgcon.pas

@@ -543,7 +543,6 @@ implementation
     procedure tcgguidconstnode.pass_generate_code;
       var
          lastlabel   : tasmlabel;
-         i           : longint;
          entry       : PHashSetItem;
          datatcb     : ttai_typedconstbuilder;
       begin

+ 0 - 1
compiler/ncgmem.pas

@@ -223,7 +223,6 @@ implementation
         sym : tsym;
         st : tsymtable;
         hp : pnode;
-        hp2 : tnode;
         extraoffset : tcgint;
       begin
          sym:=nil;

+ 1 - 1
compiler/ncgrtti.pas

@@ -1403,7 +1403,7 @@ implementation
         var
           t:Tenumsym;
           syms:tfplist;
-          h,i,p:longint;
+          i:longint;
           rttitypesym: ttypesym;
           rttidef: trecorddef;
         begin

+ 0 - 1
compiler/ncgutil.pas

@@ -783,7 +783,6 @@ implementation
         paraloc   : pcgparalocation;
         href      : treference;
         sizeleft  : aint;
-        alignment : longint;
         tempref   : treference;
 {$ifdef mips}
         tmpreg   : tregister;

+ 0 - 3
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;

+ 0 - 1
compiler/nmat.pas

@@ -933,7 +933,6 @@ implementation
     function tunaryminusnode.pass_1 : tnode;
       var
         procname: string[31];
-        fdef : tdef;
       begin
         result:=nil;
         firstpass(left);

+ 0 - 2
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

+ 1 - 1
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 := '';

+ 0 - 2
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;

+ 1 - 6
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

+ 0 - 4
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;

+ 0 - 1
compiler/pstatmnt.pas

@@ -1041,7 +1041,6 @@ implementation
     function _asm_statement : tnode;
       var
         asmstat : tasmnode;
-        Marker  : tai;
         reg     : tregister;
         asmreader : tbaseasmreader;
         entrypos : tfileposinfo;

+ 0 - 2
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;

+ 0 - 2
compiler/scanner.pas

@@ -2215,8 +2215,6 @@ type
       var
         hs  : string;
         mac : tmacro;
-        l : longint;
-        w : integer;
         exprvalue: texprvalue;
       begin
         current_scanner.skipspace;

+ 1 - 7
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);

+ 0 - 2
compiler/symsym.pas

@@ -2182,8 +2182,6 @@ implementation
 
 
     constructor tparavarsym.ppuload(ppufile:tcompilerppufile);
-      var
-        b : byte;
       begin
          inherited ppuload(paravarsym,ppufile);
          paranr:=ppufile.getword;

+ 2 - 0
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);

+ 2 - 0
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