Browse Source

* Removed/ifdefed the assigned and unused variables.

git-svn-id: trunk@48391 -
yury 4 years ago
parent
commit
75491ae21c

+ 0 - 2
compiler/aarch64/agcpugas.pas

@@ -252,7 +252,6 @@ unit agcpugas;
         lastsym : tai_symbol;
         lastsym : tai_symbol;
         lastsec : tai_section;
         lastsec : tai_section;
         inprologue,
         inprologue,
-        inhandlerdata,
         deleteai : boolean;
         deleteai : boolean;
         totalcount,
         totalcount,
         instrcount,
         instrcount,
@@ -277,7 +276,6 @@ unit agcpugas;
         instrcount:=0;
         instrcount:=0;
         datacount:=0;
         datacount:=0;
         unwinddata:=nil;
         unwinddata:=nil;
-        inhandlerdata:=false;
         inprologue:=false;
         inprologue:=false;
         handlerdata:=nil;
         handlerdata:=nil;
         handlerdataidx:=0;
         handlerdataidx:=0;

+ 0 - 3
compiler/aarch64/aoptcpu.pas

@@ -568,7 +568,6 @@ Implementation
       ThisRegister: TRegister;
       ThisRegister: TRegister;
       OffsetVal, ValidOffset, MinOffset, MaxOffset: asizeint;
       OffsetVal, ValidOffset, MinOffset, MaxOffset: asizeint;
       TargetOpcode: TAsmOp;
       TargetOpcode: TAsmOp;
-      Breakout: Boolean;
     begin
     begin
       Result := False;
       Result := False;
       ThisRegister := taicpu(p).oper[0]^.reg;
       ThisRegister := taicpu(p).oper[0]^.reg;
@@ -621,8 +620,6 @@ Implementation
 
 
                 if (taicpu(hp1).opcode = taicpu(p).opcode) then
                 if (taicpu(hp1).opcode = taicpu(p).opcode) then
                   begin
                   begin
-                    Breakout := False;
-
                     if (taicpu(hp1).oppostfix = PF_NONE) and
                     if (taicpu(hp1).oppostfix = PF_NONE) and
                       { Registers need to be the same size }
                       { Registers need to be the same size }
                       (getsubreg(ThisRegister) = getsubreg(taicpu(hp1).oper[0]^.reg)) and
                       (getsubreg(ThisRegister) = getsubreg(taicpu(hp1).oper[0]^.reg)) and

+ 0 - 2
compiler/jvm/dbgjasm.pas

@@ -105,7 +105,6 @@ implementation
       afterprocstartlabel : tasmlabel;
       afterprocstartlabel : tasmlabel;
       hp,
       hp,
       afterproccodestart  : tai;
       afterproccodestart  : tai;
-      instrcount          : longint;
     begin
     begin
       { insert debug information for local variables and parameters, but only
       { insert debug information for local variables and parameters, but only
         for routines implemented in the Pascal code }
         for routines implemented in the Pascal code }
@@ -121,7 +120,6 @@ implementation
       { set the start label for local variables after the first instruction,
       { set the start label for local variables after the first instruction,
         because javac's code completion support assumes that all info at
         because javac's code completion support assumes that all info at
         bytecode position 0 is for parameters }
         bytecode position 0 is for parameters }
-      instrcount:=0;
       afterproccodestart:=def.procstarttai;
       afterproccodestart:=def.procstarttai;
       while assigned(afterproccodestart.next) do
       while assigned(afterproccodestart.next) do
         begin
         begin

+ 0 - 3
compiler/jvm/njvmmem.pas

@@ -179,10 +179,7 @@ implementation
 
 
 
 
     function tjvmaddrnode.isdererence: boolean;
     function tjvmaddrnode.isdererence: boolean;
-      var
-        target: tnode;
       begin
       begin
-        target:=actualtargetnode(@left)^;
         result:=
         result:=
           (left.nodetype=derefn);
           (left.nodetype=derefn);
       end;
       end;

+ 4 - 2
compiler/nflw.pas

@@ -1558,14 +1558,14 @@ implementation
 
 
 
 
     function tifnode.internalsimplify(warn: boolean) : tnode;
     function tifnode.internalsimplify(warn: boolean) : tnode;
+{$if defined(i386) or defined(x86_64) or defined(xtensa)}
       var
       var
         thenstmnt, elsestmnt: tnode;
         thenstmnt, elsestmnt: tnode;
         in_nr: tinlinenumber;
         in_nr: tinlinenumber;
         paratype: tdef;
         paratype: tdef;
+{$endif}
       begin
       begin
         result:=nil;
         result:=nil;
-        elsestmnt:=nil;
-        in_nr:=Default(tinlinenumber);
         { optimize constant expressions }
         { optimize constant expressions }
         if (left.nodetype=ordconstn) then
         if (left.nodetype=ordconstn) then
           begin
           begin
@@ -1607,6 +1607,8 @@ implementation
           into appropriate min/max intrinsics
           into appropriate min/max intrinsics
 
 
           }
           }
+        elsestmnt:=nil;
+        in_nr:=Default(tinlinenumber);
         if (cs_opt_level2 in current_settings.optimizerswitches) and
         if (cs_opt_level2 in current_settings.optimizerswitches) and
            (left.nodetype in [gtn,gten,ltn,lten]) and IsSingleStatement(right,thenstmnt) and
            (left.nodetype in [gtn,gten,ltn,lten]) and IsSingleStatement(right,thenstmnt) and
            ((t1=nil) or IsSingleStatement(t1,elsestmnt)) and
            ((t1=nil) or IsSingleStatement(t1,elsestmnt)) and

+ 4 - 5
compiler/ogomf.pas

@@ -1520,7 +1520,6 @@ implementation
         RawRecord: TOmfRawRecord;
         RawRecord: TOmfRawRecord;
         i,idx: Integer;
         i,idx: Integer;
         objsym: TObjSymbol;
         objsym: TObjSymbol;
-        ExternalNameElem: TOmfExternalNameElement;
         ExtDefRec: TOmfRecord_EXTDEF;
         ExtDefRec: TOmfRecord_EXTDEF;
       begin
       begin
         ExtNames:=TFPHashObjectList.Create;
         ExtNames:=TFPHashObjectList.Create;
@@ -1532,7 +1531,7 @@ implementation
             objsym:=TObjSymbol(Data.ObjSymbolList[i]);
             objsym:=TObjSymbol(Data.ObjSymbolList[i]);
             if objsym.bind=AB_EXTERNAL then
             if objsym.bind=AB_EXTERNAL then
               begin
               begin
-                ExternalNameElem:=TOmfExternalNameElement.Create(ExtNames,objsym.Name);
+                TOmfExternalNameElement.Create(ExtNames,objsym.Name);
                 objsym.symidx:=idx;
                 objsym.symidx:=idx;
                 Inc(idx);
                 Inc(idx);
               end;
               end;
@@ -4411,7 +4410,7 @@ cleanup:
       var
       var
         s: TSymStr;
         s: TSymStr;
         Separator: SizeInt;
         Separator: SizeInt;
-        SegName, SegClass: string;
+        {SegName,} SegClass: string;
         IsStack, IsBss: Boolean;
         IsStack, IsBss: Boolean;
       begin
       begin
         { allow mixing initialized and uninitialized data in the same section
         { allow mixing initialized and uninitialized data in the same section
@@ -4423,12 +4422,12 @@ cleanup:
         Separator:=Pos('||',s);
         Separator:=Pos('||',s);
         if Separator>0 then
         if Separator>0 then
           begin
           begin
-            SegName:=Copy(s,1,Separator-1);
+            //SegName:=Copy(s,1,Separator-1);
             SegClass:=Copy(s,Separator+2,Length(s)-Separator-1);
             SegClass:=Copy(s,Separator+2,Length(s)-Separator-1);
           end
           end
         else
         else
           begin
           begin
-            SegName:=s;
+            //SegName:=s;
             SegClass:='';
             SegClass:='';
           end;
           end;
         { wlink recognizes the stack segment by the class name 'STACK' }
         { wlink recognizes the stack segment by the class name 'STACK' }

+ 0 - 6
compiler/pgenutil.pas

@@ -1379,8 +1379,6 @@ uses
         constraintdata : tgenericconstraintdata;
         constraintdata : tgenericconstraintdata;
         old_block_type : tblock_type;
         old_block_type : tblock_type;
         fileinfo : tfileposinfo;
         fileinfo : tfileposinfo;
-        last_token : ttoken;
-        last_type_pos : tfileposinfo;
       begin
       begin
         result:=tfphashobjectlist.create(false);
         result:=tfphashobjectlist.create(false);
         firstidx:=0;
         firstidx:=0;
@@ -1389,8 +1387,6 @@ uses
         block_type:=bt_type;
         block_type:=bt_type;
         allowconst:=true;
         allowconst:=true;
         is_const:=false;
         is_const:=false;
-        last_token:=NOTOKEN;
-        last_type_pos:=current_filepos;
         repeat
         repeat
           if allowconst and try_to_consume(_CONST) then
           if allowconst and try_to_consume(_CONST) then
             begin
             begin
@@ -1605,8 +1601,6 @@ uses
               is_const:=false;
               is_const:=false;
               allowconst:=true;
               allowconst:=true;
             end;
             end;
-          last_token:=token;
-          last_type_pos:=current_filepos;
         until not (try_to_consume(_COMMA) or try_to_consume(_SEMICOLON));
         until not (try_to_consume(_COMMA) or try_to_consume(_SEMICOLON));
         { if the constant parameter is not terminated then the type restriction was
         { if the constant parameter is not terminated then the type restriction was
           not specified and we need to give an error }
           not specified and we need to give an error }

+ 4 - 0
compiler/psabiehpi.pas

@@ -694,7 +694,9 @@ implementation
         otherunit: boolean; }
         otherunit: boolean; }
         wrappedexception: tregister;
         wrappedexception: tregister;
         exceptloc: tlocation;
         exceptloc: tlocation;
+{$if defined(i386) or defined(x86_64)}
         typeindex : aint;
         typeindex : aint;
+{$endif}
       begin
       begin
         paraloc1.init;
         paraloc1.init;
 {
 {
@@ -722,7 +724,9 @@ implementation
         { check if the exception is handled by this node }
         { check if the exception is handled by this node }
         if assigned(excepttype) then
         if assigned(excepttype) then
           begin
           begin
+{$if defined(i386) or defined(x86_64)}
             typeindex:=(current_procinfo as tpsabiehprocinfo).CurrentAction.AddAction(excepttype);
             typeindex:=(current_procinfo as tpsabiehprocinfo).CurrentAction.AddAction(excepttype);
+{$endif}
             current_asmdata.getjumplabel(catchstartlab);
             current_asmdata.getjumplabel(catchstartlab);
 {$if defined(i386)}
 {$if defined(i386)}
             hlcg.a_cmp_const_reg_label (list,osuinttype,OC_EQ,typeindex+1,NR_FUNCTION_RESULT64_HIGH_REG,catchstartlab);
             hlcg.a_cmp_const_reg_label (list,osuinttype,OC_EQ,typeindex+1,NR_FUNCTION_RESULT64_HIGH_REG,catchstartlab);

+ 2 - 4
compiler/systems/t_freertos.pas

@@ -81,8 +81,7 @@ Var
   i        : longint;
   i        : longint;
   HPath    : TCmdStrListItem;
   HPath    : TCmdStrListItem;
   s,s1,s2  : TCmdStr;
   s,s1,s2  : TCmdStr;
-  prtobj,
-  cprtobj  : string[80];
+  prtobj   : string[80];
   linklibc : boolean;
   linklibc : boolean;
   found1,
   found1,
   found2   : boolean;
   found2   : boolean;
@@ -96,9 +95,8 @@ begin
   prtobj:='';
   prtobj:='';
 {$else}
 {$else}
   prtobj:='prt0';
   prtobj:='prt0';
-  cprtobj:='cprt0';
   if linklibc then
   if linklibc then
-    prtobj:=cprtobj;
+    prtobj:='cprt0';
 {$endif}
 {$endif}
 
 
   { Open link.res file }
   { Open link.res file }

+ 0 - 2
compiler/systems/t_win16.pas

@@ -104,7 +104,6 @@ var
   i,j: Integer;
   i,j: Integer;
   ImportLibrary: TImportLibrary;
   ImportLibrary: TImportLibrary;
   ImportSymbol: TImportSymbol;
   ImportSymbol: TImportSymbol;
-  AsmPrefix: String;
 
 
   procedure AddImport(const dllname,afuncname,mangledname:string;ordnr:longint;isvar:boolean);
   procedure AddImport(const dllname,afuncname,mangledname:string;ordnr:longint;isvar:boolean);
     begin
     begin
@@ -114,7 +113,6 @@ var
     end;
     end;
 
 
 begin
 begin
-  AsmPrefix:='imp'+Lower(current_module.modulename^);
   current_module.linkotherstaticlibs.add(current_module.importlibfilename,link_always);
   current_module.linkotherstaticlibs.add(current_module.importlibfilename,link_always);
   ObjWriter:=TOmfLibObjectWriter.CreateAr(current_module.importlibfilename,32);
   ObjWriter:=TOmfLibObjectWriter.CreateAr(current_module.importlibfilename,32);
   ObjOutput:=TOmfObjOutput.Create(ObjWriter);
   ObjOutput:=TOmfObjOutput.Create(ObjWriter);

+ 4 - 0
compiler/x86/cgx86.pas

@@ -445,13 +445,17 @@ unit cgx86;
 
 
     procedure tcgx86.make_simple_ref(list:TAsmList;var ref: treference;isdirect:boolean);
     procedure tcgx86.make_simple_ref(list:TAsmList;var ref: treference;isdirect:boolean);
       var
       var
+{$ifndef i8086}
         hreg : tregister;
         hreg : tregister;
+{$endif i8086}
         href : treference;
         href : treference;
 {$ifdef i386}
 {$ifdef i386}
         add_hreg: boolean;
         add_hreg: boolean;
 {$endif i386}
 {$endif i386}
       begin
       begin
+{$ifndef i8086}
         hreg:=NR_NO;
         hreg:=NR_NO;
+{$endif i8086}
         { make_simple_ref() may have already been called earlier, and in that
         { make_simple_ref() may have already been called earlier, and in that
           case make sure we don't perform the PIC-simplifications twice }
           case make sure we don't perform the PIC-simplifications twice }
         if (ref.refaddr in [addr_pic,addr_pic_no_got]) then
         if (ref.refaddr in [addr_pic,addr_pic_no_got]) then