소스 검색

* removed unused units
* use tlocation.size in cg.a_*loc*() routines

peter 23 년 전
부모
커밋
5e7a1e3729
52개의 변경된 파일574개의 추가작업 그리고 459개의 파일을 삭제
  1. 7 2
      compiler/assemble.pas
  2. 30 38
      compiler/cgbase.pas
  3. 49 45
      compiler/cgobj.pas
  4. 6 2
      compiler/fmodule.pas
  5. 5 6
      compiler/fppu.pas
  6. 10 3
      compiler/i386/ag386att.pas
  7. 5 2
      compiler/i386/ag386int.pas
  8. 14 64
      compiler/i386/cga.pas
  9. 50 37
      compiler/i386/cgcpu.pas
  10. 7 1
      compiler/i386/csopt386.pas
  11. 15 13
      compiler/i386/n386add.pas
  12. 16 12
      compiler/i386/n386cal.pas
  13. 6 2
      compiler/i386/n386cnv.pas
  14. 12 8
      compiler/i386/n386flw.pas
  15. 14 10
      compiler/i386/n386inl.pas
  16. 17 14
      compiler/i386/n386ld.pas
  17. 13 9
      compiler/i386/n386mat.pas
  18. 13 11
      compiler/i386/n386mem.pas
  19. 8 4
      compiler/i386/n386opt.pas
  20. 15 11
      compiler/i386/n386util.pas
  21. 6 4
      compiler/i386/ra386.pas
  22. 7 9
      compiler/i386/ra386att.pas
  23. 6 7
      compiler/i386/ra386int.pas
  24. 10 4
      compiler/i386/rgcpu.pas
  25. 6 2
      compiler/nadd.pas
  26. 12 5
      compiler/nbas.pas
  27. 9 7
      compiler/ncgbas.pas
  28. 10 7
      compiler/ncgcnv.pas
  29. 7 11
      compiler/ncgcon.pas
  30. 10 8
      compiler/ncgflw.pas
  31. 27 24
      compiler/ncgmem.pas
  32. 7 3
      compiler/ncgutil.pas
  33. 6 2
      compiler/ncnv.pas
  34. 6 2
      compiler/ncon.pas
  35. 5 4
      compiler/ogcoff.pas
  36. 5 5
      compiler/ogelf.pas
  37. 6 2
      compiler/options.pas
  38. 5 4
      compiler/owar.pas
  39. 5 2
      compiler/pass_1.pas
  40. 6 2
      compiler/pdecobj.pas
  41. 6 2
      compiler/pexports.pas
  42. 7 3
      compiler/pmodules.pas
  43. 5 7
      compiler/ppu.pas
  44. 7 3
      compiler/ptconst.pas
  45. 6 4
      compiler/ptype.pas
  46. 6 2
      compiler/rgobj.pas
  47. 7 8
      compiler/scandir.pas
  48. 7 3
      compiler/symtable.pas
  49. 6 2
      compiler/targets/t_os2.pas
  50. 22 6
      compiler/targets/t_win32.pas
  51. 6 3
      compiler/tgobj.pas
  52. 16 8
      compiler/utils/ppudump.pp

+ 7 - 2
compiler/assemble.pas

@@ -148,11 +148,12 @@ Implementation
       unix,
   {$endif}
 {$endif}
-      cutils,script,finput,fmodule,verbose,
+      cutils,script,fmodule,verbose,
 {$ifdef memdebug}
       cclasses,
 {$endif memdebug}
 {$ifdef GDB}
+      finput,
       gdb,
 {$endif GDB}
       cpubase,cpuasm
@@ -1551,7 +1552,11 @@ Implementation
 end.
 {
   $Log$
-  Revision 1.30  2002-04-02 17:11:27  peter
+  Revision 1.31  2002-04-04 19:05:54  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.30  2002/04/02 17:11:27  peter
     * tlocation,treference update
     * LOC_CONSTANT added for better constant handling
     * secondadd splitted in multiple routines

+ 30 - 38
compiler/cgbase.pas

@@ -169,8 +169,7 @@ unit cgbase;
     procedure codegen_newmodule;
     procedure codegen_newprocedure;
 
-    function def_cgsize_ref(const p1: tdef): tcgsize;
-    function def_cgsize(const p1: tdef): tcgsize;
+    function def_cgsize(def: tdef): tcgsize;
     function int_cgsize(const l: aword): tcgsize;
 
     { return the inverse condition of opcmp }
@@ -429,36 +428,16 @@ implementation
          ResourceStrings.free;
       end;
 
-    function def_cgsize_ref(const p1: tdef): tcgsize;
-      begin
-        { return always SO_NO for arraydef, becuase for
-          some array types (open array) the size can not be determined }
-        if p1.deftype=arraydef then
-         result:=OS_NO
-        else
-         begin
-           case p1.size of
-             1    : result := OS_8;
-             2    : result := OS_16;
-             3,4  : result := OS_32;
-             5..8 : result := OS_64;
-             else   result := OS_NO;
-           end;
-           if is_signed(p1) then
-             result := tcgsize(ord(result)+(ord(OS_S8)-ord(OS_8)));
-         end;
-      end;
-
-    function def_cgsize(const p1: tdef): tcgsize;
 
+    function def_cgsize(def: tdef): tcgsize;
       begin
-        case p1.deftype of
+        case def.deftype of
           orddef,
           enumdef,
           setdef:
             begin
-              result := int_cgsize(p1.size);
-              if is_signed(p1) then
+              result := int_cgsize(def.size);
+              if is_signed(def) then
                 result := tcgsize(ord(result)+(ord(OS_S8)-ord(OS_8)));
             end;
           classrefdef,
@@ -467,34 +446,43 @@ implementation
             result := OS_ADDR;
           stringdef :
             begin
-              if is_ansistring(p1) or is_widestring(p1) then
+              if is_ansistring(def) or is_widestring(def) then
                 result := OS_ADDR
               else
-                internalerror(200203314);
+                result := OS_NO;
             end;
           objectdef :
             begin
-              if is_class_or_interface(p1) then
+              if is_class_or_interface(def) then
                 result := OS_ADDR
               else
-                internalerror(200203313);
+                result := OS_NO;
             end;
           floatdef:
-            result := tfloat2tcgsize[tfloatdef(p1).typ];
+            result := tfloat2tcgsize[tfloatdef(def).typ];
+          recorddef :
+            result:=int_cgsize(def.size);
           else
-            internalerror(200201131);
+            begin
+              { undefined size }
+              result:=OS_NO;
+            end;
         end;
       end;
 
     function int_cgsize(const l: aword): tcgsize;
       begin
         case l of
-          1: result := OS_8;
-          2: result := OS_16;
-          4: result := OS_32;
-          8: result := OS_64;
+          1 :
+            result := OS_8;
+          2 :
+            result := OS_16;
+          4 :
+            result := OS_32;
+          8 :
+            result := OS_64;
           else
-            internalerror(2001092311);
+            result:=OS_NO;
         end;
       end;
 
@@ -542,7 +530,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.8  2002-04-02 17:11:27  peter
+  Revision 1.9  2002-04-04 19:05:54  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.8  2002/04/02 17:11:27  peter
     * tlocation,treference update
     * LOC_CONSTANT added for better constant handling
     * secondadd splitted in multiple routines

+ 49 - 45
compiler/cgobj.pas

@@ -98,7 +98,7 @@ unit cgobj;
           procedure a_param_reg(list : taasmoutput;size : tcgsize;r : tregister;nr : longint);virtual; abstract;
           procedure a_param_const(list : taasmoutput;size : tcgsize;a : aword;nr : longint);virtual;
           procedure a_param_ref(list : taasmoutput;size : tcgsize;const r : treference;nr : longint);virtual;
-          procedure a_param_loc(list : taasmoutput;size : tcgsize;const l : tlocation;nr : longint);
+          procedure a_param_loc(list : taasmoutput;const l : tlocation;nr : longint);
           procedure a_paramaddr_ref(list : taasmoutput;const r : treference;nr : longint);virtual;
 
           {**********************************}
@@ -127,20 +127,20 @@ unit cgobj;
           { move instructions }
           procedure a_load_const_reg(list : taasmoutput;size : tcgsize;a : aword;register : tregister);virtual; abstract;
           procedure a_load_const_ref(list : taasmoutput;size : tcgsize;a : aword;const ref : treference);virtual;
-          procedure a_load_const_loc(list : taasmoutput;size : tcgsize;a : aword;const loc : tlocation);
+          procedure a_load_const_loc(list : taasmoutput;a : aword;const loc : tlocation);
           procedure a_load_reg_ref(list : taasmoutput;size : tcgsize;register : tregister;const ref : treference);virtual; abstract;
           procedure a_load_reg_reg(list : taasmoutput;size : tcgsize;reg1,reg2 : tregister);virtual; abstract;
-          procedure a_load_reg_loc(list : taasmoutput;size : tcgsize;reg : tregister;const loc: tlocation);
+          procedure a_load_reg_loc(list : taasmoutput;reg : tregister;const loc: tlocation);
           procedure a_load_ref_reg(list : taasmoutput;size : tcgsize;const ref : treference;register : tregister);virtual; abstract;
-          procedure a_load_loc_reg(list : taasmoutput;size : tcgsize;const loc: tlocation; reg : tregister);
-          procedure a_load_loc_ref(list : taasmoutput;size : tcgsize;const loc: tlocation; const ref : treference);
+          procedure a_load_loc_reg(list : taasmoutput;const loc: tlocation; reg : tregister);
+          procedure a_load_loc_ref(list : taasmoutput;const loc: tlocation; const ref : treference);
           procedure a_load_sym_ofs_reg(list: taasmoutput; const sym: tasmsymbol; ofs: longint; reg: tregister);virtual; abstract;
 
           { fpu move instructions }
           procedure a_loadfpu_reg_reg(list: taasmoutput; reg1, reg2: tregister); virtual; abstract;
           procedure a_loadfpu_ref_reg(list: taasmoutput; size: tcgsize; const ref: treference; reg: tregister); virtual; abstract;
           procedure a_loadfpu_reg_ref(list: taasmoutput; size: tcgsize; reg: tregister; const ref: treference); virtual; abstract;
-          procedure a_loadfpu_loc_reg(list: taasmoutput; size: tcgsize; const loc: tlocation; const reg: tregister);
+          procedure a_loadfpu_loc_reg(list: taasmoutput; const loc: tlocation; const reg: tregister);
           procedure a_loadfpu_reg_loc(list: taasmoutput; size: tcgsize; const reg: tregister; const loc: tlocation);
 
           { vector register move instructions }
@@ -155,12 +155,12 @@ unit cgobj;
           { destination (JM)                                                    }
           procedure a_op_const_reg(list : taasmoutput; Op: TOpCG; a: AWord; reg: TRegister); virtual; abstract;
           procedure a_op_const_ref(list : taasmoutput; Op: TOpCG; size: TCGSize; a: AWord; const ref: TReference); virtual;
-          procedure a_op_const_loc(list : taasmoutput; Op: TOpCG; size: TCGSize; a: AWord; const loc: tlocation);
+          procedure a_op_const_loc(list : taasmoutput; Op: TOpCG; a: AWord; const loc: tlocation);
           procedure a_op_reg_reg(list : taasmoutput; Op: TOpCG; size: TCGSize; reg1, reg2: TRegister); virtual; abstract;
           procedure a_op_reg_ref(list : taasmoutput; Op: TOpCG; size: TCGSize; reg: TRegister; const ref: TReference); virtual;
           procedure a_op_ref_reg(list : taasmoutput; Op: TOpCG; size: TCGSize; const ref: TReference; reg: TRegister); virtual;
-          procedure a_op_reg_loc(list : taasmoutput; Op: TOpCG; size: TCGSize; reg: tregister; const loc: tlocation);
-          procedure a_op_ref_loc(list : taasmoutput; Op: TOpCG; size: TCGSize; const ref: TReference; const loc: tlocation);
+          procedure a_op_reg_loc(list : taasmoutput; Op: TOpCG; reg: tregister; const loc: tlocation);
+          procedure a_op_ref_loc(list : taasmoutput; Op: TOpCG; const ref: TReference; const loc: tlocation);
 
           { trinary operations for processors that support them, 'emulated' }
           { on others. None with "ref" arguments since I don't think there  }
@@ -241,8 +241,8 @@ unit cgobj;
   implementation
 
     uses
-       strings,globals,globtype,options,gdb,systems,cgbase,
-       ppu,verbose,types,tgobj,symdef,symsym,cga,tainst,rgobj;
+       globals,globtype,options,systems,cgbase,
+       verbose,types,tgobj,symdef,cga,tainst,rgobj;
 
     const
       max_scratch_regs = high(scratch_regs) - low(scratch_regs) + 1;
@@ -364,18 +364,18 @@ unit cgobj;
       end;
 
 
-    procedure tcg.a_param_loc(list : taasmoutput;size : tcgsize;const l:tlocation;nr : longint);
+    procedure tcg.a_param_loc(list : taasmoutput;const l:tlocation;nr : longint);
 
       begin
         case l.loc of
           LOC_REGISTER,
           LOC_CREGISTER :
-            a_param_reg(list,size,l.register,nr);
+            a_param_reg(list,l.size,l.register,nr);
           LOC_CONSTANT :
-            a_param_const(list,size,l.value,nr);
+            a_param_const(list,l.size,l.value,nr);
           LOC_CREFERENCE,
           LOC_REFERENCE :
-            a_param_ref(list,size,l.reference,nr);
+            a_param_ref(list,l.size,l.reference,nr);
         else
           internalerror(2002032211);
         end;
@@ -1099,49 +1099,49 @@ unit cgobj;
         free_scratch_reg(list,tmpreg);
       end;
 
-    procedure tcg.a_load_loc_reg(list : taasmoutput;size : tcgsize;const loc: tlocation; reg : tregister);
+    procedure tcg.a_load_loc_reg(list : taasmoutput;const loc: tlocation; reg : tregister);
 
       begin
         case loc.loc of
           LOC_REFERENCE,LOC_CREFERENCE:
-            a_load_ref_reg(list,size,loc.reference,reg);
+            a_load_ref_reg(list,loc.size,loc.reference,reg);
           LOC_REGISTER,LOC_CREGISTER:
-            a_load_reg_reg(list,size,loc.register,reg);
+            a_load_reg_reg(list,loc.size,loc.register,reg);
           LOC_CONSTANT:
-            a_load_const_reg(list,size,loc.value,reg);
+            a_load_const_reg(list,loc.size,loc.value,reg);
           else
             internalerror(200109092);
         end;
       end;
 
 
-    procedure tcg.a_load_const_loc(list : taasmoutput;size : tcgsize;a : aword;const loc: tlocation);
+    procedure tcg.a_load_const_loc(list : taasmoutput;a : aword;const loc: tlocation);
       begin
         case loc.loc of
           LOC_REFERENCE,LOC_CREFERENCE:
-            a_load_const_ref(list,size,a,loc.reference);
+            a_load_const_ref(list,loc.size,a,loc.reference);
           LOC_REGISTER,LOC_CREGISTER:
-            a_load_const_reg(list,size,a,loc.register);
+            a_load_const_reg(list,loc.size,a,loc.register);
           else
             internalerror(200203272);
         end;
       end;
 
 
-    procedure tcg.a_load_reg_loc(list : taasmoutput;size : tcgsize;reg : tregister;const loc: tlocation);
+    procedure tcg.a_load_reg_loc(list : taasmoutput;reg : tregister;const loc: tlocation);
       begin
         case loc.loc of
           LOC_REFERENCE,LOC_CREFERENCE:
-            a_load_reg_ref(list,size,reg,loc.reference);
+            a_load_reg_ref(list,loc.size,reg,loc.reference);
           LOC_REGISTER,LOC_CREGISTER:
-            a_load_reg_reg(list,size,reg,loc.register);
+            a_load_reg_reg(list,loc.size,reg,loc.register);
           else
             internalerror(200203271);
         end;
       end;
 
 
-    procedure tcg.a_load_loc_ref(list : taasmoutput;size : tcgsize;const loc: tlocation; const ref : treference);
+    procedure tcg.a_load_loc_ref(list : taasmoutput;const loc: tlocation; const ref : treference);
 
       var
         tmpreg: tregister;
@@ -1151,7 +1151,7 @@ unit cgobj;
           LOC_REFERENCE,LOC_CREFERENCE:
             begin
 {$ifdef i386}
-              case size of
+              case loc.size of
                 OS_8,OS_S8:
                   tmpreg := reg32toreg8(rg.getregisterint(exprasmlist));
                 OS_16,OS_S16:
@@ -1162,31 +1162,31 @@ unit cgobj;
 {$else i386}
               tmpreg := get_scratch_reg(list);
 {$endif i386}
-              a_load_ref_reg(list,size,loc.reference,tmpreg);
-              a_load_reg_ref(list,size,tmpreg,ref);
+              a_load_ref_reg(list,loc.size,loc.reference,tmpreg);
+              a_load_reg_ref(list,loc.size,tmpreg,ref);
 {$ifdef i386}
-              if not (size in [OS_32,OS_S32]) then
+              if not (loc.size in [OS_32,OS_S32]) then
                 rg.ungetregister(exprasmlist,tmpreg)
               else
 {$endif i386}
               free_scratch_reg(list,tmpreg);
             end;
           LOC_REGISTER,LOC_CREGISTER:
-            a_load_reg_ref(list,size,loc.register,ref);
+            a_load_reg_ref(list,loc.size,loc.register,ref);
           LOC_CONSTANT:
-            a_load_const_ref(list,size,loc.value,ref);
+            a_load_const_ref(list,loc.size,loc.value,ref);
           else
             internalerror(200109302);
         end;
       end;
 
 
-    procedure tcg.a_loadfpu_loc_reg(list: taasmoutput; size: tcgsize; const loc: tlocation; const reg: tregister);
+    procedure tcg.a_loadfpu_loc_reg(list: taasmoutput; const loc: tlocation; const reg: tregister);
 
       begin
         case loc.loc of
           LOC_REFERENCE, LOC_CREFERENCE:
-            a_loadfpu_ref_reg(list,size,loc.reference,reg);
+            a_loadfpu_ref_reg(list,loc.size,loc.reference,reg);
           LOC_FPUREGISTER, LOC_CFPUREGISTER:
             a_loadfpu_reg_reg(list,loc.register,reg);
           else
@@ -1223,14 +1223,14 @@ unit cgobj;
       end;
 
 
-    procedure tcg.a_op_const_loc(list : taasmoutput; Op: TOpCG; size: TCGSize; a: AWord; const loc: tlocation);
+    procedure tcg.a_op_const_loc(list : taasmoutput; Op: TOpCG; a: AWord; const loc: tlocation);
 
       begin
         case loc.loc of
           LOC_REGISTER, LOC_CREGISTER:
             a_op_const_reg(list,op,a,loc.register);
           LOC_REFERENCE, LOC_CREFERENCE:
-            a_op_const_ref(list,op,size,a,loc.reference);
+            a_op_const_ref(list,op,loc.size,a,loc.reference);
           else
             internalerror(200109061);
         end;
@@ -1275,21 +1275,21 @@ unit cgobj;
       end;
 
 
-    procedure tcg.a_op_reg_loc(list : taasmoutput; Op: TOpCG; size: TCGSize; reg: tregister; const loc: tlocation);
+    procedure tcg.a_op_reg_loc(list : taasmoutput; Op: TOpCG; reg: tregister; const loc: tlocation);
 
       begin
         case loc.loc of
           LOC_REGISTER, LOC_CREGISTER:
-            a_op_reg_reg(list,op,size,reg,loc.register);
+            a_op_reg_reg(list,op,loc.size,reg,loc.register);
           LOC_REFERENCE, LOC_CREFERENCE:
-            a_op_reg_ref(list,op,size,reg,loc.reference);
+            a_op_reg_ref(list,op,loc.size,reg,loc.reference);
           else
             internalerror(200109061);
         end;
       end;
 
 
-    procedure tcg.a_op_ref_loc(list : taasmoutput; Op: TOpCG; size: TCGSize; const ref: TReference; const loc: tlocation);
+    procedure tcg.a_op_ref_loc(list : taasmoutput; Op: TOpCG; const ref: TReference; const loc: tlocation);
 
       var
         tmpreg: tregister;
@@ -1297,15 +1297,15 @@ unit cgobj;
       begin
         case loc.loc of
           LOC_REGISTER,LOC_CREGISTER:
-            a_op_ref_reg(list,op,size,ref,loc.register);
+            a_op_ref_reg(list,op,loc.size,ref,loc.register);
           LOC_REFERENCE,LOC_CREFERENCE:
             begin
               tmpreg := get_scratch_reg(list);
 {$ifdef i386}
-              makeregsize(tmpreg,size);
+              makeregsize(tmpreg,loc.size);
 {$endif i386}
-              a_load_ref_reg(list,size,ref,tmpreg);
-              a_op_reg_ref(list,op,size,tmpreg,loc.reference);
+              a_load_ref_reg(list,loc.size,ref,tmpreg);
+              a_op_reg_ref(list,op,loc.size,tmpreg,loc.reference);
               free_scratch_reg(list,tmpreg);
             end;
           else
@@ -1553,7 +1553,11 @@ finalization
 end.
 {
   $Log$
-  Revision 1.9  2002-04-02 17:11:27  peter
+  Revision 1.10  2002-04-04 19:05:54  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.9  2002/04/02 17:11:27  peter
     * tlocation,treference update
     * LOC_CONSTANT added for better constant handling
     * secondadd splitted in multiple routines

+ 6 - 2
compiler/fmodule.pas

@@ -171,7 +171,7 @@ uses
 {$else}
   dos,
 {$endif}
-  globtype,verbose,systems,
+  verbose,systems,
   scanner;
 
 
@@ -584,7 +584,11 @@ uses
 end.
 {
   $Log$
-  Revision 1.20  2002-03-28 20:46:59  carl
+  Revision 1.21  2002-04-04 19:05:55  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.20  2002/03/28 20:46:59  carl
   - remove go32v1 support
 
   Revision 1.19  2001/11/06 14:53:48  jonas

+ 5 - 6
compiler/fppu.pas

@@ -76,11 +76,6 @@ interface
 implementation
 
 uses
-{$ifdef delphi}
-  dmisc,
-{$else}
-  dos,
-{$endif}
   verbose,systems,version,
   symtable,
   scanner,
@@ -1178,7 +1173,11 @@ uses
 end.
 {
   $Log$
-  Revision 1.12  2002-03-28 20:46:44  carl
+  Revision 1.13  2002-04-04 19:05:56  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.12  2002/03/28 20:46:44  carl
   - remove go32v1 support
 
   Revision 1.11  2002/01/19 14:20:13  peter

+ 10 - 3
compiler/i386/ag386att.pas

@@ -45,15 +45,18 @@ interface
 
     uses
 {$ifdef Delphi}
-      sysutils,
       dmisc,
 {$else Delphi}
-      strings,
       dos,
 {$endif Delphi}
       cutils,globtype,systems,
       fmodule,finput,verbose,cpubase,cpuasm,tainst
 {$ifdef GDB}
+  {$ifdef delphi}
+      ,sysutils
+  {$else}
+      ,strings
+  {$endif}
       ,gdb
 {$endif GDB}
       ;
@@ -963,7 +966,11 @@ initialization
 end.
 {
   $Log$
-  Revision 1.14  2002-04-04 18:26:55  carl
+  Revision 1.15  2002-04-04 19:06:06  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.14  2002/04/04 18:26:55  carl
   + added wdosx patch from Pavel
 
   Revision 1.13  2002/04/02 17:11:33  peter

+ 5 - 2
compiler/i386/ag386int.pas

@@ -321,7 +321,6 @@ interface
 
     procedure T386IntelAssembler.WriteTree(p:TAAsmoutput);
     const
-      allocstr : array[boolean] of string[10]=(' released',' allocated');
       nolinetai =[ait_label,
                   ait_regalloc,ait_tempalloc,
                   ait_stabn,ait_stabs,ait_section,
@@ -822,7 +821,11 @@ initialization
 end.
 {
   $Log$
-  Revision 1.15  2002-04-02 17:11:33  peter
+  Revision 1.16  2002-04-04 19:06:07  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.15  2002/04/02 17:11:33  peter
     * tlocation,treference update
     * LOC_CONSTANT added for better constant handling
     * secondadd splitted in multiple routines

+ 14 - 64
compiler/i386/cga.pas

@@ -76,11 +76,11 @@ interface
     procedure emit_mov_ref_reg64(r : treference;rl,rh : tregister);
     procedure emit_lea_loc_ref(const t:tlocation;const ref:treference;freetemp:boolean);
     procedure emit_lea_loc_reg(const t:tlocation;reg:tregister;freetemp:boolean);
-    procedure emit_push_loc(const t:tlocation);
+//    procedure emit_push_loc(const t:tlocation);
     procedure emit_push_mem_size(const t: treference; size: longint);
 
     { pushes qword location to the stack }
-    procedure emit_pushq_loc(const t : tlocation);
+//    procedure emit_pushq_loc(const t : tlocation);
 
     { remove non regvar registers in loc from regs (in the format }
     { pushusedregisters uses)                                     }
@@ -141,17 +141,17 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
 implementation
 
     uses
-{$ifdef delphi}
-       sysutils,
-{$else}
-       strings,
-{$endif}
        cutils,cclasses,
        globtype,systems,globals,verbose,
        fmodule,
        symbase,symsym,symtable,types,
        tainst,cgbase,regvars,cgobj,tgobj,rgobj,rgcpu
 {$ifdef GDB}
+  {$ifdef delphi}
+       ,sysutils
+  {$else}
+       ,strings
+  {$endif}
        ,gdb
 {$endif}
        ;
@@ -469,38 +469,6 @@ implementation
         end;
       end;
 
-      procedure emit_pushq_loc(const t : tlocation);
-
-      var
-         hr : treference;
-
-      begin
-         case t.loc of
-            LOC_REGISTER,
-            LOC_CREGISTER:
-              begin
-                 exprasmList.concat(Taicpu.Op_reg(A_PUSH,S_L,
-                   t.registerhigh));
-                 exprasmList.concat(Taicpu.Op_reg(A_PUSH,S_L,
-                   t.registerlow));
-              end;
-            LOC_CREFERENCE,
-            LOC_REFERENCE:
-              begin
-                 hr:=t.reference;
-                 inc(hr.offset,4);
-                 exprasmList.concat(Taicpu.Op_ref(A_PUSH,S_L,
-                   hr));
-                 hr:=t.reference;
-                 exprasmList.concat(Taicpu.Op_ref(A_PUSH,S_L,
-                   hr));
-                 tg.ungetiftemp(exprasmlist,t.reference);
-              end;
-            else
-         internalerror(200203217);
-         end;
-      end;
-
     procedure remove_non_regvars_from_loc(const t: tlocation; var regs: tregisterset);
     begin
       case t.loc of
@@ -523,28 +491,6 @@ implementation
       end;
     end;
 
-    procedure emit_push_loc(const t:tlocation);
-      begin
-        case t.loc of
-          LOC_REGISTER,
-         LOC_CREGISTER : begin
-                           exprasmList.concat(Taicpu.Op_reg(A_PUSH,S_L,makereg32(t.register)));
-                         end;
-           LOC_CONSTANT :
-                         exprasmList.concat(Taicpu.Op_const(A_PUSH,S_L,t.value));
-
-         LOC_CREFERENCE,
-         LOC_REFERENCE : begin
-                             exprasmList.concat(Taicpu.Op_ref(A_PUSH,S_L,t.reference));
-                         end;
-        else
-         internalerror(200203214);
-        end;
-        location_release(exprasmlist,t);
-        location_freetemp(exprasmlist,t);
-      end;
-
-
     procedure emit_pushw_loc(const t:tlocation);
       var
         opsize : topsize;
@@ -923,9 +869,9 @@ implementation
 
     procedure concatcopy(source,dest : treference;size : longint;delsource,loadref : boolean);
 
-      const
+      {const
          isizes : array[0..3] of topsize=(S_L,S_B,S_W,S_B);
-         ishr : array[0..3] of byte=(2,0,1,0);
+         ishr : array[0..3] of byte=(2,0,1,0);}
 
       var
          ecxpushed : boolean;
@@ -2626,7 +2572,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.20  2002-04-04 18:30:22  carl
+  Revision 1.21  2002-04-04 19:06:08  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.20  2002/04/04 18:30:22  carl
   + added wdosx support (patch from Pavel)
 
   Revision 1.19  2002/04/02 17:11:33  peter

+ 50 - 37
compiler/i386/cgcpu.pas

@@ -1132,24 +1132,29 @@ unit cgcpu;
 
       begin
          case t of
-            OS_F32 : begin
-                        op:=A_FLD;
-                        s:=S_FS;
-                     end;
-            OS_F64 : begin
-                        op:=A_FLD;
-                        { ???? }
-                        s:=S_FL;
-                     end;
-            OS_F80 : begin
-                        op:=A_FLD;
-                        s:=S_FX;
-                     end;
-            OS_C64 : begin
-                        op:=A_FILD;
-                        s:=S_IQ;
-                     end;
-            else internalerror(17);
+            OS_F32 :
+              begin
+                 op:=A_FLD;
+                 s:=S_FS;
+              end;
+            OS_F64 :
+              begin
+                 op:=A_FLD;
+                 { ???? }
+                 s:=S_FL;
+              end;
+            OS_F80 :
+              begin
+                 op:=A_FLD;
+                 s:=S_FX;
+              end;
+            OS_C64 :
+              begin
+                 op:=A_FILD;
+                 s:=S_IQ;
+              end;
+            else
+              internalerror(200204041);
          end;
       end;
 
@@ -1171,24 +1176,28 @@ unit cgcpu;
 
       begin
          case t of
-            OS_F32 : begin
-                        op:=A_FSTP;
-                        s:=S_FS;
-                     end;
-            OS_F64 : begin
-                        op:=A_FSTP;
-                        s:=S_FL;
-                     end;
-            OS_F80 : begin
-                        op:=A_FSTP;
-                        s:=S_FX;
-                     end;
-            OS_C64 : begin
-                        op:=A_FISTP;
-                        s:=S_IQ;
-                     end;
-         else
-           internalerror(17);
+            OS_F32 :
+              begin
+                 op:=A_FSTP;
+                 s:=S_FS;
+              end;
+            OS_F64 :
+              begin
+                 op:=A_FSTP;
+                 s:=S_FL;
+              end;
+            OS_F80 :
+              begin
+                  op:=A_FSTP;
+                  s:=S_FX;
+               end;
+            OS_C64 :
+               begin
+                  op:=A_FISTP;
+                  s:=S_IQ;
+               end;
+            else
+               internalerror(200204042);
          end;
       end;
 
@@ -1211,7 +1220,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.10  2002-04-02 20:29:02  jonas
+  Revision 1.11  2002-04-04 19:06:10  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.10  2002/04/02 20:29:02  jonas
     * optimized the code generated by the a_op_const_* and a_op64_const
       methods
 

+ 7 - 1
compiler/i386/csopt386.pas

@@ -1326,6 +1326,7 @@ begin
         pTaiprop(startMod.optInfo)^.canBeRemoved := true;
 end;
 
+{$ifdef notused}
 function is_mov_for_div(p: Taicpu): boolean;
 begin
   is_mov_for_div :=
@@ -1338,6 +1339,7 @@ begin
     ((p.opcode = A_DIV) or
      (p.opcode = A_IDIV));
 end;
+{$endif notused}
 
 function memtoreg(const t: Taicpu; const ref: treference; var startp: tai): tregister;
 var
@@ -1981,7 +1983,11 @@ End.
 
 {
   $Log$
-  Revision 1.26  2002-04-02 17:11:34  peter
+  Revision 1.27  2002-04-04 19:06:10  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.26  2002/04/02 17:11:34  peter
     * tlocation,treference update
     * LOC_CONSTANT added for better constant handling
     * secondadd splitted in multiple routines

+ 15 - 13
compiler/i386/n386add.pas

@@ -55,7 +55,7 @@ interface
 
     uses
       globtype,systems,
-      cutils,verbose,globals,widestr,
+      cutils,verbose,globals,
       symconst,symdef,aasm,types,htypechk,
       cgbase,pass_2,regvars,
       cpuasm,
@@ -224,7 +224,7 @@ interface
               if extra_not then
                 emit_reg(A_NOT,opsize,left.location.register);
               rg.getexplicitregisterint(exprasmlist,R_EDI);
-              cg.a_load_loc_reg(exprasmlist,opsize_2_cgsize[opsize],right.location,R_EDI);
+              cg.a_load_loc_reg(exprasmlist,right.location,R_EDI);
               emit_reg_reg(op,opsize,left.location.register,R_EDI);
               emit_reg_reg(A_MOV,opsize,R_EDI,left.location.register);
               rg.ungetregisterint(exprasmlist,R_EDI);
@@ -268,7 +268,7 @@ interface
                    if extra_not then
                      begin
                         rg.getexplicitregisterint(exprasmlist,R_EDI);
-                        cg.a_load_loc_reg(exprasmlist,opsize_2_cgsize[opsize],right.location,R_EDI);
+                        cg.a_load_loc_reg(exprasmlist,right.location,R_EDI);
                         emit_reg(A_NOT,S_L,R_EDI);
                         emit_reg_reg(A_AND,S_L,R_EDI,left.location.register);
                         rg.ungetregisterint(exprasmlist,R_EDI);
@@ -320,7 +320,7 @@ interface
              is_shortstring(left.resulttype.def))) then
           begin
             if nodetype = addn then
-              location_reset(location,LOC_CREFERENCE,def_cgsize_ref(resulttype.def))
+              location_reset(location,LOC_CREFERENCE,def_cgsize(resulttype.def))
             else
               location_reset(location,LOC_FLAGS,OS_NO);
             calcregisters(self,0,0,0);
@@ -374,7 +374,7 @@ interface
                              tg.ungetiftemp(exprasmlist,left.location.reference);
 
                              { does not hurt: }
-                             location_reset(left.location,LOC_CREFERENCE,def_cgsize_ref(resulttype.def));
+                             location_reset(left.location,LOC_CREFERENCE,def_cgsize(resulttype.def));
                              left.location.reference:=href;
                           end;
 
@@ -604,14 +604,13 @@ interface
         if (right.location.loc<>LOC_FPUREGISTER) then
          begin
            cg.a_loadfpu_loc_reg(exprasmlist,
-               def_cgsize(right.resulttype.def),right.location,R_ST);
+               right.location,R_ST);
            if (right.location.loc <> LOC_CFPUREGISTER) and
               pushedfpu then
              location_freetemp(exprasmlist,left.location);
            if (left.location.loc<>LOC_FPUREGISTER) then
             begin
-              cg.a_loadfpu_loc_reg(exprasmlist,
-                  def_cgsize(left.resulttype.def),left.location,R_ST);
+              cg.a_loadfpu_loc_reg(exprasmlist,left.location,R_ST);
               if (left.location.loc <> LOC_CFPUREGISTER) and
                  pushedfpu then
                 location_freetemp(exprasmlist,left.location);
@@ -628,8 +627,7 @@ interface
         { the nominator in st0 }
         else if (left.location.loc<>LOC_FPUREGISTER) then
          begin
-           cg.a_loadfpu_loc_reg(exprasmlist,
-               def_cgsize(left.resulttype.def),left.location,R_ST);
+           cg.a_loadfpu_loc_reg(exprasmlist,left.location,R_ST);
            if (left.location.loc <> LOC_CFPUREGISTER) and
               pushedfpu then
              location_freetemp(exprasmlist,left.location);
@@ -711,8 +709,8 @@ interface
          end
         else
          begin
-           location_reset(location,LOC_FPUREGISTER,OS_NO);
-           location.register := R_ST;
+           location_reset(location,LOC_FPUREGISTER,def_cgsize(resulttype.def));
+           location.register:=R_ST;
          end;
       end;
 
@@ -1584,7 +1582,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.31  2002-04-02 17:11:35  peter
+  Revision 1.32  2002-04-04 19:06:10  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.31  2002/04/02 17:11:35  peter
     * tlocation,treference update
     * LOC_CONSTANT added for better constant handling
     * secondadd splitted in multiple routines

+ 16 - 12
compiler/i386/n386cal.pas

@@ -49,19 +49,19 @@ interface
 implementation
 
     uses
-{$ifdef delphi}
-      sysutils,
-{$else}
-      strings,
-{$endif}
       globtype,systems,
       cutils,verbose,globals,
       symconst,symbase,symsym,symtable,aasm,types,
 {$ifdef GDB}
+  {$ifdef delphi}
+      sysutils,
+  {$else}
+      strings,
+  {$endif}
       gdb,
 {$endif GDB}
       cginfo,cgbase,pass_2,
-      cpubase,cpuasm,
+      cpubase,
       nmem,nld,ncnv,
       tainst,cga,cgobj,tgobj,n386ld,n386util,regvars,rgobj,rgcpu,cg64f32;
 
@@ -156,7 +156,7 @@ implementation
                     begin
                       cgsize:=def_cgsize(left.resulttype.def);
                       tg.gettempofsizereference(exprasmlist,left.resulttype.def.size,href);
-                      cg.a_load_loc_ref(exprasmlist,cgsize,left.location,href);
+                      cg.a_load_loc_ref(exprasmlist,left.location,href);
                       location_reset(left.location,LOC_REFERENCE,cgsize);
                       left.location.reference:=href;
                     end;
@@ -187,7 +187,7 @@ implementation
                begin
                  cgsize:=def_cgsize(left.resulttype.def);
                  tg.gettempofsizereference(exprasmlist,left.resulttype.def.size,href);
-                 cg.a_load_loc_ref(exprasmlist,cgsize,left.location,href);
+                 cg.a_load_loc_ref(exprasmlist,left.location,href);
                  location_reset(left.location,LOC_REFERENCE,cgsize);
                  left.location.reference:=href;
                end;
@@ -244,7 +244,7 @@ implementation
                          (ttypeconvnode(left).left.nodetype=niln) then
                        begin
                          tg.gettempofsizereference(exprasmlist,tcgsize2size[left.location.size],href);
-                         cg.a_load_loc_ref(exprasmlist,left.location.size,left.location,href);
+                         cg.a_load_loc_ref(exprasmlist,left.location,href);
                          location_reset(left.location,LOC_REFERENCE,left.location.size);
                          left.location.reference:=href;
                        end
@@ -338,7 +338,7 @@ implementation
          dont_call;
 
       begin
-         location_reset(location,LOC_REFERENCE,def_cgsize_ref(resulttype.def));
+         location_reset(location,LOC_REFERENCE,def_cgsize(resulttype.def));
          extended_new:=false;
          iolabel:=nil;
          inlinecode:=nil;
@@ -1250,7 +1250,7 @@ implementation
                      end
               else if (resulttype.def.deftype=floatdef) then
                 begin
-                  location_reset(location,LOC_FPUREGISTER,OS_NO);
+                  location_reset(location,LOC_FPUREGISTER,def_cgsize(resulttype.def));
                   location.register:=R_ST;
                   inc(trgcpu(rg).fpuvaroffset);
                 end
@@ -1535,7 +1535,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.43  2002-04-02 17:11:35  peter
+  Revision 1.44  2002-04-04 19:06:10  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.43  2002/04/02 17:11:35  peter
     * tlocation,treference update
     * LOC_CONSTANT added for better constant handling
     * secondadd splitted in multiple routines

+ 6 - 2
compiler/i386/n386cnv.pas

@@ -133,7 +133,7 @@ implementation
          l1,l2 : tasmlabel;
 
       begin
-         location_reset(location,LOC_FPUREGISTER,OS_NO);
+         location_reset(location,LOC_FPUREGISTER,def_cgsize(resulttype.def));
          { for u32bit a solution is to push $0 and to load a comp }
          { does this first, it destroys maybe EDI }
          hregister:=R_EDI;
@@ -468,7 +468,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.32  2002-04-02 17:11:36  peter
+  Revision 1.33  2002-04-04 19:06:10  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.32  2002/04/02 17:11:36  peter
     * tlocation,treference update
     * LOC_CONSTANT added for better constant handling
     * secondadd splitted in multiple routines

+ 12 - 8
compiler/i386/n386flw.pas

@@ -56,10 +56,10 @@ implementation
     uses
       verbose,systems,
       symsym,aasm,
-      cgbase,pass_2,
+      cginfo,cgbase,pass_2,
       cpubase,cpuasm,
       nld,ncon,
-      tainst,cga,tgobj,rgobj;
+      tainst,cga,cgobj,tgobj,rgobj;
 
 {*****************************************************************************
                              SecondRaise
@@ -81,28 +81,28 @@ implementation
                       secondpass(frametree);
                       if codegenerror then
                        exit;
-                      emit_push_loc(frametree.location);
+                      cg.a_param_loc(exprasmlist,frametree.location,2);
                     end
                   else
-                    emit_const(A_PUSH,S_L,0);
+                    cg.a_param_const(exprasmlist,OS_INT,0,2);
                   { push address }
                   secondpass(right);
                   if codegenerror then
                    exit;
-                  emit_push_loc(right.location);
+                  cg.a_param_loc(exprasmlist,right.location,1);
                 end
               else
                 begin
                    getaddrlabel(a);
                    emitlab(a);
-                   emit_reg(A_PUSH,S_L,R_EBP);
+                   cg.a_param_reg(exprasmlist,OS_INT,R_EBP,2);
                    emit_sym(A_PUSH,S_L,a);
                 end;
               { push object }
               secondpass(left);
               if codegenerror then
                 exit;
-              emit_push_loc(left.location);
+              cg.a_param_loc(exprasmlist,left.location,1);
               emitcall('FPC_RAISEEXCEPTION');
            end
          else
@@ -736,7 +736,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.21  2002-04-02 17:11:36  peter
+  Revision 1.22  2002-04-04 19:06:11  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.21  2002/04/02 17:11:36  peter
     * tlocation,treference update
     * LOC_CONSTANT added for better constant handling
     * secondadd splitted in multiple routines

+ 14 - 10
compiler/i386/n386inl.pas

@@ -159,7 +159,7 @@ implementation
                      begin
                        location_release(exprasmlist,left.location);
                        hregister:=rg.getregisterint(exprasmlist);
-                       cg.a_load_loc_reg(exprasmlist,OS_ADDR,left.location,hregister);
+                       cg.a_load_loc_reg(exprasmlist,left.location,hregister);
                      end
                     else
                      hregister:=left.location.register;
@@ -253,7 +253,7 @@ implementation
                     tcg64f32(cg).a_op64_const_loc(exprasmlist,addsubop[inlinenumber],
                        addvalue,0,tcallparanode(left).left.location)
                    else
-                    cg.a_op_const_loc(exprasmlist,addsubop[inlinenumber],cgsize,
+                    cg.a_op_const_loc(exprasmlist,addsubop[inlinenumber],
                        addvalue,tcallparanode(left).left.location);
                  end
                 else
@@ -262,7 +262,7 @@ implementation
                     tcg64f32(cg).a_op64_reg_loc(exprasmlist,addsubop[inlinenumber],
                        hregister,hregisterhi,tcallparanode(left).left.location)
                    else
-                    cg.a_op_reg_loc(exprasmlist,addsubop[inlinenumber],cgsize,
+                    cg.a_op_reg_loc(exprasmlist,addsubop[inlinenumber],
                        hregister,tcallparanode(left).left.location);
                    location_release(exprasmlist,tcallparanode(tcallparanode(left).right).left.location);
                  end;
@@ -288,7 +288,7 @@ implementation
                        push_int(tcallparanode(left).left.resulttype.def.size);
                        if codegenerror then
                         exit;
-                       emit_push_loc(tcallparanode(tcallparanode(left).right).left.location);
+                       cg.a_param_loc(exprasmlist,tcallparanode(tcallparanode(left).right).left.location,1);
                     end;
 
                   { generate a reference }
@@ -350,7 +350,7 @@ implementation
                          begin
                             secondpass(tcallparanode(hp).left);
                             location_release(exprasmlist,tcallparanode(hp).left.location);
-                            cg.a_load_loc_ref(exprasmlist,OS_INT,tcallparanode(hp).left.location,href);
+                            cg.a_load_loc_ref(exprasmlist,tcallparanode(hp).left.location,href);
                             inc(href.offset,4);
                             hp:=tcallparanode(hp).right;
                          end;
@@ -358,7 +358,7 @@ implementation
                   else
                     begin
                        secondpass(tcallparanode(hp).left);
-                       emit_push_loc(tcallparanode(hp).left.location);
+                       cg.a_param_loc(exprasmlist,tcallparanode(hp).left.location,1);
                        hp:=tcallparanode(hp).right;
                     end;
                   { handle shortstrings separately since the hightree must be }
@@ -494,7 +494,7 @@ implementation
               end;
             in_pi:
               begin
-                location_reset(location,LOC_FPUREGISTER,OS_NO);
+                location_reset(location,LOC_FPUREGISTER,def_cgsize(resulttype.def));
                 emit_none(A_FLDPI,S_NO);
                 inc(trgcpu(rg).fpuvaroffset);
                 location.register:=R_ST;
@@ -507,8 +507,8 @@ implementation
             in_ln_extended,
             in_cos_extended:
               begin
-                 location_reset(location,LOC_FPUREGISTER,OS_NO);
-                 location.register := R_ST;
+                 location_reset(location,LOC_FPUREGISTER,def_cgsize(resulttype.def));
+                 location.register:=R_ST;
                  secondpass(left);
                  case left.location.loc of
                     LOC_FPUREGISTER:
@@ -600,7 +600,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.34  2002-04-02 17:11:36  peter
+  Revision 1.35  2002-04-04 19:06:11  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.34  2002/04/02 17:11:36  peter
     * tlocation,treference update
     * LOC_CONSTANT added for better constant handling
     * secondadd splitted in multiple routines

+ 17 - 14
compiler/i386/n386ld.pas

@@ -73,7 +73,7 @@ implementation
       begin
          simple_loadn:=true;
          { we don't know the size of all arrays }
-         newsize:=def_cgsize_ref(resulttype.def);
+         newsize:=def_cgsize(resulttype.def);
          location_reset(location,LOC_REFERENCE,newsize);
          case symtableentry.typ of
               { this is only for toasm and toaddr }
@@ -149,7 +149,7 @@ implementation
                            begin
                               if tvarsym(symtableentry).reg in [R_ST0..R_ST7] then
                                 begin
-                                   location_reset(location,LOC_CFPUREGISTER,OS_NO);
+                                   location_reset(location,LOC_CFPUREGISTER,def_cgsize(resulttype.def));
                                    location.register:=tvarsym(symtableentry).reg;
                                 end
                               else
@@ -520,7 +520,7 @@ implementation
                  rg.saveusedregisters(exprasmlist,regspushed,regs_to_push);
 
                  location_release(exprasmlist,right.location);
-                 cg.a_param_loc(exprasmlist,OS_INT,right.location,2);
+                 cg.a_param_loc(exprasmlist,right.location,2);
                  location_release(exprasmlist,left.location);
                  cg.a_paramaddr_ref(exprasmlist,left.location.reference,1);
                  rg.saveregvars(exprasmlist,all_registers);
@@ -580,7 +580,7 @@ implementation
                    tcg64f32(cg).a_load64_const_loc(exprasmlist,
                        right.location.valuelow,right.location.valuehigh,left.location)
                   else
-                   cg.a_load_const_loc(exprasmlist,right.location.size,right.location.value,left.location);
+                   cg.a_load_const_loc(exprasmlist,right.location.value,left.location);
                 end;
               LOC_REFERENCE,
               LOC_CREFERENCE :
@@ -651,8 +651,7 @@ implementation
                    tcg64f32(cg).a_load64_reg_loc(exprasmlist,
                        right.location.registerlow,right.location.registerhigh,left.location)
                   else
-                   cg.a_load_reg_loc(exprasmlist,cgsize,
-                       right.location.register,left.location);
+                   cg.a_load_reg_loc(exprasmlist,right.location.register,left.location);
                 end;
               LOC_FPUREGISTER,LOC_CFPUREGISTER :
                 begin
@@ -684,7 +683,7 @@ implementation
                     restore(right,false);
                   if codegenerror then
                     exit;
-                  cg.a_load_const_loc(exprasmlist,cgsize,1,left.location);
+                  cg.a_load_const_loc(exprasmlist,1,left.location);
                   emitjmp(C_None,hlabel);
                   if not(left.location.loc in [LOC_CREGISTER{$ifdef SUPPORT_MMX},LOC_CMMXREGISTER{$endif SUPPORT_MMX}]) then
                    location_release(exprasmlist,left.location);
@@ -696,7 +695,7 @@ implementation
                     restore(right,false);
                   if codegenerror then
                     exit;
-                  cg.a_load_const_loc(exprasmlist,cgsize,0,left.location);
+                  cg.a_load_const_loc(exprasmlist,0,left.location);
                   emitlab(hlabel);
                 end;
               LOC_FLAGS :
@@ -739,7 +738,7 @@ implementation
          hr_valid : boolean;
          i : integer;
       begin
-         location_reset(location,LOC_REFERENCE,OS_INT);
+         location_reset(location,LOC_REFERENCE,def_cgsize(resulttype.def));
          hr_valid:=false;
          if (not inlining_procedure) and
             (lexlevel<>funcretsym.owner.symtablelevel) then
@@ -820,7 +819,7 @@ implementation
          elesize:=tarraydef(resulttype.def).elesize;
         if not(nf_cargs in flags) then
          begin
-           location_reset(location,LOC_CREFERENCE,OS_NO);
+           location_reset(location,LOC_REFERENCE,OS_NO);
            { Allocate always a temp, also if no elements are required, to
              be sure that location is valid (PFV) }
             if tarraydef(resulttype.def).highrange=-1 then
@@ -923,7 +922,7 @@ implementation
                        location_release(exprasmlist,hp.left.location);
                      end
                     else
-                     emit_push_loc(hp.left.location);
+                     cg.a_param_loc(exprasmlist,hp.left.location,-1);
                     inc(pushedparasize,4);
                   end
                  else
@@ -938,7 +937,7 @@ implementation
                     else
                      begin
                        location_release(exprasmlist,left.location);
-                       cg.a_load_loc_ref(exprasmlist,OS_32,hp.left.location,href);
+                       cg.a_load_loc_ref(exprasmlist,hp.left.location,href);
                      end;
                     { update href to the vtype field and write it }
                     dec(href.offset,4);
@@ -954,7 +953,7 @@ implementation
                    1,2,4 :
                      begin
                        location_release(exprasmlist,left.location);
-                       cg.a_load_loc_ref(exprasmlist,int_cgsize(elesize),hp.left.location,href);
+                       cg.a_load_loc_ref(exprasmlist,hp.left.location,href);
                      end;
                    8 :
                      begin
@@ -993,7 +992,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.32  2002-04-03 10:43:37  jonas
+  Revision 1.33  2002-04-04 19:06:12  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.32  2002/04/03 10:43:37  jonas
     * fixed regvar-related bugs (the load node set the location to
       LOC_REGISTER instead of LOC_CREGISTER and the assignment node didn't
       support loading constants in LOC_CREGISTER's)

+ 13 - 9
compiler/i386/n386mat.pas

@@ -56,7 +56,7 @@ implementation
       cginfo,cgbase,pass_1,pass_2,
       ncon,
       cpubase,
-      cga,tgobj,n386util,ncgutil,cgobj,cg64f32,rgobj,rgcpu;
+      cga,tgobj,n386util,ncgutil,cgobj,rgobj,rgcpu;
 
 {*****************************************************************************
                              TI386MODDIVNODE
@@ -160,7 +160,7 @@ implementation
                   rg.getexplicitregisterint(exprasmlist,R_EDI);
                   if right.location.loc<>LOC_CREGISTER then
                    location_release(exprasmlist,right.location);
-                  cg.a_load_loc_reg(exprasmlist,OS_INT,right.location,R_EDI);
+                  cg.a_load_loc_reg(exprasmlist,right.location,R_EDI);
                   popedx:=false;
                   popeax:=false;
                   if hreg1=R_EDX then
@@ -256,7 +256,7 @@ implementation
                   include(rg.usedinproc,R_EAX);
                   include(rg.usedinproc,R_EDX);
                 End;
-              location_reset(location,LOC_REGISTER,OS_32);
+              location_reset(location,LOC_REGISTER,OS_INT);
               location.register:=hreg1;
            end;
       end;
@@ -351,7 +351,7 @@ implementation
                        if right.location.loc<>LOC_CREGISTER then
                         location_release(exprasmlist,right.location);
                        hregister2:=rg.getexplicitregisterint(exprasmlist,R_ECX);
-                       cg.a_load_loc_reg(exprasmlist,OS_INT,right.location,hregister2);
+                       cg.a_load_loc_reg(exprasmlist,right.location,hregister2);
                      end
                    else
                      hregister2:=right.location.register;
@@ -487,7 +487,7 @@ implementation
                        if right.location.loc<>LOC_CREGISTER then
                         location_release(exprasmlist,right.location);
                        hregister2:=rg.getexplicitregisterint(exprasmlist,R_ECX);
-                       cg.a_load_loc_reg(exprasmlist,OS_INT,right.location,hregister2);
+                       cg.a_load_loc_reg(exprasmlist,right.location,hregister2);
                      end
                    else
                      hregister2:=right.location.register;
@@ -663,8 +663,8 @@ implementation
                       reference_release(exprasmlist,left.location.reference);
                       if (left.resulttype.def.deftype=floatdef) then
                         begin
-                           location_reset(location,LOC_FPUREGISTER,OS_NO);
-                           location.register := R_ST;
+                           location_reset(location,LOC_FPUREGISTER,def_cgsize(resulttype.def));
+                           location.register:=R_ST;
                            cg.a_loadfpu_ref_reg(exprasmlist,
                               def_cgsize(left.resulttype.def),
                               left.location.reference,R_ST);
@@ -690,7 +690,7 @@ implementation
                    begin
                       { "load st,st" is ignored by the code generator }
                       cg.a_loadfpu_reg_reg(exprasmlist,left.location.register,R_ST);
-                      location_reset(location,LOC_FPUREGISTER,OS_NO);
+                      location_reset(location,LOC_FPUREGISTER,def_cgsize(resulttype.def));
                       location.register:=R_ST;
                       emit_none(A_FCHS,S_NO);
                    end;
@@ -831,7 +831,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.25  2002-04-02 17:11:36  peter
+  Revision 1.26  2002-04-04 19:06:12  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.25  2002/04/02 17:11:36  peter
     * tlocation,treference update
     * LOC_CONSTANT added for better constant handling
     * secondadd splitted in multiple routines

+ 13 - 11
compiler/i386/n386mem.pas

@@ -61,7 +61,7 @@ implementation
       symconst,symtype,symdef,symsym,symtable,aasm,types,
       cginfo,cgbase,pass_2,
       pass_1,nld,ncon,nadd,
-      cpubase,cpuasm,
+      cpubase,
       cgobj,cga,tgobj,n386util,rgobj;
 
 {*****************************************************************************
@@ -102,7 +102,7 @@ implementation
 
                    { push pointer we just allocated, we need to initialize the
                      data located at that pointer not the pointer self (PFV) }
-                   emit_push_loc(location);
+                   cg.a_param_loc(exprasmlist,location,1);
                    emitcall('FPC_INITIALIZE');
                 end;
               rg.restoreusedregisters(exprasmlist,pushed);
@@ -141,7 +141,7 @@ implementation
          procedure saveleft;
          begin
            tg.gettempofsizereference(exprasmlist,target_info.size_of_pointer,lefttemp);
-           cg.a_load_loc_ref(exprasmlist,OS_ADDR,left.location,lefttemp);
+           cg.a_load_loc_ref(exprasmlist,left.location,lefttemp);
            location_release(exprasmlist,left.location);
          end;
 
@@ -166,7 +166,7 @@ implementation
                      reference_reset_symbol(href,tstoreddef(tpointerdef(left.resulttype.def).pointertype.def).get_rtti_label(initrtti),0);
                      emitpushreferenceaddr(href);
                      { push pointer adress }
-                     emit_push_loc(left.location);
+                     cg.a_param_loc(exprasmlist,left.location,1);
                      { save left and free its registers }
                      saveleft;
                      emitcall('FPC_FINALIZE');
@@ -176,7 +176,7 @@ implementation
                   end
                 else
                   begin
-                    emit_push_loc(left.location);
+                    cg.a_param_loc(exprasmlist,left.location,1);
                     location_release(exprasmlist,left.location);
                   end;
                 emitcall('FPC_FREEMEM');
@@ -280,7 +280,7 @@ implementation
          otl,ofl : tasmlabel;
          newsize : tcgsize;
       begin
-         newsize:=def_cgsize_ref(resulttype.def);
+         newsize:=def_cgsize(resulttype.def);
          location_reset(location,LOC_REFERENCE,newsize);
 
          secondpass(left);
@@ -554,16 +554,14 @@ implementation
                         is_array_of_const(left.resulttype.def) then
                       begin
                         tarraydef(left.resulttype.def).genrangecheck;
-                        reference_reset(href);
-                        href.symbol:=newasmsymbol(tarraydef(left.resulttype.def).getrangecheckstring);
-                        href.offset:=4;
                         srsym:=searchsymonlyin(tloadnode(left).symtable,
                           'high'+tvarsym(tloadnode(left).symtableentry).name);
                         hightree:=cloadnode.create(tvarsym(srsym),tloadnode(left).symtable);
                         firstpass(hightree);
                         secondpass(hightree);
                         location_release(exprasmlist,hightree.location);
-                        cg.a_load_loc_ref(exprasmlist,OS_INT,hightree.location,href);
+                        reference_reset_symbol(href,newasmsymbol(tarraydef(left.resulttype.def).getrangecheckstring),4);
+                        cg.a_load_loc_ref(exprasmlist,hightree.location,href);
                         hightree.free;
                         hightree:=nil;
                       end;
@@ -665,7 +663,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.23  2002-04-02 17:11:36  peter
+  Revision 1.24  2002-04-04 19:06:12  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.23  2002/04/02 17:11:36  peter
     * tlocation,treference update
     * LOC_CONSTANT added for better constant handling
     * secondadd splitted in multiple routines

+ 8 - 4
compiler/i386/n386opt.pas

@@ -41,7 +41,7 @@ type
 
 implementation
 
-uses pass_1, types, htypechk, cginfo, cgbase, cpubase, cga,
+uses pass_1, types, htypechk, cgbase, cpubase, cga,
      tgobj, aasm, ncnv, ncon, pass_2, symdef, rgobj;
 
 
@@ -99,7 +99,7 @@ begin
        { release the registers }
        tg.ungetiftemp(exprasmlist,left.location.reference);
        { does not hurt: }
-       location_reset(left.location,LOC_CREFERENCE,def_cgsize_ref(resulttype.def));
+       location_reset(left.location,LOC_CREFERENCE,def_cgsize(resulttype.def));
        left.location.reference:=href;
     end;
   secondpass(right);
@@ -207,7 +207,7 @@ begin
        { release the registers }
        tg.ungetiftemp(exprasmlist,left.location.reference);
        { does not hurt: }
-       location_reset(left.location,LOC_CREFERENCE,def_cgsize_ref(resulttype.def));
+       location_reset(left.location,LOC_CREFERENCE,def_cgsize(resulttype.def));
        left.location.reference:=href;
     end;
   secondpass(right);
@@ -242,7 +242,11 @@ end.
 
 {
   $Log$
-  Revision 1.8  2002-04-02 17:11:36  peter
+  Revision 1.9  2002-04-04 19:06:12  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.8  2002/04/02 17:11:36  peter
     * tlocation,treference update
     * LOC_CONSTANT added for better constant handling
     * secondadd splitted in multiple routines

+ 15 - 11
compiler/i386/n386util.pas

@@ -57,8 +57,8 @@ implementation
     uses
        globtype,globals,systems,verbose,
        cutils,
-       aasm,cpuasm,cpuinfo,
-       symconst,symbase,symdef,symsym,symtable,
+       aasm,cpuasm,
+       symconst,symdef,symsym,symtable,
 {$ifdef GDB}
        gdb,
 {$endif GDB}
@@ -106,7 +106,7 @@ implementation
                     cg.a_label(exprasmlist,hl);
                   end;
                 else
-                  cg.a_load_loc_reg(exprasmlist,l.size,l,hregister);
+                  cg.a_load_loc_reg(exprasmlist,l,hregister);
               end;
               { reset hi part, take care of the signed bit of the current value }
               hregisterhi:=rg.getregisterint(exprasmlist);
@@ -227,7 +227,7 @@ implementation
                      end;
                     l.size:=size;
                   end;
-                 cg.a_load_loc_reg(exprasmlist,l.size,l,hregister);
+                 cg.a_load_loc_reg(exprasmlist,l,hregister);
                end;
            end;
            location_reset(l,LOC_REGISTER,size);
@@ -584,10 +584,10 @@ implementation
                   if inlined then
                    begin
                      reference_reset_base(r,procinfo^.framepointer,para_offset-pushedparasize);
-                     cg.a_load_loc_ref(exprasmlist,cgsize,p.location,r);
+                     cg.a_load_loc_ref(exprasmlist,p.location,r);
                    end
                   else
-                   cg.a_param_loc(exprasmlist,cgsize,p.location,-1);
+                   cg.a_param_loc(exprasmlist,p.location,-1);
                   { restore old register }
                   p.location.register:=hreg;
                 end;
@@ -627,10 +627,10 @@ implementation
                   if inlined then
                    begin
                      reference_reset_base(r,procinfo^.framepointer,para_offset-pushedparasize);
-                     cg.a_load_loc_ref(exprasmlist,cgsize,p.location,r);
+                     cg.a_load_loc_ref(exprasmlist,p.location,r);
                    end
                   else
-                   cg.a_param_loc(exprasmlist,cgsize,p.location,-1);
+                   cg.a_param_loc(exprasmlist,p.location,-1);
                 end;
                location_release(exprasmlist,p.location);
              end;
@@ -1225,7 +1225,7 @@ implementation
          rg.saveusedregisters(exprasmlist,pushed,regs_to_push);
          location_freetemp(exprasmlist,source.location);
          location_release(exprasmlist,source.location);
-         cg.a_param_loc(exprasmlist,OS_ADDR,source.location,1);
+         cg.a_param_loc(exprasmlist,source.location,1);
          push_shortstring_length(dest);
          emitpushreferenceaddr(dest.location.reference);
          rg.saveregvars(exprasmlist,all_registers);
@@ -1247,7 +1247,7 @@ implementation
          rg.saveusedregisters(exprasmlist,pushed,regs_to_push);
          location_freetemp(exprasmlist,source.location);
          location_release(exprasmlist,source.location);
-         cg.a_param_loc(exprasmlist,OS_ADDR,source.location,1);
+         cg.a_param_loc(exprasmlist,source.location,1);
          push_shortstring_length(dest);
          emitpushreferenceaddr(dest.location.reference);
          rg.saveregvars(exprasmlist,all_registers);
@@ -1308,7 +1308,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.29  2002-04-04 07:56:15  michael
+  Revision 1.30  2002-04-04 19:06:12  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.29  2002/04/04 07:56:15  michael
   * Patch from peter to fix go32v2 cycle
 
   Revision 1.28  2002/04/02 17:11:37  peter

+ 6 - 4
compiler/i386/ra386.pas

@@ -56,9 +56,7 @@ implementation
 
 uses
   globtype,globals,systems,verbose,
-  symconst,symdef,symsym,
-  cpuinfo,cgbase,
-  types,cpuasm;
+  cpuinfo,cpuasm;
 
 {$define ATTOP}
 {$define INTELOP}
@@ -631,7 +629,11 @@ end;
 end.
 {
   $Log$
-  Revision 1.15  2002-04-02 17:11:39  peter
+  Revision 1.16  2002-04-04 19:06:13  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.15  2002/04/02 17:11:39  peter
     * tlocation,treference update
     * LOC_CONSTANT added for better constant handling
     * secondadd splitted in multiple routines

+ 7 - 9
compiler/i386/ra386att.pas

@@ -43,14 +43,12 @@ Implementation
        { aasm }
        cpubase,aasm,
        { symtable }
-       symconst,symbase,symtype,symsym,symtable,types,
+       symconst,symbase,symtype,symsym,symtable,
        { pass 1 }
        nbas,
        { parser }
        scanner,
-       ra386,rautils,
-       { codegen }
-       cgbase
+       ra386,rautils
        ;
 
 type
@@ -75,10 +73,6 @@ const
    firstdirective = AS_DB;
    lastdirective  = AS_END;
 
-   _count_asmprefixes   = 5;
-   _count_asmspecialops = 25;
-   _count_asmoverrides  = 3;
-
   token2str : array[tasmtoken] of tasmkeyword=(
     '','Label','LLabel','string','integer',
     'float',',','(',
@@ -2135,7 +2129,11 @@ finalization
 end.
 {
   $Log$
-  Revision 1.18  2002-04-02 17:11:39  peter
+  Revision 1.19  2002-04-04 19:06:13  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.18  2002/04/02 17:11:39  peter
     * tlocation,treference update
     * LOC_CONSTANT added for better constant handling
     * secondadd splitted in multiple routines

+ 6 - 7
compiler/i386/ra386int.pas

@@ -43,7 +43,7 @@ Implementation
        { aasm }
        cpubase,aasm,
        { symtable }
-       symconst,symbase,symtype,symsym,symtable,types,
+       symconst,symbase,symtype,symsym,symtable,
        { pass 1 }
        nbas,
        { parser }
@@ -74,14 +74,9 @@ const
    lastdirective  = AS_END;
    firstoperator  = AS_BYTE;
    lastoperator   = AS_XOR;
-   firstsreg      = R_CS;
-   lastsreg       = R_SS;
 
    _count_asmdirectives = longint(lastdirective)-longint(firstdirective);
    _count_asmoperators  = longint(lastoperator)-longint(firstoperator);
-   _count_asmprefixes   = 5;
-   _count_asmspecialops = 25;
-   _count_asmoverrides  = 3;
 
    _asmdirectives : array[0.._count_asmdirectives] of tasmkeyword =
    ('DB','DW','DD','END');
@@ -1964,7 +1959,11 @@ finalization
 end.
 {
   $Log$
-  Revision 1.21  2002-04-02 17:11:39  peter
+  Revision 1.22  2002-04-04 19:06:13  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.21  2002/04/02 17:11:39  peter
     * tlocation,treference update
     * LOC_CONSTANT added for better constant handling
     * secondadd splitted in multiple routines

+ 10 - 4
compiler/i386/rgcpu.pas

@@ -72,8 +72,8 @@ unit rgcpu;
 
     uses
        systems,
-       globals,verbose,node,
-       cgobj,tgobj,cga;
+       globals,verbose,
+       tgobj,cga;
 
 
     function trgcpu.getregisterint(list: taasmoutput): tregister;
@@ -192,7 +192,9 @@ unit rgcpu;
 
       var
         r: tregister;
-        hr: treference;
+{$ifdef SUPPORT_MMX}
+        hr : treference;
+{$endif SUPPORT_MMX}
       begin
         usedinproc:=usedinproc + s;
         for r:=R_EAX to R_EBX do
@@ -328,7 +330,11 @@ end.
 
 {
   $Log$
-  Revision 1.2  2002-04-02 17:11:39  peter
+  Revision 1.3  2002-04-04 19:06:13  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.2  2002/04/02 17:11:39  peter
     * tlocation,treference update
     * LOC_CONSTANT added for better constant handling
     * secondadd splitted in multiple routines

+ 6 - 2
compiler/nadd.pas

@@ -57,7 +57,7 @@ implementation
     uses
       globtype,systems,
       cutils,verbose,globals,widestr,
-      symconst,symtype,symbase,symdef,symsym,symtable,types,
+      symconst,symtype,symdef,symsym,symtable,types,
       cpuinfo,
       cgbase,
       htypechk,pass_1,
@@ -1601,7 +1601,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.44  2002-04-02 17:11:28  peter
+  Revision 1.45  2002-04-04 19:05:56  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.44  2002/04/02 17:11:28  peter
     * tlocation,treference update
     * LOC_CONSTANT added for better constant handling
     * secondadd splitted in multiple routines

+ 12 - 5
compiler/nbas.pas

@@ -79,10 +79,11 @@ interface
        ttempinfo = record
          { set to the copy of a tempcreate pnode (if it gets copied) so that the }
          { refs and deletenode can hook to this copy once they get copied too    }
-         hookoncopy: ptempinfo;
-         ref: treference;
-         restype: ttype;
-         valid: boolean;
+         hookoncopy : ptempinfo;
+         ref        : treference;
+         size       : longint;
+         restype    : ttype;
+         valid      : boolean;
        end;
 
        { a node which will create a (non)persistent temp of a given type with a given  }
@@ -455,6 +456,7 @@ implementation
         new(tempinfo);
         fillchar(tempinfo^,sizeof(tempinfo^),0);
         tempinfo^.restype := _restype;
+        tempinfo^.size := _size;
         persistent := _persistent;
       end;
 
@@ -468,6 +470,7 @@ implementation
         new(n.tempinfo);
         fillchar(n.tempinfo^,sizeof(n.tempinfo^),0);
         n.tempinfo^.restype := tempinfo^.restype;
+        n.tempinfo^.size:=size;
 
         { signal the temprefs that the temp they point to has been copied, }
         { so that if the refs get copied as well, they can hook themselves }
@@ -617,7 +620,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.19  2002-03-31 20:26:33  jonas
+  Revision 1.20  2002-04-04 19:05:57  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.19  2002/03/31 20:26:33  jonas
     + a_loadfpu_* and a_loadmm_* methods in tcg
     * register allocation is now handled by a class and is mostly processor
       independent (+rgobj.pas and i386/rgcpu.pas)

+ 9 - 7
compiler/ncgbas.pas

@@ -62,14 +62,12 @@ interface
 
     uses
       globtype,systems,
-      cutils,cclasses,verbose,globals,
-      aasm,symconst,symsym,symtable,types,
-      htypechk,
+      cutils,verbose,globals,
+      aasm,symsym,
       cpubase,cpuasm,
       nflw,pass_2,
-      cgbase,
       cga,
-      tgobj,rgobj
+      cgbase,tgobj,rgobj
       ;
 {*****************************************************************************
                                  TNOTHING
@@ -257,7 +255,7 @@ interface
         if not tempinfo^.valid then
           internalerror(200108231);
         { set the temp's location }
-        location.loc := LOC_REFERENCE;
+        location_reset(location,LOC_REFERENCE,int_cgsize(tempinfo^.size));
         location.reference := tempinfo^.ref;
       end;
 
@@ -282,7 +280,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.11  2002-03-31 20:26:34  jonas
+  Revision 1.12  2002-04-04 19:05:57  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.11  2002/03/31 20:26:34  jonas
     + a_loadfpu_* and a_loadmm_* methods in tcg
     * register allocation is now handled by a class and is mostly processor
       independent (+rgobj.pas and i386/rgcpu.pas)

+ 10 - 7
compiler/ncgcnv.pas

@@ -201,22 +201,21 @@ interface
 
     procedure tcgtypeconvnode.second_real_to_real;
       begin
-         location_reset(location,LOC_FPUREGISTER,OS_NO);
+         location_reset(location,LOC_FPUREGISTER,def_cgsize(resulttype.def));
          case left.location.loc of
             LOC_FPUREGISTER,
             LOC_CFPUREGISTER:
               begin
                 location_copy(location,left.location);
+                location.size:=def_cgsize(resulttype.def);
                 exit;
               end;
             LOC_CREFERENCE,
             LOC_REFERENCE:
               begin
                  location_release(exprasmlist,left.location);
-                 location.register := rg.getregisterfpu(exprasmlist);
-                 cg.a_loadfpu_ref_reg(exprasmlist,
-                   def_cgsize(left.resulttype.def),
-                   left.location.reference,location.register);
+                 location.register:=rg.getregisterfpu(exprasmlist);
+                 cg.a_loadfpu_loc_reg(exprasmlist,left.location,location.register);
               end;
             else
               internalerror(2002032215);
@@ -428,7 +427,7 @@ interface
         { we reuse the old value }
         location_copy(location,left.location);
         { but use the new size, but we don't know the size of all arrays }
-        location.size:=def_cgsize_ref(resulttype.def)
+        location.size:=def_cgsize(resulttype.def)
       end;
 
 
@@ -438,7 +437,11 @@ end.
 
 {
   $Log$
-  Revision 1.6  2002-04-02 17:11:28  peter
+  Revision 1.7  2002-04-04 19:05:57  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.6  2002/04/02 17:11:28  peter
     * tlocation,treference update
     * LOC_CONSTANT added for better constant handling
     * secondadd splitted in multiple routines

+ 7 - 11
compiler/ncgcon.pas

@@ -88,7 +88,7 @@ implementation
          realait : tait;
 
       begin
-        location_reset(location,LOC_CREFERENCE,def_cgsize_ref(resulttype.def));
+        location_reset(location,LOC_CREFERENCE,def_cgsize(resulttype.def));
         lastlabel:=nil;
         realait:=floattype2ait[tfloatdef(resulttype.def).typ];
         { const already used ? }
@@ -150,9 +150,6 @@ implementation
 *****************************************************************************}
 
     procedure tcgordconstnode.pass_2;
-      var
-         l : tasmlabel;
-
       begin
          location_reset(location,LOC_CONSTANT,def_cgsize(resulttype.def));
          location.valuelow:=AWord(value);
@@ -183,7 +180,6 @@ implementation
          lastlabel   : tasmlabel;
          pc       : pchar;
          same_string : boolean;
-         size : tcgsize;
          l,j,
          i,mylength  : longint;
       begin
@@ -196,11 +192,7 @@ implementation
             exit;
           end;
          { return a constant reference in memory }
-         if (st_type in [st_ansistring,st_widestring]) then
-          size:=OS_ADDR
-         else
-          size:=def_cgsize_ref(resulttype.def);
-         location_reset(location,LOC_CREFERENCE,size);
+         location_reset(location,LOC_CREFERENCE,def_cgsize(resulttype.def));
          { const already used ? }
          lastlabel:=nil;
          if not assigned(lab_str) then
@@ -496,7 +488,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.6  2002-04-02 17:11:28  peter
+  Revision 1.7  2002-04-04 19:05:57  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.6  2002/04/02 17:11:28  peter
     * tlocation,treference update
     * LOC_CONSTANT added for better constant handling
     * secondadd splitted in multiple routines

+ 10 - 8
compiler/ncgflw.pas

@@ -73,7 +73,7 @@ implementation
       nld,ncon,
       cga,tgobj,rgobj,
       ncgutil,
-      tainst,regvars,cgobj,cgcpu,cg64f32;
+      regvars,cgobj,cgcpu,cg64f32;
 
 {*****************************************************************************
                          Second_While_RepeatN
@@ -407,7 +407,7 @@ implementation
            hop:=OP_SUB
          else
            hop:=OP_ADD;
-         cg.a_op_const_loc(exprasmlist,hop,opsize,1,t2.location);
+         cg.a_op_const_loc(exprasmlist,hop,1,t2.location);
          cg.a_jmp_cond(exprasmlist,OC_None,l3);
 
          if temptovalue then
@@ -495,16 +495,14 @@ implementation
                   begin
                     cg.a_reg_alloc(exprasmlist,accumulator);
                     allocated_acc := true;
-                    cg.a_load_loc_reg(exprasmlist,OS_ADDR,left.location,accumulator);
+                    cg.a_load_loc_reg(exprasmlist,left.location,accumulator);
                   end;
                 floatdef :
                   begin
 {$ifndef i386}
                     cg.a_reg_alloc(exprasmlist,fpuresultreg);
 {$endif not i386}
-                    cg.a_loadfpu_loc_reg(exprasmlist,
-                        def_cgsize(aktprocdef.rettype.def),
-                        left.location,fpuresultreg);
+                    cg.a_loadfpu_loc_reg(exprasmlist,left.location,fpuresultreg);
                   end;
                 else
                   begin
@@ -533,7 +531,7 @@ implementation
 {$else}
                           hreg:=accumulator;
 {$endif}
-                          cg.a_load_loc_reg(exprasmlist,cgsize,left.location,hreg);
+                          cg.a_load_loc_reg(exprasmlist,left.location,hreg);
                         end;
                     end;
                  end;
@@ -627,7 +625,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.10  2002-04-02 17:11:28  peter
+  Revision 1.11  2002-04-04 19:05:57  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.10  2002/04/02 17:11:28  peter
     * tlocation,treference update
     * LOC_CONSTANT added for better constant handling
     * secondadd splitted in multiple routines

+ 27 - 24
compiler/ncgmem.pas

@@ -70,21 +70,24 @@ interface
 implementation
 
     uses
-{$ifdef delphi}
-      sysutils,
-{$else}
-      strings,
-{$endif}
-{$ifdef GDB}
-      gdb,
-{$endif GDB}
       globtype,systems,
       cutils,verbose,globals,
-      symconst,symbase,symdef,symsym,aasm,
+      symconst,symdef,symsym,aasm,
       cginfo,cgbase,pass_2,
       nld,ncon,nadd,
       cpubase,cgobj,cgcpu,
-      cga,tgobj,rgobj;
+      tgobj,rgobj
+{$ifdef GDB}
+  {$ifdef delphi}
+      ,sysutils
+  {$else}
+      ,strings
+  {$endif}
+      ,cga
+      ,symbase
+      ,gdb
+{$endif GDB}
+      ;
 
 {*****************************************************************************
                             TCGLOADNODE
@@ -116,7 +119,7 @@ implementation
 
     procedure tcghdisposenode.pass_2;
       begin
-         location_reset(location,LOC_REFERENCE,def_cgsize_ref(resulttype.def));
+         location_reset(location,LOC_REFERENCE,def_cgsize(resulttype.def));
 
          secondpass(left);
          if codegenerror then
@@ -141,8 +144,7 @@ implementation
               begin
                  location_release(exprasmlist,left.location);
                  location.reference.index:=rg.getaddressregister(exprasmlist);
-                 cg.a_load_loc_reg(exprasmlist,OS_ADDR,left.location,
-                   location.reference.index);
+                 cg.a_load_loc_reg(exprasmlist,left.location,location.reference.index);
               end;
             else
               internalerror(2002032217);
@@ -212,7 +214,7 @@ implementation
 
       begin
          secondpass(left);
-         location_reset(location,LOC_REFERENCE,def_cgsize_ref(resulttype.def));
+         location_reset(location,LOC_REFERENCE,def_cgsize(resulttype.def));
          case left.location.loc of
             LOC_REGISTER:
               begin
@@ -232,8 +234,7 @@ implementation
               begin
                  location_release(exprasmlist,left.location);
                  location.reference.base:=rg.getaddressregister(exprasmlist);
-                 cg.a_load_loc_reg(exprasmlist,OS_ADDR,left.location,
-                   location.reference.base);
+                 cg.a_load_loc_reg(exprasmlist,left.location,location.reference.base);
               end;
          end;
          { still needs generic checkpointer() support! }
@@ -253,7 +254,7 @@ implementation
          { classes and interfaces must be dereferenced implicit }
          if is_class_or_interface(left.resulttype.def) then
            begin
-             location_reset(location,LOC_REFERENCE,def_cgsize_ref(resulttype.def));
+             location_reset(location,LOC_REFERENCE,def_cgsize(resulttype.def));
              case left.location.loc of
                 LOC_REGISTER:
                   begin
@@ -273,23 +274,21 @@ implementation
                   begin
                      location_release(exprasmlist,left.location);
                      location.reference.base:=rg.getaddressregister(exprasmlist);
-                     cg.a_load_loc_reg(exprasmlist,OS_ADDR,left.location,
-                       location.reference.base);
+                     cg.a_load_loc_reg(exprasmlist,left.location,location.reference.base);
                   end;
              end;
            end
          else if is_interfacecom(left.resulttype.def) then
            begin
               tg.gettempintfcomreference(exprasmlist,location.reference);
-              cg.a_load_loc_ref(exprasmlist,OS_ADDR,left.location,
-                location.reference);
+              cg.a_load_loc_ref(exprasmlist,left.location,location.reference);
            end
          else
            location_copy(location,left.location);
 
          inc(location.reference.offset,vs.address);
          { also update the size of the location }
-         location.size:=def_cgsize_ref(resulttype.def);
+         location.size:=def_cgsize(resulttype.def);
       end;
 
 {*****************************************************************************
@@ -355,7 +354,7 @@ implementation
                   tmpreg := cg.get_scratch_reg(exprasmlist);
                   usetemp:=true;
                   if is_class_or_interface(left.resulttype.def) then
-                    cg.a_load_loc_reg(exprasmlist,OS_ADDR,left.location,tmpreg)
+                    cg.a_load_loc_reg(exprasmlist,left.location,tmpreg)
                   else
                     cg.a_loadaddr_ref_reg(exprasmlist,
                       left.location.reference,tmpreg);
@@ -451,7 +450,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.5  2002-04-02 17:11:28  peter
+  Revision 1.6  2002-04-04 19:05:57  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.5  2002/04/02 17:11:28  peter
     * tlocation,treference update
     * LOC_CONSTANT added for better constant handling
     * secondadd splitted in multiple routines

+ 7 - 3
compiler/ncgutil.pas

@@ -42,11 +42,11 @@ interface
 implementation
 
   uses
-    globals,globtype,systems,verbose,
+    globals,systems,verbose,
     types,
     aasm,cgbase,regvars,
     ncon,
-    cpubase,cpuinfo,tgobj,cginfo,cgobj,cgcpu,cg64f32,rgobj;
+    cpubase,tgobj,cginfo,cgobj,cgcpu,rgobj;
 
 
 {$ifdef TEMPS_NOT_PUSH}
@@ -213,7 +213,11 @@ end.
 
 {
   $Log$
-  Revision 1.4  2002-04-02 17:11:28  peter
+  Revision 1.5  2002-04-04 19:05:57  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.4  2002/04/02 17:11:28  peter
     * tlocation,treference update
     * LOC_CONSTANT added for better constant handling
     * secondadd splitted in multiple routines

+ 6 - 2
compiler/ncnv.pas

@@ -136,7 +136,7 @@ implementation
       cutils,verbose,globals,widestr,
       symconst,symdef,symsym,symtable,
       ncon,ncal,nset,nadd,ninl,nmem,
-      cginfo,cgbase,
+      cgbase,
       htypechk,pass_1,cpubase,cpuinfo;
 
 
@@ -1684,7 +1684,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.49  2002-04-02 17:11:28  peter
+  Revision 1.50  2002-04-04 19:05:58  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.49  2002/04/02 17:11:28  peter
     * tlocation,treference update
     * LOC_CONSTANT added for better constant handling
     * secondadd splitted in multiple routines

+ 6 - 2
compiler/ncon.pas

@@ -147,7 +147,7 @@ implementation
 
     uses
       cutils,verbose,globals,systems,
-      types,cpubase,nld,symtable;
+      types,cpubase,nld;
 
     function genintconstnode(v : TConstExprInt) : tordconstnode;
 
@@ -724,7 +724,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.26  2002-04-02 17:11:29  peter
+  Revision 1.27  2002-04-04 19:05:58  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.26  2002/04/02 17:11:29  peter
     * tlocation,treference update
     * LOC_CONSTANT added for better constant handling
     * secondadd splitted in multiple routines

+ 5 - 4
compiler/ogcoff.pas

@@ -122,9 +122,7 @@ implementation
 
     const
        symbolresize = 200*sizeof(toutputsymbol);
-       coffsymbolresize = 200*18;
        strsresize   = 8192;
-       DataResize   = 8192;
 
     const
        COFF_SYM_EXTERNAL = 2;
@@ -176,7 +174,6 @@ implementation
          typ     : byte;
          aux     : byte;
        end;
-       pcoffstab=^coffstab;
        coffstab=packed record
          strpos  : longint;
          ntype   : byte;
@@ -1188,7 +1185,11 @@ initialization
 end.
 {
   $Log$
-  Revision 1.17  2002-04-04 18:38:30  carl
+  Revision 1.18  2002-04-04 19:05:58  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.17  2002/04/04 18:38:30  carl
   + added wdosx support (patch from Pavel)
 
   Revision 1.16  2001/09/17 21:29:12  peter

+ 5 - 5
compiler/ogelf.pas

@@ -110,7 +110,6 @@ implementation
 
     const
       symbolresize = 200*18;
-      DataResize   = 8192;
 
     const
       R_386_32 = 1;                    { ordinary absolute relocation }
@@ -185,12 +184,10 @@ implementation
           sh_addralign      : longint;
           sh_entsize        : longint;
         end;
-        pelf32reloc=^telf32reloc;
         telf32reloc=packed record
           address : longint;
           info    : longint; { bit 0-7: type, 8-31: symbol }
         end;
-        pelf32symbol=^telf32symbol;
         telf32symbol=packed record
           st_name  : longint;
           st_value : longint;
@@ -199,7 +196,6 @@ implementation
           st_other : byte;
           st_shndx : word;
         end;
-        pelf32stab=^telf32stab;
         telf32stab=packed record
           strpos  : longint;
           ntype   : byte;
@@ -890,7 +886,11 @@ initialization
 end.
 {
   $Log$
-  Revision 1.10  2001-05-06 17:13:23  jonas
+  Revision 1.11  2002-04-04 19:05:58  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.10  2001/05/06 17:13:23  jonas
     * completed incomplete typed constant records
 
   Revision 1.9  2001/05/04 19:50:58  peter

+ 6 - 2
compiler/options.pas

@@ -75,7 +75,7 @@ uses
   dos,
 {$endif Delphi}
   version,
-  cutils,cmsgs,symsym
+  cutils,cmsgs
 {$ifdef BrowserLog}
   ,browlog
 {$endif BrowserLog}
@@ -1646,7 +1646,11 @@ finalization
 end.
 {
   $Log$
-  Revision 1.65  2002-04-04 18:39:45  carl
+  Revision 1.66  2002-04-04 19:05:58  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.65  2002/04/04 18:39:45  carl
   + added wdosx support (patch from Pavel)
 
   Revision 1.64  2001/12/03 21:48:42  peter

+ 5 - 4
compiler/owar.pas

@@ -79,7 +79,6 @@ const
   symstrbufsize = 8192;
   lfnstrbufsize = 4096;
   arbufsize  = 65536;
-  objbufsize = 16384;
 
 {*****************************************************************************
                                    Helpers
@@ -227,8 +226,6 @@ procedure tarobjectwriter.writear;
 
 const
   armagic:array[1..8] of char='!<arch>'#10;
-type
-  plongint=^longint;
 var
   arf      : TCFileStream;
   fixup,l,
@@ -281,7 +278,11 @@ end;
 end.
 {
   $Log$
-  Revision 1.8  2001-03-05 21:40:39  peter
+  Revision 1.9  2002-04-04 19:06:00  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.8  2001/03/05 21:40:39  peter
     * more things for tcoffobjectinput
 
   Revision 1.7  2000/12/24 12:25:32  peter

+ 5 - 2
compiler/pass_1.pas

@@ -47,7 +47,6 @@ implementation
       cutils,globals,
       cgbase,symdef,
 {$ifdef extdebug}
-      verbose,
       htypechk,
 {$endif extdebug}
       tgobj
@@ -198,7 +197,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.19  2002-03-31 20:26:35  jonas
+  Revision 1.20  2002-04-04 19:06:00  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.19  2002/03/31 20:26:35  jonas
     + a_loadfpu_* and a_loadmm_* methods in tcg
     * register allocation is now handled by a class and is mostly processor
       independent (+rgobj.pas and i386/rgcpu.pas)

+ 6 - 2
compiler/pdecobj.pas

@@ -37,7 +37,7 @@ implementation
     uses
       cutils,cclasses,
       globals,verbose,systems,tokens,
-      aasm,symconst,symbase,symsym,symtable,types,
+      symconst,symbase,symsym,symtable,types,
       cgbase,
       node,nld,nmem,ncon,ncnv,ncal,pass_1,
       scanner,
@@ -1110,7 +1110,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.38  2002-01-25 17:38:19  peter
+  Revision 1.39  2002-04-04 19:06:00  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.38  2002/01/25 17:38:19  peter
     * fixed default value for properties with index values
 
   Revision 1.37  2002/01/24 18:25:48  peter

+ 6 - 2
compiler/pexports.pas

@@ -39,7 +39,7 @@ implementation
        globals,tokens,verbose,
        systems,
        { symtable }
-       symconst,symbase,symtype,symdef,symsym,
+       symconst,symbase,symtype,symsym,
        { pass 1 }
        node,
        ncon,
@@ -173,7 +173,11 @@ end.
 
 {
   $Log$
-  Revision 1.17  2002-04-04 18:41:07  carl
+  Revision 1.18  2002-04-04 19:06:03  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.17  2002/04/04 18:41:07  carl
   + added wdosx support (patch from Pavel)
 
   Revision 1.16  2001/11/02 22:58:04  peter

+ 7 - 3
compiler/pmodules.pas

@@ -38,7 +38,7 @@ implementation
        globtype,version,systems,tokens,
        cutils,cclasses,comphook,
        globals,verbose,fmodule,finput,fppu,
-       symconst,symbase,symppu,symdef,symsym,symtable,aasm,
+       symconst,symbase,symdef,symsym,symtable,aasm,
        cgbase,
        cga,
        link,assemble,import,export,gendef,ppu,comprsrc,
@@ -46,7 +46,7 @@ implementation
 {$ifdef GDB}
        gdb,
 {$endif GDB}
-       scanner,pbase,pexpr,psystem,psub,parser;
+       scanner,pbase,pexpr,psystem,psub;
 
     procedure create_objectfile;
       var
@@ -1428,7 +1428,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.57  2002-04-04 18:42:49  carl
+  Revision 1.58  2002-04-04 19:06:03  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.57  2002/04/04 18:42:49  carl
   + added wdosx support (patch from Pavel)
 
   Revision 1.56  2002/04/02 17:11:29  peter

+ 5 - 7
compiler/ppu.pas

@@ -556,8 +556,6 @@ end;
 
 
 function tppufile.getword:word;
-type
-  pword = ^word;
 var
   w : word;
 begin
@@ -577,8 +575,6 @@ end;
 
 
 function tppufile.getlongint:longint;
-type
-  plongint = ^longint;
 var
   l : longint;
 begin
@@ -598,8 +594,6 @@ end;
 
 
 function tppufile.getreal:ppureal;
-type
-  pppureal = ^ppureal;
 var
   d : ppureal;
 begin
@@ -987,7 +981,11 @@ end;
 end.
 {
   $Log$
-  Revision 1.16  2002-03-31 20:26:36  jonas
+  Revision 1.17  2002-04-04 19:06:03  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.16  2002/03/31 20:26:36  jonas
     + a_loadfpu_* and a_loadmm_* methods in tcg
     * register allocation is now handled by a class and is mostly processor
       independent (+rgobj.pas and i386/rgcpu.pas)

+ 7 - 3
compiler/ptconst.pas

@@ -41,11 +41,11 @@ implementation
 {$else}
        strings,
 {$endif Delphi}
-       globtype,systems,tokens,cpuinfo,
+       globtype,systems,tokens,
        cutils,globals,widestr,scanner,
        symconst,symbase,symdef,aasm,cpuasm,types,verbose,
        { pass 1 }
-       node,pass_1,
+       node,
        nmat,nadd,ncal,nmem,nset,ncnv,ninl,ncon,nld,nflw,
        { parser specific stuff }
        pbase,pexpr,
@@ -970,7 +970,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.41  2002-01-24 18:25:49  peter
+  Revision 1.42  2002-04-04 19:06:03  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.41  2002/01/24 18:25:49  peter
    * implicit result variable generation for assembler routines
    * removed m_tp modeswitch, use m_tp7 or not(m_fpc) instead
 

+ 6 - 4
compiler/ptype.pas

@@ -59,12 +59,10 @@ implementation
        { global }
        globals,tokens,verbose,
        systems,
-       { aasm }
-       aasm,
        { symtable }
        symconst,symbase,symdef,symsym,symtable,types,
        { pass 1 }
-       node,pass_1,
+       node,
        nmat,nadd,ncal,nset,ncnv,ninl,ncon,nld,nflw,
        { parser }
        scanner,
@@ -612,7 +610,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.34  2002-01-24 18:25:49  peter
+  Revision 1.35  2002-04-04 19:06:04  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.34  2002/01/24 18:25:49  peter
    * implicit result variable generation for assembler routines
    * removed m_tp modeswitch, use m_tp7 or not(m_fpc) instead
 

+ 6 - 2
compiler/rgobj.pas

@@ -192,7 +192,7 @@ unit rgobj;
       end;
 
 
-      punusedstate = ^tsavedstate;
+      punusedstate = ^tunusedstate;
       tunusedstate = record
         unusedregsint : tregisterset;
         unusedregsfpu : tregisterset;
@@ -842,7 +842,11 @@ end.
 
 {
   $Log$
-  Revision 1.3  2002-04-02 17:11:29  peter
+  Revision 1.4  2002-04-04 19:06:04  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.3  2002/04/02 17:11:29  peter
     * tlocation,treference update
     * LOC_CONSTANT added for better constant handling
     * secondadd splitted in multiple routines

+ 7 - 8
compiler/scandir.pas

@@ -32,16 +32,11 @@ interface
 implementation
 
     uses
-{$ifdef delphi}
-      dmisc,
-{$else}
-      dos,
-{$endif}
       cutils,
-      version,globtype,globals,systems,
+      globtype,globals,systems,
       verbose,comphook,
       scanner,switches,
-      finput,fmodule;
+      fmodule;
 
 
 {*****************************************************************************
@@ -930,7 +925,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.10  2001-11-02 23:16:52  peter
+  Revision 1.11  2002-04-04 19:06:05  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.10  2001/11/02 23:16:52  peter
     * removed obsolete chainprocsym and test_procsym code
 
   Revision 1.9  2001/10/23 21:49:42  peter

+ 7 - 3
compiler/symtable.pas

@@ -269,11 +269,11 @@ implementation
 
     uses
       { global }
-      version,verbose,globals,
+      verbose,globals,
       { target }
       systems,
       { module }
-      finput,fmodule,
+      fmodule,
 {$ifdef GDB}
       gdb,
 {$endif GDB}
@@ -2063,7 +2063,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.56  2002-03-04 19:10:11  peter
+  Revision 1.57  2002-04-04 19:06:05  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.56  2002/03/04 19:10:11  peter
     * removed compiler warnings
 
   Revision 1.55  2002/02/03 09:30:07  peter

+ 6 - 2
compiler/targets/t_os2.pas

@@ -48,7 +48,7 @@ implementation
      cutils,cclasses,
      globtype,comphook,systems,symsym,
      globals,verbose,fmodule,script,
-     import,link,comprsrc;
+     import,link;
 
   type
     timportlibos2=class(timportlib)
@@ -593,7 +593,11 @@ initialization
 end.
 {
   $Log$
-  Revision 1.14  2002-01-29 21:27:34  peter
+  Revision 1.15  2002-04-04 19:06:13  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.14  2002/01/29 21:27:34  peter
     * default alignment changed to 4 bytes for locals and static const,var
 
   Revision 1.12  2002/01/27 12:58:42  hajny

+ 22 - 6
compiler/targets/t_win32.pas

@@ -43,7 +43,7 @@ interface
        import,export,link,rgobj;
 
 
-  type 
+  type
      tStr4=array[1..1]of string[4];
      pStr4=^tStr4;
 
@@ -225,10 +225,9 @@ const
            end;
       end;
 
-    //PVO 26.03.02 <
+
     const
      MainAsmFormats=[as_i386_asw,as_i386_aswdosx,as_i386_pecoff,as_i386_pecoffwdosx];
-    //PVO 26.03.02 <
     procedure timportlibwin32.generatesmartlib;
       var
          hp1 : timportlist;
@@ -374,8 +373,10 @@ const
          hp1 : timportlist;
          hp2 : timported_item;
          l1,l2,l3,l4 : tasmlabel;
+{$ifdef GDB}
          importname : string;
          suffix : integer;
+{$endif GDB}
          href : treference;
       begin
          if not(aktoutputformat in MainAsmFormats)then //PVO 26.03.02 !
@@ -1287,13 +1288,13 @@ end;
 {****************************************************************************
                             TDLLScannerWin32
 ****************************************************************************}
-//PVO 26.03.02 <
+
     procedure tDLLScannerWin32.GetDefExt(var N:longint;var P:pStr4);
      begin
       N:=sizeof(DefaultDLLExtensions)div sizeof(DefaultDLLExtensions[1]);
       pointer(P):=@DefaultDLLExtensions;
      end;
-//PVO 26.03.02 >
+
     function tDLLScannerWin32.DOSstubOK(var x:cardinal):boolean;
       begin
         blockread(f,TheWord,2,loaded);
@@ -1337,6 +1338,17 @@ end;
 
 //PVO 26.03.02 !
 
+    function tDLLScannerWin32.DllName(Const Name : string) : string;
+      var n : string;
+      begin
+         n:=Upper(SplitExtension(Name));
+         if (n='.DLL') or (n='.DRV') or (n='.EXE') then
+           DllName:=Name
+         else
+           DllName:=Name+target_info.sharedlibext;
+      end;
+
+
 
 function tDLLScannerWin32.isSuitableFileType(x:cardinal):longbool;
  begin
@@ -1624,7 +1636,11 @@ initialization
 end.
 {
   $Log$
-  Revision 1.25  2002-04-04 18:25:30  carl
+  Revision 1.26  2002-04-04 19:06:14  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.25  2002/04/04 18:25:30  carl
   + added wdosx patch from Pavel
 
   Revision 1.24  2002/04/02 17:11:39  peter

+ 6 - 3
compiler/tgobj.pas

@@ -118,8 +118,7 @@ unit tgobj;
 
     uses
        systems,
-       verbose,cutils,
-       cgobj;
+       verbose,cutils;
 
     constructor ttgobj.create;
 
@@ -642,7 +641,11 @@ finalization
 end.
 {
   $Log$
-  Revision 1.2  2002-04-02 17:11:32  peter
+  Revision 1.3  2002-04-04 19:06:06  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.2  2002/04/02 17:11:32  peter
     * tlocation,treference update
     * LOC_CONSTANT added for better constant handling
     * secondadd splitted in multiple routines

+ 16 - 8
compiler/utils/ppudump.pp

@@ -224,6 +224,15 @@ end;
                              Read Routines
 ****************************************************************************}
 
+function getint64:int64;
+var
+  l1,l2 : longint;
+begin
+  l1:=ppufile.getlongint;
+  l2:=ppufile.getlongint;
+  getint64:=(int64(l2) shl 32) or l1;
+end;
+
 Procedure ReadLinkContainer(const prefix:string);
 {
   Read a serie of strings and write to the screen starting every line
@@ -694,7 +703,6 @@ var
   totalsyms,
   symcnt,
   i,j,len : longint;
-  l1,l2 : longint;
 begin
   symcnt:=1;
   with ppufile do
@@ -777,11 +785,7 @@ begin
                  else
                    writeln (space,'      Value: False');
                constint :
-                 begin
-                   l1:=getlongint;
-                   l2:=getlongint;
-                   writeln(space,'       Value: ',int64(l2 shl 32) or l1);
-                 end;
+                 writeln(space,'       Value: ',getint64);
                constchar :
                  writeln(space,'       Value: "'+chr(getlongint)+'"');
                constset :
@@ -1050,7 +1054,7 @@ begin
                uwidechar : writeln('uwidechar');
                else        writeln('!! Warning: Invalid base type ',b);
              end;
-             writeln(space,'            Range : ',getlongint,' to ',getlongint);
+             writeln(space,'            Range : ',getint64,' to ',getint64);
            end;
 
          ibfloatdef :
@@ -1690,7 +1694,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.16  2002-04-04 18:50:27  carl
+  Revision 1.17  2002-04-04 19:06:14  peter
+    * removed unused units
+    * use tlocation.size in cg.a_*loc*() routines
+
+  Revision 1.16  2002/04/04 18:50:27  carl
   + added wdosx support (patch from Pavel)
 
   Revision 1.15  2002/03/31 20:26:42  jonas