فهرست منبع

+ defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+ try to fix temp allocation (still in ifdef)
+ generic constructor calls
+ start of tassembler / tmodulebase class cleanup

carl 23 سال پیش
والد
کامیت
21b3a10f02
100فایلهای تغییر یافته به همراه7546 افزوده شده و 949 حذف شده
  1. 140 14
      compiler/aasm.pas
  2. 18 15
      compiler/aggas.pas
  3. 39 4
      compiler/aopt.pas
  4. 44 16
      compiler/aoptbase.pas
  5. 39 4
      compiler/aoptcs.pas
  6. 30 4
      compiler/aoptda.pas
  7. 47 3
      compiler/aoptobj.pas
  8. 126 11
      compiler/assemble.pas
  9. 124 4
      compiler/browcol.pas
  10. 38 4
      compiler/browlog.pas
  11. 27 4
      compiler/catch.pas
  12. 40 4
      compiler/cclasses.pas
  13. 27 4
      compiler/cg64f32.pas
  14. 76 4
      compiler/cgbase.pas
  15. 7 4
      compiler/cginfo.pas
  16. 61 4
      compiler/cgobj.pas
  17. 42 4
      compiler/cmsgs.pas
  18. 56 4
      compiler/comphook.pas
  19. 77 4
      compiler/compiler.pas
  20. 35 3
      compiler/compinnr.inc
  21. 38 4
      compiler/comprsrc.pas
  22. 20 3
      compiler/crc.pas
  23. 38 4
      compiler/cresstr.pas
  24. 15 4
      compiler/cstreams.pas
  25. 17 14
      compiler/cutils.pas
  26. 22 4
      compiler/dmisc.pas
  27. 58 4
      compiler/export.pas
  28. 19 7
      compiler/finput.pas
  29. 9 3
      compiler/fmodule.pas
  30. 8 2
      compiler/fppu.pas
  31. 35 4
      compiler/gdb.pas
  32. 26 4
      compiler/gendef.pas
  33. 179 4
      compiler/globals.pas
  34. 70 4
      compiler/globtype.pas
  35. 153 4
      compiler/htypechk.pas
  36. 66 4
      compiler/i386/ag386att.pas
  37. 58 4
      compiler/i386/ag386bin.pas
  38. 72 4
      compiler/i386/ag386int.pas
  39. 67 4
      compiler/i386/ag386nsm.pas
  40. 40 4
      compiler/i386/aopt386.pas
  41. 231 4
      compiler/i386/cga.pas
  42. 40 6
      compiler/i386/cgcpu.pas
  43. 100 165
      compiler/i386/cpuasm.pas
  44. 582 307
      compiler/i386/cpubase.pas
  45. 35 4
      compiler/i386/cpuinfo.pas
  46. 45 3
      compiler/i386/cpunode.pas
  47. 59 4
      compiler/i386/cpuswtch.pas
  48. 12 3
      compiler/i386/cputarg.pas
  49. 162 4
      compiler/i386/csopt386.pas
  50. 183 11
      compiler/i386/daopt386.pas
  51. 157 3
      compiler/i386/n386add.pas
  52. 179 4
      compiler/i386/n386cal.pas
  53. 135 4
      compiler/i386/n386cnv.pas
  54. 48 4
      compiler/i386/n386con.pas
  55. 87 4
      compiler/i386/n386flw.pas
  56. 164 6
      compiler/i386/n386inl.pas
  57. 104 4
      compiler/i386/n386mat.pas
  58. 89 4
      compiler/i386/n386mem.pas
  59. 45 4
      compiler/i386/n386obj.pas
  60. 28 4
      compiler/i386/n386opt.pas
  61. 96 4
      compiler/i386/n386set.pas
  62. 127 4
      compiler/i386/popt386.pas
  63. 72 4
      compiler/i386/ra386.pas
  64. 82 4
      compiler/i386/ra386att.pas
  65. 61 4
      compiler/i386/ra386dir.pas
  66. 101 4
      compiler/i386/ra386int.pas
  67. 8 2
      compiler/i386/rgcpu.pas
  68. 48 4
      compiler/i386/rropt386.pas
  69. 8 2
      compiler/ia64/cpuasm.pas
  70. 8 2
      compiler/ia64/cpuinfo.pas
  71. 8 2
      compiler/ia64/tgcpu.pas
  72. 23 4
      compiler/impdef.pas
  73. 52 4
      compiler/import.pas
  74. 90 4
      compiler/link.pas
  75. 8 2
      compiler/m68k/cpuswtch.pas
  76. 181 4
      compiler/nadd.pas
  77. 84 3
      compiler/nbas.pas
  78. 259 4
      compiler/ncal.pas
  79. 54 3
      compiler/ncgbas.pas
  80. 24 3
      compiler/ncgcnv.pas
  81. 35 53
      compiler/ncgcon.pas
  82. 58 4
      compiler/ncgflw.pas
  83. 7 4
      compiler/ncgld.pas
  84. 17 4
      compiler/ncgmem.pas
  85. 14 4
      compiler/ncgutil.pas
  86. 200 4
      compiler/ncnv.pas
  87. 99 3
      compiler/ncon.pas
  88. 8 2
      compiler/new/symtable/defs.pas
  89. 102 4
      compiler/nflw.pas
  90. 271 4
      compiler/ninl.pas
  91. 116 3
      compiler/nld.pas
  92. 99 3
      compiler/nmat.pas
  93. 92 3
      compiler/nmem.pas
  94. 114 4
      compiler/nobj.pas
  95. 83 3
      compiler/node.pas
  96. 25 4
      compiler/nopt.pas
  97. 74 4
      compiler/nset.pas
  98. 37 4
      compiler/ogbase.pas
  99. 71 5
      compiler/ogcoff.pas
  100. 42 4
      compiler/ogelf.pas

+ 140 - 14
compiler/aasm.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Florian Klaempfl
+    Copyright (c) 1998-2000 by Florian Klaempfl
 
     This unit implements an abstract asmoutput class for all processor types
 
@@ -24,11 +24,11 @@
   This unit implements an abstract assembler output class for all processors, these
   are then overriden for each assembler writer to actually write the data in these
   classes to an assembler file.
-}
-
+}  
+   
 unit aasm;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -68,11 +68,10 @@ interface
           ait_regalloc, { for register,temp allocation debugging }
           ait_tempalloc,
           ait_marker,
-{$ifdef alpha}
+
           { the follow is for the DEC Alpha }
           ait_frame,
           ait_ent,
-{$endif alpha}
 {$ifdef m68k}
           ait_labeled_instruction,
 {$endif m68k}
@@ -206,6 +205,22 @@ interface
        end;
 
 
+       { alignment for operator }
+{$ifdef i386}
+       tai_align_abstract = class(tai)
+{$else i386}
+       tai_align = class(tai)
+{$endif i386}
+          buf       : array[0..63] of char; { buf used for fill }
+          aligntype : byte;   { 1 = no align, 2 = word align, 4 = dword align }
+          fillsize  : byte;   { real size to fill }
+          fillop    : byte;   { value to fill with - optional }
+          use_op    : boolean;
+          constructor Create(b:byte);
+          constructor Create_op(b: byte; _op: byte);
+          function getfillbuf:pchar;
+       end;
+
        { Insert a section/segment directive }
        tai_section = class(tai)
           sec : tsection;
@@ -727,6 +742,56 @@ uses
          inherited Destroy;
       end;
 
+{****************************************************************************
+                              TAI_ALIGN
+ ****************************************************************************}
+
+{$ifdef i386}
+     constructor tai_align_abstract.Create(b: byte);
+{$else i386}
+     constructor tai_align.Create(b: byte);
+{$endif i386}
+       begin
+          inherited Create;
+          typ:=ait_align;
+          if b in [1,2,4,8,16,32] then
+            aligntype := b
+          else
+            aligntype := 1;
+          fillsize:=0;
+          fillop:=0;
+          use_op:=false;
+       end;
+
+
+{$ifdef i386}
+     constructor tai_align_abstract.Create_op(b: byte; _op: byte);
+{$else i386}
+     constructor tai_align.Create_op(b: byte; _op: byte);
+{$endif i386}
+       begin
+          inherited Create;
+          typ:=ait_align;
+          if b in [1,2,4,8,16,32] then
+            aligntype := b
+          else
+            aligntype := 1;
+          fillsize:=0;
+          fillop:=_op;
+          use_op:=true;
+          fillchar(buf,sizeof(buf),_op)
+       end;
+
+
+{$ifdef i386}
+     function tai_align_abstract.getfillbuf:pchar;
+{$else i386}
+     function tai_align.getfillbuf:pchar;
+{$endif i386}
+       begin
+         getfillbuf:=@buf;
+       end;
+
 {****************************************************************************
                               TAI_CUT
  ****************************************************************************}
@@ -1070,14 +1135,11 @@ uses
 end.
 {
   $Log$
-  Revision 1.25  2002-05-14 19:34:38  peter
-    * removed old logs and updated copyright year
-
-  Revision 1.24  2002/05/14 17:28:08  peter
-    * synchronized cpubase between powerpc and i386
-    * moved more tables from cpubase to cpuasm
-    * tai_align_abstract moved to tainst, cpuasm must define
-      the tai_align class now, which may be empty
+  Revision 1.26  2002-05-16 19:46:34  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.23  2002/04/15 18:54:34  carl
   - removed tcpuflags
@@ -1092,4 +1154,68 @@ end.
   Revision 1.20  2002/03/24 19:04:31  carl
   + patch for SPARC from Mazen NEIFER
 
+  Revision 1.19  2001/12/31 16:54:14  peter
+    * fixed inline crash with assembler routines
+
+  Revision 1.18  2001/08/30 19:43:50  peter
+    * detect duplicate labels
+
+  Revision 1.17  2001/04/13 01:22:06  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.16  2001/02/20 21:36:39  peter
+    * tasm/masm fixes merged
+
+  Revision 1.15  2000/12/25 00:07:25  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.14  2000/11/29 00:30:30  florian
+    * unused units removed from uses clause
+    * some changes for widestrings
+
+  Revision 1.13  2000/09/24 15:06:10  peter
+    * use defines.inc
+
+  Revision 1.12  2000/08/27 20:19:38  peter
+    * store strings with case in ppu, when an internal symbol is created
+      a '$' is prefixed so it's not automatic uppercased
+
+  Revision 1.11  2000/08/27 16:11:48  peter
+    * moved some util functions from globals,cobjects to cutils
+    * splitted files into finput,fmodule
+
+  Revision 1.10  2000/08/20 17:38:21  peter
+    * smartlinking fixed for linux (merged)
+
+  Revision 1.9  2000/08/16 18:33:53  peter
+    * splitted namedobjectitem.next into indexnext and listnext so it
+      can be used in both lists
+    * don't allow "word = word" type definitions (merged)
+
+  Revision 1.8  2000/08/12 19:14:58  peter
+    * ELF writer works now also with -g
+    * ELF writer is default again for linux
+
+  Revision 1.7  2000/08/12 15:34:21  peter
+    + usedasmsymbollist to check and reset only the used symbols (merged)
+
+  Revision 1.6  2000/08/09 19:49:44  peter
+    * packenumfixed things so it compiles with 1.0.0 again
+
+  Revision 1.5  2000/08/05 13:25:06  peter
+    * packenum 1 fixes (merged)
+
+  Revision 1.4  2000/07/21 15:14:01  jonas
+    + added is_addr field for labels, if they are only used for getting the address
+       (e.g. for io checks) and corresponding getaddrlabel() procedure
+
+  Revision 1.3  2000/07/13 12:08:24  michael
+  + patched to 1.1.0 with former 1.09patch from peter
+
+  Revision 1.2  2000/07/13 11:32:28  michael
+  + removed logs
+
 }

+ 18 - 15
compiler/aggas.pas

@@ -20,11 +20,11 @@
 
  ****************************************************************************
 }
-{# Base unit for writing GNU assembler output.
+{# Base unit for writing GNU assembler output. 
 }
 unit aggas;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -34,12 +34,12 @@ interface
       aasm,assemble;
 
 
-
+    
     type
-
+    
       {# This is a derived class which is used to write
-         GAS styled assembler.
-
+         GAS styled assembler. 
+         
          The WriteInstruction() method must be overriden
          to write a single instruction to the assembler
          file.
@@ -54,7 +54,7 @@ interface
 {$endif}
         procedure WriteInstruction(hp: tai);  virtual; abstract;
       end;
-
+      
 implementation
 
     uses
@@ -153,8 +153,8 @@ var
           hs[1]:='+';
          extended2str:='0d'+hs
       end;
-
-
+      
+      
   { convert floating point values }
   { to correct endian             }
   procedure swap64bitarray(var t: t64bitarray);
@@ -197,7 +197,7 @@ var
      {!!!!!!!!!!!!}
     end;
 
-
+      
 
     const
       ait_const2str : array[ait_const_32bit..ait_const_8bit] of string[8]=
@@ -645,7 +645,7 @@ var
 
            ait_instruction :
              begin
-               WriteInstruction(hp);
+               WriteInstruction(hp); 
              end;
 
 {$ifdef GDB}
@@ -791,12 +791,15 @@ var
        comment(v_info,'Done writing gas-styled assembler output for '+current_module.mainsource^);
 {$endif EXTDEBUG}
     end;
-
-end.
+      
+end.      
 {
   $Log$
-  Revision 1.3  2002-05-14 19:34:38  peter
-    * removed old logs and updated copyright year
+  Revision 1.4  2002-05-16 19:46:34  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.2  2002/04/15 18:53:48  carl
   + comments in register allocator uses std_Reg2str

+ 39 - 4
compiler/aopt.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Jonas Maebe, member of the Free Pascal
+    Copyright (c) 1998-2000 by Jonas Maebe, member of the Free Pascal
     Development Team
 
     This unit contains the interface routines between the code generator
@@ -241,7 +241,42 @@ End.
 
 {
  $Log$
- Revision 1.2  2002-05-14 19:34:38  peter
-   * removed old logs and updated copyright year
+ Revision 1.3  2002-05-16 19:46:34  carl
+ + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+ + try to fix temp allocation (still in ifdef)
+ + generic constructor calls
+ + start of tassembler / tmodulebase class cleanup
 
-}
+ Revision 1.1  2001/08/26 13:36:35  florian
+   * some cg reorganisation
+   * some PPC updates
+
+ Revision 1.1  2000/07/13 06:30:07  michael
+ + Initial import
+
+ Revision 1.5  2000/01/07 01:14:51  peter
+   * updated copyright to 2000
+
+ Revision 1.4  1999/11/09 22:57:08  peter
+   * compiles again both i386,alpha both with optimizer
+
+ Revision 1.3  1999/08/18 14:32:20  jonas
+   + compilable!
+   + dataflow analyzer finished
+   + start of CSE units
+   + aoptbase which contains a base object for all optimizer objects
+   * some constants and type definitions moved around to avoid circular
+     dependencies
+   * moved some methods from base objects to specialized objects because
+     they're not used anywhere else
+
+ Revision 1.2  1999/08/09 14:07:22  jonas
+ commit.msg
+
+ Revision 1.1  1999/08/08 13:24:50  jonas
+   + added copyright header/GNU license info
+   * made the assembler optimizer almost completely OOP
+   * some code style clean up and extra comments
+   * moved from the new/aopt to the /new and /new/i386 dirs
+
+}

+ 44 - 16
compiler/aoptbase.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Jonas Maebe, member of the Free Pascal
+    Copyright (c) 1998-2000 by Jonas Maebe, member of the Free Pascal
     Development Team
 
     This unit contains the base of all optimizer related objects
@@ -91,19 +91,21 @@ uses globals, aoptcpub, cpuinfo;
 
 Function RefsEqual(Const R1, R2: TReference): Boolean;
 Begin
-  RefsEqual := (R1.Offset+R1.OffsetFixup = R2.Offset+R2.OffsetFixup)
-               And (R1.Base = R2.Base)
+  If R1.is_immediate Then
+    RefsEqual := R2.is_immediate and (R1.Offset = R2.Offset)
+  Else
+    RefsEqual := (R1.Offset+R1.OffsetFixup = R2.Offset+R2.OffsetFixup)
+                 And (R1.Base = R2.Base)
 {$ifdef RefsHaveindex}
-               And (R1.Index = R2.Index)
+                 And (R1.Index = R2.Index)
 {$endif RefsHaveindex}
 {$ifdef RefsHaveScale}
-               And (R1.ScaleFactor = R2.ScaleFactor)
+                 And (R1.ScaleFactor = R2.ScaleFactor)
 {$endif RefsHaveScale}
-               And (R1.Symbol = R2.Symbol)
+                 And (R1.Symbol = R2.Symbol)
 {$ifdef RefsHaveSegment}
-               And (R1.Segment = R2.Segment)
+                 And (R1.Segment = R2.Segment)
 {$endif RefsHaveSegment}
-               ;
 End;
 
 
@@ -261,13 +263,39 @@ End.
 
 {
   $Log$
-  Revision 1.3  2002-05-14 19:34:38  peter
-    * removed old logs and updated copyright year
-
-  Revision 1.2  2002/05/14 17:28:09  peter
-    * synchronized cpubase between powerpc and i386
-    * moved more tables from cpubase to cpuasm
-    * tai_align_abstract moved to tainst, cpuasm must define
-      the tai_align class now, which may be empty
+  Revision 1.4  2002-05-16 19:46:34  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
+
+  Revision 1.1  2001/08/26 13:36:35  florian
+    * some cg reorganisation
+    * some PPC updates
+
+  Revision 1.1  2000/07/13 06:30:07  michael
+  + Initial import
+
+  Revision 1.5  2000/01/07 01:14:51  peter
+    * updated copyright to 2000
+
+  Revision 1.4  1999/11/09 22:57:08  peter
+    * compiles again both i386,alpha both with optimizer
+
+  Revision 1.3  1999/09/08 15:01:31  jonas
+    * some small changes so the noew optimizer is again compilable
+
+  Revision 1.2  1999/08/23 14:41:12  jonas
+    + checksequence (processor independent)\n  + processor independent part of docse
+
+  Revision 1.1  1999/08/18 14:32:21  jonas
+    + compilable!
+    + dataflow analyzer finished
+    + start of CSE units
+    + aoptbase which contains a base object for all optimizer objects
+    * some constants and type definitions moved around to avoid circular
+      dependencies
+    * moved some methods from base objects to specialized objects because
+      they're not used anywhere else
 
 }

+ 39 - 4
compiler/aoptcs.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Jonas Maebe, member of the Free Pascal
+    Copyright (c) 1998-2000 by Jonas Maebe, member of the Free Pascal
     Development Team
 
     This unit contains the common subexpression elimination object of the
@@ -850,8 +850,11 @@ End.
 
 {
   $Log$
-  Revision 1.5  2002-05-14 19:34:39  peter
-    * removed old logs and updated copyright year
+  Revision 1.6  2002-05-16 19:46:34  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.4  2002/04/20 21:32:23  carl
   + generic FPC_CHECKPOINTER
@@ -868,4 +871,36 @@ End.
   Revision 1.2  2002/04/14 16:49:30  carl
   + att_reg2str -> gas_reg2str
 
-}
+  Revision 1.1  2001/08/26 13:36:35  florian
+    * some cg reorganisation
+    * some PPC updates
+
+  Revision 1.1  2000/07/13 06:30:07  michael
+  + Initial import
+
+  Revision 1.5  2000/02/28 17:23:58  daniel
+  * Current work of symtable integration committed. The symtable can be
+    activated by defining 'newst', but doesn't compile yet. Changes in type
+    checking and oop are completed. What is left is to write a new
+    symtablestack and adapt the parser to use it.
+
+  Revision 1.4  2000/01/07 01:14:51  peter
+    * updated copyright to 2000
+
+  Revision 1.3  1999/08/25 12:00:10  jonas
+    * changed pai386, paippc and paiapha (same for tai*) to paicpu (taicpu)
+
+  Revision 1.2  1999/08/23 14:41:13  jonas
+    + checksequence (processor independent)\n  + processor independent part of docse
+
+  Revision 1.1  1999/08/18 14:32:21  jonas
+    + compilable!
+    + dataflow analyzer finished
+    + start of CSE units
+    + aoptbase which contains a base object for all optimizer objects
+    * some constants and type definitions moved around to avoid circular
+      dependencies
+    * moved some methods from base objects to specialized objects because
+      they're not used anywhere else
+
+}

+ 30 - 4
compiler/aoptda.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Jonas Maebe, member of the Free Pascal
+    Copyright (c) 1998-2000 by Jonas Maebe, member of the Free Pascal
     Development Team
 
     This unit contains the data flow analyzer object of the assembler
@@ -177,8 +177,11 @@ End.
 
 {
   $Log$
-  Revision 1.4  2002-05-14 19:34:39  peter
-    * removed old logs and updated copyright year
+  Revision 1.5  2002-05-16 19:46:35  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.3  2002/04/15 18:55:40  carl
   + change reg2str array use
@@ -186,4 +189,27 @@ End.
   Revision 1.2  2002/04/14 16:49:30  carl
   + att_reg2str -> gas_reg2str
 
-}
+  Revision 1.1  2001/08/26 13:36:35  florian
+    * some cg reorganisation
+    * some PPC updates
+
+  Revision 1.1  2000/07/13 06:30:07  michael
+  + Initial import
+
+  Revision 1.6  2000/01/07 01:14:52  peter
+    * updated copyright to 2000
+
+  Revision 1.5  1999/11/09 22:57:08  peter
+    * compiles again both i386,alpha both with optimizer
+
+  Revision 1.4  1999/08/18 14:32:21  jonas
+    + compilable!
+    + dataflow analyzer finished
+    + start of CSE units
+    + aoptbase which contains a base object for all optimizer objects
+    * some constants and type definitions moved around to avoid circular
+      dependencies
+    * moved some methods from base objects to specialized objects because
+      they're not used anywhere else
+
+}

+ 47 - 3
compiler/aoptobj.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Jonas Maebe, member of the Free Pascal
+    Copyright (c) 1998-2000 by Jonas Maebe, member of the Free Pascal
     Development Team
 
     This unit contains the processor independent assembler optimizer
@@ -787,7 +787,51 @@ End.
 
 {
  $Log$
- Revision 1.2  2002-05-14 19:34:39  peter
-   * removed old logs and updated copyright year
+ Revision 1.3  2002-05-16 19:46:35  carl
+ + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+ + try to fix temp allocation (still in ifdef)
+ + generic constructor calls
+ + start of tassembler / tmodulebase class cleanup
+
+ Revision 1.1  2001/08/26 13:36:35  florian
+   * some cg reorganisation
+   * some PPC updates
+
+ Revision 1.2  2000/07/14 05:11:49  michael
+ + Patch to 1.1
+
+ Revision 1.1  2000/07/13 06:30:07  michael
+ + Initial import
+
+ Revision 1.8  2000/01/07 01:14:52  peter
+   * updated copyright to 2000
+
+ Revision 1.7  1999/11/09 22:57:08  peter
+   * compiles again both i386,alpha both with optimizer
+
+ Revision 1.6  1999/09/29 13:50:34  jonas
+   * fixes from daopt386.pas integrated
+
+ Revision 1.5  1999/08/26 14:50:52  jonas
+   * fixed small type in TP conditional
+
+ Revision 1.4  1999/08/18 14:32:22  jonas
+   + compilable!
+   + dataflow analyzer finished
+   + start of CSE units
+   + aoptbase which contains a base object for all optimizer objects
+   * some constants and type definitions moved around to avoid circular
+     dependencies
+   * moved some methods from base objects to specialized objects because
+     they're not used anywhere else
+
+ Revision 1.2  1999/08/09 14:07:24  jonas
+ commit.msg
+
+ Revision 1.1  1999/08/08 13:24:50  jonas
+   + added copyright header/GNU license info
+   * made the assembler optimizer almost completely OOP
+   * some code style clean up and extra comments
+   * moved from the new/aopt to the /new and /new/i386 dirs
 
 }

+ 126 - 11
compiler/assemble.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Peter Vreman
+    Copyright (c) 1998-2000 by Peter Vreman
 
     This unit handles the assemblerfile write and assembler calls of FPC
 
@@ -27,7 +27,7 @@
 }
 unit assemble;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -56,6 +56,8 @@ interface
         name     : namestr;
         asmfile,         { current .s and .o file }
         objfile  : string;
+        ppufilename : string;
+        asmprefix : string;
         SmartAsm : boolean;
         SmartFilesCount,
         SmartHeaderCount : longint;
@@ -199,10 +201,15 @@ Implementation
     Constructor TAssembler.Create(smart:boolean);
       begin
       { load start values }
-        asmfile:=current_module.asmfilename^;
+        asmfile:=current_module.get_asmfilename;
         objfile:=current_module.objfilename^;
         name:=Lower(current_module.modulename^);
         path:=current_module.outputpath^;
+        asmprefix := current_module.asmprefix^;
+        if not assigned(current_module.outputpath) then
+          ppufilename := ''
+        else  
+          ppufilename := current_module.ppufilename^;
         SmartAsm:=smart;
         SmartFilesCount:=0;
         SmartHeaderCount:=0;
@@ -226,12 +233,12 @@ Implementation
           cut_begin :
             begin
               inc(SmartHeaderCount);
-              s:=current_module.asmprefix^+tostr(SmartHeaderCount)+'h';
+              s:=asmprefix+tostr(SmartHeaderCount)+'h';
             end;
           cut_normal :
-            s:=current_module.asmprefix^+tostr(SmartHeaderCount)+'s';
+            s:=asmprefix+tostr(SmartHeaderCount)+'s';
           cut_end :
-            s:=current_module.asmprefix^+tostr(SmartHeaderCount)+'t';
+            s:=asmprefix+tostr(SmartHeaderCount)+'t';
         end;
         AsmFile:=Path+FixFileName(s+tostr(SmartFilesCount)+target_info.asmext);
         ObjFile:=Path+FixFileName(s+tostr(SmartFilesCount)+target_info.objext);
@@ -263,7 +270,7 @@ Implementation
         inherited Create(smart);
         if SmartAsm then
          begin
-           path:=FixPath(current_module.outputpath^+FixFileName(current_module.modulename^)+target_info.smartext,false);
+           path:=FixPath(path+FixFileName(name)+target_info.smartext,false);
            CreateSmartLinkPath(path);
          end;
         Outcnt:=0;
@@ -537,9 +544,9 @@ Implementation
       {$endif}
          begin
          {Touch Assembler time to ppu time is there is a ppufilename}
-           if Assigned(current_module.ppufilename) then
+           if ppufilename<>'' then
             begin
-              Assign(f,current_module.ppufilename^);
+              Assign(f,ppufilename);
               {$I-}
                reset(f,1);
               {$I+}
@@ -1581,8 +1588,11 @@ Implementation
 end.
 {
   $Log$
-  Revision 1.34  2002-05-14 19:34:40  peter
-    * removed old logs and updated copyright year
+  Revision 1.35  2002-05-16 19:46:35  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.33  2002/04/10 08:07:55  jonas
     * fix for the ie9999 under Linux (patch from Peter)
@@ -1605,4 +1615,109 @@ end.
       with string operations
     * adapted some routines to use the new cg methods
 
+  Revision 1.29  2001/11/06 14:53:48  jonas
+    * compiles again with -dmemdebug
+
+  Revision 1.28  2001/09/18 11:30:47  michael
+  * Fixes win32 linking problems with import libraries
+  * LINKLIB Libraries are now looked for using C file extensions
+  * get_exepath fix
+
+  Revision 1.27  2001/09/17 21:29:10  peter
+    * merged netbsd, fpu-overflow from fixes branch
+
+  Revision 1.26  2001/08/30 20:57:09  peter
+    * asbsd merged
+
+  Revision 1.25  2001/08/30 19:43:50  peter
+    * detect duplicate labels
+
+  Revision 1.24  2001/08/26 13:36:35  florian
+    * some cg reorganisation
+    * some PPC updates
+
+  Revision 1.23  2001/08/07 18:47:12  peter
+    * merged netbsd start
+    * profile for win32
+
+  Revision 1.22  2001/07/01 20:16:15  peter
+    * alignmentinfo record added
+    * -Oa argument supports more alignment settings that can be specified
+      per type: PROC,LOOP,VARMIN,VARMAX,CONSTMIN,CONSTMAX,RECORDMIN
+      RECORDMAX,LOCALMIN,LOCALMAX. It is possible to set the mimimum
+      required alignment and the maximum usefull alignment. The final
+      alignment will be choosen per variable size dependent on these
+      settings
+
+  Revision 1.21  2001/06/18 20:36:23  peter
+    * -Ur switch (merged)
+    * masm fixes (merged)
+    * quoted filenames for go32v2 and win32
+
+  Revision 1.20  2001/06/13 18:31:57  peter
+    * smartlink with dll fixed (merged)
+
+  Revision 1.19  2001/04/21 15:34:49  peter
+    * used target_asm.id instead of target_info.assem
+
+  Revision 1.18  2001/04/18 22:01:53  peter
+    * registration of targets and assemblers
+
+  Revision 1.17  2001/04/13 01:22:06  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.16  2001/03/13 18:42:39  peter
+    * don't create temporary smartlink dir for internalassembler
+
+  Revision 1.15  2001/03/05 21:39:11  peter
+    * changed to class with common TAssembler also for internal assembler
+
+  Revision 1.14  2001/02/26 08:08:16  michael
+  * bug correction: pipes must be closed by pclose (not close);
+    There was too many not closed processes under Linux before patch.
+    Test this by making a compiler under Linux with command
+      OPT="-P" make
+    and check a list of processes in another shell with
+      ps -xa
+
+  Revision 1.13  2001/02/20 21:36:39  peter
+    * tasm/masm fixes merged
+
+  Revision 1.12  2001/02/09 23:06:17  peter
+    * fixed uninited var
+
+  Revision 1.11  2001/02/05 20:46:59  peter
+    * support linux unit for ver1_0 compilers
+
+  Revision 1.10  2001/01/21 20:32:45  marco
+   * Renamefest. Compiler part. Not that hard.
+
+  Revision 1.9  2001/01/12 19:19:44  peter
+    * fixed searching for utils
+
+  Revision 1.8  2000/12/25 00:07:25  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.7  2000/11/13 15:26:12  marco
+   * Renamefest
+
+  Revision 1.6  2000/10/01 19:48:23  peter
+    * lot of compile updates for cg11
+
+  Revision 1.5  2000/09/24 15:06:11  peter
+    * use defines.inc
+
+  Revision 1.4  2000/08/27 16:11:49  peter
+    * moved some util functions from globals,cobjects to cutils
+    * splitted files into finput,fmodule
+
+  Revision 1.3  2000/07/13 12:08:24  michael
+  + patched to 1.1.0 with former 1.09patch from peter
+
+  Revision 1.2  2000/07/13 11:32:32  michael
+  + removed logs
+
 }

+ 124 - 4
compiler/browcol.pas

@@ -1,7 +1,7 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Berczi Gabor
-    Modifications Copyright (c) 1999-2002 Florian Klaempfl and Pierre Muller
+    Copyright (c) 1998-2000 by Berczi Gabor
+    Modifications Copyright (c) 1999-2000 Florian Klaempfl and Pierre Muller
 
     Support routines for getting browser info in collections
 
@@ -2125,7 +2125,127 @@ begin
 end.
 {
   $Log$
-  Revision 1.23  2002-05-14 19:34:40  peter
-    * removed old logs and updated copyright year
+  Revision 1.24  2002-05-16 19:46:35  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
+
+  Revision 1.22  2001/11/02 22:58:00  peter
+    * procsym definition rewrite
+
+  Revision 1.21  2001/09/04 11:53:48  jonas
+    * fixed compiling errors
+
+  Revision 1.20  2001/08/07 17:08:49  peter
+    * fixed rettype->returntype renaming
+
+  Revision 1.19  2001/08/04 11:06:29  peter
+    * browcol has no depends on ide/fv
+
+  Revision 1.18  2001/08/04 10:23:54  peter
+    * updates so it works with the ide
+
+  Revision 1.1.2.6  2001/03/22 17:30:11  pierre
+   * fix an error introduced in last change
+
+  Revision 1.1.2.5  2001/03/17 23:13:01  pierre
+   * fix several memory leaks
+
+  Revision 1.1.2.4  2001/03/16 17:48:19  pierre
+   * try to remove memory leaks
+
+  Revision 1.1.2.3  2000/11/06 16:56:46  pierre
+   * fix source file list
+
+  Revision 1.1.2.2  2000/08/18 13:18:52  pierre
+   * restore next instead of indexnext field for dc local var in GetAbsProcParmDefStr
+
+  Revision 1.1.2.1  2000/08/16 18:25:59  peter
+    * splitted namedobjectitem.next into indexnext and listnext so it
+      can be used in both lists
+    * don't allow "word = word" type definitions
+
+  Revision 1.1  2000/07/13 06:29:44  michael
+  + Initial import
+
+  Revision 1.43  2000/07/05 21:20:48  pierre
+   + Register TModuleSymbol
+
+  Revision 1.42  2000/07/05 10:17:38  pierre
+   * avoid internalerror on open arrays
+
+  Revision 1.41  2000/06/19 19:56:43  pierre
+   * small error fix
+
+  Revision 1.40  2000/06/16 06:08:44  pierre
+   *Gabor's changes
+
+  Revision 1.39  2000/05/29 10:04:40  pierre
+    * New bunch of Gabor changes
+
+  Revision 1.38  2000/04/20 08:52:01  pierre
+   * allow to view objects having the same name
+
+  Revision 1.37  2000/03/14 15:04:19  pierre
+   * DebuggerValue moved to fpsymbol unit
+
+  Revision 1.36  2000/03/13 20:28:12  pierre
+   * X was not found in TSortedSymbolCollection.LookUp
+
+  Revision 1.35  2000/03/08 12:25:29  pierre
+   * more fixes for TSymbol
+
+  Revision 1.34  2000/03/07 21:55:59  pierre
+    * Tsymbol and Ancestor fixes
+
+  Revision 1.33  2000/02/09 13:22:45  peter
+    * log truncated
+
+  Revision 1.32  2000/01/20 00:24:06  pierre
+   * StoreBrowserCol changed to boolean function
+
+  Revision 1.31  2000/01/07 01:14:19  peter
+    * updated copyright to 2000
+
+  Revision 1.30  1999/12/01 11:11:19  pierre
+   * don't redefine sw_integer for FPC : corrected version
+
+  Revision 1.29  1999/12/01 11:05:47  pierre
+   * don't redefine sw_integer for FPC
+
+  Revision 1.28  1999/11/30 10:40:42  peter
+    + ttype, tsymlist
+
+  Revision 1.27  1999/11/10 00:42:42  pierre
+    * LookUp function now returns the complete name in browcol
+      and fpsymbol only yakes a part of LoopUpStr
+
+  Revision 1.26  1999/11/06 14:34:17  peter
+    * truncated log to 20 revs
+
+  Revision 1.25  1999/10/26 12:30:40  peter
+    * const parameter is now checked
+    * better and generic check if a node can be used for assigning
+    * export fixes
+    * procvar equal works now (it never had worked at least from 0.99.8)
+    * defcoll changed to linkedlist with tparaitem so it can easily be
+      walked both directions
+
+  Revision 1.24  1999/09/16 07:54:48  pierre
+   * BuildSourceList allways called for dependency in FP
+
+  Revision 1.23  1999/09/07 15:07:49  pierre
+   * avoid some infinite recursions
+
+  Revision 1.22  1999/08/16 18:25:49  peter
+    * fixes from gabor
+
+  Revision 1.21  1999/08/09 14:09:04  peter
+    * updated for symtable updates
+
+  Revision 1.20  1999/08/03 22:02:29  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
 
 }

+ 38 - 4
compiler/browlog.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Florian Klaempfl and Pierre Muller
+    Copyright (c) 1998-2000 by Florian Klaempfl and Pierre Muller
 
     Support routines for creating the browser log
 
@@ -22,7 +22,7 @@
 }
 unit browlog;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 uses
@@ -514,7 +514,41 @@ implementation
 end.
 {
   $Log$
-  Revision 1.11  2002-05-14 19:34:40  peter
-    * removed old logs and updated copyright year
+  Revision 1.12  2002-05-16 19:46:35  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
+
+  Revision 1.10  2001/11/02 22:58:01  peter
+    * procsym definition rewrite
+
+  Revision 1.9  2001/08/19 09:39:27  peter
+    * local browser support fixed
+
+  Revision 1.8  2001/04/18 22:01:53  peter
+    * registration of targets and assemblers
+
+  Revision 1.7  2001/04/13 01:22:06  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.6  2000/12/25 00:07:25  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.5  2000/10/31 22:02:46  peter
+    * symtable splitted, no real code changes
+
+  Revision 1.4  2000/09/24 15:06:11  peter
+    * use defines.inc
+
+  Revision 1.3  2000/08/27 16:11:49  peter
+    * moved some util functions from globals,cobjects to cutils
+    * splitted files into finput,fmodule
+
+  Revision 1.2  2000/07/13 11:32:32  michael
+  + removed logs
 
 }

+ 27 - 4
compiler/catch.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Michael Van Canneyt
+    Copyright (c) 1998-2000 by Michael Van Canneyt
 
     Unit to catch segmentation faults and Ctrl-C and exit gracefully
     under linux and go32v2
@@ -23,7 +23,7 @@
 }
 Unit catch;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 {$ifdef go32v2}
   { go32v2 stack check goes nuts if ss is not the data selector (PM) }
@@ -107,7 +107,30 @@ end.
 
 {
   $Log$
-  Revision 1.9  2002-05-14 19:34:40  peter
-    * removed old logs and updated copyright year
+  Revision 1.10  2002-05-16 19:46:35  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
+  Revision 1.8  2001/02/26 19:44:52  peter
+    * merged generic m68k updates from fixes branch
+
+  Revision 1.7  2001/02/05 20:47:00  peter
+    * support linux unit for ver1_0 compilers
+
+  Revision 1.6  2001/01/21 20:32:45  marco
+   * Renamefest. Compiler part. Not that hard.
+
+  Revision 1.5  2000/11/13 15:26:12  marco
+   * Renamefest
+
+  Revision 1.4  2000/09/24 15:06:11  peter
+    * use defines.inc
+
+  Revision 1.3  2000/09/10 20:26:55  peter
+    * bsd patches from marco
+
+  Revision 1.2  2000/07/13 11:32:32  michael
+  + removed logs
 }

+ 40 - 4
compiler/cclasses.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Florian Klaempfl and Peter Vreman
+    Copyright (c) 1998-2000 by Florian Klaempfl and Peter Vreman
 
     This module provides some basic classes
 
@@ -22,7 +22,7 @@
 }
 unit cclasses;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -1728,8 +1728,11 @@ end;
 end.
 {
   $Log$
-  Revision 1.11  2002-05-14 19:34:40  peter
-    * removed old logs and updated copyright year
+  Revision 1.12  2002-05-16 19:46:35  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.10  2002/05/12 16:53:04  peter
     * moved entry and exitcode to ncgutil and cgobj
@@ -1748,4 +1751,37 @@ end.
     * fixed pascal calling method with reversing also the high tree in
       the parast, detected by tcalcst3 test
 
+  Revision 1.9  2001/11/18 18:43:13  peter
+    * overloading supported in child classes
+    * fixed parsing of classes with private and virtual and overloaded
+      so it is compatible with delphi
+
+  Revision 1.8  2001/11/05 14:16:25  jonas
+    * reduced memory usage by about 10% and increased speed by about 15%
+
+  Revision 1.7  2001/05/04 19:50:04  peter
+    * fixed dynamicarray.seek() with pos equals multiple of $10000
+
+  Revision 1.6  2001/04/13 01:22:06  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.5  2001/03/13 18:45:06  peter
+    * fixed some memory leaks
+
+  Revision 1.4  2001/03/05 21:40:01  peter
+    * fixed tdynamicarray.readstream
+
+  Revision 1.3  2000/12/29 21:57:27  peter
+    * 'classified' tdictionary, but leave it within an define
+
+  Revision 1.2  2000/12/25 00:07:25  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.1  2000/12/24 12:25:31  peter
+    + cstreams unit
+    * dynamicarray object to class
+
 }

+ 27 - 4
compiler/cg64f32.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Florian Klaempfl
+    Copyright (c) 1998-2000 by Florian Klaempfl
     Member of the Free Pascal development team
 
     This unit implements the code generation for 64 bit int
@@ -28,7 +28,7 @@
 }
 unit cg64f32;
 
-  {$i defines.inc}
+  {$i fpcdefs.inc}
 
   interface
 
@@ -591,8 +591,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.11  2002-05-14 19:34:40  peter
-    * removed old logs and updated copyright year
+  Revision 1.12  2002-05-16 19:46:35  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.10  2002/05/12 16:53:04  peter
     * moved entry and exitcode to ncgutil and cgobj
@@ -652,4 +655,24 @@ end.
       instead of direct comparisons of low/high values of orddefs because
       qword is a special case
 
+  Revision 1.2  2001/12/30 17:24:48  jonas
+    * range checking is now processor independent (part in cgobj,
+      part in cg64f32) and should work correctly again (it needed
+      some changes after the changes of the low and high of
+      tordef's to int64)
+    * maketojumpbool() is now processor independent (in ncgutil)
+    * getregister32 is now called getregisterint
+
+  Revision 1.1  2001/12/29 15:29:58  jonas
+    * powerpc/cgcpu.pas compiles :)
+    * several powerpc-related fixes
+    * cpuasm unit is now based on common tainst unit
+    + nppcmat unit for powerpc (almost complete)
+
+  Revision 1.1  2000/07/13 06:30:07  michael
+  + Initial import
+
+  Revision 1.1  2000/03/01 15:36:13  florian
+    * some new stuff for the new cg
+
 }

+ 76 - 4
compiler/cgbase.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Florian Klaempfl
+    Copyright (c) 1998-2000 by Florian Klaempfl
 
     This unit exports some help routines for the code generation
 
@@ -22,7 +22,7 @@
 }
 unit cgbase;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
   interface
 
@@ -524,8 +524,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.14  2002-05-14 19:34:40  peter
-    * removed old logs and updated copyright year
+  Revision 1.15  2002-05-16 19:46:35  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.13  2002/04/25 20:16:38  peter
     * moved more routines from cga/n386util
@@ -582,4 +585,73 @@ end.
   Revision 1.6  2002/03/04 19:10:11  peter
     * removed compiler warnings
 
+  Revision 1.5  2001/12/30 17:24:48  jonas
+    * range checking is now processor independent (part in cgobj,
+      part in cg64f32) and should work correctly again (it needed
+      some changes after the changes of the low and high of
+      tordef's to int64)
+    * maketojumpbool() is now processor independent (in ncgutil)
+    * getregister32 is now called getregisterint
+
+  Revision 1.4  2001/11/06 14:53:48  jonas
+    * compiles again with -dmemdebug
+
+  Revision 1.3  2001/09/29 21:33:47  jonas
+    * support 64bit operands in def_cgsize()
+
+  Revision 1.2  2001/09/28 20:39:33  jonas
+    * changed all flow control structures (except for exception handling
+      related things) to processor independent code (in new ncgflw unit)
+    + generic cgobj unit which contains lots of code generator helpers with
+      global "cg" class instance variable
+    + cgcpu unit for i386 (implements processor specific routines of the above
+      unit)
+    * updated cgbase and cpubase for the new code generator units
+    * include ncgflw unit in cpunode unit
+
+  Revision 1.1  2001/08/26 13:36:36  florian
+    * some cg reorganisation
+    * some PPC updates
+
+  Revision 1.11  2001/08/06 21:40:46  peter
+    * funcret moved from tprocinfo to tprocdef
+
+  Revision 1.10  2001/04/13 01:22:07  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.9  2000/12/25 00:07:26  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.8  2000/11/30 22:16:49  florian
+    * moved to i386
+
+  Revision 1.7  2000/10/31 22:02:47  peter
+    * symtable splitted, no real code changes
+
+  Revision 1.6  2000/09/24 15:06:17  peter
+    * use defines.inc
+
+  Revision 1.5  2000/08/27 16:11:51  peter
+    * moved some util functions from globals,cobjects to cutils
+    * splitted files into finput,fmodule
+
+  Revision 1.4  2000/08/12 15:34:22  peter
+    + usedasmsymbollist to check and reset only the used symbols (merged)
+
+  Revision 1.3  2000/08/03 13:17:26  jonas
+    + allow regvars to be used inside inlined procs, which required  the
+      following changes:
+        + load regvars in genentrycode/free them in genexitcode (cgai386)
+        * moved all regvar related code to new regvars unit
+        + added pregvarinfo type to hcodegen
+        + added regvarinfo field to tprocinfo (symdef/symdefh)
+        * deallocate the regvars of the caller in secondprocinline before
+          inlining the called procedure and reallocate them afterwards
+
+  Revision 1.2  2000/07/13 11:32:41  michael
+  + removed logs
+
 }

+ 7 - 4
compiler/cginfo.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Florian Klaempfl
+    Copyright (c) 1998-2000 by Florian Klaempfl
 
     This unit exports some types and constants for the code generation
 
@@ -23,7 +23,7 @@
 {# This unit exports some types which are used across the code generator }
 unit cginfo;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -101,8 +101,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.8  2002-05-14 19:34:40  peter
-    * removed old logs and updated copyright year
+  Revision 1.9  2002-05-16 19:46:35  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.7  2002/05/13 19:54:36  peter
     * removed n386ld and n386util units

+ 61 - 4
compiler/cgobj.pas

@@ -27,7 +27,7 @@
 }
 unit cgobj;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
   interface
 
@@ -318,8 +318,8 @@ unit cgobj;
           { restores the frame pointer at procedure exit }
           procedure g_restore_frame_pointer(list : taasmoutput);virtual; abstract;
           procedure g_return_from_proc(list : taasmoutput;parasize : aword);virtual; abstract;
-          procedure g_call_constructor_helper(list : taasmoutput);virtual;abstract;
-          procedure g_call_destructor_helper(list : taasmoutput);virtual;abstract;
+          procedure g_call_constructor_helper(list : taasmoutput);virtual;
+          procedure g_call_destructor_helper(list : taasmoutput);virtual;
           procedure g_call_fail_helper(list : taasmoutput);virtual;abstract;
           procedure g_save_standard_registers(list : taasmoutput);virtual;abstract;
           procedure g_restore_standard_registers(list : taasmoutput);virtual;abstract;
@@ -1092,6 +1092,54 @@ unit cgobj;
 {*****************************************************************************
                             Entry/Exit Code Functions
 *****************************************************************************}
+    procedure tcg.g_call_constructor_helper(list : taasmoutput);
+     var
+      href : treference;
+      hregister : tregister;
+     begin
+        if is_class(procinfo^._class) then
+          begin
+            procinfo^.flags:=procinfo^.flags or pi_needs_implicit_finally;
+            { parameter 2 : self pointer  }
+            a_param_reg(list, OS_ADDR, SELF_POINTER_REG, 2);
+            { parameter 1 : vmt pointer (stored at the selfpointer address on stack)  }
+            reference_reset_base(href, procinfo^.framepointer,procinfo^.selfpointer_offset); 
+            a_param_ref(list, OS_ADDR,href,1);
+            a_call_name(list,'FPC_NEW_CLASS');
+            a_load_reg_reg(list,OS_INT,accumulator,SELF_POINTER_REG); 
+            { save the self pointer result }
+            a_load_reg_ref(list,OS_ADDR,SELF_POINTER_REG,href);
+            a_cmp_const_reg_label(list,OS_INT,OC_EQ,0,accumulator,faillabel); 
+          end
+        else if is_object(procinfo^._class) then
+          begin
+            { parameter 3 :vmt_offset     }
+            a_param_const(list, OS_32, procinfo^._class.vmt_offset, 3);
+            { parameter 2 : address of pointer to vmt }
+            {  this is the first(?) parameter which was pushed to the constructor }
+            reference_reset_base(href, procinfo^.framepointer,procinfo^.selfpointer_offset-POINTER_SIZE); 
+            hregister:=get_scratch_reg(list);
+            a_loadaddr_ref_reg(list, href, hregister);
+            a_param_reg(list, OS_INT,hregister,1);
+            free_scratch_reg(list, hregister);
+            { parameter 1 : address of self pointer   }
+            reference_reset_base(href, procinfo^.framepointer,procinfo^.selfpointer_offset); 
+            hregister:=get_scratch_reg(list);
+            a_loadaddr_ref_reg(list, href, hregister);
+            a_param_reg(list, OS_INT,hregister,1);
+            free_scratch_reg(list, hregister);
+            a_call_name(list,'FPC_HELP_CONSTRUCTOR');
+            a_load_reg_reg(list,OS_INT,accumulator,SELF_POINTER_REG); 
+            a_cmp_const_reg_label(list,OS_INT,OC_EQ,0,accumulator,faillabel); 
+          end
+        else
+          internalerror(200006161);
+     end;
+     
+     
+    procedure tcg.g_call_destructor_helper(list : taasmoutput);
+     begin
+     end;
 
     procedure tcg.g_interrupt_stackframe_entry(list : taasmoutput);
       begin
@@ -1106,6 +1154,9 @@ unit cgobj;
     procedure tcg.g_profilecode(list : taasmoutput);
       begin
       end;
+      
+      
+      
 
 
 finalization
@@ -1113,7 +1164,13 @@ finalization
 end.
 {
   $Log$
-  Revision 1.23  2002-05-14 19:34:40  peter
+  Revision 1.24  2002-05-16 19:46:35  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
+
+  Revision 1.23  2002/05/14 19:34:40  peter
     * removed old logs and updated copyright year
 
   Revision 1.22  2002/05/13 19:54:36  peter

+ 42 - 4
compiler/cmsgs.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Peter Vreman
+    Copyright (c) 1998-2000 by Peter Vreman
 
     This unit implements the message object
 
@@ -22,7 +22,7 @@
 }
 unit cmsgs;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -462,8 +462,11 @@ end;
 end.
 {
   $Log$
-  Revision 1.4  2002-05-14 19:34:40  peter
-    * removed old logs and updated copyright year
+  Revision 1.5  2002-05-16 19:46:35  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.3  2002/04/19 15:41:39  peter
     * better replacements that also allow $1 in the replacements without
@@ -472,4 +475,39 @@ end.
   Revision 1.2  2002/03/01 12:41:40  peter
     * fixed Message4()
 
+  Revision 1.1  2001/08/20 10:58:48  florian
+    * renamed messages unit to cmsgs to avoid conflicts with the
+      win32 messages unit
+
+  Revision 1.10  2001/06/03 20:21:08  peter
+    * Kylix fixes, mostly case names of units
+
+  Revision 1.9  2001/05/27 14:30:55  florian
+    + some widestring stuff added
+
+  Revision 1.8  2001/04/21 13:32:07  peter
+    * remove endless loop with replacements (merged)
+
+  Revision 1.7  2001/04/14 16:05:41  jonas
+    * allow a single replacement string to be substituted more than once per
+      message (already used in assembler reader messages for "fsub x" etc.
+      transformations) (merged)
+
+  Revision 1.6  2001/03/10 13:19:10  peter
+    * don't check messagefile for numbers, this allows the usage of
+      1.1 msgfiles with a 1.0.x compiler
+
+  Revision 1.5  2000/11/29 00:30:31  florian
+    * unused units removed from uses clause
+    * some changes for widestrings
+
+  Revision 1.4  2000/09/24 21:33:46  peter
+    * message updates merges
+
+  Revision 1.3  2000/09/24 15:06:18  peter
+    * use defines.inc
+
+  Revision 1.2  2000/07/13 11:32:43  michael
+  + removed logs
+
 }

+ 56 - 4
compiler/comphook.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Peter Vreman
+    Copyright (c) 1998-2000 by Peter Vreman
 
     This unit handles the compilerhooks for output to external programs
 
@@ -22,7 +22,7 @@
 }
 unit comphook;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -355,7 +355,59 @@ end;
 end.
 {
   $Log$
-  Revision 1.17  2002-05-14 19:34:40  peter
-    * removed old logs and updated copyright year
+  Revision 1.18  2002-05-16 19:46:35  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
+
+  Revision 1.16  2001/08/04 10:23:54  peter
+    * updates so it works with the ide
+
+  Revision 1.15  2001/06/07 21:25:57  peter
+    * Regenerated
+
+  Revision 1.14  2001/06/06 17:20:21  jonas
+    * fixed wrong typed constant procvars in preparation of my fix which will
+      disallow them in FPC mode (plus some other unmerged changes since
+      LAST_MERGE)
+
+  Revision 1.13  2001/02/05 20:47:00  peter
+    * support linux unit for ver1_0 compilers
+
+  Revision 1.12  2001/01/21 20:32:45  marco
+   * Renamefest. Compiler part. Not that hard.
+
+  Revision 1.11  2000/12/26 15:58:29  peter
+    * check for verbosity in verbose instead of comphook
+
+  Revision 1.10  2000/12/25 00:07:25  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.9  2000/11/13 15:26:12  marco
+   * Renamefest
+
+  Revision 1.8  2000/09/30 16:07:20  peter
+    * prefix fix (merged)
+
+  Revision 1.7  2000/09/24 21:33:46  peter
+    * message updates merges
+
+  Revision 1.6  2000/09/24 15:06:13  peter
+    * use defines.inc
+
+  Revision 1.5  2000/08/27 16:11:50  peter
+    * moved some util functions from globals,cobjects to cutils
+    * splitted files into finput,fmodule
+
+  Revision 1.4  2000/08/13 13:04:15  peter
+    * -vb update
+
+  Revision 1.3  2000/08/12 15:30:45  peter
+    * IDE patch for stream reading (merged)
+
+  Revision 1.2  2000/07/13 11:32:38  michael
+  + removed logs
 
 }

+ 77 - 4
compiler/compiler.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Florian Klaempfl
+    Copyright (c) 1998-2000 by Florian Klaempfl
 
     This unit is the interface of the compiler which can be used by
      external programs to link in the compiler
@@ -23,7 +23,7 @@
 
 unit compiler;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 {$ifdef FPC}
    { One of Alpha, I386 or M68K must be defined }
@@ -337,8 +337,11 @@ end;
 end.
 {
   $Log$
-  Revision 1.27  2002-05-14 19:34:40  peter
-    * removed old logs and updated copyright year
+  Revision 1.28  2002-05-16 19:46:35  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.26  2002/05/12 16:53:05  peter
     * moved entry and exitcode to ncgutil and cgobj
@@ -366,4 +369,74 @@ end.
   Revision 1.23  2002/03/24 19:05:31  carl
   + patch for SPARC from Mazen NEIFER
 
+  Revision 1.22  2001/09/18 11:30:47  michael
+  * Fixes win32 linking problems with import libraries
+  * LINKLIB Libraries are now looked for using C file extensions
+  * get_exepath fix
+
+  Revision 1.21  2001/05/06 14:49:16  peter
+    * ppu object to class rewrite
+    * move ppu read and write stuff to fppu
+
+  Revision 1.20  2001/04/21 13:37:16  peter
+    * made tclassheader using class of to implement cpu dependent code
+
+  Revision 1.19  2001/04/18 22:01:53  peter
+    * registration of targets and assemblers
+
+  Revision 1.18  2001/04/13 18:08:36  peter
+    * scanner object to class
+
+  Revision 1.17  2001/04/13 01:22:06  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.16  2001/04/02 21:20:29  peter
+    * resulttype rewrite
+
+  Revision 1.15  2000/12/26 15:57:25  peter
+    * use system.paramstr()
+
+  Revision 1.14  2000/12/25 00:07:25  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.13  2000/12/24 12:24:38  peter
+    * moved preprocessfile into a conditional
+
+  Revision 1.11  2000/11/29 00:30:30  florian
+    * unused units removed from uses clause
+    * some changes for widestrings
+
+  Revision 1.10  2000/10/31 22:02:46  peter
+    * symtable splitted, no real code changes
+
+  Revision 1.9  2000/10/15 09:39:36  peter
+    * moved cpu*.pas to i386/
+    * renamed n386 to common cpunode
+
+  Revision 1.8  2000/10/14 10:14:46  peter
+    * moehrendorf oct 2000 rewrite
+
+  Revision 1.7  2000/10/08 10:26:33  peter
+    * merged @result fix from Pierre
+
+  Revision 1.6  2000/09/24 15:06:14  peter
+    * use defines.inc
+
+  Revision 1.5  2000/08/27 16:11:50  peter
+    * moved some util functions from globals,cobjects to cutils
+    * splitted files into finput,fmodule
+
+  Revision 1.4  2000/08/21 09:14:40  jonas
+    - removed catch unit from uses clause for Linux (clashed with fpcatch
+     from IDE and is already in pp.pas for command line compiler) (merged
+     from fixes branch)
+
+  Revision 1.3  2000/08/04 22:00:50  peter
+    * merges from fixes
+
+  Revision 1.2  2000/07/13 11:32:38  michael
+  + removed logs
 }

+ 35 - 3
compiler/compinnr.inc

@@ -1,7 +1,7 @@
 {
     $Id$
     This file is part of the Free Pascal run time library and compiler.
-    Copyright (c) 1998-2002 by the Free Pascal development team
+    Copyright (c) 1998-2000 by the Free Pascal development team
 
     Internal Function/Constant Evaluator numbers
 
@@ -104,7 +104,39 @@ const
 
 {
   $Log$
-  Revision 1.5  2002-05-14 19:34:40  peter
-    * removed old logs and updated copyright year
+  Revision 1.6  2002-05-16 19:46:35  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
+
+  Revision 1.4  2001/10/24 11:51:39  marco
+   * Make new/dispose system functions instead of keywords
+
+  Revision 1.3  2001/07/09 21:15:40  peter
+    * Length made internal
+    * Add array support for Length
+
+  Revision 1.2  2000/11/09 17:46:54  florian
+    * System.TypeInfo fixed
+    + System.Finalize implemented
+    + some new keywords for interface support added
+
+  Revision 1.1  2000/11/04 16:48:32  florian
+    * innr.inc renamed to make compiler compilation easier because the rtl contains
+      a file of the same name
+
+  Revision 1.4  2000/10/21 18:16:11  florian
+    * a lot of changes:
+       - basic dyn. array support
+       - basic C++ support
+       - some work for interfaces done
+       ....
+
+  Revision 1.3  2000/08/16 13:06:06  florian
+    + support of 64 bit integer constants
+
+  Revision 1.2  2000/07/13 11:32:43  michael
+  + removed logs
 
 }

+ 38 - 4
compiler/comprsrc.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Florian Klaempfl
+    Copyright (c) 1998-2000 by Florian Klaempfl
 
     Handles the resource files handling
 
@@ -22,7 +22,7 @@
 }
 unit comprsrc;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -142,10 +142,44 @@ end;
 end.
 {
   $Log$
-  Revision 1.12  2002-05-14 19:34:40  peter
-    * removed old logs and updated copyright year
+  Revision 1.13  2002-05-16 19:46:35  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.11  2002/04/04 18:32:37  carl
   + added wdosx support (patch from Pavel)
 
+  Revision 1.10  2001/08/07 18:47:12  peter
+    * merged netbsd start
+    * profile for win32
+
+  Revision 1.9  2001/04/18 22:01:53  peter
+    * registration of targets and assemblers
+
+  Revision 1.8  2001/03/13 21:01:14  peter
+    * string fixes
+
+  Revision 1.7  2001/02/20 21:41:17  peter
+    * new fixfilename, findfile for unix. Look first for lowercase, then
+      NormalCase and last for UPPERCASE names.
+
+  Revision 1.6  2000/12/25 00:07:25  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.5  2000/09/24 15:06:14  peter
+    * use defines.inc
+
+  Revision 1.4  2000/08/27 16:11:50  peter
+    * moved some util functions from globals,cobjects to cutils
+    * splitted files into finput,fmodule
+
+  Revision 1.3  2000/08/04 22:00:51  peter
+    * merges from fixes
+
+  Revision 1.2  2000/07/13 11:32:38  michael
+  + removed logs
+
 }

+ 20 - 3
compiler/crc.pas

@@ -22,7 +22,7 @@
 }
 Unit crc;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 Interface
 
@@ -101,7 +101,24 @@ end;
 end.
 {
   $Log$
-  Revision 1.7  2002-05-14 19:34:40  peter
-    * removed old logs and updated copyright year
+  Revision 1.8  2002-05-16 19:46:35  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
+  Revision 1.6  2001/06/03 20:21:08  peter
+    * Kylix fixes, mostly case names of units
+
+  Revision 1.5  2001/05/09 14:11:10  jonas
+    * range check error fixes from Peter
+
+  Revision 1.4  2000/09/24 15:06:14  peter
+    * use defines.inc
+
+  Revision 1.3  2000/08/13 13:04:38  peter
+    * new ppu version
+
+  Revision 1.2  2000/07/13 11:32:39  michael
+  + removed logs
 }

+ 38 - 4
compiler/cresstr.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Michael van Canneyt
+    Copyright (c) 1998-2000 by Michael van Canneyt
 
     Handles resourcestrings
 
@@ -22,7 +22,7 @@
 }
 unit cresstr;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -292,7 +292,41 @@ end;
 end.
 {
   $Log$
-  Revision 1.11  2002-05-14 19:34:40  peter
-    * removed old logs and updated copyright year
+  Revision 1.12  2002-05-16 19:46:35  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
+
+  Revision 1.10  2001/04/13 01:22:07  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.9  2001/02/24 10:44:55  peter
+    * generate .rst from ppufilename instead of modulename
+
+  Revision 1.8  2000/12/25 00:07:25  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.7  2000/11/13 14:44:35  jonas
+    * fixes so no more range errors with improved range checking code
+
+  Revision 1.6  2000/09/24 15:06:14  peter
+    * use defines.inc
+
+  Revision 1.5  2000/08/27 16:11:50  peter
+    * moved some util functions from globals,cobjects to cutils
+    * splitted files into finput,fmodule
+
+  Revision 1.4  2000/08/15 09:45:29  michael
+  + Merged changes in fixbranch
+
+  Revision 1.1.2.1  2000/08/15 09:41:56  michael
+  + Fix to write rst file in output directory of module
+
+  Revision 1.1  2000/07/13 06:29:48  michael
+  + Initial import
 
 }

+ 15 - 4
compiler/cstreams.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Florian Klaempfl and Peter Vreman
+    Copyright (c) 1998-2000 by Florian Klaempfl and Peter Vreman
 
     This module provides stream classes
 
@@ -22,7 +22,7 @@
 }
 unit cstreams;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -610,7 +610,18 @@ end;
 end.
 {
   $Log$
-  Revision 1.3  2002-05-14 19:34:40  peter
-    * removed old logs and updated copyright year
+  Revision 1.4  2002-05-16 19:46:36  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
+
+  Revision 1.2  2000/12/25 00:07:25  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.1  2000/12/24 12:25:31  peter
+    + cstreams unit
+    * dynamicarray object to class
 
 }

+ 17 - 14
compiler/cutils.pas

@@ -1,11 +1,11 @@
 {
     $Id$
-    Copyright (C) 1998-2002 by Florian Klaempfl
+    Copyright (C) 1998-2000 by Florian Klaempfl
 
     This unit implements some support functions
 
     This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published
+    it under the terms of the GNU General Public License as published 
     by the Free Software Foundation; either version 2 of the License, or
     (at your option) any later version.
 
@@ -18,15 +18,15 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-
+ 
 ****************************************************************************
 }
 {# This unit contains some generic support functions which are used
    in the different parts of the compiler.
-}
+}   
 unit cutils;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -49,7 +49,7 @@ interface
     function SwapWord(x : word): word;
     {# Return value @var(i) aligned on @var(a) boundary }
     function align(i,a:longint):longint;
-
+    
     function used_align(varalign,minalign,maxalign:longint):longint;
     function size_2_align(len : longint) : longint;
     procedure Replace(var s:string;s1:string;const s2:string);
@@ -68,7 +68,7 @@ interface
     procedure valint(S : string;var V : longint;var code : integer);
     {# Returns true if the string s is a number }
     function is_number(const s : string) : boolean;
-    {# Returns true if value is a power of 2, the actual
+    {# Returns true if value is a power of 2, the actual  
        exponent value is returned in power.
     }
     function ispowerof2(value : int64;var power : longint) : boolean;
@@ -84,15 +84,15 @@ interface
     { a pointer to this mem                                           }
     function stringdup(const s : string) : pstring;
 
-    {# Allocates memory for the string @var(s) and copies s as zero
-       terminated string to that allocated memory and returns a pointer
-       to that mem
+    {# Allocates memory for the string @var(s) and copies s as zero 
+       terminated string to that allocated memory and returns a pointer 
+       to that mem 
     }
     function  strpnew(const s : string) : pchar;
     procedure strdispose(var p : pchar);
 
-    {# makes the character @var(c) lowercase, with spanish, french and german
-       character set
+    {# makes the character @var(c) lowercase, with spanish, french and german 
+       character set 
     }
     function lowercase(c : char) : char;
 
@@ -765,8 +765,11 @@ initialization
 end.
 {
   $Log$
-  Revision 1.15  2002-05-14 19:34:40  peter
-    * removed old logs and updated copyright year
+  Revision 1.16  2002-05-16 19:46:36  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.14  2002/04/12 17:16:35  carl
   + more documentation of basic unit

+ 22 - 4
compiler/dmisc.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Florian Klaempfl
+    Copyright (c) 1998-2000 by Florian Klaempfl
 
     Dos unit for BP7 compatible RTL for Delphi
 
@@ -22,7 +22,7 @@
 }
 unit dmisc;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -836,7 +836,25 @@ End;
 end.
 {
   $Log$
-  Revision 1.7  2002-05-14 19:34:41  peter
-    * removed old logs and updated copyright year
+  Revision 1.8  2002-05-16 19:46:36  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
+
+  Revision 1.6  2001/09/02 21:16:25  peter
+    * delphi fixes
+
+  Revision 1.5  2001/06/03 20:21:08  peter
+    * Kylix fixes, mostly case names of units
+
+  Revision 1.4  2000/09/24 21:19:50  peter
+    * delphi compile fixes
+
+  Revision 1.3  2000/09/24 15:06:15  peter
+    * use defines.inc
+
+  Revision 1.2  2000/07/13 11:32:40  michael
+  + removed logs
 
 }

+ 58 - 4
compiler/export.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Florian Klaempfl
+    Copyright (c) 1998-2000 by Florian Klaempfl
 
     This unit implements an uniform export object
 
@@ -22,7 +22,7 @@
 }
 unit export;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -180,7 +180,61 @@ end;
 end.
 {
   $Log$
-  Revision 1.17  2002-05-14 19:34:41  peter
-    * removed old logs and updated copyright year
+  Revision 1.18  2002-05-16 19:46:36  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
+
+  Revision 1.16  2001/06/28 19:46:25  peter
+    * added override and virtual for constructors
+
+  Revision 1.15  2001/06/06 21:58:16  peter
+    * Win32 fixes for Makefile so it doesn't require sh.exe
+
+  Revision 1.14  2001/04/18 22:01:53  peter
+    * registration of targets and assemblers
+
+  Revision 1.13  2001/04/13 01:22:07  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.12  2001/02/26 19:44:52  peter
+    * merged generic m68k updates from fixes branch
+
+  Revision 1.11  2001/02/03 00:09:02  peter
+    * fixed netware typo in previous commit
+
+  Revision 1.10  2001/02/02 22:43:39  peter
+    * add notarget defines
+
+  Revision 1.9  2000/12/25 00:07:25  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.8  2000/11/29 00:30:30  florian
+    * unused units removed from uses clause
+    * some changes for widestrings
+
+  Revision 1.7  2000/10/31 22:02:46  peter
+    * symtable splitted, no real code changes
+
+  Revision 1.6  2000/09/24 15:06:16  peter
+    * use defines.inc
+
+  Revision 1.5  2000/09/16 12:22:52  peter
+    * freebsd support merged
+
+  Revision 1.4  2000/09/11 17:00:22  florian
+    + first implementation of Netware Module support, thanks to
+      Armin Diehl ([email protected]) for providing the patches
+
+  Revision 1.3  2000/08/27 16:11:50  peter
+    * moved some util functions from globals,cobjects to cutils
+    * splitted files into finput,fmodule
+
+  Revision 1.2  2000/07/13 11:32:41  michael
+  + removed logs
 
 }

+ 19 - 7
compiler/finput.pas

@@ -22,7 +22,7 @@
 }
 unit finput;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -122,7 +122,7 @@ interface
           modulename,               { name of the module in uppercase }
           realmodulename,           { name of the module in the orignal case }
           objfilename,              { fullname of the objectfile }
-          asmfilename,              { fullname of the assemblerfile }
+          newfilename,              { fullname of the assemblerfile }
           ppufilename,              { fullname of the ppufile }
           staticlibfilename,        { fullname of the static libraryfile }
           sharedlibfilename,        { fullname of the shared libraryfile }
@@ -131,6 +131,7 @@ interface
           constructor create(const s:string);
           destructor destroy;override;
           procedure setfilename(const fn:string;allowoutput:boolean);
+          function get_asmfilename : string;
        end;
 
 
@@ -599,7 +600,7 @@ uses
         e : ExtStr;
       begin
          stringdispose(objfilename);
-         stringdispose(asmfilename);
+         stringdispose(newfilename);
          stringdispose(ppufilename);
          stringdispose(staticlibfilename);
          stringdispose(sharedlibfilename);
@@ -622,8 +623,8 @@ uses
               p:=OutputExeDir;
           end;
          outputpath:=stringdup(p);
+         newfilename := stringdup(n);
          objfilename:=stringdup(p+n+target_info.objext);
-         asmfilename:=stringdup(p+n+target_info.asmext);
          ppufilename:=stringdup(p+n+target_info.unitext);
          { lib and exe could be loaded with a file specified with -o }
          if AllowOutput and (OutputFile<>'') and (compile_level=1) then
@@ -649,7 +650,7 @@ uses
         mainsource:=nil;
         ppufilename:=nil;
         objfilename:=nil;
-        asmfilename:=nil;
+        newfilename:=nil;
         staticlibfilename:=nil;
         sharedlibfilename:=nil;
         exefilename:=nil;
@@ -665,13 +666,18 @@ uses
       end;
 
 
+    function tmodulebase.get_asmfilename : string;
+     begin
+         get_asmfilename:=outputpath^+newfilename^+target_info.asmext;
+     end;    
+
     destructor tmodulebase.destroy;
       begin
         if assigned(sourcefiles) then
          sourcefiles.free;
         sourcefiles:=nil;
         stringdispose(objfilename);
-        stringdispose(asmfilename);
+        stringdispose(newfilename);
         stringdispose(ppufilename);
         stringdispose(staticlibfilename);
         stringdispose(sharedlibfilename);
@@ -687,7 +693,13 @@ uses
 end.
 {
   $Log$
-  Revision 1.13  2002-05-14 19:34:41  peter
+  Revision 1.14  2002-05-16 19:46:36  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
+
+  Revision 1.13  2002/05/14 19:34:41  peter
     * removed old logs and updated copyright year
 
   Revision 1.12  2002/04/04 18:34:00  carl

+ 9 - 3
compiler/fmodule.pas

@@ -22,7 +22,7 @@
 }
 unit fmodule;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 {$ifdef go32v2}
   {$define shortasmprefix}
@@ -443,7 +443,7 @@ uses
         linkotherstaticlibs.Free;
         linkothersharedlibs.Free;
         stringdispose(objfilename);
-        stringdispose(asmfilename);
+        stringdispose(newfilename);
         stringdispose(ppufilename);
         stringdispose(staticlibfilename);
         stringdispose(sharedlibfilename);
@@ -584,7 +584,13 @@ uses
 end.
 {
   $Log$
-  Revision 1.22  2002-05-14 19:34:41  peter
+  Revision 1.23  2002-05-16 19:46:36  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
+
+  Revision 1.22  2002/05/14 19:34:41  peter
     * removed old logs and updated copyright year
 
   Revision 1.21  2002/04/04 19:05:55  peter

+ 8 - 2
compiler/fppu.pas

@@ -22,7 +22,7 @@
 }
 unit fppu;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 { close ppufiles on system that are
   short on file handles like DOS system PM }
@@ -1173,7 +1173,13 @@ uses
 end.
 {
   $Log$
-  Revision 1.15  2002-05-14 19:34:41  peter
+  Revision 1.16  2002-05-16 19:46:36  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
+
+  Revision 1.15  2002/05/14 19:34:41  peter
     * removed old logs and updated copyright year
 
   Revision 1.14  2002/05/12 16:53:05  peter

+ 35 - 4
compiler/gdb.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Florian Klaempfl
+    Copyright (c) 1998-2000 by Florian Klaempfl
 
     This units contains special support for the GDB
 
@@ -22,7 +22,7 @@
 }
 unit gdb;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -304,10 +304,41 @@ end.
 
 {
   $Log$
-  Revision 1.11  2002-05-14 19:34:41  peter
-    * removed old logs and updated copyright year
+  Revision 1.12  2002-05-16 19:46:36  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.10  2002/05/06 19:49:26  carl
   + added more patches from Mazen for SPARC port
 
+  Revision 1.9  2001/12/02 17:20:58  peter
+    * merged register fixes
+
+  Revision 1.8  2001/10/12 16:05:36  peter
+    * more registers (merged)
+
+  Revision 1.7  2001/04/21 12:03:11  peter
+    * m68k updates merged from fixes branch
+
+  Revision 1.6  2001/04/13 01:22:07  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.5  2000/12/25 00:07:26  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.4  2000/11/29 00:30:30  florian
+    * unused units removed from uses clause
+    * some changes for widestrings
+
+  Revision 1.3  2000/09/24 15:06:16  peter
+    * use defines.inc
+
+  Revision 1.2  2000/07/13 11:32:41  michael
+  + removed logs
+
 }

+ 26 - 4
compiler/gendef.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Florian Klaempfl
+    Copyright (c) 1998-2000 by Florian Klaempfl
 
     Generation of a .def file for needed for Os2/Win32
 
@@ -22,7 +22,7 @@
 }
 unit gendef;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 uses
@@ -160,10 +160,32 @@ end;
 end.
 {
   $Log$
-  Revision 1.8  2002-05-14 19:34:41  peter
-    * removed old logs and updated copyright year
+  Revision 1.9  2002-05-16 19:46:36  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.7  2002/04/04 18:36:46  carl
   + added wdosx support (patch from Pavel)
 
+  Revision 1.6  2001/04/13 01:22:07  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.5  2000/12/25 00:07:26  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.4  2000/09/24 15:06:16  peter
+    * use defines.inc
+
+  Revision 1.3  2000/08/27 16:11:50  peter
+    * moved some util functions from globals,cobjects to cutils
+    * splitted files into finput,fmodule
+
+  Revision 1.2  2000/07/13 11:32:41  michael
+  + removed logs
+
 }

+ 179 - 4
compiler/globals.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (C) 1998-2002 by Florian Klaempfl
+    Copyright (C) 1998-2000 by Florian Klaempfl
 
     This unit implements some support functions and global variables
 
@@ -22,7 +22,7 @@
 }
 unit globals;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -1460,8 +1460,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.56  2002-05-14 19:34:41  peter
-    * removed old logs and updated copyright year
+  Revision 1.57  2002-05-16 19:46:36  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.55  2002/04/20 21:32:23  carl
   + generic FPC_CHECKPOINTER
@@ -1494,4 +1497,176 @@ end.
    * implicit result variable generation for assembler routines
    * removed m_tp modeswitch, use m_tp7 or not(m_fpc) instead
 
+  Revision 1.50  2001/12/06 17:57:33  florian
+    + parasym to tparaitem added
+
+  Revision 1.49  2001/10/25 21:22:32  peter
+    * calling convention rewrite
+
+  Revision 1.48  2001/10/23 21:49:42  peter
+    * $calling directive and -Cc commandline patch added
+      from Pavel Ozerski
+
+  Revision 1.47  2001/10/21 12:33:05  peter
+    * array access for properties added
+
+  Revision 1.46  2001/10/20 20:30:20  peter
+    * read only typed const support, switch $J-
+
+  Revision 1.45  2001/10/16 15:10:34  jonas
+    * fixed goto/label/try bugs
+
+  Revision 1.44  2001/10/12 16:06:17  peter
+    * pathexists fix (merged)
+
+  Revision 1.43  2001/09/18 11:30:47  michael
+  * Fixes win32 linking problems with import libraries
+  * LINKLIB Libraries are now looked for using C file extensions
+  * get_exepath fix
+
+  Revision 1.42  2001/09/17 21:29:11  peter
+    * merged netbsd, fpu-overflow from fixes branch
+
+  Revision 1.41  2001/08/19 11:22:22  peter
+    * palmos support from v10 merged
+
+  Revision 1.40  2001/08/04 10:23:54  peter
+    * updates so it works with the ide
+
+  Revision 1.39  2001/07/01 20:16:15  peter
+    * alignmentinfo record added
+    * -Oa argument supports more alignment settings that can be specified
+      per type: PROC,LOOP,VARMIN,VARMAX,CONSTMIN,CONSTMAX,RECORDMIN
+      RECORDMAX,LOCALMIN,LOCALMAX. It is possible to set the mimimum
+      required alignment and the maximum usefull alignment. The final
+      alignment will be choosen per variable size dependent on these
+      settings
+
+  Revision 1.38  2001/06/18 20:36:24  peter
+    * -Ur switch (merged)
+    * masm fixes (merged)
+    * quoted filenames for go32v2 and win32
+
+  Revision 1.37  2001/06/03 21:57:35  peter
+    + hint directive parsing support
+
+  Revision 1.36  2001/06/03 20:21:08  peter
+    * Kylix fixes, mostly case names of units
+
+  Revision 1.35  2001/05/30 21:35:48  peter
+    * netware patches for copyright, screenname, threadname directives
+
+  Revision 1.34  2001/05/12 12:11:31  peter
+    * simplify_ppu is now the default, a recompile of the compiler now
+      only compiles pp.pas
+
+  Revision 1.33  2001/05/06 14:49:17  peter
+    * ppu object to class rewrite
+    * move ppu read and write stuff to fppu
+
+  Revision 1.32  2001/04/18 22:01:53  peter
+    * registration of targets and assemblers
+
+  Revision 1.31  2001/04/15 09:48:29  peter
+    * fixed crash in labelnode
+    * easier detection of goto and label in try blocks
+
+  Revision 1.30  2001/04/13 01:22:07  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.29  2001/04/04 21:30:42  florian
+    * applied several fixes to get the DD8 Delphi Unit compiled
+     e.g. "forward"-interfaces are working now
+
+  Revision 1.28  2001/02/20 21:41:16  peter
+    * new fixfilename, findfile for unix. Look first for lowercase, then
+      NormalCase and last for UPPERCASE names.
+
+  Revision 1.27  2001/02/09 23:05:45  peter
+    * default packenum=1 for tp7 mode
+
+  Revision 1.26  2001/02/05 20:47:00  peter
+    * support linux unit for ver1_0 compilers
+
+  Revision 1.25  2001/01/21 20:32:45  marco
+   * Renamefest. Compiler part. Not that hard.
+
+  Revision 1.24  2001/01/20 18:32:52  hajny
+    + APPTYPE support under OS/2, app_fs, GetEnvPChar for OS/2
+
+  Revision 1.23  2001/01/13 00:03:41  peter
+    * fixed findexe to also support already extension in name
+
+  Revision 1.22  2000/12/26 15:57:25  peter
+    * use system.paramstr()
+
+  Revision 1.21  2000/12/25 00:07:26  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.20  2000/11/13 15:26:12  marco
+   * Renamefest
+
+  Revision 1.19  2000/11/12 22:20:37  peter
+    * create generic toutputsection for binary writers
+
+  Revision 1.18  2000/11/04 14:25:19  florian
+    + merged Attila's changes for interfaces, not tested yet
+
+  Revision 1.17  2000/10/31 22:02:46  peter
+    * symtable splitted, no real code changes
+
+  Revision 1.16  2000/10/04 14:51:08  pierre
+   * IsExe restored
+
+  Revision 1.15  2000/09/27 21:20:56  peter
+    * also set initlocalswitches in setcompilemode (merged)
+
+  Revision 1.14  2000/09/26 10:50:41  jonas
+    * initmodeswitches is changed is you change the compiler mode from the
+      command line (the -S<x> switches didn't work anymore for changing the
+      compiler mode) (merged from fixes branch)
+
+  Revision 1.13  2000/09/24 21:33:46  peter
+    * message updates merges
+
+  Revision 1.12  2000/09/24 21:19:50  peter
+    * delphi compile fixes
+
+  Revision 1.11  2000/09/24 15:12:40  peter
+    * fixed typo
+
+  Revision 1.10  2000/09/24 15:06:16  peter
+    * use defines.inc
+
+  Revision 1.9  2000/09/24 10:33:07  peter
+    * searching of exe in path also for OS/2
+    * fixed searching of exe in path.
+
+  Revision 1.8  2000/09/11 17:00:22  florian
+    + first implementation of Netware Module support, thanks to
+      Armin Diehl ([email protected]) for providing the patches
+
+  Revision 1.7  2000/08/27 16:11:51  peter
+    * moved some util functions from globals,cobjects to cutils
+    * splitted files into finput,fmodule
+
+  Revision 1.6  2000/08/12 19:14:58  peter
+    * ELF writer works now also with -g
+    * ELF writer is default again for linux
+
+  Revision 1.5  2000/08/12 15:30:44  peter
+    * IDE patch for stream reading (merged)
+
+  Revision 1.4  2000/08/02 19:49:59  peter
+    * first things for default parameters
+
+  Revision 1.3  2000/07/13 12:08:25  michael
+  + patched to 1.1.0 with former 1.09patch from peter
+
+  Revision 1.2  2000/07/13 11:32:41  michael
+  + removed logs
+
 }

+ 70 - 4
compiler/globtype.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Florian Klaempfl, Pierre Muller
+    Copyright (c) 1998-2000 by Florian Klaempfl, Pierre Muller
 
     Global types
 
@@ -21,7 +21,7 @@
 }
 unit globtype;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -255,8 +255,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.24  2002-05-14 19:34:41  peter
-    * removed old logs and updated copyright year
+  Revision 1.25  2002-05-16 19:46:36  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.23  2002/05/12 16:53:05  peter
     * moved entry and exitcode to ncgutil and cgobj
@@ -289,4 +292,67 @@ end.
    * implicit result variable generation for assembler routines
    * removed m_tp modeswitch, use m_tp7 or not(m_fpc) instead
 
+  Revision 1.19  2001/10/25 21:22:32  peter
+    * calling convention rewrite
+
+  Revision 1.18  2001/10/24 11:46:06  marco
+   * Opt Align fix.
+
+  Revision 1.17  2001/10/23 21:49:42  peter
+    * $calling directive and -Cc commandline patch added
+      from Pavel Ozerski
+
+  Revision 1.16  2001/10/20 20:30:21  peter
+    * read only typed const support, switch $J-
+
+  Revision 1.15  2001/09/17 21:29:11  peter
+    * merged netbsd, fpu-overflow from fixes branch
+
+  Revision 1.14  2001/07/30 20:59:27  peter
+    * m68k updates from v10 merged
+
+  Revision 1.13  2001/07/01 20:16:15  peter
+    * alignmentinfo record added
+    * -Oa argument supports more alignment settings that can be specified
+      per type: PROC,LOOP,VARMIN,VARMAX,CONSTMIN,CONSTMAX,RECORDMIN
+      RECORDMAX,LOCALMIN,LOCALMAX. It is possible to set the mimimum
+      required alignment and the maximum usefull alignment. The final
+      alignment will be choosen per variable size dependent on these
+      settings
+
+  Revision 1.12  2001/06/03 21:57:35  peter
+    + hint directive parsing support
+
+  Revision 1.11  2001/01/20 18:32:52  hajny
+    + APPTYPE support under OS/2, app_fs, GetEnvPChar for OS/2
+
+  Revision 1.10  2000/11/29 00:30:30  florian
+    * unused units removed from uses clause
+    * some changes for widestrings
+
+  Revision 1.9  2000/11/12 22:20:37  peter
+    * create generic toutputsection for binary writers
+
+  Revision 1.8  2000/11/04 14:25:19  florian
+    + merged Attila's changes for interfaces, not tested yet
+
+  Revision 1.7  2000/09/24 15:06:16  peter
+    * use defines.inc
+
+  Revision 1.6  2000/09/21 11:30:49  jonas
+    + support for full boolean evaluation (b+/b-), default remains short
+      circuit boolean evaluation
+
+  Revision 1.5  2000/08/05 13:25:06  peter
+    * packenum 1 fixes (merged)
+
+  Revision 1.4  2000/08/02 19:49:59  peter
+    * first things for default parameters
+
+  Revision 1.3  2000/07/13 12:08:25  michael
+  + patched to 1.1.0 with former 1.09patch from peter
+
+  Revision 1.2  2000/07/13 11:32:41  michael
+  + removed logs
+
 }

+ 153 - 4
compiler/htypechk.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Florian Klaempfl
+    Copyright (c) 1998-2000 by Florian Klaempfl
 
     This unit exports some help routines for the type checking
 
@@ -22,7 +22,7 @@
 }
 unit htypechk;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -938,8 +938,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.43  2002-05-14 19:34:41  peter
-    * removed old logs and updated copyright year
+  Revision 1.44  2002-05-16 19:46:37  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.42  2002/04/02 17:11:28  peter
     * tlocation,treference update
@@ -956,4 +959,150 @@ end.
     * no longer allow assignments to pointer expressions (unless there's a
       deref), reported by John Lee
 
+  Revision 1.40  2001/12/31 16:59:41  peter
+    * protected/private symbols parsing fixed
+
+  Revision 1.39  2001/11/08 21:55:36  marco
+   * Fix from Peter. Fixes a hang when ptop's upperstr procedure is converted
+     to ansistrings
+
+  Revision 1.38  2001/11/02 22:58:01  peter
+    * procsym definition rewrite
+
+  Revision 1.37  2001/10/20 20:30:21  peter
+    * read only typed const support, switch $J-
+
+  Revision 1.36  2001/10/12 13:51:51  jonas
+    * fixed internalerror(10) due to previous fpu overflow fixes ("merged")
+    * fixed bug in n386add (introduced after compilerproc changes for string
+      operations) where calcregisters wasn't called for shortstring addnodes
+    * NOTE: from now on, the location of a binary node must now always be set
+       before you call calcregisters() for it
+
+  Revision 1.35  2001/09/17 21:29:11  peter
+    * merged netbsd, fpu-overflow from fixes branch
+
+  Revision 1.34  2001/09/07 07:46:17  jonas
+    * allow typecasting from child object types to parent object types (with
+      different sizes)
+
+  Revision 1.33  2001/09/02 21:13:31  peter
+    * check for size differences in typecasts when assigning
+
+  Revision 1.32  2001/08/26 13:36:37  florian
+    * some cg reorganisation
+    * some PPC updates
+
+  Revision 1.31  2001/08/23 14:28:35  jonas
+    + tempcreate/ref/delete nodes (allows the use of temps in the
+      resulttype and first pass)
+    * made handling of read(ln)/write(ln) processor independent
+    * moved processor independent handling for str and reset/rewrite-typed
+      from firstpass to resulttype pass
+    * changed names of helpers in text.inc to be generic for use as
+      compilerprocs + added "iocheck" directive for most of them
+    * reading of ordinals is done by procedures instead of functions
+      because otherwise FPC_IOCHECK overwrote the result before it could
+      be stored elsewhere (range checking still works)
+    * compilerprocs can now be used in the system unit before they are
+      implemented
+    * added note to errore.msg that booleans can't be read using read/readln
+
+  Revision 1.30  2001/08/06 21:40:46  peter
+    * funcret moved from tprocinfo to tprocdef
+
+  Revision 1.29  2001/06/04 18:04:36  peter
+    * fixes to valid_for_assign for properties
+
+  Revision 1.28  2001/06/04 11:48:02  peter
+    * better const to var checking
+
+  Revision 1.27  2001/05/18 22:57:08  peter
+    * replace constant by cpu dependent value (merged)
+
+  Revision 1.26  2001/05/08 08:52:05  jonas
+    * fix from Peter to avoid excessive number of warnings
+
+  Revision 1.25  2001/04/22 22:46:49  florian
+    * more variant support
+
+  Revision 1.24  2001/04/13 01:22:08  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.23  2001/04/02 21:20:29  peter
+    * resulttype rewrite
+
+  Revision 1.22  2001/02/20 21:46:26  peter
+    * don't allow assign to void type (merged)
+
+  Revision 1.21  2001/02/04 11:12:17  jonas
+    * fixed web bug 1377 & const pointer arithmtic
+
+  Revision 1.20  2000/12/09 13:04:05  florian
+    * web bug 1207 fixed: field and properties of const classes can be
+      changed
+
+  Revision 1.19  2000/11/29 00:30:31  florian
+    * unused units removed from uses clause
+    * some changes for widestrings
+
+  Revision 1.18  2000/11/28 17:14:33  jonas
+    * fixed crash when trying to use an overloaded operator which is nowhere
+      defined
+
+  Revision 1.17  2000/11/28 14:04:03  jonas
+    * fixed operator overloading problems
+
+  Revision 1.16  2000/11/13 11:30:54  florian
+    * some bugs with interfaces and NIL fixed
+
+  Revision 1.15  2000/11/12 22:20:37  peter
+    * create generic toutputsection for binary writers
+
+  Revision 1.14  2000/11/04 14:25:19  florian
+    + merged Attila's changes for interfaces, not tested yet
+
+  Revision 1.13  2000/10/31 22:02:47  peter
+    * symtable splitted, no real code changes
+
+  Revision 1.12  2000/10/14 10:14:47  peter
+    * moehrendorf oct 2000 rewrite
+
+  Revision 1.11  2000/10/01 19:48:23  peter
+    * lot of compile updates for cg11
+
+  Revision 1.10  2000/09/29 15:45:23  florian
+    * make cycle fixed
+
+  Revision 1.9  2000/09/28 19:49:51  florian
+  *** empty log message ***
+
+  Revision 1.8  2000/09/27 18:14:31  florian
+    * fixed a lot of syntax errors in the n*.pas stuff
+
+  Revision 1.7  2000/09/26 20:06:13  florian
+    * hmm, still a lot of work to get things compilable
+
+  Revision 1.6  2000/09/24 15:06:17  peter
+    * use defines.inc
+
+  Revision 1.5  2000/08/27 16:11:51  peter
+    * moved some util functions from globals,cobjects to cutils
+    * splitted files into finput,fmodule
+
+  Revision 1.4  2000/08/16 18:33:53  peter
+    * splitted namedobjectitem.next into indexnext and listnext so it
+      can be used in both lists
+    * don't allow "word = word" type definitions (merged)
+
+  Revision 1.3  2000/08/07 11:31:04  jonas
+    * fixed bug in type conversions between enum subranges (it didn't take
+      the packenum directive into account)
+    + define PACKENUMFIXED symbol in options.pas
+     (merged from fixes branch)
+
+  Revision 1.2  2000/07/13 11:32:41  michael
+  + removed logs
 }

+ 66 - 4
compiler/i386/ag386att.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Florian Klaempfl
+    Copyright (c) 1998-2000 by Florian Klaempfl
 
     This unit implements an asmoutput class for i386 AT&T syntax
 
@@ -22,7 +22,7 @@
 }
 unit ag386att;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -338,8 +338,11 @@ initialization
 end.
 {
   $Log$
-  Revision 1.20  2002-05-14 19:34:52  peter
-    * removed old logs and updated copyright year
+  Revision 1.21  2002-05-16 19:46:49  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.19  2002/05/12 16:53:16  peter
     * moved entry and exitcode to ncgutil and cgobj
@@ -390,4 +393,63 @@ end.
       with string operations
     * adapted some routines to use the new cg methods
 
+  Revision 1.12  2001/12/29 15:29:58  jonas
+    * powerpc/cgcpu.pas compiles :)
+    * several powerpc-related fixes
+    * cpuasm unit is now based on common tainst unit
+    + nppcmat unit for powerpc (almost complete)
+
+  Revision 1.11  2001/09/17 21:29:13  peter
+    * merged netbsd, fpu-overflow from fixes branch
+
+  Revision 1.10  2001/08/30 20:57:10  peter
+    * asbsd merged
+
+  Revision 1.9  2001/05/06 17:13:23  jonas
+    * completed incomplete typed constant records
+
+  Revision 1.8  2001/04/21 15:33:03  peter
+    * stupid bug, finalization to initialization renaming
+
+  Revision 1.7  2001/04/21 12:09:00  peter
+    * fixed bug 1472 (merged)
+
+  Revision 1.6  2001/04/18 22:02:00  peter
+    * registration of targets and assemblers
+
+  Revision 1.5  2001/04/13 01:22:17  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.4  2001/03/05 21:39:11  peter
+    * changed to class with common TAssembler also for internal assembler
+
+  Revision 1.3  2001/01/13 20:24:24  peter
+    * fixed operand order that got mixed up for external writers after
+      my previous assembler block valid instruction check
+
+  Revision 1.2  2000/12/25 00:07:31  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.1  2000/11/30 22:18:48  florian
+    * moved to i386
+
+  Revision 1.6  2000/09/24 15:06:10  peter
+    * use defines.inc
+
+  Revision 1.5  2000/08/27 16:11:49  peter
+    * moved some util functions from globals,cobjects to cutils
+    * splitted files into finput,fmodule
+
+  Revision 1.4  2000/08/20 17:38:21  peter
+    * smartlinking fixed for linux (merged)
+
+  Revision 1.3  2000/07/13 12:08:24  michael
+  + patched to 1.1.0 with former 1.09patch from peter
+
+  Revision 1.2  2000/07/13 11:32:28  michael
+  + removed logs
+
 }

+ 58 - 4
compiler/i386/ag386bin.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Peter Vreman
+    Copyright (c) 1998-2000 by Peter Vreman
 
     This unit implements an binary assembler output class
 
@@ -22,7 +22,7 @@
 }
 unit ag386bin;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 {$define MULTIPASS}
 
@@ -1034,8 +1034,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.9  2002-05-14 19:34:52  peter
-    * removed old logs and updated copyright year
+  Revision 1.10  2002-05-16 19:46:50  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.8  2002/04/15 19:12:10  carl
   + target_info.size_of_pointer -> pointer_size
@@ -1045,4 +1048,55 @@ end.
   + att_Reg2str -> gas_reg2str
   + int_reg2str -> std_reg2str
 
+  Revision 1.7  2001/04/13 01:22:17  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.6  2001/03/11 22:58:51  peter
+    * getsym redesign, removed the globals srsym,srsymtable
+
+  Revision 1.5  2001/03/05 21:39:11  peter
+    * changed to class with common TAssembler also for internal assembler
+
+  Revision 1.4  2000/12/25 00:07:31  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.3  2000/12/23 19:59:35  peter
+    * object to class for ow/og objects
+    * split objectdata from objectoutput
+
+  Revision 1.2  2000/12/12 19:50:21  peter
+    * clear usedasmsymbol at exit of writetree
+
+  Revision 1.1  2000/11/30 22:18:48  florian
+    * moved to i386
+
+  Revision 1.9  2000/11/12 22:20:37  peter
+    * create generic toutputsection for binary writers
+
+  Revision 1.8  2000/09/24 15:06:10  peter
+    * use defines.inc
+
+  Revision 1.7  2000/08/27 16:11:49  peter
+    * moved some util functions from globals,cobjects to cutils
+    * splitted files into finput,fmodule
+
+  Revision 1.6  2000/08/12 15:34:22  peter
+    + usedasmsymbollist to check and reset only the used symbols (merged)
+
+  Revision 1.5  2000/08/08 19:28:57  peter
+    * memdebug/memory patches (merged)
+    * only once illegal directive (merged)
+
+  Revision 1.4  2000/08/04 22:00:50  peter
+    * merges from fixes
+
+  Revision 1.3  2000/07/13 12:08:24  michael
+  + patched to 1.1.0 with former 1.09patch from peter
+
+  Revision 1.2  2000/07/13 11:32:29  michael
+  + removed logs
+
 }

+ 72 - 4
compiler/i386/ag386int.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Florian Klaempfl
+    Copyright (c) 1998-2000 by Florian Klaempfl
 
     This unit implements an asmoutput class for Intel syntax with Intel i386+
 
@@ -22,7 +22,7 @@
 }
 unit ag386int;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -824,8 +824,11 @@ initialization
 end.
 {
   $Log$
-  Revision 1.19  2002-05-14 19:34:53  peter
-    * removed old logs and updated copyright year
+  Revision 1.20  2002-05-16 19:46:50  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.18  2002/05/12 16:53:16  peter
     * moved entry and exitcode to ncgutil and cgobj
@@ -867,4 +870,69 @@ end.
       with string operations
     * adapted some routines to use the new cg methods
 
+  Revision 1.14  2001/06/18 20:36:25  peter
+    * -Ur switch (merged)
+    * masm fixes (merged)
+    * quoted filenames for go32v2 and win32
+
+  Revision 1.13  2001/05/06 17:13:23  jonas
+    * completed incomplete typed constant records
+
+  Revision 1.12  2001/04/21 15:33:03  peter
+    * stupid bug, finalization to initialization renaming
+
+  Revision 1.11  2001/04/21 12:09:00  peter
+    * fixed bug 1472 (merged)
+
+  Revision 1.10  2001/04/18 22:02:00  peter
+    * registration of targets and assemblers
+
+  Revision 1.9  2001/04/13 01:22:17  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.8  2001/03/25 12:30:17  peter
+    * masm -al fix (merged)
+
+  Revision 1.7  2001/03/05 21:39:11  peter
+    * changed to class with common TAssembler also for internal assembler
+
+  Revision 1.6  2001/02/20 21:36:39  peter
+    * tasm/masm fixes merged
+
+  Revision 1.5  2001/01/13 20:24:24  peter
+    * fixed operand order that got mixed up for external writers after
+      my previous assembler block valid instruction check
+
+  Revision 1.4  2000/12/25 00:07:31  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.3  2000/12/18 21:56:52  peter
+    * extdebug fixes
+
+  Revision 1.2  2000/11/29 00:30:43  florian
+    * unused units removed from uses clause
+    * some changes for widestrings
+
+  Revision 1.1  2000/10/15 09:47:42  peter
+    * moved to i386/
+
+  Revision 1.6  2000/09/24 15:06:10  peter
+    * use defines.inc
+
+  Revision 1.5  2000/08/27 16:11:49  peter
+    * moved some util functions from globals,cobjects to cutils
+    * splitted files into finput,fmodule
+
+  Revision 1.4  2000/08/20 17:38:21  peter
+    * smartlinking fixed for linux (merged)
+
+  Revision 1.3  2000/07/13 12:08:24  michael
+  + patched to 1.1.0 with former 1.09patch from peter
+
+  Revision 1.2  2000/07/13 11:32:30  michael
+  + removed logs
+
 }

+ 67 - 4
compiler/i386/ag386nsm.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Florian Klaempfl
+    Copyright (c) 1998-2000 by Florian Klaempfl
 
     This unit implements an asmoutput class for the Nasm assembler with
     Intel syntax for the i386+
@@ -23,7 +23,7 @@
 }
 unit ag386nsm;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -898,8 +898,11 @@ initialization
 end.
 {
   $Log$
-  Revision 1.18  2002-05-14 19:34:54  peter
-    * removed old logs and updated copyright year
+  Revision 1.19  2002-05-16 19:46:50  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.17  2002/05/12 16:53:16  peter
     * moved entry and exitcode to ncgutil and cgobj
@@ -943,4 +946,64 @@ end.
       with string operations
     * adapted some routines to use the new cg methods
 
+  Revision 1.12  2001/12/29 15:29:58  jonas
+    * powerpc/cgcpu.pas compiles :)
+    * several powerpc-related fixes
+    * cpuasm unit is now based on common tainst unit
+    + nppcmat unit for powerpc (almost complete)
+
+  Revision 1.11  2001/05/06 17:13:23  jonas
+    * completed incomplete typed constant records
+
+  Revision 1.10  2001/04/21 15:33:03  peter
+    * stupid bug, finalization to initialization renaming
+
+  Revision 1.9  2001/04/21 12:09:00  peter
+    * fixed bug 1472 (merged)
+
+  Revision 1.8  2001/04/18 22:02:00  peter
+    * registration of targets and assemblers
+
+  Revision 1.7  2001/04/13 01:22:17  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.6  2001/03/05 21:39:11  peter
+    * changed to class with common TAssembler also for internal assembler
+
+  Revision 1.5  2001/02/20 21:36:39  peter
+    * tasm/masm fixes merged
+
+  Revision 1.4  2001/01/13 20:24:24  peter
+    * fixed operand order that got mixed up for external writers after
+      my previous assembler block valid instruction check
+
+  Revision 1.3  2000/12/25 00:07:31  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.2  2000/11/29 00:30:43  florian
+    * unused units removed from uses clause
+    * some changes for widestrings
+
+  Revision 1.1  2000/10/15 09:47:42  peter
+    * moved to i386/
+
+  Revision 1.6  2000/09/24 15:06:11  peter
+    * use defines.inc
+
+  Revision 1.5  2000/08/27 16:11:49  peter
+    * moved some util functions from globals,cobjects to cutils
+    * splitted files into finput,fmodule
+
+  Revision 1.4  2000/08/20 17:38:21  peter
+    * smartlinking fixed for linux (merged)
+
+  Revision 1.3  2000/07/13 12:08:24  michael
+  + patched to 1.1.0 with former 1.09patch from peter
+
+  Revision 1.2  2000/07/13 11:32:30  michael
+  + removed logs
+
 }

+ 40 - 4
compiler/i386/aopt386.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Jonas Maebe
+    Copyright (c) 1998-2000 by Jonas Maebe
 
     This unit calls the optimization procedures to optimize the assembler
     code for i386+
@@ -23,7 +23,7 @@
 }
 Unit aopt386;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 Interface
 
@@ -118,7 +118,43 @@ End;
 End.
 {
   $Log$
-  Revision 1.4  2002-05-14 19:34:55  peter
-    * removed old logs and updated copyright year
+  Revision 1.5  2002-05-16 19:46:50  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
+
+  Revision 1.3  2000/12/25 00:07:31  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.2  2000/10/24 10:40:53  jonas
+    + register renaming ("fixes" bug1088)
+    * changed command line options meanings for optimizer:
+        O2 now means peepholopts, CSE and register renaming in 1 pass
+        O3 is the same, but repeated until no further optimizations are
+          possible or until 5 passes have been done (to avoid endless loops)
+    * changed aopt386 so it does this looping
+    * added some procedures from csopt386 to the interface because they're
+      used by rropt386 as well
+    * some changes to csopt386 and daopt386 so that newly added instructions
+      by the CSE get optimizer info (they were simply skipped previously),
+      this fixes some bugs
+
+  Revision 1.1  2000/10/15 09:47:42  peter
+    * moved to i386/
+
+  Revision 1.5  2000/09/24 15:06:11  peter
+    * use defines.inc
+
+  Revision 1.4  2000/08/19 09:10:08  jonas
+    * for all optimization levels > 1, all passes are done twice (the
+      result improves the most if -Or is used as well)
+
+  Revision 1.3  2000/07/14 05:11:48  michael
+  + Patch to 1.1
+
+  Revision 1.2  2000/07/13 11:32:31  michael
+  + removed logs
 
 }

+ 231 - 4
compiler/i386/cga.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Florian Klaempfl
+    Copyright (c) 1998-2000 by Florian Klaempfl
 
     Helper routines for the i386 code generator
 
@@ -23,7 +23,7 @@
 
 unit cga;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -174,8 +174,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.30  2002-05-14 19:34:55  peter
-    * removed old logs and updated copyright year
+  Revision 1.31  2002-05-16 19:46:50  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.29  2002/05/13 19:54:37  peter
     * removed n386ld and n386util units
@@ -278,4 +281,228 @@ end.
   Revision 1.14  2002/01/19 14:21:17  peter
     * fixed init/final for value parameters
 
+  Revision 1.13  2001/12/30 17:24:45  jonas
+    * range checking is now processor independent (part in cgobj,
+      part in cg64f32) and should work correctly again (it needed
+      some changes after the changes of the low and high of
+      tordef's to int64)
+    * maketojumpbool() is now processor independent (in ncgutil)
+    * getregister32 is now called getregisterint
+
+  Revision 1.12  2001/12/29 15:28:58  jonas
+    * powerpc/cgcpu.pas compiles :)
+    * several powerpc-related fixes
+    * cpuasm unit is now based on common tainst unit
+    + nppcmat unit for powerpc (almost complete)
+
+  Revision 1.11  2001/11/18 18:59:59  peter
+    * changed aktprocsym to aktprocdef for stabs generation
+
+  Revision 1.10  2001/11/06 16:39:02  jonas
+    * moved call to "cleanup_regvars" to cga.pas for i386 because it has
+      to insert "fstp %st0" instructions after the exit label
+
+  Revision 1.9  2001/11/02 22:58:09  peter
+    * procsym definition rewrite
+
+  Revision 1.8  2001/10/25 21:22:41  peter
+    * calling convention rewrite
+
+  Revision 1.7  2001/10/20 17:22:57  peter
+    * concatcopy could release a wrong reference because the offset was
+      increased without restoring the original before the release of
+      a temp
+
+  Revision 1.6  2001/10/14 11:49:51  jonas
+    * finetuned register allocation info for assignments
+
+  Revision 1.5  2001/09/30 21:28:34  peter
+    * int64->boolean fixed
+
+  Revision 1.4  2001/08/30 20:13:57  peter
+    * rtti/init table updates
+    * rttisym for reusable global rtti/init info
+    * support published for interfaces
+
+  Revision 1.3  2001/08/29 12:01:47  jonas
+    + support for int64 LOC_REGISTERS in remove_non_regvars_from_loc
+
+  Revision 1.2  2001/08/26 13:36:52  florian
+    * some cg reorganisation
+    * some PPC updates
+
+  Revision 1.29  2001/08/12 20:23:02  peter
+    * netbsd doesn't use stackchecking
+
+  Revision 1.28  2001/08/07 18:47:13  peter
+    * merged netbsd start
+    * profile for win32
+
+  Revision 1.27  2001/08/06 21:40:49  peter
+    * funcret moved from tprocinfo to tprocdef
+
+  Revision 1.26  2001/07/30 20:59:28  peter
+    * m68k updates from v10 merged
+
+  Revision 1.25  2001/07/01 20:16:18  peter
+    * alignmentinfo record added
+    * -Oa argument supports more alignment settings that can be specified
+      per type: PROC,LOOP,VARMIN,VARMAX,CONSTMIN,CONSTMAX,RECORDMIN
+      RECORDMAX,LOCALMIN,LOCALMAX. It is possible to set the mimimum
+      required alignment and the maximum usefull alignment. The final
+      alignment will be choosen per variable size dependent on these
+      settings
+
+  Revision 1.24  2001/05/27 14:30:55  florian
+    + some widestring stuff added
+
+  Revision 1.23  2001/04/21 13:33:16  peter
+    * move winstackpagesize const to cgai386 to remove uses t_win32
+
+  Revision 1.22  2001/04/21 12:05:32  peter
+    * add nop after popa (merged)
+
+  Revision 1.21  2001/04/18 22:02:00  peter
+    * registration of targets and assemblers
+
+  Revision 1.20  2001/04/13 01:22:17  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.19  2001/04/05 21:33:07  peter
+    * fast exit fix merged
+
+  Revision 1.18  2001/04/02 21:20:35  peter
+    * resulttype rewrite
+
+  Revision 1.17  2001/01/05 17:36:58  florian
+  * the info about exception frames is stored now on the stack
+  instead on the heap
+
+  Revision 1.16  2000/12/25 00:07:31  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.15  2000/12/05 11:44:32  jonas
+    + new integer regvar handling, should be much more efficient
+
+  Revision 1.14  2000/11/29 00:30:43  florian
+    * unused units removed from uses clause
+    * some changes for widestrings
+
+  Revision 1.13  2000/11/28 00:28:07  pierre
+   * stabs fixing
+
+  Revision 1.12  2000/11/22 15:12:06  jonas
+    * fixed inline-related problems (partially "merges")
+
+  Revision 1.11  2000/11/17 10:30:24  florian
+    * passing interfaces as parameters fixed
+
+  Revision 1.10  2000/11/07 23:40:48  florian
+    + AfterConstruction and BeforeDestruction impemented
+
+  Revision 1.9  2000/11/06 23:49:20  florian
+    * fixed init_paras call
+
+  Revision 1.8  2000/11/06 23:15:01  peter
+    * added copyvaluepara call again
+
+  Revision 1.7  2000/11/04 14:25:23  florian
+    + merged Attila's changes for interfaces, not tested yet
+
+  Revision 1.6  2000/10/31 22:02:55  peter
+    * symtable splitted, no real code changes
+
+  Revision 1.5  2000/10/24 22:23:04  peter
+    * emitcall -> emitinsertcall for profiling (merged)
+
+  Revision 1.4  2000/10/24 12:47:45  jonas
+    * allocate registers which hold function result
+
+  Revision 1.3  2000/10/24 08:54:25  michael
+  + Extra patch from peter
+
+  Revision 1.2  2000/10/24 07:20:03  pierre
+   * fix for bug 1193 (merged)
+
+  Revision 1.1  2000/10/15 09:47:42  peter
+    * moved to i386/
+
+  Revision 1.19  2000/10/14 10:14:46  peter
+    * moehrendorf oct 2000 rewrite
+
+  Revision 1.18  2000/10/10 14:55:28  jonas
+    * added missing regallocs for edi in emit_mov_ref_reg64 (merged)
+
+  Revision 1.17  2000/10/01 19:48:23  peter
+    * lot of compile updates for cg11
+
+  Revision 1.16  2000/09/30 16:08:45  peter
+    * more cg11 updates
+
+  Revision 1.15  2000/09/24 15:06:12  peter
+    * use defines.inc
+
+  Revision 1.14  2000/09/16 12:22:52  peter
+    * freebsd support merged
+
+  Revision 1.13  2000/08/27 16:11:49  peter
+    * moved some util functions from globals,cobjects to cutils
+    * splitted files into finput,fmodule
+
+  Revision 1.12  2000/08/24 19:07:54  peter
+    * don't initialize if localvarsym is set because that varsym will
+      already be initialized
+    * first initialize local data before copy of value para's (merged)
+
+  Revision 1.11  2000/08/19 20:09:33  peter
+    * check size after checking openarray in push_value_para (merged)
+
+  Revision 1.10  2000/08/16 13:06:06  florian
+    + support of 64 bit integer constants
+
+  Revision 1.9  2000/08/10 18:42:03  peter
+    * fixed for constants in emit_push_mem_size for go32v2 (merged)
+
+  Revision 1.8  2000/08/07 11:29:40  jonas
+    + emit_push_mem_size() which pushes a value in memory of a certain size
+    * pushsetelement() and pushvaluepara() use this new procedure, because
+      otherwise they could sometimes try to push data past the end of the
+      heap, causing a crash
+     (merged from fixes branch)
+
+  Revision 1.7  2000/08/03 13:17:25  jonas
+    + allow regvars to be used inside inlined procs, which required  the
+      following changes:
+        + load regvars in genentrycode/free them in genexitcode (cgai386)
+        * moved all regvar related code to new regvars unit
+        + added pregvarinfo type to hcodegen
+        + added regvarinfo field to tprocinfo (symdef/symdefh)
+        * deallocate the regvars of the caller in secondprocinline before
+          inlining the called procedure and reallocate them afterwards
+
+  Revision 1.6  2000/08/02 08:05:04  jonas
+    * fixed web bug1087
+    * allocate R_ECX explicitely if it's used
+    (merged from fixes branch)
+
+  Revision 1.5  2000/07/27 09:25:05  jonas
+    * moved locflags2reg() procedure from cg386add to cgai386
+    + added locjump2reg() procedure to cgai386
+    * fixed internalerror(2002) when the result of a case expression has
+      LOC_JUMP
+    (all merged from fixes branch)
+
+  Revision 1.4  2000/07/21 15:14:02  jonas
+    + added is_addr field for labels, if they are only used for getting the address
+       (e.g. for io checks) and corresponding getaddrlabel() procedure
+
+  Revision 1.3  2000/07/13 12:08:25  michael
+  + patched to 1.1.0 with former 1.09patch from peter
+
+  Revision 1.2  2000/07/13 11:32:37  michael
+  + removed logs
+
 }

+ 40 - 6
compiler/i386/cgcpu.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Florian Klaempfl
+    Copyright (c) 1998-2000 by Florian Klaempfl
 
     This unit implements the code generator for the i386
 
@@ -23,7 +23,7 @@
 
 unit cgcpu;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
   interface
 
@@ -1623,7 +1623,6 @@ unit cgcpu;
          end;
       end;
 
-
     procedure tcg386.g_call_constructor_helper(list : taasmoutput);
       begin
         if is_class(procinfo^._class) then
@@ -1643,7 +1642,6 @@ unit cgcpu;
           internalerror(200006161);
       end;
 
-
     procedure tcg386.g_call_destructor_helper(list : taasmoutput);
       var
         nofinal : tasmlabel;
@@ -1780,8 +1778,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.18  2002-05-14 19:34:58  peter
-    * removed old logs and updated copyright year
+  Revision 1.19  2002-05-16 19:46:50  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.17  2002/05/13 19:54:37  peter
     * removed n386ld and n386util units
@@ -1861,4 +1862,37 @@ end.
   Revision 1.7  2002/03/04 19:10:12  peter
     * removed compiler warnings
 
+  Revision 1.6  2001/12/30 17:24:46  jonas
+    * range checking is now processor independent (part in cgobj,
+      part in cg64f32) and should work correctly again (it needed
+      some changes after the changes of the low and high of
+      tordef's to int64)
+    * maketojumpbool() is now processor independent (in ncgutil)
+    * getregister32 is now called getregisterint
+
+  Revision 1.5  2001/12/29 15:29:59  jonas
+    * powerpc/cgcpu.pas compiles :)
+    * several powerpc-related fixes
+    * cpuasm unit is now based on common tainst unit
+    + nppcmat unit for powerpc (almost complete)
+
+  Revision 1.4  2001/10/04 14:33:28  jonas
+    * fixed range check errors
+
+  Revision 1.3  2001/09/30 16:17:18  jonas
+    * made most constant and mem handling processor independent
+
+  Revision 1.2  2001/09/29 21:32:19  jonas
+    * fixed bug in a_load_reg_reg + implemented a_call
+
+  Revision 1.1  2001/09/28 20:39:33  jonas
+    * changed all flow control structures (except for exception handling
+      related things) to processor independent code (in new ncgflw unit)
+    + generic cgobj unit which contains lots of code generator helpers with
+      global "cg" class instance variable
+    + cgcpu unit for i386 (implements processor specific routines of the above
+      unit)
+    * updated cgbase and cpubase for the new code generator units
+    * include ncgflw unit in cpunode unit
+
 }

+ 100 - 165
compiler/i386/cpuasm.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Florian Klaempfl and Peter Vreman
+    Copyright (c) 1998-2000 by Florian Klaempfl and Peter Vreman
 
     Contains the assembler object for the i386
 
@@ -26,7 +26,16 @@
 }
 unit cpuasm;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
+
+{ Optimize addressing and skip already passed nodes }
+{$ifndef NASMDEBUG}
+  {$define OPTEA}
+  {$define PASS2FLAG}
+{$endif ndef NASMDEBUG}
+
+{ Give warnings when an immediate is found in the reference struct }
+{.$define REF_IMMEDIATE_WARN}
 
 interface
 
@@ -42,121 +51,6 @@ const
                               Instruction table
 *****************************************************************************}
 
-const
-{ Operand types }
-  OT_NONE      = $00000000;
-
-  OT_BITS8     = $00000001;  { size, and other attributes, of the operand  }
-  OT_BITS16    = $00000002;
-  OT_BITS32    = $00000004;
-  OT_BITS64    = $00000008;  { FPU only  }
-  OT_BITS80    = $00000010;
-  OT_FAR       = $00000020;  { this means 16:16 or 16:32, like in CALL/JMP }
-  OT_NEAR      = $00000040;
-  OT_SHORT     = $00000080;
-
-  OT_SIZE_MASK = $000000FF;  { all the size attributes  }
-  OT_NON_SIZE  = longint(not OT_SIZE_MASK);
-
-  OT_SIGNED    = $00000100;  { the operand need to be signed -128-127 }
-
-  OT_TO        = $00000200;  { operand is followed by a colon  }
-                             { reverse effect in FADD, FSUB &c  }
-  OT_COLON     = $00000400;
-
-  OT_REGISTER  = $00001000;
-  OT_IMMEDIATE = $00002000;
-  OT_IMM8      = $00002001;
-  OT_IMM16     = $00002002;
-  OT_IMM32     = $00002004;
-  OT_IMM64     = $00002008;
-  OT_IMM80     = $00002010;
-  OT_REGMEM    = $00200000;  { for r/m, ie EA, operands  }
-  OT_REGNORM   = $00201000;  { 'normal' reg, qualifies as EA  }
-  OT_REG8      = $00201001;
-  OT_REG16     = $00201002;
-  OT_REG32     = $00201004;
-  OT_MMXREG    = $00201008;  { MMX registers  }
-  OT_XMMREG    = $00201010;  { Katmai registers  }
-  OT_MEMORY    = $00204000;  { register number in 'basereg'  }
-  OT_MEM8      = $00204001;
-  OT_MEM16     = $00204002;
-  OT_MEM32     = $00204004;
-  OT_MEM64     = $00204008;
-  OT_MEM80     = $00204010;
-  OT_FPUREG    = $01000000;  { floating point stack registers  }
-  OT_FPU0      = $01000800;  { FPU stack register zero  }
-  OT_REG_SMASK = $00070000;  { special register operands: these may be treated differently  }
-                             { a mask for the following  }
-  OT_REG_ACCUM = $00211000;  { accumulator: AL, AX or EAX  }
-  OT_REG_AL    = $00211001;    { REG_ACCUM | BITSxx  }
-  OT_REG_AX    = $00211002;    { ditto  }
-  OT_REG_EAX   = $00211004;    { and again  }
-  OT_REG_COUNT = $00221000;  { counter: CL, CX or ECX  }
-  OT_REG_CL    = $00221001;    { REG_COUNT | BITSxx  }
-  OT_REG_CX    = $00221002;    { ditto  }
-  OT_REG_ECX   = $00221004;    { another one  }
-  OT_REG_DX    = $00241002;
-
-  OT_REG_SREG  = $00081002;  { any segment register  }
-  OT_REG_CS    = $01081002;  { CS  }
-  OT_REG_DESS  = $02081002;  { DS, ES, SS (non-CS 86 registers)  }
-  OT_REG_FSGS  = $04081002;  { FS, GS (386 extended registers)  }
-
-  OT_REG_CDT   = $00101004;  { CRn, DRn and TRn  }
-  OT_REG_CREG  = $08101004;  { CRn  }
-  OT_REG_CR4   = $08101404;  { CR4 (Pentium only)  }
-  OT_REG_DREG  = $10101004;  { DRn  }
-  OT_REG_TREG  = $20101004;  { TRn  }
-
-  OT_MEM_OFFS  = $00604000;  { special type of EA  }
-                             { simple [address] offset  }
-  OT_ONENESS   = $00800000;  { special type of immediate operand  }
-                             { so UNITY == IMMEDIATE | ONENESS  }
-  OT_UNITY     = $00802000;  { for shift/rotate instructions  }
-
-{Instruction flags }
-  IF_NONE   = $00000000;
-  IF_SM     = $00000001;        { size match first two operands  }
-  IF_SM2    = $00000002;
-  IF_SB     = $00000004;  { unsized operands can't be non-byte  }
-  IF_SW     = $00000008;  { unsized operands can't be non-word  }
-  IF_SD     = $00000010;  { unsized operands can't be nondword  }
-  IF_AR0    = $00000020;  { SB, SW, SD applies to argument 0  }
-  IF_AR1    = $00000040;  { SB, SW, SD applies to argument 1  }
-  IF_AR2    = $00000060;  { SB, SW, SD applies to argument 2  }
-  IF_ARMASK = $00000060;  { mask for unsized argument spec  }
-  IF_PRIV   = $00000100;  { it's a privileged instruction  }
-  IF_SMM    = $00000200;  { it's only valid in SMM  }
-  IF_PROT   = $00000400;  { it's protected mode only  }
-  IF_UNDOC  = $00001000;  { it's an undocumented instruction  }
-  IF_FPU    = $00002000;  { it's an FPU instruction  }
-  IF_MMX    = $00004000;  { it's an MMX instruction  }
-  IF_3DNOW  = $00008000;  { it's a 3DNow! instruction  }
-  IF_SSE    = $00010000;  { it's a SSE (KNI, MMX2) instruction  }
-  IF_PMASK  =
-     longint($FF000000);  { the mask for processor types  }
-  IF_PFMASK =
-     longint($F001FF00);  { the mask for disassembly "prefer"  }
-  IF_8086   = $00000000;  { 8086 instruction  }
-  IF_186    = $01000000;  { 186+ instruction  }
-  IF_286    = $02000000;  { 286+ instruction  }
-  IF_386    = $03000000;  { 386+ instruction  }
-  IF_486    = $04000000;  { 486+ instruction  }
-  IF_PENT   = $05000000;  { Pentium instruction  }
-  IF_P6     = $06000000;  { P6 instruction  }
-  IF_KATMAI = $07000000;  { Katmai instructions  }
-  IF_CYRIX  = $10000000;  { Cyrix-specific instruction  }
-  IF_AMD    = $20000000;  { AMD-specific instruction  }
-  { added flags }
-  IF_PRE    = $40000000;  { it's a prefix instruction }
-  IF_PASS2  =
-     longint($80000000);  { if the instruction can change in a second pass }
-
-  { Size of the instruction table converted by nasmconv.pas }
-  instabentries = {$i i386nop.inc}
-  maxinfolen    = 8;
-
 type
   tinsentry=packed record
     opcode  : tasmop;
@@ -185,10 +79,10 @@ type
      reg       : tregister;
      constructor create(b:byte);
      constructor create_op(b: byte; _op: byte);
-     function getfillbuf:pchar;override;
+     function getfillbuf:pchar;
   end;
 
-  taicpu = class(taicpu_abstract)
+  taicpu = class(tainstruction)
      opsize    : topsize;
      constructor op_none(op : tasmop;_size : topsize);
 
@@ -265,44 +159,6 @@ uses
   ogbase,
   ag386att;
 
-const
-  { Intel style operands ! }
-  opsize_2_type:array[0..2,topsize] of longint=(
-    (OT_NONE,
-     OT_BITS8,OT_BITS16,OT_BITS32,OT_BITS16,OT_BITS32,OT_BITS32,
-     OT_BITS16,OT_BITS32,OT_BITS64,
-     OT_BITS32,OT_BITS64,OT_BITS80,OT_BITS64,OT_BITS64,OT_BITS64,
-     OT_NEAR,OT_FAR,OT_SHORT
-    ),
-    (OT_NONE,
-     OT_BITS8,OT_BITS16,OT_BITS32,OT_BITS8,OT_BITS8,OT_BITS16,
-     OT_BITS16,OT_BITS32,OT_BITS64,
-     OT_BITS32,OT_BITS64,OT_BITS80,OT_BITS64,OT_BITS64,OT_BITS64,
-     OT_NEAR,OT_FAR,OT_SHORT
-    ),
-    (OT_NONE,
-     OT_BITS8,OT_BITS16,OT_BITS32,OT_NONE,OT_NONE,OT_NONE,
-     OT_BITS16,OT_BITS32,OT_BITS64,
-     OT_BITS32,OT_BITS64,OT_BITS80,OT_BITS64,OT_BITS64,OT_BITS64,
-     OT_NEAR,OT_FAR,OT_SHORT
-    )
-  );
-
-  { Convert reg to operand type }
-  reg2type : array[firstreg..lastreg] of longint = (OT_NONE,
-    OT_REG_EAX,OT_REG_ECX,OT_REG32,OT_REG32,OT_REG32,OT_REG32,OT_REG32,OT_REG32,
-    OT_REG_AX,OT_REG_CX,OT_REG_DX,OT_REG16,OT_REG16,OT_REG16,OT_REG16,OT_REG16,
-    OT_REG_AL,OT_REG_CL,OT_REG8,OT_REG8,OT_REG8,OT_REG8,OT_REG8,OT_REG8,
-    OT_REG_CS,OT_REG_DESS,OT_REG_DESS,OT_REG_DESS,OT_REG_FSGS,OT_REG_FSGS,
-    OT_FPU0,OT_FPU0,OT_FPUREG,OT_FPUREG,OT_FPUREG,OT_FPUREG,OT_FPUREG,OT_FPUREG,OT_FPUREG,
-    OT_REG_DREG,OT_REG_DREG,OT_REG_DREG,OT_REG_DREG,OT_REG_DREG,OT_REG_DREG,
-    OT_REG_CREG,OT_REG_CREG,OT_REG_CREG,OT_REG_CR4,
-    OT_REG_TREG,OT_REG_TREG,OT_REG_TREG,OT_REG_TREG,OT_REG_TREG,
-    OT_MMXREG,OT_MMXREG,OT_MMXREG,OT_MMXREG,OT_MMXREG,OT_MMXREG,OT_MMXREG,OT_MMXREG,
-    OT_XMMREG,OT_XMMREG,OT_XMMREG,OT_XMMREG,OT_XMMREG,OT_XMMREG,OT_XMMREG,OT_XMMREG
-  );
-
-
 {****************************************************************************
                               TAI_ALIGN
  ****************************************************************************}
@@ -1807,14 +1663,11 @@ end;
 end.
 {
   $Log$
-  Revision 1.23  2002-05-14 19:34:58  peter
-    * removed old logs and updated copyright year
-
-  Revision 1.22  2002/05/14 17:28:09  peter
-    * synchronized cpubase between powerpc and i386
-    * moved more tables from cpubase to cpuasm
-    * tai_align_abstract moved to tainst, cpuasm must define
-      the tai_align class now, which may be empty
+  Revision 1.24  2002-05-16 19:46:50  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.21  2002/05/12 16:53:16  peter
     * moved entry and exitcode to ncgutil and cgobj
@@ -1860,4 +1713,86 @@ end.
       with string operations
     * adapted some routines to use the new cg methods
 
+  Revision 1.17  2001/12/31 16:59:43  peter
+    * protected/private symbols parsing fixed
+
+  Revision 1.16  2001/12/29 15:29:59  jonas
+    * powerpc/cgcpu.pas compiles :)
+    * several powerpc-related fixes
+    * cpuasm unit is now based on common tainst unit
+    + nppcmat unit for powerpc (almost complete)
+
+  Revision 1.15  2001/04/21 12:13:15  peter
+    * restore correct pass2 handling bug 1425 (merged)
+
+  Revision 1.14  2001/04/13 01:22:18  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.13  2001/04/05 21:33:45  peter
+    * movd and opsize fix merged
+
+  Revision 1.12  2001/03/25 12:29:45  peter
+    * offset_fixup fixes (merged)
+
+  Revision 1.11  2001/02/20 21:51:36  peter
+    * fpu fixes (merged)
+
+  Revision 1.10  2001/01/13 20:24:24  peter
+    * fixed operand order that got mixed up for external writers after
+      my previous assembler block valid instruction check
+
+  Revision 1.9  2001/01/12 19:18:42  peter
+    * check for valid asm instructions
+
+  Revision 1.8  2001/01/07 15:48:56  jonas
+    * references to symbols were only decreased in taicpu.done for jmps, fixed
+
+  Revision 1.7  2000/12/26 15:56:17  peter
+    * unrolled loops in taicpu.destroy
+
+  Revision 1.6  2000/12/25 00:07:31  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.5  2000/12/23 19:59:35  peter
+    * object to class for ow/og objects
+    * split objectdata from objectoutput
+
+  Revision 1.4  2000/12/07 17:19:45  jonas
+    * new constant handling: from now on, hex constants >$7fffffff are
+      parsed as unsigned constants (otherwise, $80000000 got sign extended
+      and became $ffffffff80000000), all constants in the longint range
+      become longints, all constants >$7fffffff and <=cardinal($ffffffff)
+      are cardinals and the rest are int64's.
+    * added lots of longint typecast to prevent range check errors in the
+      compiler and rtl
+    * type casts of symbolic ordinal constants are now preserved
+    * fixed bug where the original resulttype wasn't restored correctly
+      after doing a 64bit rangecheck
+
+  Revision 1.3  2000/11/12 22:20:37  peter
+    * create generic toutputsection for binary writers
+
+  Revision 1.2  2000/10/15 10:50:46  florian
+   * fixed xmm register access
+
+  Revision 1.1  2000/10/15 09:39:37  peter
+    * moved cpu*.pas to i386/
+    * renamed n386 to common cpunode
+
+  Revision 1.5  2000/09/24 15:06:14  peter
+    * use defines.inc
+
+  Revision 1.4  2000/08/27 16:11:50  peter
+    * moved some util functions from globals,cobjects to cutils
+    * splitted files into finput,fmodule
+
+  Revision 1.3  2000/07/13 12:08:25  michael
+  + patched to 1.1.0 with former 1.09patch from peter
+
+  Revision 1.2  2000/07/13 11:32:38  michael
+  + removed logs
+
 }

+ 582 - 307
compiler/i386/cpubase.pas

@@ -1,9 +1,13 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Florian Klaempfl and Peter Vreman
+    Copyright (c) 1998-2000 by Florian Klaempfl and Peter Vreman
 
     Contains the base types for the i386
 
+    * This code was inspired by the NASM sources
+      The Netwide Assembler is copyright (C) 1996 Simon Tatham and
+      Julian Hall. All rights reserved.
+
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
     the Free Software Foundation; either version 2 of the License, or
@@ -26,372 +30,562 @@
 }
 unit cpubase;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
 uses
   globals,cutils,cclasses,aasm,cpuinfo,cginfo;
 
+const
+{ Size of the instruction table converted by nasmconv.pas }
+  instabentries = {$i i386nop.inc}
+  maxinfolen    = 8;
+
+{ By default we want everything }
+{$define ATTOP}
+{$define INTELOP}
+{$define ITTABLE}
+
+{ We Don't need the intel style opcodes if we don't have a intel
+  reader or generator }
+{$ifdef NORA386INT}
+  {$ifdef NOAG386NSM}
+    {$ifdef NOAG386INT}
+      {$undef INTELOP}
+    {$endif}
+  {$endif}
+{$endif}
+
+{ We Don't need the AT&T style opcodes if we don't have a AT&T
+  reader or generator }
+{$ifdef NORA386ATT}
+  {$ifdef NOAG386ATT}
+    {$undef ATTOP}
+    {$ifdef NOAG386DIR}
+       {$undef ATTREG}
+    {$endif}
+  {$endif}
+{$endif}
+
+{ We need the AT&T suffix table for both asm readers and AT&T writer }
+{$define ATTSUF}
+{$ifdef NORA386INT}
+  {$ifdef NORA386ATT}
+    {$ifdef NOAG386ATT}
+      {$undef ATTSUF}
+    {$endif}
+  {$endif}
+{$endif}
+
+const
+{ Operand types }
+  OT_NONE      = $00000000;
+
+  OT_BITS8     = $00000001;  { size, and other attributes, of the operand  }
+  OT_BITS16    = $00000002;
+  OT_BITS32    = $00000004;
+  OT_BITS64    = $00000008;  { FPU only  }
+  OT_BITS80    = $00000010;
+  OT_FAR       = $00000020;  { this means 16:16 or 16:32, like in CALL/JMP }
+  OT_NEAR      = $00000040;
+  OT_SHORT     = $00000080;
+
+  OT_SIZE_MASK = $000000FF;  { all the size attributes  }
+  OT_NON_SIZE  = longint(not OT_SIZE_MASK);
+
+  OT_SIGNED    = $00000100;  { the operand need to be signed -128-127 }
+
+  OT_TO        = $00000200;  { operand is followed by a colon  }
+                             { reverse effect in FADD, FSUB &c  }
+  OT_COLON     = $00000400;
+
+  OT_REGISTER  = $00001000;
+  OT_IMMEDIATE = $00002000;
+  OT_IMM8      = $00002001;
+  OT_IMM16     = $00002002;
+  OT_IMM32     = $00002004;
+  OT_IMM64     = $00002008;
+  OT_IMM80     = $00002010;
+  OT_REGMEM    = $00200000;  { for r/m, ie EA, operands  }
+  OT_REGNORM   = $00201000;  { 'normal' reg, qualifies as EA  }
+  OT_REG8      = $00201001;
+  OT_REG16     = $00201002;
+  OT_REG32     = $00201004;
+  OT_MMXREG    = $00201008;  { MMX registers  }
+  OT_XMMREG    = $00201010;  { Katmai registers  }
+  OT_MEMORY    = $00204000;  { register number in 'basereg'  }
+  OT_MEM8      = $00204001;
+  OT_MEM16     = $00204002;
+  OT_MEM32     = $00204004;
+  OT_MEM64     = $00204008;
+  OT_MEM80     = $00204010;
+  OT_FPUREG    = $01000000;  { floating point stack registers  }
+  OT_FPU0      = $01000800;  { FPU stack register zero  }
+  OT_REG_SMASK = $00070000;  { special register operands: these may be treated differently  }
+                             { a mask for the following  }
+  OT_REG_ACCUM = $00211000;  { accumulator: AL, AX or EAX  }
+  OT_REG_AL    = $00211001;    { REG_ACCUM | BITSxx  }
+  OT_REG_AX    = $00211002;    { ditto  }
+  OT_REG_EAX   = $00211004;    { and again  }
+  OT_REG_COUNT = $00221000;  { counter: CL, CX or ECX  }
+  OT_REG_CL    = $00221001;    { REG_COUNT | BITSxx  }
+  OT_REG_CX    = $00221002;    { ditto  }
+  OT_REG_ECX   = $00221004;    { another one  }
+  OT_REG_DX    = $00241002;
+
+  OT_REG_SREG  = $00081002;  { any segment register  }
+  OT_REG_CS    = $01081002;  { CS  }
+  OT_REG_DESS  = $02081002;  { DS, ES, SS (non-CS 86 registers)  }
+  OT_REG_FSGS  = $04081002;  { FS, GS (386 extended registers)  }
+
+  OT_REG_CDT   = $00101004;  { CRn, DRn and TRn  }
+  OT_REG_CREG  = $08101004;  { CRn  }
+  OT_REG_CR4   = $08101404;  { CR4 (Pentium only)  }
+  OT_REG_DREG  = $10101004;  { DRn  }
+  OT_REG_TREG  = $20101004;  { TRn  }
+
+  OT_MEM_OFFS  = $00604000;  { special type of EA  }
+                             { simple [address] offset  }
+  OT_ONENESS   = $00800000;  { special type of immediate operand  }
+                             { so UNITY == IMMEDIATE | ONENESS  }
+  OT_UNITY     = $00802000;  { for shift/rotate instructions  }
+
+{Instruction flags }
+  IF_NONE   = $00000000;
+  IF_SM     = $00000001;        { size match first two operands  }
+  IF_SM2    = $00000002;
+  IF_SB     = $00000004;  { unsized operands can't be non-byte  }
+  IF_SW     = $00000008;  { unsized operands can't be non-word  }
+  IF_SD     = $00000010;  { unsized operands can't be nondword  }
+  IF_AR0    = $00000020;  { SB, SW, SD applies to argument 0  }
+  IF_AR1    = $00000040;  { SB, SW, SD applies to argument 1  }
+  IF_AR2    = $00000060;  { SB, SW, SD applies to argument 2  }
+  IF_ARMASK = $00000060;  { mask for unsized argument spec  }
+  IF_PRIV   = $00000100;  { it's a privileged instruction  }
+  IF_SMM    = $00000200;  { it's only valid in SMM  }
+  IF_PROT   = $00000400;  { it's protected mode only  }
+  IF_UNDOC  = $00001000;  { it's an undocumented instruction  }
+  IF_FPU    = $00002000;  { it's an FPU instruction  }
+  IF_MMX    = $00004000;  { it's an MMX instruction  }
+  IF_3DNOW  = $00008000;  { it's a 3DNow! instruction  }
+  IF_SSE    = $00010000;  { it's a SSE (KNI, MMX2) instruction  }
+  IF_PMASK  =
+     longint($FF000000);  { the mask for processor types  }
+  IF_PFMASK =
+     longint($F001FF00);  { the mask for disassembly "prefer"  }
+  IF_8086   = $00000000;  { 8086 instruction  }
+  IF_186    = $01000000;  { 186+ instruction  }
+  IF_286    = $02000000;  { 286+ instruction  }
+  IF_386    = $03000000;  { 386+ instruction  }
+  IF_486    = $04000000;  { 486+ instruction  }
+  IF_PENT   = $05000000;  { Pentium instruction  }
+  IF_P6     = $06000000;  { P6 instruction  }
+  IF_KATMAI = $07000000;  { Katmai instructions  }
+  IF_CYRIX  = $10000000;  { Cyrix-specific instruction  }
+  IF_AMD    = $20000000;  { AMD-specific instruction  }
+  { added flags }
+  IF_PRE    = $40000000;  { it's a prefix instruction }
+  IF_PASS2  =
+     longint($80000000);  { if the instruction can change in a second pass }
+
+type
+
+  TAsmOp={$i i386op.inc}
+
+  {# This should define the array of instructions as string }
+  op2strtable=array[tasmop] of string[11];
+
+Const
+
+  {# First value of opcode enumeration }
+  firstop = low(tasmop);
+  {# Last value of opcode enumeration  }
+  lastop  = high(tasmop);
+
 
 {*****************************************************************************
-                                Assembler Opcodes
+                                Operand Sizes
 *****************************************************************************}
 
-    type
-      TAsmOp={$i i386op.inc}
+type
+  topsize = (S_NO,
+    S_B,S_W,S_L,S_BW,S_BL,S_WL,
+    S_IS,S_IL,S_IQ,
+    S_FS,S_FL,S_FX,S_D,S_Q,S_FV,
+    S_NEAR,S_FAR,S_SHORT
+  );
+
+const
+  { Intel style operands ! }
+  opsize_2_type:array[0..2,topsize] of longint=(
+    (OT_NONE,
+     OT_BITS8,OT_BITS16,OT_BITS32,OT_BITS16,OT_BITS32,OT_BITS32,
+     OT_BITS16,OT_BITS32,OT_BITS64,
+     OT_BITS32,OT_BITS64,OT_BITS80,OT_BITS64,OT_BITS64,OT_BITS64,
+     OT_NEAR,OT_FAR,OT_SHORT
+    ),
+    (OT_NONE,
+     OT_BITS8,OT_BITS16,OT_BITS32,OT_BITS8,OT_BITS8,OT_BITS16,
+     OT_BITS16,OT_BITS32,OT_BITS64,
+     OT_BITS32,OT_BITS64,OT_BITS80,OT_BITS64,OT_BITS64,OT_BITS64,
+     OT_NEAR,OT_FAR,OT_SHORT
+    ),
+    (OT_NONE,
+     OT_BITS8,OT_BITS16,OT_BITS32,OT_NONE,OT_NONE,OT_NONE,
+     OT_BITS16,OT_BITS32,OT_BITS64,
+     OT_BITS32,OT_BITS64,OT_BITS80,OT_BITS64,OT_BITS64,OT_BITS64,
+     OT_NEAR,OT_FAR,OT_SHORT
+    )
+  );
 
-      {# This should define the array of instructions as string }
-      op2strtable=array[tasmop] of string[11];
 
-    Const
-      {# First value of opcode enumeration }
-      firstop = low(tasmop);
-      {# Last value of opcode enumeration  }
-      lastop  = high(tasmop);
 
 {*****************************************************************************
-                                Operand Sizes
+                                Conditions
 *****************************************************************************}
 
-    type
-      topsize = (S_NO,
-        S_B,S_W,S_L,S_BW,S_BL,S_WL,
-        S_IS,S_IL,S_IQ,
-        S_FS,S_FL,S_FX,S_D,S_Q,S_FV,
-        S_NEAR,S_FAR,S_SHORT
-      );
+type
+  TAsmCond=(C_None,
+    C_A,C_AE,C_B,C_BE,C_C,C_E,C_G,C_GE,C_L,C_LE,C_NA,C_NAE,
+    C_NB,C_NBE,C_NC,C_NE,C_NG,C_NGE,C_NL,C_NLE,C_NO,C_NP,
+    C_NS,C_NZ,C_O,C_P,C_PE,C_PO,C_S,C_Z
+  );
+
+const
+  cond2str:array[TAsmCond] of string[3]=('',
+    'a','ae','b','be','c','e','g','ge','l','le','na','nae',
+    'nb','nbe','nc','ne','ng','nge','nl','nle','no','np',
+    'ns','nz','o','p','pe','po','s','z'
+  );
+  inverse_cond:array[TAsmCond] of TAsmCond=(C_None,
+    C_NA,C_NAE,C_NB,C_NBE,C_NC,C_NE,C_NG,C_NGE,C_NL,C_NLE,C_A,C_AE,
+    C_B,C_BE,C_C,C_E,C_G,C_GE,C_L,C_LE,C_O,C_P,
+    C_S,C_Z,C_NO,C_NP,C_NP,C_P,C_NS,C_NZ
+  );
+
 
 {*****************************************************************************
                                   Registers
 *****************************************************************************}
 
-    type
-      {# Enumeration for all possible registers for cpu. It
-        is to note that all registers of the same type
-        (for example all FPU registers), should be grouped
-        together.
-      }
-      { don't change the order }
-      { it's used by the register size conversions        }
-      tregister = (R_NO,
-        R_EAX,R_ECX,R_EDX,R_EBX,R_ESP,R_EBP,R_ESI,R_EDI,
-        R_AX,R_CX,R_DX,R_BX,R_SP,R_BP,R_SI,R_DI,
-        R_AL,R_CL,R_DL,R_BL,R_AH,R_CH,R_BH,R_DH,
-        R_CS,R_DS,R_ES,R_SS,R_FS,R_GS,
-        R_ST,R_ST0,R_ST1,R_ST2,R_ST3,R_ST4,R_ST5,R_ST6,R_ST7,
-        R_DR0,R_DR1,R_DR2,R_DR3,R_DR6,R_DR7,
-        R_CR0,R_CR2,R_CR3,R_CR4,
-        R_TR3,R_TR4,R_TR5,R_TR6,R_TR7,
-        R_MM0,R_MM1,R_MM2,R_MM3,R_MM4,R_MM5,R_MM6,R_MM7,
-        R_XMM0,R_XMM1,R_XMM2,R_XMM3,R_XMM4,R_XMM5,R_XMM6,R_XMM7
-      );
-
-      {# Set type definition for registers }
-      tregisterset = set of tregister;
-
-      {# Type definition for the array of string of register nnames }
-      reg2strtable = array[tregister] of string[6];
+type
+  {# Enumeration for all possible registers for cpu. It
+    is to note that all registers of the same type
+    (for example all FPU registers), should be grouped
+    together.
+  }
+  { don't change the order }
+  { it's used by the register size conversions        }
+  tregister = (R_NO,
+    R_EAX,R_ECX,R_EDX,R_EBX,R_ESP,R_EBP,R_ESI,R_EDI,
+    R_AX,R_CX,R_DX,R_BX,R_SP,R_BP,R_SI,R_DI,
+    R_AL,R_CL,R_DL,R_BL,R_AH,R_CH,R_BH,R_DH,
+    R_CS,R_DS,R_ES,R_SS,R_FS,R_GS,
+    R_ST,R_ST0,R_ST1,R_ST2,R_ST3,R_ST4,R_ST5,R_ST6,R_ST7,
+    R_DR0,R_DR1,R_DR2,R_DR3,R_DR6,R_DR7,
+    R_CR0,R_CR2,R_CR3,R_CR4,
+    R_TR3,R_TR4,R_TR5,R_TR6,R_TR7,
+    R_MM0,R_MM1,R_MM2,R_MM3,R_MM4,R_MM5,R_MM6,R_MM7,
+    R_XMM0,R_XMM1,R_XMM2,R_XMM3,R_XMM4,R_XMM5,R_XMM6,R_XMM7
+  );
+
+  {# Set type definition for registers }
+  tregisterset = set of tregister;
+
+  {# Type definition for the array of string of register nnames }
+  reg2strtable = array[tregister] of string[6];
+
+const
+  {# First register in the tregister enumeration }
+  firstreg = low(tregister);
+  {# Last register in the tregister enumeration }
+  lastreg  = high(tregister);
+
+  firstsreg = R_CS;
+  lastsreg  = R_GS;
+
+  regset8bit  : tregisterset = [R_AL..R_DH];
+  regset16bit : tregisterset = [R_AX..R_DI,R_CS..R_SS];
+  regset32bit : tregisterset = [R_EAX..R_EDI];
+
+  { Convert reg to opsize }
+  reg2opsize : array[firstreg..lastreg] of topsize = (S_NO,
+    S_L,S_L,S_L,S_L,S_L,S_L,S_L,S_L,
+    S_W,S_W,S_W,S_W,S_W,S_W,S_W,S_W,
+    S_B,S_B,S_B,S_B,S_B,S_B,S_B,S_B,
+    S_W,S_W,S_W,S_W,S_W,S_W,
+    S_FL,S_FL,S_FL,S_FL,S_FL,S_FL,S_FL,S_FL,S_FL,
+    S_L,S_L,S_L,S_L,S_L,S_L,
+    S_L,S_L,S_L,S_L,
+    S_L,S_L,S_L,S_L,S_L,
+    S_D,S_D,S_D,S_D,S_D,S_D,S_D,S_D,
+    S_D,S_D,S_D,S_D,S_D,S_D,S_D,S_D
+  );
+
+  { Convert reg to operand type }
+  reg2type : array[firstreg..lastreg] of longint = (OT_NONE,
+    OT_REG_EAX,OT_REG_ECX,OT_REG32,OT_REG32,OT_REG32,OT_REG32,OT_REG32,OT_REG32,
+    OT_REG_AX,OT_REG_CX,OT_REG_DX,OT_REG16,OT_REG16,OT_REG16,OT_REG16,OT_REG16,
+    OT_REG_AL,OT_REG_CL,OT_REG8,OT_REG8,OT_REG8,OT_REG8,OT_REG8,OT_REG8,
+    OT_REG_CS,OT_REG_DESS,OT_REG_DESS,OT_REG_DESS,OT_REG_FSGS,OT_REG_FSGS,
+    OT_FPU0,OT_FPU0,OT_FPUREG,OT_FPUREG,OT_FPUREG,OT_FPUREG,OT_FPUREG,OT_FPUREG,OT_FPUREG,
+    OT_REG_DREG,OT_REG_DREG,OT_REG_DREG,OT_REG_DREG,OT_REG_DREG,OT_REG_DREG,
+    OT_REG_CREG,OT_REG_CREG,OT_REG_CREG,OT_REG_CR4,
+    OT_REG_TREG,OT_REG_TREG,OT_REG_TREG,OT_REG_TREG,OT_REG_TREG,
+    OT_MMXREG,OT_MMXREG,OT_MMXREG,OT_MMXREG,OT_MMXREG,OT_MMXREG,OT_MMXREG,OT_MMXREG,
+    OT_XMMREG,OT_XMMREG,OT_XMMREG,OT_XMMREG,OT_XMMREG,OT_XMMREG,OT_XMMREG,OT_XMMREG
+  );
+
+  {# Standard opcode string table (for each tasmop enumeration). The
+     opcode strings should conform to the names as defined by the
+     processor manufacturer.
+  }
+  std_op2str:op2strtable={$i i386int.inc}
+
+  {# Standard register table (for each tregister enumeration). The
+     register strings should conform to the the names as defined
+     by the processor manufacturer
+  }
+  std_reg2str : reg2strtable = ('',
+    'eax','ecx','edx','ebx','esp','ebp','esi','edi',
+    'ax','cx','dx','bx','sp','bp','si','di',
+    'al','cl','dl','bl','ah','ch','bh','dh',
+    'cs','ds','es','ss','fs','gs',
+    'st','st(0)','st(1)','st(2)','st(3)','st(4)','st(5)','st(6)','st(7)',
+    'dr0','dr1','dr2','dr3','dr6','dr7',
+    'cr0','cr2','cr3','cr4',
+    'tr3','tr4','tr5','tr6','tr7',
+    'mm0','mm1','mm2','mm3','mm4','mm5','mm6','mm7',
+    'xmm0','xmm1','xmm2','xmm3','xmm4','xmm5','xmm6','xmm7'
+  );
 
-    const
-      {# First register in the tregister enumeration }
-      firstreg = low(tregister);
-      {# Last register in the tregister enumeration }
-      lastreg  = high(tregister);
-
-      firstsreg = R_CS;
-      lastsreg  = R_GS;
-
-      regset8bit  : tregisterset = [R_AL..R_DH];
-      regset16bit : tregisterset = [R_AX..R_DI,R_CS..R_SS];
-      regset32bit : tregisterset = [R_EAX..R_EDI];
-
-      { Convert reg to opsize }
-      reg2opsize : array[firstreg..lastreg] of topsize = (S_NO,
-        S_L,S_L,S_L,S_L,S_L,S_L,S_L,S_L,
-        S_W,S_W,S_W,S_W,S_W,S_W,S_W,S_W,
-        S_B,S_B,S_B,S_B,S_B,S_B,S_B,S_B,
-        S_W,S_W,S_W,S_W,S_W,S_W,
-        S_FL,S_FL,S_FL,S_FL,S_FL,S_FL,S_FL,S_FL,S_FL,
-        S_L,S_L,S_L,S_L,S_L,S_L,
-        S_L,S_L,S_L,S_L,
-        S_L,S_L,S_L,S_L,S_L,
-        S_D,S_D,S_D,S_D,S_D,S_D,S_D,S_D,
-        S_D,S_D,S_D,S_D,S_D,S_D,S_D,S_D
-      );
-
-      {# Standard opcode string table (for each tasmop enumeration). The
-         opcode strings should conform to the names as defined by the
-         processor manufacturer.
-      }
-      std_op2str:op2strtable={$i i386int.inc}
-
-      {# Standard register table (for each tregister enumeration). The
-         register strings should conform to the the names as defined
-         by the processor manufacturer
-      }
-      std_reg2str : reg2strtable = ('',
-        'eax','ecx','edx','ebx','esp','ebp','esi','edi',
-        'ax','cx','dx','bx','sp','bp','si','di',
-        'al','cl','dl','bl','ah','ch','bh','dh',
-        'cs','ds','es','ss','fs','gs',
-        'st','st(0)','st(1)','st(2)','st(3)','st(4)','st(5)','st(6)','st(7)',
-        'dr0','dr1','dr2','dr3','dr6','dr7',
-        'cr0','cr2','cr3','cr4',
-        'tr3','tr4','tr5','tr6','tr7',
-        'mm0','mm1','mm2','mm3','mm4','mm5','mm6','mm7',
-        'xmm0','xmm1','xmm2','xmm3','xmm4','xmm5','xmm6','xmm7'
-      );
 
 {*****************************************************************************
-                                Conditions
+                                   Flags
 *****************************************************************************}
 
-    type
-      TAsmCond=(C_None,
-        C_A,C_AE,C_B,C_BE,C_C,C_E,C_G,C_GE,C_L,C_LE,C_NA,C_NAE,
-        C_NB,C_NBE,C_NC,C_NE,C_NG,C_NGE,C_NL,C_NLE,C_NO,C_NP,
-        C_NS,C_NZ,C_O,C_P,C_PE,C_PO,C_S,C_Z
-      );
-
-    const
-      cond2str:array[TAsmCond] of string[3]=('',
-        'a','ae','b','be','c','e','g','ge','l','le','na','nae',
-        'nb','nbe','nc','ne','ng','nge','nl','nle','no','np',
-        'ns','nz','o','p','pe','po','s','z'
-      );
-
-      inverse_cond:array[TAsmCond] of TAsmCond=(C_None,
-        C_NA,C_NAE,C_NB,C_NBE,C_NC,C_NE,C_NG,C_NGE,C_NL,C_NLE,C_A,C_AE,
-        C_B,C_BE,C_C,C_E,C_G,C_GE,C_L,C_LE,C_O,C_P,
-        C_S,C_Z,C_NO,C_NP,C_NP,C_P,C_NS,C_NZ
-      );
+type
+  TResFlags = (F_E,F_NE,F_G,F_L,F_GE,F_LE,F_C,F_NC,F_A,F_AE,F_B,F_BE);
 
 {*****************************************************************************
-                                   Flags
+                                Reference
 *****************************************************************************}
 
-    type
-      TResFlags = (F_E,F_NE,F_G,F_L,F_GE,F_LE,F_C,F_NC,F_A,F_AE,F_B,F_BE);
+type
+  trefoptions=(ref_none,ref_parafixup,ref_localfixup,ref_selffixup);
+
+type
+  { immediate/reference record }
+  poperreference = ^treference;
+  treference = packed record
+     segment,
+     base,
+     index       : tregister;
+     scalefactor : byte;
+     offset      : longint;
+     symbol      : tasmsymbol;
+     offsetfixup : longint;
+     options     : trefoptions;
+  end;
 
 {*****************************************************************************
-                                Reference
+                                Operands
 *****************************************************************************}
 
-    type
-      trefoptions=(ref_none,ref_parafixup,ref_localfixup,ref_selffixup);
-
-      { reference record }
-      preference = ^treference;
-      treference = packed record
-         segment,
-         base,
-         index       : tregister;
-         scalefactor : byte;
-         offset      : longint;
-         symbol      : tasmsymbol;
-         offsetfixup : longint;
-         options     : trefoptions;
-      end;
+       { Types of operand }
+        toptype=(top_none,top_reg,top_ref,top_const,top_symbol);
+
+        toper=record
+          ot  : longint;
+          case typ : toptype of
+           top_none   : ();
+           top_reg    : (reg:tregister);
+           top_ref    : (ref:poperreference);
+           top_const  : (val:aword);
+           top_symbol : (sym:tasmsymbol;symofs:longint);
+        end;
+
+
 
 {*****************************************************************************
-                                Operands
+                             Argument Classification
 *****************************************************************************}
 
-      { Types of operand }
-      toptype=(top_none,top_reg,top_ref,top_const,top_symbol);
-
-      toper=record
-        ot  : longint;
-        case typ : toptype of
-         top_none   : ();
-         top_reg    : (reg:tregister);
-         top_ref    : (ref:preference);
-         top_const  : (val:aword);
-         top_symbol : (sym:tasmsymbol;symofs:longint);
-      end;
 
 {*****************************************************************************
                                Generic Location
 *****************************************************************************}
 
-    type
-      TLoc=(
-        LOC_INVALID,      { added for tracking problems}
-        LOC_CONSTANT,     { constant value }
-        LOC_JUMP,         { boolean results only, jump to false or true label }
-        LOC_FLAGS,        { boolean results only, flags are set }
-        LOC_CREFERENCE,   { in memory constant value reference (cannot change) }
-        LOC_REFERENCE,    { in memory value }
-        LOC_REGISTER,     { in a processor register }
-        LOC_CREGISTER,    { Constant register which shouldn't be modified }
-        LOC_FPUREGISTER,  { FPU stack }
-        LOC_CFPUREGISTER, { if it is a FPU register variable on the fpu stack }
-        LOC_MMXREGISTER,  { MMX register }
-        LOC_CMMXREGISTER, { MMX register variable }
-        LOC_SSEREGISTER,
-        LOC_CSSEREGISTER
-      );
-
-      tlocation = packed record
-         loc  : TLoc;
-         size : TCGSize;
-         case TLoc of
-            LOC_FLAGS : (resflags : tresflags);
-            LOC_CONSTANT : (
-              case longint of
-                1 : (value : AWord);
-                2 : (valuelow, valuehigh:AWord);
-              );
-            LOC_CREFERENCE,
-            LOC_REFERENCE : (reference : treference);
-            { segment in reference at the same place as in loc_register }
-            LOC_REGISTER,LOC_CREGISTER : (
-              case longint of
-                1 : (register,segment,registerhigh : tregister);
-                { overlay a registerlow }
-                2 : (registerlow : tregister);
-              );
-            { it's only for better handling }
-            LOC_MMXREGISTER,LOC_CMMXREGISTER : (mmxreg : tregister);
-      end;
+type
+  TLoc=(
+    LOC_INVALID,      { added for tracking problems}
+    LOC_CONSTANT,     { constant value }
+    LOC_JUMP,         { boolean results only, jump to false or true label }
+    LOC_FLAGS,        { boolean results only, flags are set }
+    LOC_CREFERENCE,   { in memory constant value reference (cannot change) }
+    LOC_REFERENCE,    { in memory value }
+    LOC_REGISTER,     { in a processor register }
+    LOC_CREGISTER,    { Constant register which shouldn't be modified }
+    LOC_FPUREGISTER,  { FPU stack }
+    LOC_CFPUREGISTER, { if it is a FPU register variable on the fpu stack }
+    LOC_MMXREGISTER,  { MMX register }
+    LOC_CMMXREGISTER, { MMX register variable }
+    LOC_SSEREGISTER,
+    LOC_CSSEREGISTER
+  );
+
+  plocation = ^tlocation;
+  tlocation = packed record
+     loc  : TLoc;
+     size : TCGSize;
+     case TLoc of
+        LOC_FLAGS : (resflags : tresflags);
+        LOC_CONSTANT : (
+          case longint of
+            1 : (value : AWord);
+            2 : (valuelow, valuehigh:AWord);
+          );
+        LOC_CREFERENCE,
+        LOC_REFERENCE : (reference : treference);
+        { segment in reference at the same place as in loc_register }
+        LOC_REGISTER,LOC_CREGISTER : (
+          case longint of
+            1 : (register,segment,registerhigh : tregister);
+            { overlay a registerlow }
+            2 : (registerlow : tregister);
+          );
+        { it's only for better handling }
+        LOC_MMXREGISTER,LOC_CMMXREGISTER : (mmxreg : tregister);
+  end;
 
 {*****************************************************************************
                                  Constants
 *****************************************************************************}
 
-    const
-      max_operands = 3;
-
-      lvaluelocations = [LOC_REFERENCE,LOC_CFPUREGISTER,
-        LOC_CREGISTER,LOC_MMXREGISTER,LOC_CMMXREGISTER];
-
-      {# Constant defining possibly all registers which might require saving }
-      ALL_REGISTERS = [firstreg..lastreg];
-
-      general_registers = [R_EAX,R_EBX,R_ECX,R_EDX];
-
-      {# low and high of the available maximum width integer general purpose }
-      { registers                                                            }
-      LoGPReg = R_EAX;
-      HiGPReg = R_EDX;
-
-      {# low and high of every possible width general purpose register (same as }
-      { above on most architctures apart from the 80x86)                        }
-      LoReg = R_EAX;
-      HiReg = R_DH;
-
-      {# Table of registers which can be allocated by the code generator
-         internally, when generating the code.
-      }
-      { legend:                                                                }
-      { xxxregs = set of all possibly used registers of that type in the code  }
-      {           generator                                                    }
-      { usableregsxxx = set of all 32bit components of registers that can be   }
-      {           possible allocated to a regvar or using getregisterxxx (this }
-      {           excludes registers which can be only used for parameter      }
-      {           passing on ABI's that define this)                           }
-      { c_countusableregsxxx = amount of registers in the usableregsxxx set    }
-
-      maxintregs = 4;
-      intregs = [R_EAX..R_BL];
-      usableregsint = [R_EAX,R_EBX,R_ECX,R_EDX];
-      c_countusableregsint = 4;
-
-      maxfpuregs = 8;
-      fpuregs = [R_ST0..R_ST7];
-      usableregsfpu = [];
-      c_countusableregsfpu = 0;
-
-      mmregs = [R_MM0..R_MM7];
-      usableregsmm = [R_MM0..R_MM7];
-      c_countusableregsmm  = 8;
-
-      firstsaveintreg = R_EAX;
-      lastsaveintreg  = R_EBX;
-      firstsavefpureg = R_NO;
-      lastsavefpureg  = R_NO;
-      firstsavemmreg  = R_MM0;
-      lastsavemmreg   = R_MM7;
-
-      maxvarregs = 4;
-      varregs : array[1..maxvarregs] of tregister =
-         (R_EBX,R_EDX,R_ECX,R_EAX);
-
-      maxfpuvarregs = 8;
-
-      {# Registers which are defined as scratch and no need to save across
-         routine calls or in assembler blocks.
-      }
-      max_scratch_regs = 1;
-      scratch_regs : array[1..max_scratch_regs] of tregister = (R_EDI);
+const
+  general_registers = [R_EAX,R_EBX,R_ECX,R_EDX];
+
+  {# Table of registers which can be allocated by the code generator
+     internally, when generating the code.
+  }
+  { legend:                                                                }
+  { xxxregs = set of all possibly used registers of that type in the code  }
+  {           generator                                                    }
+  { usableregsxxx = set of all 32bit components of registers that can be   }
+  {           possible allocated to a regvar or using getregisterxxx (this }
+  {           excludes registers which can be only used for parameter      }
+  {           passing on ABI's that define this)                           }
+  { c_countusableregsxxx = amount of registers in the usableregsxxx set    }
+
+  intregs = [R_EAX..R_BL];
+  usableregsint = general_registers;
+  c_countusableregsint = 4;
+
+  fpuregs = [R_ST0..R_ST7];
+  usableregsfpu = [];
+  c_countusableregsfpu = 0;
+
+  mmregs = [R_MM0..R_MM7];
+  usableregsmm = [R_MM0..R_MM7];
+  c_countusableregsmm  = 8;
+
+  firstsaveintreg = R_EAX;
+  lastsaveintreg = R_EBX;
+  firstsavefpureg = R_NO;
+  lastsavefpureg = R_NO;
+  firstsavemmreg = R_MM0;
+  lastsavemmreg = R_MM7;
+
+  {# Constant defining possibly all registers which might require saving }
+  ALL_REGISTERS = [firstreg..lastreg];
+
+  lvaluelocations = [LOC_REFERENCE,LOC_CFPUREGISTER,
+    LOC_CREGISTER,LOC_MMXREGISTER,LOC_CMMXREGISTER];
 
 {*****************************************************************************
                           Default generic sizes
 *****************************************************************************}
-
-      {# Defines the default address size for a processor, }
-      OS_ADDR = OS_32;
-      {# the natural int size for a processor,             }
-      OS_INT = OS_32;
-      {# the maximum float size for a processor,           }
-      OS_FLOAT = OS_F80;
-      {# the size of a vector register for a processor     }
-      OS_VECTOR = OS_M64;
+   {# Defines the default address size for a processor, }
+   OS_ADDR = OS_32;
+   {# the natural int size for a processor,             }
+   OS_INT = OS_32;
+   {# the maximum float size for a processor,           }
+   OS_FLOAT = OS_F80;
+   {# the size of a vector register for a processor     }
+   OS_VECTOR = OS_M64;
 
 {*****************************************************************************
                           Generic Register names
 *****************************************************************************}
 
-      {# Stack pointer register }
-      stack_pointer_reg = R_ESP;
-      {# Frame pointer register }
-      frame_pointer_reg = R_EBP;
-      {# Self pointer register : contains the instance address of an
-         object or class. }
-      self_pointer_reg  = R_ESI;
-      {# Register for addressing absolute data in a position independant way,
-         such as in PIC code. The exact meaning is ABI specific }
-      pic_offset_reg = R_EBX;
-      {# Results are returned in this register (32-bit values) }
-      accumulator   = R_EAX;
-      {# Hi-Results are returned in this register (64-bit value high register) }
-      accumulatorhigh = R_EDX;
-      { WARNING: don't change to R_ST0!! See comments above implementation of }
-      { a_loadfpu* methods in rgcpu (JM)                                      }
-      fpuresultreg = R_ST;
-      mmresultreg = R_MM0;
+  {# Stack pointer register }
+  stack_pointer_reg = R_ESP;
+  {# Frame pointer register }
+  frame_pointer_reg = R_EBP;
+  {# Self pointer register : contains the instance address of an
+     object or class. }
+  self_pointer_reg  = R_ESI;
+  {# Register for addressing absolute data in a position independant way,
+     such as in PIC code. The exact meaning is ABI specific }
+  pic_offset_reg = R_EBX;
+  {# Results are returned in this register (32-bit values) }
+  accumulator   = R_EAX;
+  {# Hi-Results are returned in this register (64-bit value high register) }
+  accumulatorhigh = R_EDX;
+  { WARNING: don't change to R_ST0!! See comments above implementation of }
+  { a_loadfpu* methods in rgcpu (JM)                                      }
+  fpuresultreg = R_ST;
+  mmresultreg = R_MM0;
+
+  {# Registers which are defined as scratch and no need to save across
+     routine calls or in assembler blocks.
+  }
+  scratch_regs : array[1..1] of tregister = (R_EDI);
+
+
 
 {*****************************************************************************
                        GCC /ABI linking information
 *****************************************************************************}
 
-    const
-      {# Registers which must be saved when calling a routine declared as
-         cppdecl, cdecl, stdcall, safecall, palmossyscall. The registers
-         saved should be the ones as defined in the target ABI and / or GCC.
-
-         This value can be deduced from the CALLED_USED_REGISTERS array in the
-         GCC source.
-      }
-      std_saved_registers = [R_ESI,R_EDI,R_EBX];
-      {# Required parameter alignment when calling a routine declared as
-         stdcall and cdecl. The alignment value should be the one defined
-         by GCC or the target ABI.
-
-         The value of this constant is equal to the constant
-         PARM_BOUNDARY / BITS_PER_UNIT in the GCC source.
-      }
-      std_param_align = 4;
+  {# Registers which must be saved when calling a routine declared as
+     cppdecl, cdecl, stdcall, safecall, palmossyscall. The registers
+     saved should be the ones as defined in the target ABI and / or GCC.
+
+     This value can be deduced from the CALLED_USED_REGISTERS array in the
+     GCC source.
+  }
+  std_saved_registers = [R_ESI,R_EDI,R_EBX];
+  {# Required parameter alignment when calling a routine declared as
+     stdcall and cdecl. The alignment value should be the one defined
+     by GCC or the target ABI.
+
+     The value of this constant is equal to the constant
+     PARM_BOUNDARY / BITS_PER_UNIT in the GCC source.
+  }
+  std_param_align = 4;
+
+
+
 
-{*****************************************************************************
-                            CPU Dependent Constants
-*****************************************************************************}
 
 {*****************************************************************************
                                   Helpers
 *****************************************************************************}
 
+    const
+       maxvarregs = 4;
+       varregs : array[1..maxvarregs] of tregister =
+         (R_EBX,R_EDX,R_ECX,R_EAX);
+
+       maxfpuvarregs = 8;
+       max_operands = 3;
+
+       maxintregs = maxvarregs;
+       maxfpuregs = maxfpuvarregs;
+
+
     function is_calljmp(o:tasmop):boolean;
 
     function flags_to_cond(const f: TResFlags) : TAsmCond;
@@ -399,10 +593,17 @@ uses
 
 implementation
 
+{$ifdef heaptrc}
+  uses
+      ppheap;
+{$endif heaptrc}
+
+
 {*****************************************************************************
                                   Helpers
 *****************************************************************************}
 
+
     function is_calljmp(o:tasmop):boolean;
       begin
         case o of
@@ -423,6 +624,9 @@ implementation
       end;
 
 
+
+
+
     function flags_to_cond(const f: TResFlags) : TAsmCond;
       const
         flags_2_cond : array[TResFlags] of TAsmCond =
@@ -431,17 +635,15 @@ implementation
         result := flags_2_cond[f];
       end;
 
+
 end.
 {
   $Log$
-  Revision 1.21  2002-05-14 19:34:58  peter
-    * removed old logs and updated copyright year
-
-  Revision 1.20  2002/05/14 17:28:09  peter
-    * synchronized cpubase between powerpc and i386
-    * moved more tables from cpubase to cpuasm
-    * tai_align_abstract moved to tainst, cpuasm must define
-      the tai_align class now, which may be empty
+  Revision 1.22  2002-05-16 19:46:50  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.19  2002/05/12 16:53:16  peter
     * moved entry and exitcode to ncgutil and cgobj
@@ -526,4 +728,77 @@ end.
   Revision 1.10  2002/03/04 19:10:12  peter
     * removed compiler warnings
 
+  Revision 1.9  2001/12/30 17:24:46  jonas
+    * range checking is now processor independent (part in cgobj,
+      part in cg64f32) and should work correctly again (it needed
+      some changes after the changes of the low and high of
+      tordef's to int64)
+    * maketojumpbool() is now processor independent (in ncgutil)
+    * getregister32 is now called getregisterint
+
+  Revision 1.8  2001/12/29 15:29:59  jonas
+    * powerpc/cgcpu.pas compiles :)
+    * several powerpc-related fixes
+    * cpuasm unit is now based on common tainst unit
+    + nppcmat unit for powerpc (almost complete)
+
+  Revision 1.7  2001/12/06 17:57:40  florian
+    + parasym to tparaitem added
+
+  Revision 1.6  2001/09/28 20:39:33  jonas
+    * changed all flow control structures (except for exception handling
+      related things) to processor independent code (in new ncgflw unit)
+    + generic cgobj unit which contains lots of code generator helpers with
+      global "cg" class instance variable
+    + cgcpu unit for i386 (implements processor specific routines of the above
+      unit)
+    * updated cgbase and cpubase for the new code generator units
+    * include ncgflw unit in cpunode unit
+
+  Revision 1.5  2001/05/18 23:01:13  peter
+    * portable constants
+
+  Revision 1.4  2001/04/13 01:22:18  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.3  2001/02/20 21:34:04  peter
+    * iret, lret fixes
+
+  Revision 1.2  2000/12/07 17:19:45  jonas
+    * new constant handling: from now on, hex constants >$7fffffff are
+      parsed as unsigned constants (otherwise, $80000000 got sign extended
+      and became $ffffffff80000000), all constants in the longint range
+      become longints, all constants >$7fffffff and <=cardinal($ffffffff)
+      are cardinals and the rest are int64's.
+    * added lots of longint typecast to prevent range check errors in the
+      compiler and rtl
+    * type casts of symbolic ordinal constants are now preserved
+    * fixed bug where the original resulttype wasn't restored correctly
+      after doing a 64bit rangecheck
+
+  Revision 1.1  2000/10/15 09:39:37  peter
+    * moved cpu*.pas to i386/
+    * renamed n386 to common cpunode
+
+  Revision 1.7  2000/09/26 20:06:13  florian
+    * hmm, still a lot of work to get things compilable
+
+  Revision 1.6  2000/09/24 15:06:14  peter
+    * use defines.inc
+
+  Revision 1.5  2000/08/27 16:11:50  peter
+    * moved some util functions from globals,cobjects to cutils
+    * splitted files into finput,fmodule
+
+  Revision 1.4  2000/08/05 13:25:06  peter
+    * packenum 1 fixes (merged)
+
+  Revision 1.3  2000/07/14 05:11:48  michael
+  + Patch to 1.1
+
+  Revision 1.2  2000/07/13 11:32:39  michael
+  + removed logs
+
 }

+ 35 - 4
compiler/i386/cpuinfo.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Florian Klaempfl
+    Copyright (c) 1998-2000 by Florian Klaempfl
 
     Basic Processor information
 
@@ -22,7 +22,7 @@
 }
 Unit cpuinfo;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 Interface
 
@@ -51,8 +51,11 @@ Implementation
 end.
 {
   $Log$
-  Revision 1.8  2002-05-14 19:34:58  peter
-    * removed old logs and updated copyright year
+  Revision 1.9  2002-05-16 19:46:50  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.7  2002/04/20 21:37:07  carl
   + generic FPC_CHECKPOINTER
@@ -78,4 +81,32 @@ end.
       with string operations
     * adapted some routines to use the new cg methods
 
+  Revision 1.4  2001/09/02 21:18:29  peter
+    * split constsym.value in valueord,valueordptr,valueptr. The valueordptr
+      is used for holding target platform pointer values. As those can be
+      bigger than the source platform.
+
+  Revision 1.3  2001/06/03 20:21:08  peter
+    * Kylix fixes, mostly case names of units
+
+  Revision 1.2  2001/02/08 13:09:03  jonas
+    * fixed web bug 1396: tpointerord is now a cardinal instead of a longint,
+      but added a hack in ncnv so that pointer(-1) still works
+
+  Revision 1.1  2000/10/15 09:39:37  peter
+    * moved cpu*.pas to i386/
+    * renamed n386 to common cpunode
+
+  Revision 1.5  2000/09/24 15:06:14  peter
+    * use defines.inc
+
+  Revision 1.4  2000/08/16 13:06:06  florian
+    + support of 64 bit integer constants
+
+  Revision 1.3  2000/08/12 06:45:08  florian
+    + type TConstExprInt added
+
+  Revision 1.2  2000/07/13 11:32:39  michael
+  + removed logs
+
 }

+ 45 - 3
compiler/i386/cpunode.pas

@@ -22,7 +22,7 @@
 }
 unit cpunode;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
   interface
 
@@ -38,8 +38,11 @@ unit cpunode;
 end.
 {
   $Log$
-  Revision 1.11  2002-05-14 19:34:59  peter
-    * removed old logs and updated copyright year
+  Revision 1.12  2002-05-16 19:46:50  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.10  2002/05/13 19:54:37  peter
     * removed n386ld and n386util units
@@ -67,4 +70,43 @@ end.
     - list field removed of the tnode class because it's not used currently
       and can cause hard-to-find bugs
 
+  Revision 1.6  2001/09/29 21:32:47  jonas
+    * almost all second pass typeconvnode helpers are now processor independent
+    * fixed converting boolean to int64/qword
+    * fixed register allocation bugs which could cause internalerror 10
+    * isnode and asnode are completely processor indepent now as well
+    * fpc_do_as now returns its class argument (necessary to be able to use it
+      properly with compilerproc)
+
+  Revision 1.5  2001/09/28 20:39:33  jonas
+    * changed all flow control structures (except for exception handling
+      related things) to processor independent code (in new ncgflw unit)
+    + generic cgobj unit which contains lots of code generator helpers with
+      global "cg" class instance variable
+    + cgcpu unit for i386 (implements processor specific routines of the above
+      unit)
+    * updated cgbase and cpubase for the new code generator units
+    * include ncgflw unit in cpunode unit
+
+  Revision 1.4  2001/05/18 22:31:06  peter
+    * tasmnode.pass_2 is independent of cpu, moved to ncgbas
+    * include ncgbas for independent nodes
+
+  Revision 1.3  2001/04/21 13:37:17  peter
+    * made tclassheader using class of to implement cpu dependent code
+
+  Revision 1.2  2000/12/31 11:14:11  jonas
+    + implemented/fixed docompare() mathods for all nodes (not tested)
+    + nopt.pas, nadd.pas, i386/n386opt.pas: optimized nodes for adding strings
+      and constant strings/chars together
+    * n386add.pas: don't copy temp strings (of size 256) to another temp string
+      when adding
+
+  Revision 1.1  2000/10/15 09:39:37  peter
+    * moved cpu*.pas to i386/
+    * renamed n386 to common cpunode
+
+  Revision 1.1  2000/10/14 10:14:47  peter
+    * moehrendorf oct 2000 rewrite
+
 }

+ 59 - 4
compiler/i386/cpuswtch.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Florian Klaempfl, Pierre Muller
+    Copyright (c) 1998-2000 by Florian Klaempfl, Pierre Muller
 
     interprets the commandline options which are i386 specific
 
@@ -22,7 +22,7 @@
 }
 unit cpuswtch;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -129,7 +129,62 @@ initialization
 end.
 {
   $Log$
-  Revision 1.5  2002-05-14 19:34:59  peter
-    * removed old logs and updated copyright year
+  Revision 1.6  2002-05-16 19:46:50  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
+
+  Revision 1.4  2001/07/01 20:16:20  peter
+    * alignmentinfo record added
+    * -Oa argument supports more alignment settings that can be specified
+      per type: PROC,LOOP,VARMIN,VARMAX,CONSTMIN,CONSTMAX,RECORDMIN
+      RECORDMAX,LOCALMIN,LOCALMAX. It is possible to set the mimimum
+      required alignment and the maximum usefull alignment. The final
+      alignment will be choosen per variable size dependent on these
+      settings
+
+  Revision 1.3  2001/05/12 12:11:31  peter
+    * simplify_ppu is now the default, a recompile of the compiler now
+      only compiles pp.pas
+
+  Revision 1.2  2000/12/23 19:46:49  peter
+    * object to class conversion
+    * more verbosity for -vt and -vd
+    * -i options can be put after eachother so the Makefiles only need
+      to call fpc once for all info (will be twice as the first one will
+      be to check the version if fpc supports multiple info)
+
+  Revision 1.1  2000/11/30 22:42:50  florian
+  * renamed
+
+  Revision 1.1  2000/11/30 22:21:56  florian
+    * moved to i386
+
+  Revision 1.6  2000/10/24 10:40:53  jonas
+    + register renaming ("fixes" bug1088)
+    * changed command line options meanings for optimizer:
+        O2 now means peepholopts, CSE and register renaming in 1 pass
+        O3 is the same, but repeated until no further optimizations are
+          possible or until 5 passes have been done (to avoid endless loops)
+    * changed aopt386 so it does this looping
+    * added some procedures from csopt386 to the interface because they're
+      used by rropt386 as well
+    * some changes to csopt386 and daopt386 so that newly added instructions
+      by the CSE get optimizer info (they were simply skipped previously),
+      this fixes some bugs
+
+  Revision 1.5  2000/09/24 15:06:20  peter
+    * use defines.inc
+
+  Revision 1.4  2000/08/27 16:11:51  peter
+    * moved some util functions from globals,cobjects to cutils
+    * splitted files into finput,fmodule
+
+  Revision 1.3  2000/07/27 13:03:36  jonas
+    * release alignopts
+
+  Revision 1.2  2000/07/13 11:32:44  michael
+  + removed logs
 
 }

+ 12 - 3
compiler/i386/cputarg.pas

@@ -22,7 +22,7 @@
 }
 unit cputarg;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -85,8 +85,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.7  2002-05-14 19:34:59  peter
-    * removed old logs and updated copyright year
+  Revision 1.8  2002-05-16 19:46:50  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.6  2002/05/12 16:53:16  peter
     * moved entry and exitcode to ncgutil and cgobj
@@ -114,4 +117,10 @@ end.
   Revision 1.3  2002/03/28 20:48:04  carl
   - remove go32v1 support
 
+  Revision 1.2  2001/06/03 15:12:47  peter
+    * t_beos target inclusion
+
+  Revision 1.1  2001/04/18 22:02:01  peter
+    * registration of targets and assemblers
+
 }

+ 162 - 4
compiler/i386/csopt386.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Jonas Maebe, member of the Free Pascal
+    Copyright (c) 1998-2000 by Jonas Maebe, member of the Free Pascal
       development team
 
     This unit contains the common subexpression elimination procedure.
@@ -23,7 +23,7 @@
 }
 Unit CSOpt386;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 Interface
 
@@ -1984,8 +1984,11 @@ End.
 
 {
   $Log$
-  Revision 1.33  2002-05-14 19:34:59  peter
-    * removed old logs and updated copyright year
+  Revision 1.34  2002-05-16 19:46:51  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.32  2002/04/21 15:32:59  carl
   * changeregsize -> rg.makeregsize
@@ -2054,4 +2057,159 @@ End.
   Revision 1.24  2002/03/04 19:10:12  peter
     * removed compiler warnings
 
+  Revision 1.23  2001/12/04 15:58:13  jonas
+    * unnecessary loads of constants are now also remove by
+      removePrevNotUsedLoad()
+
+  Revision 1.22  2001/11/30 16:35:02  jonas
+    * added missing allocregbetween() call for a memtoreg() optimization
+
+  Revision 1.21  2001/10/27 10:20:43  jonas
+    + replace mem accesses to locations to which a reg was stored recently with that reg
+
+  Revision 1.20  2001/10/14 11:50:21  jonas
+    + also replace mem references in modify operands with regs
+
+  Revision 1.19  2001/10/12 13:58:05  jonas
+    + memory references are now replaced by register reads in "regular"
+      instructions (e.g. "addl ref1,%eax" will be replaced by "addl %ebx,%eax"
+      if %ebx contains ref1). Previously only complete load sequences were
+      optimized away, but not such small accesses in other instructions than
+      mov/movzx/movsx
+
+  Revision 1.18  2001/09/04 14:01:03  jonas
+    * commented out some inactive code in csopt386
+    + small improvement: lea is now handled the same as mov/zx/sx
+
+  Revision 1.17  2001/08/29 14:07:43  jonas
+    * the optimizer now keeps track of flags register usage. This fixes some
+      optimizer bugs with int64 calculations (because of the carry flag usage)
+    * fixed another bug which caused wrong optimizations with complex
+      array expressions
+
+  Revision 1.16  2001/08/26 13:36:55  florian
+    * some cg reorganisation
+    * some PPC updates
+
+  Revision 1.15  2001/04/06 16:24:38  jonas
+    * fixed bug due to short boolean evaluation
+
+  Revision 1.14  2001/04/02 21:20:36  peter
+    * resulttype rewrite
+
+  Revision 1.13  2001/01/10 08:52:40  michael
+  + Patch from jonas so 1.0.2 can be used to cycle
+
+  Revision 1.12  2001/01/07 15:51:17  jonas
+    * fixed crashing bug to due previous changes
+
+  Revision 1.11  2001/01/06 23:35:05  jonas
+    * fixed webbug 1323
+
+  Revision 1.10  2000/12/25 00:07:31  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.9  2000/12/05 09:33:42  jonas
+    * when searching for constants in registers, the returned register
+      sometimes didn't have the same size as the requested size
+
+  Revision 1.8  2000/11/29 00:30:43  florian
+    * unused units removed from uses clause
+    * some changes for widestrings
+
+  Revision 1.7  2000/11/28 16:32:11  jonas
+    + support for optimizing simple sequences with div/idiv/mul opcodes
+
+  Revision 1.6  2000/11/14 12:17:34  jonas
+    * fixed some bugs in checksequence
+
+  Revision 1.5  2000/11/09 12:34:44  jonas
+    * fixed range check error
+
+  Revision 1.4  2000/11/03 17:53:24  jonas
+    * some small improvements
+
+  Revision 1.3  2000/11/01 22:53:30  jonas
+    * register contents were not cleared if there was only 1 instruction
+
+      between de previous sequence and the current one
+
+  Revision 1.2  2000/10/24 10:40:53  jonas
+    + register renaming ("fixes" bug1088)
+    * changed command line options meanings for optimizer:
+        O2 now means peepholopts, CSE and register renaming in 1 pass
+        O3 is the same, but repeated until no further optimizations are
+          possible or until 5 passes have been done (to avoid endless loops)
+    * changed aopt386 so it does this looping
+    * added some procedures from csopt386 to the interface because they're
+      used by rropt386 as well
+    * some changes to csopt386 and daopt386 so that newly added instructions
+      by the CSE get optimizer info (they were simply skipped previously),
+      this fixes some bugs
+
+  Revision 1.1  2000/10/15 09:47:43  peter
+    * moved to i386/
+
+  Revision 1.14  2000/09/30 13:07:23  jonas
+    * fixed support for -Or with new features of CSE
+
+  Revision 1.13  2000/09/29 23:14:45  jonas
+    * search much further back for CSE sequences (non-conflicting stores are
+      now passed)
+    * remove more unnecessary loads of registers (especially the self pointer)
+
+  Revision 1.12  2000/09/26 11:49:41  jonas
+    * writes to register variables and to the self pointer now also count as
+      memore writes
+
+  Revision 1.11  2000/09/25 09:50:29  jonas
+    - removed TP conditional code
+
+  Revision 1.10  2000/09/24 15:06:14  peter
+    * use defines.inc
+
+  Revision 1.9  2000/09/22 15:01:59  jonas
+    * fixed some bugs in the previous improvements: in some cases, esi was
+      still being replaced before a conditional jump (the code that
+      detected conditional jumps sometimes skipped over them)
+
+  Revision 1.8  2000/09/20 15:00:58  jonas
+    + much improved CSE: the CSE now searches further back for sequences it
+      can reuse. After I've also implemented register renaming, the effect
+      should be even better (afaik web bug 1088 will then even be optimized
+      properly). I don't know about the slow down factor this adds. Maybe
+      a new optimization level should be introduced?
+
+  Revision 1.7  2000/08/25 19:40:45  jonas
+    * refined previous fix a bit, some instructions weren't being removed
+      while they could (merged from fixes branch)
+    * made checksequence a bit faster
+
+  Revision 1.6  2000/08/23 12:55:10  jonas
+    * fix for web bug 1112 and a bit of clean up in csopt386 (merged from
+      fixes branch)
+
+  Revision 1.5  2000/08/04 20:08:03  jonas
+    * improved detection of range of instructions which use a register
+      (merged from fixes branch)
+
+  Revision 1.4  2000/07/21 15:19:54  jonas
+    * daopt386: changes to getnextinstruction/getlastinstruction so they
+      ignore labels who have is_addr set
+    + daopt386/csopt386: remove loads of registers which are overwritten
+       before their contents are used (especially usefull for removing superfluous
+      maybe_loadself outputs and push/pops transformed by below optimization
+    + popt386: transform pop/pop/pop/.../push/push/push to sequences of
+      'movl x(%esp),%reg' (only active when compiling a go32v2 compiler
+      currently because I don't know whether it's safe to do this under Win32/
+      Linux (because of problems we had when using esp as frame pointer on
+      those os'es)
+
+  Revision 1.3  2000/07/14 05:11:48  michael
+  + Patch to 1.1
+
+  Revision 1.2  2000/07/13 11:32:39  michael
+  + removed logs
+
 }

+ 183 - 11
compiler/i386/daopt386.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Jonas Maebe, member of the Freepascal
+    Copyright (c) 1998-2000 by Jonas Maebe, member of the Freepascal
       development team
 
     This unit contains the data flow analyzer and several helper procedures
@@ -24,7 +24,7 @@
 }
 Unit DAOpt386;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 Interface
 
@@ -1616,7 +1616,7 @@ Begin
 End;
 
 
-Procedure ReadRef(p: PTaiProp; Const Ref: PReference);
+Procedure ReadRef(p: PTaiProp; Const Ref: POperReference);
 Begin
   If Ref^.Base <> R_NO Then
     ReadReg(p, Ref^.Base);
@@ -2591,14 +2591,11 @@ End.
 
 {
   $Log$
-  Revision 1.36  2002-05-14 19:34:59  peter
-    * removed old logs and updated copyright year
-
-  Revision 1.35  2002/05/14 17:28:09  peter
-    * synchronized cpubase between powerpc and i386
-    * moved more tables from cpubase to cpuasm
-    * tai_align_abstract moved to tainst, cpuasm must define
-      the tai_align class now, which may be empty
+  Revision 1.37  2002-05-16 19:46:51  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.34  2002/05/12 16:53:16  peter
     * moved entry and exitcode to ncgutil and cgobj
@@ -2680,4 +2677,179 @@ End.
   Revision 1.26  2002/03/04 19:10:13  peter
     * removed compiler warnings
 
+  Revision 1.25  2001/12/29 15:29:59  jonas
+    * powerpc/cgcpu.pas compiles :)
+    * several powerpc-related fixes
+    * cpuasm unit is now based on common tainst unit
+    + nppcmat unit for powerpc (almost complete)
+
+  Revision 1.24  2001/11/02 22:58:09  peter
+    * procsym definition rewrite
+
+  Revision 1.23  2001/10/27 10:20:43  jonas
+    + replace mem accesses to locations to which a reg was stored recently with that reg
+
+  Revision 1.22  2001/10/12 13:58:05  jonas
+    + memory references are now replaced by register reads in "regular"
+      instructions (e.g. "addl ref1,%eax" will be replaced by "addl %ebx,%eax"
+      if %ebx contains ref1). Previously only complete load sequences were
+      optimized away, but not such small accesses in other instructions than
+      mov/movzx/movsx
+
+  Revision 1.21  2001/09/04 14:01:04  jonas
+    * commented out some inactive code in csopt386
+    + small improvement: lea is now handled the same as mov/zx/sx
+
+  Revision 1.20  2001/08/29 14:07:43  jonas
+    * the optimizer now keeps track of flags register usage. This fixes some
+      optimizer bugs with int64 calculations (because of the carry flag usage)
+    * fixed another bug which caused wrong optimizations with complex
+      array expressions
+
+  Revision 1.19  2001/08/26 13:36:55  florian
+    * some cg reorganisation
+    * some PPC updates
+
+  Revision 1.18  2001/08/06 21:40:50  peter
+    * funcret moved from tprocinfo to tprocdef
+
+  Revision 1.17  2001/04/13 01:22:18  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.16  2001/04/02 21:20:36  peter
+    * resulttype rewrite
+
+  Revision 1.15  2000/12/31 11:00:31  jonas
+    * fixed potential bug in writeToMemDestroysContents
+
+  Revision 1.14  2000/12/25 00:07:32  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.13  2000/12/21 12:22:53  jonas
+    * fixed range error
+
+  Revision 1.12  2000/12/04 17:00:09  jonas
+    * invalidate regs that depend on a modified register
+
+  Revision 1.11  2000/11/29 00:30:44  florian
+    * unused units removed from uses clause
+    * some changes for widestrings
+
+  Revision 1.10  2000/11/28 16:32:11  jonas
+    + support for optimizing simple sequences with div/idiv/mul opcodes
+
+  Revision 1.9  2000/11/23 14:20:18  jonas
+    * fixed stupid bug in previous commit
+
+  Revision 1.8  2000/11/23 13:26:33  jonas
+    * fix for webbug 1066/1126
+
+  Revision 1.7  2000/11/17 15:22:04  jonas
+    * fixed another bug in allocregbetween (introduced by the previous fix)
+      ("merged")
+
+  Revision 1.6  2000/11/14 13:26:10  jonas
+    * fixed bug in allocregbetween
+
+  Revision 1.5  2000/11/08 16:04:34  sg
+  * Fix for containsPointerRef: Loop now runs in the correct range
+
+  Revision 1.4  2000/11/03 18:06:26  jonas
+    * fixed bug in arrayRefsEq
+    * object/class fields are now handled the same as local/global vars and
+      parameters (ie. a write to a local var can now never destroy a class
+      field)
+
+  Revision 1.3  2000/10/24 10:40:53  jonas
+    + register renaming ("fixes" bug1088)
+    * changed command line options meanings for optimizer:
+        O2 now means peepholopts, CSE and register renaming in 1 pass
+        O3 is the same, but repeated until no further optimizations are
+          possible or until 5 passes have been done (to avoid endless loops)
+    * changed aopt386 so it does this looping
+    * added some procedures from csopt386 to the interface because they're
+      used by rropt386 as well
+    * some changes to csopt386 and daopt386 so that newly added instructions
+      by the CSE get optimizer info (they were simply skipped previously),
+      this fixes some bugs
+
+  Revision 1.2  2000/10/19 15:59:40  jonas
+    * fixed bug in allocregbetween (the register wasn't added to the
+      usedregs set of the last instruction of the chain) ("merged")
+
+  Revision 1.1  2000/10/15 09:47:43  peter
+    * moved to i386/
+
+  Revision 1.16  2000/10/14 10:14:47  peter
+    * moehrendorf oct 2000 rewrite
+
+  Revision 1.15  2000/09/30 13:07:23  jonas
+    * fixed support for -Or with new features of CSE
+
+  Revision 1.14  2000/09/29 23:14:11  jonas
+    + writeToMemDestroysContents() and writeDestroysContents() to support the
+      new features of the CSE
+
+  Revision 1.13  2000/09/25 09:50:30  jonas
+    - removed TP conditional code
+
+  Revision 1.12  2000/09/24 21:19:50  peter
+    * delphi compile fixes
+
+  Revision 1.11  2000/09/24 15:06:15  peter
+    * use defines.inc
+
+  Revision 1.10  2000/09/22 15:00:20  jonas
+    * fixed bug in regsEquivalent (in some rare cases, registers with
+      completely unrelated content were considered equivalent) (merged
+      from fixes branch)
+
+  Revision 1.9  2000/09/20 15:00:58  jonas
+    + much improved CSE: the CSE now searches further back for sequences it
+      can reuse. After I've also implemented register renaming, the effect
+      should be even better (afaik web bug 1088 will then even be optimized
+      properly). I don't know about the slow down factor this adds. Maybe
+      a new optimization level should be introduced?
+
+  Revision 1.8  2000/08/25 19:39:18  jonas
+    * bugfix to FindRegAlloc function (caused wrong regalloc info in
+      some cases) (merged from fixes branch)
+
+  Revision 1.7  2000/08/23 12:55:10  jonas
+    * fix for web bug 1112 and a bit of clean up in csopt386 (merged from
+      fixes branch)
+
+  Revision 1.6  2000/08/19 17:53:29  jonas
+    * fixed a potential bug in destroyregs regarding the removal of
+      unused loads
+    * added destroyDependingRegs() procedure and use it for the fix in
+      the previous commit (safer/more complete than what was done before)
+
+  Revision 1.5  2000/08/19 09:08:59  jonas
+    * fixed bug where the contents of a register would not be destroyed
+      if another register on which these contents depend is modified
+      (not really merged, but same idea as fix in fixes branch,
+      LAST_MERGE tag is updated)
+
+  Revision 1.4  2000/07/21 15:19:54  jonas
+    * daopt386: changes to getnextinstruction/getlastinstruction so they
+      ignore labels who have is_addr set
+    + daopt386/csopt386: remove loads of registers which are overwritten
+       before their contents are used (especially usefull for removing superfluous
+      maybe_loadself outputs and push/pops transformed by below optimization
+    + popt386: transform pop/pop/pop/.../push/push/push to sequences of
+      'movl x(%esp),%reg' (only active when compiling a go32v2 compiler
+      currently because I don't know whether it's safe to do this under Win32/
+      Linux (because of problems we had when using esp as frame pointer on
+      those os'es)
+
+  Revision 1.3  2000/07/14 05:11:48  michael
+  + Patch to 1.1
+
+  Revision 1.2  2000/07/13 11:32:40  michael
+  + removed logs
+
 }

+ 157 - 3
compiler/i386/n386add.pas

@@ -22,7 +22,7 @@
 }
 unit n386add;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -1572,8 +1572,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.37  2002-05-14 19:34:59  peter
-    * removed old logs and updated copyright year
+  Revision 1.38  2002-05-16 19:46:51  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.36  2002/05/13 19:54:37  peter
     * removed n386ld and n386util units
@@ -1620,4 +1623,155 @@ end.
   Revision 1.29  2002/03/04 19:10:13  peter
     * removed compiler warnings
 
+  Revision 1.28  2001/12/30 17:24:46  jonas
+    * range checking is now processor independent (part in cgobj,
+      part in cg64f32) and should work correctly again (it needed
+      some changes after the changes of the low and high of
+      tordef's to int64)
+    * maketojumpbool() is now processor independent (in ncgutil)
+    * getregister32 is now called :=rg.getregisterint(exprasmlist);
+
+  Revision 1.27  2001/12/29 15:29:58  jonas
+    * powerpc/cgcpu.pas compiles :)
+    * several powerpc-related fixes
+    * cpuasm unit is now based on common tainst unit
+    + nppcmat unit for powerpc (almost complete)
+
+  Revision 1.25  2001/10/12 13:51:51  jonas
+    * fixed internalerror(10) due to previous fpu overflow fixes ("merged")
+    * fixed bug in n386add (introduced after compilerproc changes for string
+      operations) where calcregisters wasn't called for shortstring addnodes
+    * NOTE: from now on, the location of a binary node must now always be set
+       before you call calcregisters() for it
+
+  Revision 1.24  2001/09/17 21:29:13  peter
+    * merged netbsd, fpu-overflow from fixes branch
+
+  Revision 1.23  2001/09/05 15:22:09  jonas
+    * made multiplying, dividing and mod'ing of int64 and qword processor
+      independent with compilerprocs (+ small optimizations by using shift/and
+      where possible)
+
+  Revision 1.22  2001/09/04 11:38:55  jonas
+    + searchsystype() and searchsystype() functions in symtable
+    * changed ninl and nadd to use these functions
+    * i386 set comparison functions now return their results in al instead
+      of in the flags so that they can be sued as compilerprocs
+    - removed all processor specific code from n386add.pas that has to do
+      with set handling, it's now all done in nadd.pas
+    * fixed fpc_set_contains_sets in genset.inc
+    * fpc_set_in_byte is now coded inline in n386set.pas and doesn't use a
+      helper anymore
+    * some small fixes in compproc.inc/set.inc regarding the declaration of
+      internal helper types (fpc_small_set and fpc_normal_set)
+
+  Revision 1.21  2001/09/03 13:27:42  jonas
+    * compilerproc implementation of set addition/substraction/...
+    * changed the declaration of some set helpers somewhat to accomodate the
+      above change
+    * i386 still uses the old code for comparisons of sets, because its
+      helpers return the results in the flags
+    * dummy tc_normal_2_small_set type conversion because I need the original
+      resulttype of the set add nodes
+    NOTE: you have to start a cycle with 1.0.5!
+
+  Revision 1.20  2001/08/30 15:43:14  jonas
+    * converted adding/comparing of strings to compileproc. Note that due
+      to the way the shortstring helpers for i386 are written, they are
+      still handled by the old code (reason: fpc_shortstr_compare returns
+      results in the flags instead of in eax and fpc_shortstr_concat
+      has wierd parameter conventions). The compilerproc stuff should work
+      fine with the generic implementations though.
+    * removed some nested comments warnings
+
+  Revision 1.19  2001/08/29 17:50:45  jonas
+    * removed unused var
+
+  Revision 1.18  2001/08/29 12:03:23  jonas
+    * fixed wrong regalloc info around FPC_MUL/DIV/MOD_INT64/QWORD calls
+    * fixed partial result overwriting with the above calls too
+
+  Revision 1.17  2001/08/26 13:36:55  florian
+    * some cg reorganisation
+    * some PPC updates
+
+  Revision 1.16  2001/07/08 21:00:16  peter
+    * various widestring updates, it works now mostly without charset
+      mapping supported
+
+  Revision 1.15  2001/06/25 14:11:37  jonas
+    * fixed set bug discovered by Carl (merged)
+
+  Revision 1.14  2001/06/18 20:36:25  peter
+    * -Ur switch (merged)
+    * masm fixes (merged)
+    * quoted filenames for go32v2 and win32
+
+  Revision 1.13  2001/05/27 14:30:56  florian
+    + some widestring stuff added
+
+  Revision 1.12  2001/05/06 17:12:14  jonas
+    * fixed an IE10 and another bug with [var1..var2] construct
+
+  Revision 1.11  2001/04/13 01:22:18  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.10  2001/04/02 21:20:36  peter
+    * resulttype rewrite
+
+  Revision 1.9  2000/12/31 11:14:11  jonas
+    + implemented/fixed docompare() mathods for all nodes (not tested)
+    + nopt.pas, nadd.pas, i386/n386opt.pas: optimized nodes for adding strings
+      and constant strings/chars together
+    * n386add.pas: don't copy temp strings (of size 256) to another temp string
+      when adding
+
+  Revision 1.8  2000/12/25 00:07:32  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.7  2000/12/16 15:56:18  jonas
+    - removed all ifdef cardinalmulfix code
+
+  Revision 1.6  2000/12/05 11:44:32  jonas
+    + new integer regvar handling, should be much more efficient
+
+  Revision 1.5  2000/11/29 00:30:45  florian
+    * unused units removed from uses clause
+    * some changes for widestrings
+
+  Revision 1.4  2000/11/13 11:30:56  florian
+    * some bugs with interfaces and NIL fixed
+
+  Revision 1.3  2000/11/04 14:25:23  florian
+    + merged Attila's changes for interfaces, not tested yet
+
+  Revision 1.2  2000/10/31 22:02:56  peter
+    * symtable splitted, no real code changes
+
+  Revision 1.1  2000/10/15 09:33:31  peter
+    * moved n386*.pas to i386/ cpu_target dir
+
+  Revision 1.6  2000/10/14 10:14:47  peter
+    * moehrendorf oct 2000 rewrite
+
+  Revision 1.5  2000/09/30 16:08:45  peter
+    * more cg11 updates
+
+  Revision 1.4  2000/09/24 15:06:18  peter
+    * use defines.inc
+
+  Revision 1.3  2000/09/22 22:42:52  florian
+    * more fixes
+
+  Revision 1.2  2000/09/21 12:24:22  jonas
+    * small fix to my changes for full boolean evaluation support (moved
+      opsize determination for boolean operations back in boolean
+      processing block)
+    + full boolean evaluation support (from cg386add)
+
+  Revision 1.1  2000/09/20 21:23:32  florian
+    * initial revision
 }

+ 179 - 4
compiler/i386/n386cal.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Florian Klaempfl
+    Copyright (c) 1998-2000 by Florian Klaempfl
 
     Generate i386 assembler for in call nodes
 
@@ -22,7 +22,7 @@
 }
 unit n386cal;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -1484,8 +1484,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.51  2002-05-14 19:34:59  peter
-    * removed old logs and updated copyright year
+  Revision 1.52  2002-05-16 19:46:51  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.50  2002/05/13 19:54:38  peter
     * removed n386ld and n386util units
@@ -1564,4 +1567,176 @@ end.
   Revision 1.41  2002/03/04 19:10:13  peter
     * removed compiler warnings
 
+  Revision 1.40  2001/12/31 09:53:15  jonas
+    * changed remaining "getregister32" calls to "getregisterint"
+
+  Revision 1.39  2001/12/29 15:32:13  jonas
+    * powerpc/cgcpu.pas compiles :)
+    * several powerpc-related fixes
+    * cpuasm unit is now based on common tainst unit
+    + nppcmat unit for powerpc (almost complete)
+
+  Revision 1.38  2001/11/18 00:00:34  florian
+    * handling of ansi- and widestring results improved
+
+  Revision 1.37  2001/11/02 23:24:40  peter
+    * fixed crash with inlining after aktprocdef change
+
+  Revision 1.36  2001/11/02 22:58:09  peter
+    * procsym definition rewrite
+
+  Revision 1.35  2001/10/25 21:22:41  peter
+    * calling convention rewrite
+
+  Revision 1.34  2001/10/21 12:33:07  peter
+    * array access for properties added
+
+  Revision 1.33  2001/09/09 08:50:15  jonas
+    * when calling an inline procedure inside a nested procedure, the
+      framepointer was being pushed on the stack, but this pushed framepointer
+      was never used nor removed from the stack again after the inlining was
+      done. It's now simply not pushed anymore, because the inlined procedure
+      can get the previous framepointer from the procedure in which it is being
+      inlined (merged)
+
+  Revision 1.32  2001/09/01 23:02:30  jonas
+    * i386*: call and jmp read their first operand
+    * cgcal: deallocate hlper register only after call statement (fixes bug
+      with "procedure of object" and optimizer reported to bugrep on
+      2001/08/30) ('merged')
+
+  Revision 1.31  2001/08/29 12:18:08  jonas
+    + new createinternres() constructor for tcallnode to support setting a
+      custom resulttype
+    * compilerproc typeconversions now set the resulttype from the type
+      conversion for the generated call node, because the resulttype of
+      of the compilerproc helper isn't always exact (e.g. the ones that
+      return shortstrings, actually return a shortstring[x], where x is
+      specified by the typeconversion node)
+    * ti386callnode.pass_2 now always uses resulttype instead of
+      procsym.definition.rettype (so the custom resulttype, if any, is
+      always used). Note that this "rettype" stuff is only for use with
+      compilerprocs.
+
+  Revision 1.30  2001/08/26 13:36:56  florian
+    * some cg reorganisation
+    * some PPC updates
+
+  Revision 1.29  2001/08/19 21:11:21  florian
+    * some bugs fix:
+      - overload; with external procedures fixed
+      - better selection of routine to do an overloaded
+        type case
+      - ... some more
+
+  Revision 1.28  2001/08/06 21:40:50  peter
+    * funcret moved from tprocinfo to tprocdef
+
+  Revision 1.27  2001/07/08 21:00:16  peter
+    * various widestring updates, it works now mostly without charset
+      mapping supported
+
+  Revision 1.26  2001/07/01 20:16:20  peter
+    * alignmentinfo record added
+    * -Oa argument supports more alignment settings that can be specified
+      per type: PROC,LOOP,VARMIN,VARMAX,CONSTMIN,CONSTMAX,RECORDMIN
+      RECORDMAX,LOCALMIN,LOCALMAX. It is possible to set the mimimum
+      required alignment and the maximum usefull alignment. The final
+      alignment will be choosen per variable size dependent on these
+      settings
+
+  Revision 1.25  2001/06/04 11:48:02  peter
+    * better const to var checking
+
+  Revision 1.24  2001/05/19 21:22:53  peter
+    * function returning int64 inlining fixed
+
+  Revision 1.23  2001/05/16 15:11:42  jonas
+    * added missign begin..end pair (noticed by Carl)
+
+  Revision 1.22  2001/04/18 22:02:01  peter
+    * registration of targets and assemblers
+
+  Revision 1.21  2001/04/13 01:22:18  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.20  2001/04/02 21:20:36  peter
+    * resulttype rewrite
+
+  Revision 1.19  2001/03/11 22:58:51  peter
+    * getsym redesign, removed the globals srsym,srsymtable
+
+  Revision 1.18  2001/01/27 21:29:35  florian
+     * behavior -Oa optimized
+
+  Revision 1.17  2001/01/08 21:46:46  peter
+    * don't push high value for open array with cdecl;external;
+
+  Revision 1.16  2000/12/25 00:07:32  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.15  2000/12/09 10:45:40  florian
+    * AfterConstructor isn't called anymore when a constructor failed
+
+  Revision 1.14  2000/12/07 17:19:46  jonas
+    * new constant handling: from now on, hex constants >$7fffffff are
+      parsed as unsigned constants (otherwise, $80000000 got sign extended
+      and became $ffffffff80000000), all constants in the longint range
+      become longints, all constants >$7fffffff and <=cardinal($ffffffff)
+      are cardinals and the rest are int64's.
+    * added lots of longint typecast to prevent range check errors in the
+      compiler and rtl
+    * type casts of symbolic ordinal constants are now preserved
+    * fixed bug where the original resulttype.def wasn't restored correctly
+      after doing a 64bit rangecheck
+
+  Revision 1.13  2000/12/05 11:44:33  jonas
+    + new integer regvar handling, should be much more efficient
+
+  Revision 1.12  2000/12/03 22:26:54  florian
+    * fixed web buzg 1275: problem with int64 functions results
+
+  Revision 1.11  2000/11/29 00:30:46  florian
+    * unused units removed from uses clause
+    * some changes for widestrings
+
+  Revision 1.10  2000/11/23 13:26:34  jonas
+    * fix for webbug 1066/1126
+
+  Revision 1.9  2000/11/22 15:12:06  jonas
+    * fixed inline-related problems (partially "merges")
+
+  Revision 1.8  2000/11/17 09:54:58  florian
+    * INT_CHECK_OBJECT_* isn't applied to interfaces anymore
+
+  Revision 1.7  2000/11/12 23:24:14  florian
+    * interfaces are basically running
+
+  Revision 1.6  2000/11/07 23:40:49  florian
+    + AfterConstruction and BeforeDestruction impemented
+
+  Revision 1.5  2000/11/06 23:15:01  peter
+    * added copyvaluepara call again
+
+  Revision 1.4  2000/11/04 14:25:23  florian
+    + merged Attila's changes for interfaces, not tested yet
+
+  Revision 1.3  2000/11/04 13:12:14  jonas
+    * check for nil pointers before calling getcopy
+
+  Revision 1.2  2000/10/31 22:02:56  peter
+    * symtable splitted, no real code changes
+
+  Revision 1.1  2000/10/15 09:33:31  peter
+    * moved n386*.pas to i386/ cpu_target dir
+
+  Revision 1.2  2000/10/14 10:14:48  peter
+    * moehrendorf oct 2000 rewrite
+
+  Revision 1.1  2000/10/10 17:31:56  florian
+    * initial revision
+
 }

+ 135 - 4
compiler/i386/n386cnv.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Florian Klaempfl
+    Copyright (c) 1998-2000 by Florian Klaempfl
 
     Generate i386 assembler for type converting nodes
 
@@ -22,7 +22,7 @@
 }
 unit n386cnv;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -365,8 +365,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.39  2002-05-14 19:34:59  peter
-    * removed old logs and updated copyright year
+  Revision 1.40  2002-05-16 19:46:51  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.38  2002/05/12 16:53:17  peter
     * moved entry and exitcode to ncgutil and cgobj
@@ -443,4 +446,132 @@ end.
   Revision 1.30  2002/03/04 19:10:13  peter
     * removed compiler warnings
 
+  Revision 1.29  2001/12/30 17:24:46  jonas
+    * range checking is now processor independent (part in cgobj,
+      part in cg64f32) and should work correctly again (it needed
+      some changes after the changes of the low and high of
+      tordef's to int64)
+    * maketojumpbool() is now processor independent (in ncgutil)
+    * getregister32 is now called getregisterint
+
+  Revision 1.28  2001/12/11 08:14:17  jonas
+    * part of my fix for dynarray -> open array conversion, forgot to
+      commit yesterday :(
+
+  Revision 1.27  2001/11/02 23:24:12  jonas
+    * fixed web bug 1665 (allow char to chararray type conversion) ("merged")
+
+  Revision 1.26  2001/09/30 21:28:34  peter
+    * int64->boolean fixed
+
+  Revision 1.25  2001/09/30 16:12:47  jonas
+    - removed unnecessary i386 pass_2 of as- and isnode and added dummy generic ones
+
+  Revision 1.24  2001/09/29 21:32:47  jonas
+    * almost all second pass typeconvnode helpers are now processor independent
+    * fixed converting boolean to int64/qword
+    * fixed register allocation bugs which could cause internalerror 10
+    * isnode and asnode are completely processor indepent now as well
+    * fpc_do_as now returns its class argument (necessary to be able to use it
+      properly with compilerproc)
+
+  Revision 1.23  2001/09/03 13:27:42  jonas
+    * compilerproc implementation of set addition/substraction/...
+    * changed the declaration of some set helpers somewhat to accomodate the
+      above change
+    * i386 still uses the old code for comparisons of sets, because its
+      helpers return the results in the flags
+    * dummy tc_normal_2_small_set type conversion because I need the original
+      resulttype of the set add nodes
+    NOTE: you have to start a cycle with 1.0.5!
+
+  Revision 1.22  2001/08/29 19:49:03  jonas
+    * some fixes in compilerprocs for chararray to string conversions
+    * conversion from string to chararray is now also done via compilerprocs
+
+  Revision 1.21  2001/08/28 13:24:47  jonas
+    + compilerproc implementation of most string-related type conversions
+    - removed all code from the compiler which has been replaced by
+      compilerproc implementations (using $ifdef hascompilerproc is not
+      necessary in the compiler)
+
+  Revision 1.20  2001/08/26 13:36:57  florian
+    * some cg reorganisation
+    * some PPC updates
+
+  Revision 1.19  2001/08/01 21:44:59  peter
+    * fixed empty pwidechar register allocation
+
+  Revision 1.18  2001/07/30 20:59:29  peter
+    * m68k updates from v10 merged
+
+  Revision 1.17  2001/07/16 13:19:08  jonas
+    * fixed allocation of register before release in second_cstring_to_pchar
+
+  Revision 1.16  2001/07/08 21:00:17  peter
+    * various widestring updates, it works now mostly without charset
+      mapping supported
+
+  Revision 1.15  2001/05/08 21:06:33  florian
+    * some more support for widechars commited especially
+      regarding type casting and constants
+
+  Revision 1.14  2001/04/13 01:22:18  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.13  2001/04/02 21:20:36  peter
+    * resulttype rewrite
+
+  Revision 1.12  2001/01/08 21:45:11  peter
+    * internalerror for string to chararray
+
+  Revision 1.11  2000/12/25 00:07:32  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.10  2000/12/07 17:19:46  jonas
+    * new constant handling: from now on, hex constants >$7fffffff are
+      parsed as unsigned constants (otherwise, $80000000 got sign extended
+      and became $ffffffff80000000), all constants in the longint range
+      become longints, all constants >$7fffffff and <=cardinal($ffffffff)
+      are cardinals and the rest are int64's.
+    * added lots of longint typecast to prevent range check errors in the
+      compiler and rtl
+    * type casts of symbolic ordinal constants are now preserved
+    * fixed bug where the original resulttype.def wasn't restored correctly
+      after doing a 64bit rangecheck
+
+  Revision 1.9  2000/12/05 11:44:33  jonas
+    + new integer regvar handling, should be much more efficient
+
+  Revision 1.8  2000/11/29 00:30:46  florian
+    * unused units removed from uses clause
+    * some changes for widestrings
+
+  Revision 1.7  2000/11/16 15:27:48  jonas
+    * fixed web bug 1242
+
+  Revision 1.6  2000/11/13 11:30:56  florian
+    * some bugs with interfaces and NIL fixed
+
+  Revision 1.5  2000/11/12 23:24:14  florian
+    * interfaces are basically running
+
+  Revision 1.4  2000/11/11 16:00:10  jonas
+    * optimize converting of 8/16/32 bit constants to 64bit ones
+
+  Revision 1.3  2000/11/04 14:25:23  florian
+    + merged Attila's changes for interfaces, not tested yet
+
+  Revision 1.2  2000/10/31 22:02:56  peter
+    * symtable splitted, no real code changes
+
+  Revision 1.1  2000/10/15 09:33:31  peter
+    * moved n386*.pas to i386/ cpu_target dir
+
+  Revision 1.1  2000/10/14 10:14:48  peter
+    * moehrendorf oct 2000 rewrite
+
 }

+ 48 - 4
compiler/i386/n386con.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Florian Klaempfl
+    Copyright (c) 1998-2000 by Florian Klaempfl
 
     Generate i386 assembler for constants
 
@@ -22,7 +22,7 @@
 }
 unit n386con;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -85,8 +85,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.14  2002-05-14 19:34:59  peter
-    * removed old logs and updated copyright year
+  Revision 1.15  2002-05-16 19:46:51  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.13  2002/04/02 17:11:36  peter
     * tlocation,treference update
@@ -116,4 +119,45 @@ end.
     - list field removed of the tnode class because it's not used currently
       and can cause hard-to-find bugs
 
+  Revision 1.10  2001/08/26 13:36:57  florian
+    * some cg reorganisation
+    * some PPC updates
+
+  Revision 1.9  2001/07/08 21:00:18  peter
+    * various widestring updates, it works now mostly without charset
+      mapping supported
+
+  Revision 1.8  2001/04/13 01:22:18  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.7  2001/04/02 21:20:37  peter
+    * resulttype rewrite
+
+  Revision 1.6  2000/12/25 00:07:32  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.5  2000/11/29 00:30:47  florian
+    * unused units removed from uses clause
+    * some changes for widestrings
+
+  Revision 1.4  2000/11/20 15:31:38  jonas
+  *  longint typecast to assignment of constant to offset field
+
+  Revision 1.3  2000/11/13 14:44:36  jonas
+    * fixes so no more range errors with improved range checking code
+
+  Revision 1.2  2000/10/31 22:02:56  peter
+    * symtable splitted, no real code changes
+
+  Revision 1.1  2000/10/15 09:33:31  peter
+    * moved n386*.pas to i386/ cpu_target dir
+
+  Revision 1.2  2000/10/14 10:14:48  peter
+    * moehrendorf oct 2000 rewrite
+
+  Revision 1.1  2000/09/28 20:48:52  florian
+  *** empty log message ***
 }

+ 87 - 4
compiler/i386/n386flw.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Florian Klaempfl
+    Copyright (c) 1998-2000 by Florian Klaempfl
 
     Generate i386 assembler for nodes that influence the flow
 
@@ -22,7 +22,7 @@
 }
 unit n386flw;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -739,8 +739,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.24  2002-05-14 19:34:59  peter
-    * removed old logs and updated copyright year
+  Revision 1.25  2002-05-16 19:46:51  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.23  2002/05/12 16:53:17  peter
     * moved entry and exitcode to ncgutil and cgobj
@@ -791,4 +794,84 @@ end.
     - list field removed of the tnode class because it's not used currently
       and can cause hard-to-find bugs
 
+  Revision 1.19  2001/12/29 15:29:58  jonas
+    * powerpc/cgcpu.pas compiles :)
+    * several powerpc-related fixes
+    * cpuasm unit is now based on common tainst unit
+    + nppcmat unit for powerpc (almost complete)
+
+  Revision 1.17  2001/09/29 21:34:04  jonas
+    - removed unused code (replaced by processor independent code)
+
+  Revision 1.16  2001/09/28 20:39:33  jonas
+    * changed all flow control structures (except for exception handling
+      related things) to processor independent code (in new ncgflw unit)
+    + generic cgobj unit which contains lots of code generator helpers with
+      global "cg" class instance variable
+    + cgcpu unit for i386 (implements processor specific routines of the above
+      unit)
+    * updated cgbase and cpubase for the new code generator units
+    * include ncgflw unit in cpunode unit
+
+  Revision 1.15  2001/08/26 13:36:58  florian
+    * some cg reorganisation
+    * some PPC updates
+
+  Revision 1.14  2001/08/06 21:40:50  peter
+    * funcret moved from tprocinfo to tprocdef
+
+  Revision 1.13  2001/07/01 20:16:20  peter
+    * alignmentinfo record added
+    * -Oa argument supports more alignment settings that can be specified
+      per type: PROC,LOOP,VARMIN,VARMAX,CONSTMIN,CONSTMAX,RECORDMIN
+      RECORDMAX,LOCALMIN,LOCALMAX. It is possible to set the mimimum
+      required alignment and the maximum usefull alignment. The final
+      alignment will be choosen per variable size dependent on these
+      settings
+
+  Revision 1.12  2001/04/15 09:48:31  peter
+    * fixed crash in labelnode
+    * easier detection of goto and label in try blocks
+
+  Revision 1.11  2001/04/14 14:07:11  peter
+    * moved more code from pass_1 to det_resulttype
+
+  Revision 1.10  2001/04/13 01:22:19  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.9  2001/04/02 21:20:37  peter
+    * resulttype rewrite
+
+  Revision 1.8  2001/01/27 21:29:35  florian
+     * behavior -Oa optimized
+
+  Revision 1.7  2001/01/06 23:35:05  jonas
+    * fixed webbug 1323
+
+  Revision 1.6  2001/01/05 17:36:58  florian
+  * the info about exception frames is stored now on the stack
+  instead on the heap
+
+  Revision 1.5  2000/12/25 00:07:32  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.4  2000/12/05 11:44:33  jonas
+    + new integer regvar handling, should be much more efficient
+
+  Revision 1.3  2000/11/29 00:30:47  florian
+    * unused units removed from uses clause
+    * some changes for widestrings
+
+  Revision 1.2  2000/10/31 22:02:56  peter
+    * symtable splitted, no real code changes
+
+  Revision 1.1  2000/10/15 09:33:31  peter
+    * moved n386*.pas to i386/ cpu_target dir
+
+  Revision 1.1  2000/10/14 10:14:48  peter
+    * moehrendorf oct 2000 rewrite
+
 }

+ 164 - 6
compiler/i386/n386inl.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Florian Klaempfl
+    Copyright (c) 1998-2000 by Florian Klaempfl
 
     Generate i386 inline nodes
 
@@ -22,7 +22,7 @@
 }
 unit n386inl;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -148,8 +148,14 @@ implementation
                  if is_ansistring(left.resulttype.def) or
                     is_widestring(left.resulttype.def) then
                   begin
-                    location_force_reg(exprasmlist,left.location,OS_ADDR,false);
-                    hregister:=left.location.register;
+                    if left.location.loc<>LOC_REGISTER then
+                     begin
+                       location_release(exprasmlist,left.location);
+                       hregister:=rg.getregisterint(exprasmlist);
+                       cg.a_load_loc_reg(exprasmlist,left.location,hregister);
+                     end
+                    else
+                     hregister:=left.location.register;
                     getlabel(lengthlab);
                     cg.a_cmp_const_reg_label(exprasmlist,OS_ADDR,OC_EQ,0,hregister,lengthlab);
                     reference_reset_base(href,hregister,-8);
@@ -460,8 +466,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.42  2002-05-14 19:35:00  peter
-    * removed old logs and updated copyright year
+  Revision 1.43  2002-05-16 19:46:51  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.41  2002/05/13 19:54:38  peter
     * removed n386ld and n386util units
@@ -540,4 +549,153 @@ end.
   Revision 1.32  2002/03/04 19:10:14  peter
     * removed compiler warnings
 
+  Revision 1.31  2001/12/30 17:24:46  jonas
+    * range checking is now processor independent (part in cgobj,
+      part in cg64f32) and should work correctly again (it needed
+      some changes after the changes of the low and high of
+      tordef's to int64)
+    * maketojumpbool() is now processor independent (in ncgutil)
+    * getregister32 is now called getregisterint
+
+  Revision 1.30  2001/12/10 14:34:04  jonas
+    * fixed type conversions from dynamic arrays to open arrays
+
+  Revision 1.29  2001/12/04 15:59:03  jonas
+    * converted lo/hi to processor independent code, generated code is the
+      same as before (when turning on the optimizer)
+
+  Revision 1.28  2001/12/02 16:19:17  jonas
+    * less unnecessary regvar loading with if-statements
+
+  Revision 1.26  2001/09/28 20:38:51  jonas
+    * fixed big bug in my previous changes (the arguent for bts/btr is always
+      a 32 bit register, but it wasn't cleared properly if the value was only
+      an 8 bit one)
+
+  Revision 1.25  2001/09/27 13:03:18  jonas
+    * fixed bug reported by sg about self not being restored after calling
+      setlength
+
+  Revision 1.24  2001/09/04 14:32:45  jonas
+    * simplified det_resulttype code for include/exclude
+    * include/exclude doesn't use any helpers anymore in the i386 secondpass
+
+  Revision 1.23  2001/08/30 20:13:57  peter
+    * rtti/init table updates
+    * rttisym for reusable global rtti/init info
+    * support published for interfaces
+
+  Revision 1.22  2001/08/28 13:24:47  jonas
+    + compilerproc implementation of most string-related type conversions
+    - removed all code from the compiler which has been replaced by
+      compilerproc implementations (using ($ifdef hascompilerproc) is not
+      necessary in the compiler)
+
+  Revision 1.21  2001/08/26 13:36:58  florian
+    * some cg reorganisation
+    * some PPC updates
+
+  Revision 1.20  2001/08/24 12:33:54  jonas
+    * fixed big bug in handle_str that caused it to (almost) always call
+      fpc_<stringtype>_longint
+    * fixed small bug in handle_read_write that caused wrong warnigns about
+      uninitialized vars with read(ln)
+    + handle_val (processor independent val() handling)
+
+  Revision 1.19  2001/08/23 14:28:36  jonas
+    + tempcreate/ref/delete nodes (allows the use of temps in the
+      resulttype and first pass)
+    * made handling of read(ln)/write(ln) processor independent
+    * moved processor independent handling for str and reset/rewrite-typed
+      from firstpass to resulttype pass
+    * changed names of helpers in text.inc to be generic for use as
+      compilerprocs + added "iocheck" directive for most of them
+    * reading of ordinals is done by procedures instead of functions
+      because otherwise FPC_IOCHECK overwrote the result before it could
+      be stored elsewhere (range checking still works)
+    * compilerprocs can now be used in the system unit before they are
+      implemented
+    * added note to errore.msg that booleans can't be read using read/readln
+
+  Revision 1.18  2001/08/13 15:39:52  jonas
+    * made in_reset_typedfile/in_rewrite_typedfile handling processor
+      independent
+
+  Revision 1.17  2001/08/13 12:41:57  jonas
+    * made code for str(x,y) completely processor independent
+
+  Revision 1.16  2001/07/10 18:01:08  peter
+    * internal length for ansistring and widestrings
+
+  Revision 1.15  2001/07/08 21:00:18  peter
+    * various widestring updates, it works now mostly without charset
+      mapping supported
+
+  Revision 1.14  2001/04/13 01:22:19  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.13  2001/04/02 21:20:37  peter
+    * resulttype rewrite
+
+  Revision 1.12  2001/03/13 11:52:48  jonas
+    * fixed some memory leaks
+
+  Revision 1.11  2000/12/25 00:07:33  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.10  2000/12/09 22:51:37  florian
+    * helper name of val for qword fixed
+
+  Revision 1.9  2000/12/07 17:19:46  jonas
+    * new constant handling: from now on, hex constants >$7fffffff are
+      parsed as unsigned constants (otherwise, $80000000 got sign extended
+      and became $ffffffff80000000), all constants in the longint range
+      become longints, all constants >$7fffffff and <=cardinal($ffffffff)
+      are cardinals and the rest are int64's.
+    * added lots of longint typecast to prevent range check errors in the
+      compiler and rtl
+    * type casts of symbolic ordinal constants are now preserved
+    * fixed bug where the original resulttype.def wasn't restored correctly
+      after doing a 64bit rangecheck
+
+  Revision 1.8  2000/12/05 11:44:33  jonas
+    + new integer regvar handling, should be much more efficient
+
+  Revision 1.7  2000/11/29 00:30:47  florian
+    * unused units removed from uses clause
+    * some changes for widestrings
+
+  Revision 1.6  2000/11/12 23:24:15  florian
+    * interfaces are basically running
+
+  Revision 1.5  2000/11/09 17:46:56  florian
+    * System.TypeInfo fixed
+    + System.Finalize implemented
+    + some new keywords for interface support added
+
+  Revision 1.4  2000/10/31 22:02:56  peter
+    * symtable splitted, no real code changes
+
+  Revision 1.3  2000/10/26 14:15:07  jonas
+    * fixed setlength for shortstrings
+
+  Revision 1.2  2000/10/21 18:16:13  florian
+    * a lot of changes:
+       - basic dyn. array support
+       - basic C++ support
+       - some work for interfaces done
+       ....
+
+  Revision 1.1  2000/10/15 09:33:31  peter
+    * moved n386*.pas to i386/ cpu_target dir
+
+  Revision 1.2  2000/10/15 09:08:58  peter
+    * use System for the systemunit instead of target dependent
+
+  Revision 1.1  2000/10/14 10:14:49  peter
+    * moehrendorf oct 2000 rewrite
+
 }

+ 104 - 4
compiler/i386/n386mat.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Florian Klaempfl
+    Copyright (c) 1998-2000 by Florian Klaempfl
 
     Generate i386 assembler for math nodes
 
@@ -22,7 +22,7 @@
 }
 unit n386mat;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -830,8 +830,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.29  2002-05-14 19:35:00  peter
-    * removed old logs and updated copyright year
+  Revision 1.30  2002-05-16 19:46:51  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.28  2002/05/13 19:54:38  peter
     * removed n386ld and n386util units
@@ -889,4 +892,101 @@ end.
   Revision 1.23  2002/03/04 19:10:14  peter
     * removed compiler warnings
 
+  Revision 1.22  2001/12/30 17:24:47  jonas
+    * range checking is now processor independent (part in cgobj,
+      part in cg64f32) and should work correctly again (it needed
+      some changes after the changes of the low and high of
+      tordef's to int64)
+    * maketojumpbool() is now processor independent (in ncgutil)
+    * getregister32 is now called getregisterint
+
+  Revision 1.21  2001/12/29 15:27:24  jonas
+    * made 'mod powerof2' -> 'and' optimization processor independent
+
+  Revision 1.20  2001/12/27 15:33:58  jonas
+    * fixed fpuregister counting errors ("merged")
+
+  Revision 1.19  2001/12/07 13:03:49  jonas
+    * fixed web bug 1716
+
+  Revision 1.18  2001/12/04 15:57:28  jonas
+    * never generate any "shll/shrl $0,%reg" anymore
+
+  Revision 1.17  2001/12/02 16:19:17  jonas
+    * less unnecessary regvar loading with if-statements
+
+  Revision 1.16  2001/09/05 15:22:10  jonas
+    * made multiplying, dividing and mod'ing of int64 and qword processor
+      independent with compilerprocs (+ small optimizations by using shift/and
+      where possible)
+
+  Revision 1.15  2001/08/29 12:03:23  jonas
+    * fixed wrong regalloc info around FPC_MUL/DIV/MOD_INT64/QWORD calls
+    * fixed partial result overwriting with the above calls too
+
+  Revision 1.14  2001/08/26 13:37:00  florian
+    * some cg reorganisation
+    * some PPC updates
+
+  Revision 1.13  2001/04/13 01:22:19  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.12  2001/04/04 22:37:06  peter
+    * fix for not with no 32bit values
+
+  Revision 1.11  2001/04/02 21:20:38  peter
+    * resulttype rewrite
+
+  Revision 1.10  2001/02/03 12:52:34  jonas
+    * fixed web bug 1383
+
+  Revision 1.9  2000/12/07 17:19:46  jonas
+    * new constant handling: from now on, hex constants >$7fffffff are
+      parsed as unsigned constants (otherwise, $80000000 got sign extended
+      and became $ffffffff80000000), all constants in the longint range
+      become longints, all constants >$7fffffff and <=cardinal($ffffffff)
+      are cardinals and the rest are int64's.
+    * added lots of longint typecast to prevent range check errors in the
+      compiler and rtl
+    * type casts of symbolic ordinal constants are now preserved
+    * fixed bug where the original resulttype.def wasn't restored correctly
+      after doing a 64bit rangecheck
+
+  Revision 1.8  2000/12/05 11:44:33  jonas
+    + new integer regvar handling, should be much more efficient
+
+  Revision 1.7  2000/11/29 00:30:48  florian
+    * unused units removed from uses clause
+    * some changes for widestrings
+
+  Revision 1.6  2000/11/20 14:05:50  jonas
+    * fixed bug in my changes to fix the regalloc info for div/mod ("merged")
+
+  Revision 1.5  2000/10/31 22:02:56  peter
+    * symtable splitted, no real code changes
+
+  Revision 1.4  2000/10/19 16:26:52  jonas
+    * fixed wrong regalloc info for secondmoddiv ("merged", also small
+      correction made afterwards in fixes branch)
+
+  Revision 1.3  2000/10/17 15:41:48  jonas
+    * fixed stupid error in previous commit :/
+
+  Revision 1.1  2000/10/15 09:33:32  peter
+    * moved n386*.pas to i386/ cpu_target dir
+
+  Revision 1.4  2000/10/14 10:14:49  peter
+    * moehrendorf oct 2000 rewrite
+
+  Revision 1.3  2000/09/30 16:08:45  peter
+    * more cg11 updates
+
+  Revision 1.2  2000/09/24 15:06:18  peter
+    * use defines.inc
+
+  Revision 1.1  2000/09/22 22:24:37  florian
+    * initial revision
+
 }

+ 89 - 4
compiler/i386/n386mem.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Florian Klaempfl
+    Copyright (c) 1998-2000 by Florian Klaempfl
 
     Generate i386 assembler for in memory related nodes
 
@@ -22,7 +22,7 @@
 }
 unit n386mem;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -519,8 +519,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.31  2002-05-14 19:35:00  peter
-    * removed old logs and updated copyright year
+  Revision 1.32  2002-05-16 19:46:51  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.30  2002/05/13 19:54:38  peter
     * removed n386ld and n386util units
@@ -611,4 +614,86 @@ end.
   Revision 1.20  2002/03/04 19:10:14  peter
     * removed compiler warnings
 
+  Revision 1.19  2001/12/30 17:24:47  jonas
+    * range checking is now processor independent (part in cgobj,
+      part in cg64f32) and should work correctly again (it needed
+      some changes after the changes of the low and high of
+      tordef's to int64)
+    * maketojumpbool() is now processor independent (in ncgutil)
+    * getregister32 is now called getregisterint
+
+  Revision 1.18  2001/12/03 21:48:43  peter
+    * freemem change to value parameter
+    * torddef low/high range changed to int64
+
+  Revision 1.17  2001/09/30 16:17:17  jonas
+    * made most constant and mem handling processor independent
+
+  Revision 1.16  2001/08/30 20:13:57  peter
+    * rtti/init table updates
+    * rttisym for reusable global rtti/init info
+    * support published for interfaces
+
+  Revision 1.15  2001/08/26 13:37:00  florian
+    * some cg reorganisation
+    * some PPC updates
+
+  Revision 1.14  2001/07/08 21:00:18  peter
+    * various widestring updates, it works now mostly without charset
+      mapping supported
+
+  Revision 1.13  2001/04/18 22:02:03  peter
+    * registration of targets and assemblers
+
+  Revision 1.12  2001/04/13 01:22:19  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.11  2001/04/02 21:20:38  peter
+    * resulttype rewrite
+
+  Revision 1.10  2001/03/11 22:58:52  peter
+    * getsym redesign, removed the globals srsym,srsymtable
+
+  Revision 1.9  2001/02/02 22:38:00  peter
+    * fixed crash with new(precord), merged
+
+  Revision 1.8  2000/12/25 00:07:33  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.7  2000/12/05 11:44:33  jonas
+    + new integer regvar handling, should be much more efficient
+
+  Revision 1.6  2000/11/29 00:30:48  florian
+    * unused units removed from uses clause
+    * some changes for widestrings
+
+  Revision 1.5  2000/11/04 14:25:24  florian
+    + merged Attila's changes for interfaces, not tested yet
+
+  Revision 1.4  2000/10/31 22:02:57  peter
+    * symtable splitted, no real code changes
+
+  Revision 1.3  2000/10/31 14:18:53  jonas
+    * merged double deleting of left location when using a temp in
+      secondwith (merged from fixes branch). This also fixes web bug1194
+
+  Revision 1.2  2000/10/21 18:16:13  florian
+    * a lot of changes:
+       - basic dyn. array support
+       - basic C++ support
+       - some work for interfaces done
+       ....
+
+  Revision 1.1  2000/10/15 09:33:32  peter
+    * moved n386*.pas to i386/ cpu_target dir
+
+  Revision 1.2  2000/10/14 21:52:54  peter
+    * fixed memory leaks
+
+  Revision 1.1  2000/10/14 10:14:49  peter
+    * moehrendorf oct 2000 rewrite
+
 }

+ 45 - 4
compiler/i386/n386obj.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Kovacs Attila Zoltan
+    Copyright (c) 1998-2000 by Kovacs Attila Zoltan
 
     Generate i386 assembly wrapper code interface implementor objects
 
@@ -22,7 +22,7 @@
 }
 unit n386obj;
 
-{$i defines.inc }
+{$i fpcdefs.inc}
 
 interface
 
@@ -237,8 +237,11 @@ initialization
 end.
 {
   $Log$
-  Revision 1.8  2002-05-14 19:35:00  peter
-    * removed old logs and updated copyright year
+  Revision 1.9  2002-05-16 19:46:52  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.7  2002/05/12 16:53:17  peter
     * moved entry and exitcode to ncgutil and cgobj
@@ -285,4 +288,42 @@ end.
     - list field removed of the tnode class because it's not used currently
       and can cause hard-to-find bugs
 
+  Revision 1.4  2001/10/25 21:22:41  peter
+    * calling convention rewrite
+
+  Revision 1.3  2001/09/19 11:04:41  michael
+  * Smartlinking with interfaces fixed
+  * Better smartlinking for rtti and init tables
+
+  Revision 1.2  2001/08/26 13:37:00  florian
+    * some cg reorganisation
+    * some PPC updates
+
+  Revision 1.1  2001/04/21 13:37:17  peter
+    * made tclassheader using class of to implement cpu dependent code
+
+  Revision 1.5  2001/04/13 01:22:19  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.4  2000/12/25 00:07:33  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.3  2000/11/29 00:30:47  florian
+    * unused units removed from uses clause
+    * some changes for widestrings
+
+  Revision 1.2  2000/11/12 23:24:15  florian
+    * interfaces are basically running
+
+  Revision 1.1  2000/11/04 14:25:23  florian
+    + merged Attila's changes for interfaces, not tested yet
+
+  Revision 1.1.2.2  2000/06/15 15:05:30  kaz
+    * An minor bug fix
+
+  Revision 1.1.2.1  2000/06/15 06:26:34  kaz
+    * Initial version
 }

+ 28 - 4
compiler/i386/n386opt.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Jonas Maebe
+    Copyright (c) 1998-2000 by Jonas Maebe
 
     This unit implements the 80x86 implementation of optimized nodes
 
@@ -22,7 +22,7 @@
 }
 unit n386opt;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 uses node, nopt;
@@ -248,8 +248,11 @@ end.
 
 {
   $Log$
-  Revision 1.15  2002-05-14 19:35:00  peter
-    * removed old logs and updated copyright year
+  Revision 1.16  2002-05-16 19:46:52  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.14  2002/05/13 19:54:38  peter
     * removed n386ld and n386util units
@@ -318,4 +321,25 @@ end.
     - list field removed of the tnode class because it's not used currently
       and can cause hard-to-find bugs
 
+  Revision 1.6  2001/12/31 09:53:15  jonas
+    * changed remaining "getregister32" calls to ":=rg.getregisterint(exprasmlist);"
+
+  Revision 1.5  2001/08/26 13:37:00  florian
+    * some cg reorganisation
+    * some PPC updates
+
+  Revision 1.4  2001/04/13 01:22:19  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.3  2001/04/02 21:20:38  peter
+    * resulttype rewrite
+
+  Revision 1.2  2001/01/06 19:12:31  jonas
+    * fixed IE 10 (but code is less efficient now :( )
+
+  Revision 1.1  2001/01/04 11:24:19  jonas
+    + initial implementation (still needs to be made more modular)
+
 }

+ 96 - 4
compiler/i386/n386set.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Florian Klaempfl
+    Copyright (c) 1998-2000 by Florian Klaempfl
 
     Generate i386 assembler for in set/case nodes
 
@@ -22,7 +22,7 @@
 }
 unit n386set;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -1016,8 +1016,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.29  2002-05-14 19:35:00  peter
-    * removed old logs and updated copyright year
+  Revision 1.30  2002-05-16 19:46:52  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.28  2002/05/13 19:54:38  peter
     * removed n386ld and n386util units
@@ -1094,4 +1097,93 @@ end.
     - list field removed of the tnode class because it's not used currently
       and can cause hard-to-find bugs
 
+  Revision 1.19  2001/12/31 09:53:15  jonas
+    * changed remaining "getregister32" calls to "getregisterint"
+
+  Revision 1.18  2001/12/03 21:48:43  peter
+    * freemem change to value parameter
+    * torddef low/high range changed to int64
+
+  Revision 1.17  2001/09/04 11:38:55  jonas
+    + searchsystype() and searchsystype() functions in symtable
+    * changed ninl and nadd to use these functions
+    * i386 set comparison functions now return their results in al instead
+      of in the flags so that they can be sued as compilerprocs
+    - removed all processor specific code from n386add.pas that has to do
+      with set handling, it's now all done in nadd.pas
+    * fixed fpc_set_contains_sets in genset.inc
+    * fpc_set_in_byte is now coded inline in n386set.pas and doesn't use a
+      helper anymore
+    * some small fixes in compproc.inc/set.inc regarding the declaration of
+      internal helper types (fpc_small_set and fpc_normal_set)
+
+  Revision 1.16  2001/08/26 13:37:00  florian
+    * some cg reorganisation
+    * some PPC updates
+
+  Revision 1.15  2001/05/06 17:12:14  jonas
+    * fixed an IE10 and another bug with [var1..var2] construct
+
+  Revision 1.14  2001/04/13 01:22:19  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.13  2001/04/06 14:09:34  jonas
+    * fixed bug in ti386innode.pass_2 code and made it simpler/faster
+
+  Revision 1.12  2001/04/02 21:20:38  peter
+    * resulttype rewrite
+
+  Revision 1.11  2001/02/11 12:14:56  jonas
+    * simplified and optimized code generated for in-statements
+
+  Revision 1.10  2000/12/25 00:07:33  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.9  2000/12/18 17:45:32  jonas
+    * int64 case fixes
+    * explicit longint type casts for constants used in assembler code
+      generation s,ice they can be cardinals too (or even int64's in case of
+      range check errors)
+
+  Revision 1.8  2000/12/16 15:58:18  jonas
+    * removed warnings about possible range check errors
+
+  Revision 1.7  2000/12/05 11:44:34  jonas
+    + new integer regvar handling, should be much more efficient
+
+  Revision 1.6  2000/11/29 00:30:49  florian
+    * unused units removed from uses clause
+    * some changes for widestrings
+
+  Revision 1.5  2000/11/17 14:09:00  jonas
+    * fixed webbug 1222 ("merged")
+
+  Revision 1.4  2000/11/13 14:44:36  jonas
+    * fixes so no more range errors with improved range checking code
+
+  Revision 1.3  2000/10/31 22:02:57  peter
+    * symtable splitted, no real code changes
+
+  Revision 1.2  2000/10/26 15:53:27  jonas
+    * fixed web bug1192 (changed an ungetregister32 to ungetregister)
+      ("merged" from fixes)
+
+  Revision 1.1  2000/10/15 09:33:32  peter
+    * moved n386*.pas to i386/ cpu_target dir
+
+  Revision 1.4  2000/10/14 10:14:49  peter
+    * moehrendorf oct 2000 rewrite
+
+  Revision 1.3  2000/09/30 16:08:45  peter
+    * more cg11 updates
+
+  Revision 1.2  2000/09/24 20:17:44  florian
+    * more conversion work done
+
+  Revision 1.1  2000/09/24 19:38:39  florian
+    * initial implementation
+
 }

+ 127 - 4
compiler/i386/popt386.pas

@@ -1,6 +1,6 @@
  {
     $Id$
-    Copyright (c) 1998-2002 by Florian Klaempfl and Jonas Maebe
+    Copyright (c) 1998-2000 by Florian Klaempfl and Jonas Maebe
 
     This unit contains the peephole optimizer.
 
@@ -22,7 +22,7 @@
 }
 Unit POpt386;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 Interface
 
@@ -2043,8 +2043,11 @@ End.
 
 {
   $Log$
-  Revision 1.25  2002-05-14 19:35:00  peter
-    * removed old logs and updated copyright year
+  Revision 1.26  2002-05-16 19:46:52  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.24  2002/05/12 16:53:18  peter
     * moved entry and exitcode to ncgutil and cgobj
@@ -2109,4 +2112,124 @@ End.
     - list field removed of the tnode class because it's not used currently
       and can cause hard-to-find bugs
 
+  Revision 1.17  2001/12/29 15:29:59  jonas
+    * powerpc/cgcpu.pas compiles :)
+    * several powerpc-related fixes
+    * cpuasm unit is now based on common tainst unit
+    + nppcmat unit for powerpc (almost complete)
+
+  Revision 1.16  2001/10/12 13:53:24  jonas
+    * fixed small crashing bug ("merged")
+    * some more optimizations are now only done once at the end of the optimizing
+      cycle instead of every iteration
+
+  Revision 1.15  2001/08/26 13:37:01  florian
+    * some cg reorganisation
+    * some PPC updates
+
+  Revision 1.14  2001/08/01 09:46:55  jonas
+    * fixed endless loop with web bug 1571 (merged)
+
+  Revision 1.13  2001/04/13 01:22:19  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.12  2001/04/06 14:06:03  jonas
+    * fixed incompatibility between new regvar handling and -Op2
+
+  Revision 1.11  2001/04/02 21:20:39  peter
+    * resulttype rewrite
+
+  Revision 1.10  2001/02/08 12:13:40  jonas
+    * fixed web bug 1391
+
+  Revision 1.9  2001/01/27 21:29:35  florian
+     * behavior -Oa optimized
+
+  Revision 1.8  2001/01/10 10:29:36  jonas
+    * really fixed problems with -Op2 opts (merged)
+
+  Revision 1.7  2001/01/07 15:49:49  jonas
+    * fixed bug in call/jmp optimization with -Op1 and -Op2
+
+  Revision 1.6  2000/12/25 00:07:33  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.5  2000/12/16 16:00:12  jonas
+    * removed warnings about possible range check errors
+
+  Revision 1.4  2000/11/29 00:30:49  florian
+    * unused units removed from uses clause
+    * some changes for widestrings
+
+  Revision 1.3  2000/11/14 09:53:18  jonas
+    * added missing allocregbetween() (merged)
+
+  Revision 1.2  2000/10/24 10:40:54  jonas
+    + register renaming ("fixes" bug1088)
+    * changed command line options meanings for optimizer:
+        O2 now means peepholopts, CSE and register renaming in 1 pass
+        O3 is the same, but repeated until no further optimizations are
+          possible or until 5 passes have been done (to avoid endless loops)
+    * changed aopt386 so it does this looping
+    * added some procedures from csopt386 to the interface because they're
+      used by rropt386 as well
+    * some changes to csopt386 and daopt386 so that newly added instructions
+      by the CSE get optimizer info (they were simply skipped previously),
+      this fixes some bugs
+
+  Revision 1.1  2000/10/15 09:47:43  peter
+    * moved to i386/
+
+  Revision 1.13  2000/10/02 13:01:29  jonas
+    * fixed bug regarding removal of "test/or reg,reg": apparently, shr/shl
+      doesn't set the zero flag according to the contents of the register
+      after the shift :( (mergfed from fixes branch)
+
+  Revision 1.12  2000/09/24 15:06:23  peter
+    * use defines.inc
+
+  Revision 1.11  2000/09/18 11:28:36  jonas
+    * fixed web bug 1133 (merged from fixes branch)
+
+  Revision 1.10  2000/08/18 10:09:13  jonas
+    * fix for web bug1099 (merged from fixes branch)
+
+  Revision 1.9  2000/08/05 13:33:08  peter
+    * $ifdef go32v2 -> target_info.target=go32v2
+
+  Revision 1.8  2000/08/05 10:35:51  jonas
+    * readded l1 variable (between ifdef go32v2 to avoid hints/notes)
+
+  Revision 1.7  2000/08/04 22:00:52  peter
+    * merges from fixes
+
+  Revision 1.6  2000/07/31 08:44:05  jonas
+    - removed imul support from -dfoldarithops since "imull [reg32],[mem32]"
+      doesn't exist (merged from fixes branch)
+
+  Revision 1.5  2000/07/28 13:56:23  jonas
+    * fixed bug in shr/shl optimization when -Og is used (merged from fixes
+      branch)
+
+  Revision 1.4  2000/07/21 15:19:55  jonas
+    * daopt386: changes to getnextinstruction/getlastinstruction so they
+      ignore labels who have is_addr set
+    + daopt386/csopt386: remove loads of registers which are overwritten
+       before their contents are used (especially usefull for removing superfluous
+      maybe_loadself outputs and push/pops transformed by below optimization
+    + popt386: transform pop/pop/pop/.../push/push/push to sequences of
+      'movl x(%esp),%reg' (only active when compiling a go32v2 compiler
+      currently because I don't know whether it's safe to do this under Win32/
+      Linux (because of problems we had when using esp as frame pointer on
+      those os'es)
+
+  Revision 1.3  2000/07/14 05:11:49  michael
+  + Patch to 1.1
+
+  Revision 1.2  2000/07/13 11:32:45  michael
+  + removed logs
+
 }

+ 72 - 4
compiler/i386/ra386.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Carl Eric Codere and Peter Vreman
+    Copyright (c) 1998-2000 by Carl Eric Codere and Peter Vreman
 
     Handles the common i386 assembler reader routines
 
@@ -22,7 +22,7 @@
 }
 unit Ra386;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -668,8 +668,11 @@ end;
 end.
 {
   $Log$
-  Revision 1.19  2002-05-14 19:35:00  peter
-    * removed old logs and updated copyright year
+  Revision 1.20  2002-05-16 19:46:52  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.18  2002/05/12 16:53:18  peter
     * moved entry and exitcode to ncgutil and cgobj
@@ -715,4 +718,69 @@ end.
    * implicit result variable generation for assembler routines
    * removed m_tp modeswitch, use m_tp7 or not(m_fpc) instead
 
+  Revision 1.13  2001/11/02 22:58:11  peter
+    * procsym definition rewrite
+
+  Revision 1.12  2001/08/26 13:37:01  florian
+    * some cg reorganisation
+    * some PPC updates
+
+  Revision 1.11  2001/08/07 18:47:14  peter
+    * merged netbsd start
+    * profile for win32
+
+  Revision 1.10  2001/08/06 21:40:50  peter
+    * funcret moved from tprocinfo to tprocdef
+
+  Revision 1.9  2001/04/13 01:22:19  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.8  2001/04/05 21:33:45  peter
+    * movd and opsize fix merged
+
+  Revision 1.7  2001/03/05 21:49:44  peter
+    * noag386bin fix
+
+  Revision 1.6  2001/02/20 21:51:36  peter
+    * fpu fixes (merged)
+
+  Revision 1.5  2001/01/12 19:18:42  peter
+    * check for valid asm instructions
+
+  Revision 1.4  2000/12/25 00:07:34  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.3  2000/11/29 00:30:50  florian
+    * unused units removed from uses clause
+    * some changes for widestrings
+
+  Revision 1.2  2000/10/31 22:30:14  peter
+    * merged asm result patch part 2
+
+  Revision 1.1  2000/10/15 09:47:43  peter
+    * moved to i386/
+
+  Revision 1.7  2000/10/08 10:26:33  peter
+    * merged @result fix from Pierre
+
+  Revision 1.6  2000/09/24 21:33:47  peter
+    * message updates merges
+
+  Revision 1.5  2000/09/24 15:06:25  peter
+    * use defines.inc
+
+  Revision 1.4  2000/09/16 12:22:52  peter
+    * freebsd support merged
+
+  Revision 1.3  2000/09/03 11:44:00  peter
+    * error for not specified operand size, which is now required for
+      newer binutils (merged)
+    * previous commit fix for tcflw (merged)
+
+  Revision 1.2  2000/07/13 11:32:47  michael
+  + removed logs
+
 }

+ 82 - 4
compiler/i386/ra386att.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Carl Eric Codere and Peter Vreman
+    Copyright (c) 1998-2000 by Carl Eric Codere and Peter Vreman
 
     Does the parsing for the AT&T styled inline assembler.
 
@@ -22,7 +22,7 @@
 }
 Unit Ra386att;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 Interface
 
@@ -2129,8 +2129,11 @@ finalization
 end.
 {
   $Log$
-  Revision 1.22  2002-05-14 19:35:00  peter
-    * removed old logs and updated copyright year
+  Revision 1.23  2002-05-16 19:46:52  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.21  2002/04/15 19:12:09  carl
   + target_info.size_of_pointer -> pointer_size
@@ -2165,4 +2168,79 @@ end.
    * implicit result variable generation for assembler routines
    * removed m_tp modeswitch, use m_tp7 or not(m_fpc) instead
 
+  Revision 1.15  2001/11/02 22:58:11  peter
+    * procsym definition rewrite
+
+  Revision 1.14  2001/08/26 13:37:02  florian
+    * some cg reorganisation
+    * some PPC updates
+
+  Revision 1.13  2001/08/06 21:40:50  peter
+    * funcret moved from tprocinfo to tprocdef
+
+  Revision 1.12  2001/04/18 22:02:03  peter
+    * registration of targets and assemblers
+
+  Revision 1.11  2001/04/13 20:06:05  peter
+    * allow unit.identifier in asm readers
+
+  Revision 1.10  2001/04/13 18:20:21  peter
+    * scanner object to class
+
+  Revision 1.9  2001/04/13 01:22:21  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.8  2001/03/25 12:29:45  peter
+    * offset_fixup fixes (merged)
+
+  Revision 1.7  2001/03/11 22:58:52  peter
+    * getsym redesign, removed the globals srsym,srsymtable
+
+  Revision 1.6  2000/12/25 00:07:34  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.5  2000/12/07 17:19:46  jonas
+    * new constant handling: from now on, hex constants >$7fffffff are
+      parsed as unsigned constants (otherwise, $80000000 got sign extended
+      and became $ffffffff80000000), all constants in the longint range
+      become longints, all constants >$7fffffff and <=cardinal($ffffffff)
+      are cardinals and the rest are int64's.
+    * added lots of longint typecast to prevent range check errors in the
+      compiler and rtl
+    * type casts of symbolic ordinal constants are now preserved
+    * fixed bug where the original resulttype wasn't restored correctly
+      after doing a 64bit rangecheck
+
+  Revision 1.4  2000/11/30 20:27:51  peter
+    * merged fix for bug 1229
+
+  Revision 1.3  2000/11/29 00:30:50  florian
+    * unused units removed from uses clause
+    * some changes for widestrings
+
+  Revision 1.2  2000/10/31 22:02:57  peter
+    * symtable splitted, no real code changes
+
+  Revision 1.1  2000/10/15 09:47:43  peter
+    * moved to i386/
+
+  Revision 1.6  2000/10/14 10:14:52  peter
+    * moehrendorf oct 2000 rewrite
+
+  Revision 1.5  2000/09/24 21:19:51  peter
+    * delphi compile fixes
+
+  Revision 1.4  2000/09/24 15:06:26  peter
+    * use defines.inc
+
+  Revision 1.3  2000/08/27 16:11:52  peter
+    * moved some util functions from globals,cobjects to cutils
+    * splitted files into finput,fmodule
+
+  Revision 1.2  2000/07/13 11:32:48  michael
+  + removed logs
+
 }

+ 61 - 4
compiler/i386/ra386dir.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Florian Klaempfl
+    Copyright (c) 1998-2000 by Florian Klaempfl
 
     Reads inline assembler and writes the lines direct to the output
 
@@ -22,7 +22,7 @@
 }
 unit Ra386dir;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -304,8 +304,11 @@ initialization
 end.
 {
   $Log$
-  Revision 1.16  2002-05-14 19:35:00  peter
-    * removed old logs and updated copyright year
+  Revision 1.17  2002-05-16 19:46:52  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.15  2002/05/12 16:53:18  peter
     * moved entry and exitcode to ncgutil and cgobj
@@ -335,4 +338,58 @@ end.
   Revision 1.13  2002/04/14 17:01:52  carl
   + att_reg2str -> gas_reg2str
 
+  Revision 1.12  2001/11/02 22:58:11  peter
+    * procsym definition rewrite
+
+  Revision 1.11  2001/08/26 13:37:02  florian
+    * some cg reorganisation
+    * some PPC updates
+
+  Revision 1.10  2001/08/06 21:40:51  peter
+    * funcret moved from tprocinfo to tprocdef
+
+  Revision 1.9  2001/04/18 22:02:03  peter
+    * registration of targets and assemblers
+
+  Revision 1.8  2001/04/13 18:20:21  peter
+    * scanner object to class
+
+  Revision 1.7  2001/04/13 01:22:21  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.6  2001/04/02 21:20:40  peter
+    * resulttype rewrite
+
+  Revision 1.5  2001/03/11 22:58:52  peter
+    * getsym redesign, removed the globals srsym,srsymtable
+
+  Revision 1.4  2000/12/25 00:07:34  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.3  2000/11/29 00:30:50  florian
+    * unused units removed from uses clause
+    * some changes for widestrings
+
+  Revision 1.2  2000/10/31 22:02:57  peter
+    * symtable splitted, no real code changes
+
+  Revision 1.1  2000/10/15 09:47:43  peter
+    * moved to i386/
+
+  Revision 1.5  2000/10/14 10:14:52  peter
+    * moehrendorf oct 2000 rewrite
+
+  Revision 1.4  2000/09/24 15:06:26  peter
+    * use defines.inc
+
+  Revision 1.3  2000/08/27 16:11:52  peter
+    * moved some util functions from globals,cobjects to cutils
+    * splitted files into finput,fmodule
+
+  Revision 1.2  2000/07/13 11:32:48  michael
+  + removed logs
+
 }

+ 101 - 4
compiler/i386/ra386int.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Carl Eric Codere and Peter Vreman
+    Copyright (c) 1998-2000 by Carl Eric Codere and Peter Vreman
 
     Does the parsing process for the intel styled inline assembler.
 
@@ -22,7 +22,7 @@
 }
 Unit Ra386int;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 Interface
 
@@ -1959,8 +1959,11 @@ finalization
 end.
 {
   $Log$
-  Revision 1.26  2002-05-14 19:35:00  peter
-    * removed old logs and updated copyright year
+  Revision 1.27  2002-05-16 19:46:52  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.25  2002/04/20 21:37:07  carl
   + generic FPC_CHECKPOINTER
@@ -2007,4 +2010,98 @@ end.
    * implicit result variable generation for assembler routines
    * removed m_tp modeswitch, use m_tp7 or not(m_fpc) instead
 
+  Revision 1.19  2001/11/02 22:58:11  peter
+    * procsym definition rewrite
+
+  Revision 1.18  2001/09/17 21:29:14  peter
+    * merged netbsd, fpu-overflow from fixes branch
+
+  Revision 1.17  2001/08/26 13:37:03  florian
+    * some cg reorganisation
+    * some PPC updates
+
+  Revision 1.16  2001/08/06 21:40:51  peter
+    * funcret moved from tprocinfo to tprocdef
+
+  Revision 1.15  2001/04/18 22:02:03  peter
+    * registration of targets and assemblers
+
+  Revision 1.14  2001/04/13 20:06:05  peter
+    * allow unit.identifier in asm readers
+
+  Revision 1.13  2001/04/13 18:20:21  peter
+    * scanner object to class
+
+  Revision 1.12  2001/04/13 01:22:21  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.11  2001/03/25 12:29:45  peter
+    * offset_fixup fixes (merged)
+
+  Revision 1.10  2001/03/11 22:58:52  peter
+    * getsym redesign, removed the globals srsym,srsymtable
+
+  Revision 1.9  2001/02/20 21:51:36  peter
+    * fpu fixes (merged)
+
+  Revision 1.8  2001/02/09 23:42:49  peter
+    * merged fix for bug 1327
+
+  Revision 1.7  2001/01/05 17:36:58  florian
+  * the info about exception frames is stored now on the stack
+  instead on the heap
+
+  Revision 1.6  2000/12/25 00:07:34  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.5  2000/12/07 17:19:46  jonas
+    * new constant handling: from now on, hex constants >$7fffffff are
+      parsed as unsigned constants (otherwise, $80000000 got sign extended
+      and became $ffffffff80000000), all constants in the longint range
+      become longints, all constants >$7fffffff and <=cardinal($ffffffff)
+      are cardinals and the rest are int64's.
+    * added lots of longint typecast to prevent range check errors in the
+      compiler and rtl
+    * type casts of symbolic ordinal constants are now preserved
+    * fixed bug where the original resulttype wasn't restored correctly
+      after doing a 64bit rangecheck
+
+  Revision 1.4  2000/11/30 20:27:51  peter
+    * merged fix for bug 1229
+
+  Revision 1.3  2000/11/29 00:30:51  florian
+    * unused units removed from uses clause
+    * some changes for widestrings
+
+  Revision 1.2  2000/10/31 22:02:57  peter
+    * symtable splitted, no real code changes
+
+  Revision 1.1  2000/10/15 09:47:43  peter
+    * moved to i386/
+
+  Revision 1.8  2000/10/14 10:14:52  peter
+    * moehrendorf oct 2000 rewrite
+
+  Revision 1.7  2000/09/24 21:19:51  peter
+    * delphi compile fixes
+
+  Revision 1.6  2000/09/24 15:06:26  peter
+    * use defines.inc
+
+  Revision 1.5  2000/08/27 16:11:52  peter
+    * moved some util functions from globals,cobjects to cutils
+    * splitted files into finput,fmodule
+
+  Revision 1.4  2000/08/12 15:32:02  peter
+    * reference reading fix from Jonas (merged)
+
+  Revision 1.3  2000/07/30 17:04:43  peter
+    * merged fixes
+
+  Revision 1.2  2000/07/13 11:32:48  michael
+  + removed logs
+
 }

+ 8 - 2
compiler/i386/rgcpu.pas

@@ -24,7 +24,7 @@
 
 unit rgcpu;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
   interface
 
@@ -430,7 +430,13 @@ end.
 
 {
   $Log$
-  Revision 1.6  2002-05-12 16:53:18  peter
+  Revision 1.7  2002-05-16 19:46:52  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
+
+  Revision 1.6  2002/05/12 16:53:18  peter
     * moved entry and exitcode to ncgutil and cgobj
     * foreach gets extra argument for passing local data to the
       iterator function

+ 48 - 4
compiler/i386/rropt386.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Jonas Maebe, member of the Free Pascal
+    Copyright (c) 1998-2000 by Jonas Maebe, member of the Free Pascal
       development team
 
     This unit contains register renaming functionality
@@ -23,7 +23,7 @@
 }
 Unit rrOpt386;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 Interface
 
@@ -350,8 +350,11 @@ End.
 
 {
   $Log$
-  Revision 1.15  2002-05-14 19:35:00  peter
-    * removed old logs and updated copyright year
+  Revision 1.16  2002-05-16 19:46:52  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.14  2002/05/12 16:53:18  peter
     * moved entry and exitcode to ncgutil and cgobj
@@ -419,4 +422,45 @@ End.
     - list field removed of the tnode class because it's not used currently
       and can cause hard-to-find bugs
 
+  Revision 1.8  2001/10/12 13:55:03  jonas
+    * finer granularity for allocation of reused/replaced registers
+
+  Revision 1.7  2001/08/29 14:07:43  jonas
+    * the optimizer now keeps track of flags register usage. This fixes some
+      optimizer bugs with int64 calculations (because of the carry flag usage)
+    * fixed another bug which caused wrong optimizations with complex
+      array expressions
+
+  Revision 1.6  2001/01/06 23:35:06  jonas
+    * fixed webbug 1323
+
+  Revision 1.5  2000/12/25 00:07:34  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.4  2000/12/05 09:32:47  jonas
+    * fixed bug where "shl $1,%reg" was changed to "leal (%reg),%reg2"
+      instread of to "leal (,%reg,2),%reg2"
+
+  Revision 1.3  2000/11/29 00:30:51  florian
+    * unused units removed from uses clause
+    * some changes for widestrings
+
+  Revision 1.2  2000/11/22 16:30:04  jonas
+    * fixed bug where "imul mem32,reg,reg" could be generated
+
+  Revision 1.1  2000/10/24 10:40:54  jonas
+    + register renaming ("fixes" bug1088)
+    * changed command line options meanings for optimizer:
+        O2 now means peepholopts, CSE and register renaming in 1 pass
+        O3 is the same, but repeated until no further optimizations are
+          possible or until 5 passes have been done (to avoid endless loops)
+    * changed aopt386 so it does this looping
+    * added some procedures from csopt386 to the interface because they're
+      used by rropt386 as well
+    * some changes to csopt386 and daopt386 so that newly added instructions
+      by the CSE get optimizer info (they were simply skipped previously),
+      this fixes some bugs
+
+
 }

+ 8 - 2
compiler/ia64/cpuasm.pas

@@ -22,7 +22,7 @@
 }
 unit cpuasm;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -297,7 +297,13 @@ implementation
 end.
 {
   $Log$
-  Revision 1.2  2001-01-05 17:36:58  florian
+  Revision 1.3  2002-05-16 19:46:52  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
+
+  Revision 1.2  2001/01/05 17:36:58  florian
   * the info about exception frames is stored now on the stack
   instead on the heap
 

+ 8 - 2
compiler/ia64/cpuinfo.pas

@@ -22,7 +22,7 @@
 }
 Unit CPUInfo;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 Interface
 
@@ -49,7 +49,13 @@ Implementation
 end.
 {
   $Log$
-  Revision 1.3  2002-04-07 13:42:40  carl
+  Revision 1.4  2002-05-16 19:46:52  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
+
+  Revision 1.3  2002/04/07 13:42:40  carl
   - moved type constant
 
   Revision 1.2  2001/01/05 17:36:58  florian

+ 8 - 2
compiler/ia64/tgcpu.pas

@@ -21,7 +21,7 @@
 }
 unit tgcpu;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -393,7 +393,13 @@ begin
 end.
 {
   $Log$
-  Revision 1.2  2002-04-20 21:38:45  carl
+  Revision 1.3  2002-05-16 19:46:52  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
+
+  Revision 1.2  2002/04/20 21:38:45  carl
   * renamed some constants
 
   Revision 1.1  2000/12/31 16:54:19  florian

+ 23 - 4
compiler/impdef.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Pavel
+    Copyright (c) 1998-2000 by Pavel
 
     This unit finds the export defs from PE files
 
@@ -26,7 +26,7 @@
 unit imtdef;
 
 {$ifndef STANDALONE}
-  {$i defines.inc}
+  {$i fpcdefs.inc}
 {$endif}
 
 interface
@@ -479,7 +479,26 @@ end.
 
 {
   $Log$
-  Revision 1.7  2002-05-14 19:34:41  peter
-    * removed old logs and updated copyright year
+  Revision 1.8  2002-05-16 19:46:37  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
+  Revision 1.6  2001/04/13 01:22:08  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.5  2001/01/13 00:09:21  peter
+    * made Pavel O. happy ;)
+
+  Revision 1.4  2000/11/20 13:58:19  pierre
+   * missing end. added
+
+  Revision 1.3  2000/09/24 15:06:17  peter
+    * use defines.inc
+
+  Revision 1.2  2000/07/13 11:32:43  michael
+  + removed logs
 }

+ 52 - 4
compiler/import.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Peter Vreman
+    Copyright (c) 1998-2000 by Peter Vreman
 
     This unit implements an uniform import object
 
@@ -21,7 +21,7 @@
  ****************************************************************************}
 unit import;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -237,7 +237,55 @@ end;
 end.
 {
   $Log$
-  Revision 1.15  2002-05-14 19:34:41  peter
-    * removed old logs and updated copyright year
+  Revision 1.16  2002-05-16 19:46:37  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
+
+  Revision 1.14  2001/06/28 19:46:25  peter
+    * added override and virtual for constructors
+
+  Revision 1.13  2001/04/18 22:01:54  peter
+    * registration of targets and assemblers
+
+  Revision 1.12  2001/04/13 01:22:08  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.11  2001/03/06 18:28:02  peter
+    * patch from Pavel with a new and much faster DLL Scanner for
+      automatic importing so $linklib works for DLLs. Thanks Pavel!
+
+  Revision 1.10  2001/02/26 19:44:52  peter
+    * merged generic m68k updates from fixes branch
+
+  Revision 1.9  2001/02/03 00:09:02  peter
+    * fixed netware typo in previous commit
+
+  Revision 1.8  2001/02/02 22:43:39  peter
+    * add notarget defines
+
+  Revision 1.7  2000/12/25 00:07:26  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.6  2000/09/24 15:06:18  peter
+    * use defines.inc
+
+  Revision 1.5  2000/09/16 12:22:52  peter
+    * freebsd support merged
+
+  Revision 1.4  2000/09/11 17:00:23  florian
+    + first implementation of Netware Module support, thanks to
+      Armin Diehl ([email protected]) for providing the patches
+
+  Revision 1.3  2000/08/27 16:11:51  peter
+    * moved some util functions from globals,cobjects to cutils
+    * splitted files into finput,fmodule
+
+  Revision 1.2  2000/07/13 11:32:43  michael
+  + removed logs
 
 }

+ 90 - 4
compiler/link.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Peter Vreman
+    Copyright (c) 1998-2000 by Peter Vreman
 
     This unit handles the linker and binder calls for programs and
     libraries
@@ -23,7 +23,7 @@
 }
 unit link;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 { Needed for LFN support in path to the executable }
 {$ifdef GO32V2}
@@ -539,10 +539,96 @@ initialization
 end.
 {
   $Log$
-  Revision 1.26  2002-05-14 19:34:41  peter
-    * removed old logs and updated copyright year
+  Revision 1.27  2002-05-16 19:46:37  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.25  2002/01/19 11:57:05  peter
     * fixed path appending for lib
 
+  Revision 1.24  2001/09/18 11:30:48  michael
+  * Fixes win32 linking problems with import libraries
+  * LINKLIB Libraries are now looked for using C file extensions
+  * get_exepath fix
+
+  Revision 1.23  2001/09/17 21:29:11  peter
+    * merged netbsd, fpu-overflow from fixes branch
+
+  Revision 1.22  2001/08/30 20:13:53  peter
+    * rtti/init table updates
+    * rttisym for reusable global rtti/init info
+    * support published for interfaces
+
+  Revision 1.21  2001/08/19 11:22:22  peter
+    * palmos support from v10 merged
+
+  Revision 1.20  2001/08/13 19:26:03  peter
+    * fixed ordering of object and libraries
+
+  Revision 1.19  2001/08/07 18:47:12  peter
+    * merged netbsd start
+    * profile for win32
+
+  Revision 1.18  2001/06/28 19:46:25  peter
+    * added override and virtual for constructors
+
+  Revision 1.17  2001/06/03 15:15:31  peter
+    * dllprt0 stub for linux shared libs
+    * pass -init and -fini for linux shared libs
+    * libprefix splitted into staticlibprefix and sharedlibprefix
+
+  Revision 1.16  2001/04/18 22:01:54  peter
+    * registration of targets and assemblers
+
+  Revision 1.15  2001/04/13 01:22:08  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.14  2001/02/26 19:44:52  peter
+    * merged generic m68k updates from fixes branch
+
+  Revision 1.13  2001/02/20 21:41:17  peter
+    * new fixfilename, findfile for unix. Look first for lowercase, then
+      NormalCase and last for UPPERCASE names.
+
+  Revision 1.12  2001/01/12 19:19:44  peter
+    * fixed searching for utils
+
+  Revision 1.11  2000/12/25 00:07:26  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.10  2000/11/29 00:30:31  florian
+    * unused units removed from uses clause
+    * some changes for widestrings
+
+  Revision 1.9  2000/09/24 21:33:46  peter
+    * message updates merges
+
+  Revision 1.8  2000/09/24 15:06:18  peter
+    * use defines.inc
+
+  Revision 1.7  2000/09/16 12:22:52  peter
+    * freebsd support merged
+
+  Revision 1.6  2000/09/11 17:00:23  florian
+    + first implementation of Netware Module support, thanks to
+      Armin Diehl ([email protected]) for providing the patches
+
+  Revision 1.5  2000/09/04 09:40:23  michael
+  + merged Patch from peter
+
+  Revision 1.4  2000/08/27 16:11:51  peter
+    * moved some util functions from globals,cobjects to cutils
+    * splitted files into finput,fmodule
+
+  Revision 1.3  2000/07/26 13:08:19  jonas
+    * merged from fixes branch (v_hint to v_tried changed when attempting
+      to smart/static/shared link)
+
+  Revision 1.2  2000/07/13 11:32:43  michael
+  + removed logs
 }

+ 8 - 2
compiler/m68k/cpuswtch.pas

@@ -21,7 +21,7 @@
 
 unit cpuswtch;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -74,7 +74,13 @@ end;
 end.
 {
   $Log$
-  Revision 1.1  2000-11-30 22:41:55  florian
+  Revision 1.2  2002-05-16 19:46:52  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
+
+  Revision 1.1  2000/11/30 22:41:55  florian
   * renamed
 
   Revision 1.1  2000/11/30 22:22:50  florian

+ 181 - 4
compiler/nadd.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Florian Klaempfl
+    Copyright (c) 1998-2000 by Florian Klaempfl
 
     Type checking and register allocation for add nodes
 
@@ -22,7 +22,7 @@
 }
 unit nadd;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -1617,8 +1617,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.49  2002-05-14 19:34:41  peter
-    * removed old logs and updated copyright year
+  Revision 1.50  2002-05-16 19:46:37  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.48  2002/05/13 19:54:36  peter
     * removed n386ld and n386util units
@@ -1664,4 +1667,178 @@ end.
   Revision 1.43  2002/03/30 23:12:09  carl
   * avoid crash with procinfo ('merged')
 
+  Revision 1.42  2001/12/27 15:33:58  jonas
+    * fixed fpuregister counting errors ("merged")
+
+  Revision 1.41  2001/10/20 19:28:37  peter
+    * interface 2 guid support
+    * guid constants support
+
+  Revision 1.40  2001/10/12 13:51:51  jonas
+    * fixed internalerror(10) due to previous fpu overflow fixes ("merged")
+    * fixed bug in n386add (introduced after compilerproc changes for string
+      operations) where calcregisters wasn't called for shortstring addnodes
+    * NOTE: from now on, the location of a binary node must now always be set
+       before you call calcregisters() for it
+
+  Revision 1.39  2001/09/05 15:22:09  jonas
+    * made multiplying, dividing and mod'ing of int64 and qword processor
+      independent with compilerprocs (+ small optimizations by using shift/and
+      where possible)
+
+  Revision 1.38  2001/09/04 11:38:54  jonas
+    + searchsystype() and searchsystype() functions in symtable
+    * changed ninl and nadd to use these functions
+    * i386 set comparison functions now return their results in al instead
+      of in the flags so that they can be sued as compilerprocs
+    - removed all processor specific code from n386add.pas that has to do
+      with set handling, it's now all done in nadd.pas
+    * fixed fpc_set_contains_sets in genset.inc
+    * fpc_set_in_byte is now coded inline in n386set.pas and doesn't use a
+      helper anymore
+    * some small fixes in compproc.inc/set.inc regarding the declaration of
+      internal helper types (fpc_small_set and fpc_normal_set)
+
+  Revision 1.37  2001/09/03 13:27:42  jonas
+    * compilerproc implementation of set addition/substraction/...
+    * changed the declaration of some set helpers somewhat to accomodate the
+      above change
+    * i386 still uses the old code for comparisons of sets, because its
+      helpers return the results in the flags
+    * dummy tc_normal_2_small_set type conversion because I need the original
+      resulttype of the set add nodes
+    NOTE: you have to start a cycle with 1.0.5!
+
+  Revision 1.36  2001/09/02 21:12:06  peter
+    * move class of definitions into type section for delphi
+
+  Revision 1.35  2001/08/31 15:42:15  jonas
+    * added missing type conversion from small to normal sets
+
+  Revision 1.34  2001/08/30 15:43:14  jonas
+    * converted adding/comparing of strings to compileproc. Note that due
+      to the way the shortstring helpers for i386 are written, they are
+      still handled by the old code (reason: fpc_shortstr_compare returns
+      results in the flags instead of in eax and fpc_shortstr_concat
+      has wierd parameter conventions). The compilerproc stuff should work
+      fine with the generic implementations though.
+    * removed some nested comments warnings
+
+  Revision 1.33  2001/08/26 13:36:38  florian
+    * some cg reorganisation
+    * some PPC updates
+
+  Revision 1.32  2001/08/06 21:40:46  peter
+    * funcret moved from tprocinfo to tprocdef
+
+  Revision 1.31  2001/07/08 21:00:14  peter
+    * various widestring updates, it works now mostly without charset
+      mapping supported
+
+  Revision 1.30  2001/06/04 21:41:26  peter
+    * readded generic conversion to s32bit that i removed yesterday. It
+      is still used for error recovery, added a small note about that
+
+  Revision 1.29  2001/06/04 18:13:53  peter
+    * Support kylix hack of having enum+integer in a enum declaration.
+
+  Revision 1.28  2001/05/27 14:30:55  florian
+    + some widestring stuff added
+
+  Revision 1.27  2001/05/19 21:11:50  peter
+    * first check for overloaded operator before doing inserting any
+      typeconvs
+
+  Revision 1.26  2001/05/19 12:53:52  peter
+    * check set types when doing constant set evaluation
+
+  Revision 1.25  2001/04/13 01:22:08  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.24  2001/04/04 22:42:39  peter
+    * move constant folding into det_resulttype
+
+  Revision 1.23  2001/04/02 21:20:30  peter
+    * resulttype rewrite
+
+  Revision 1.22  2001/02/04 11:12:17  jonas
+    * fixed web bug 1377 & const pointer arithmtic
+
+  Revision 1.21  2001/01/14 22:13:13  peter
+    * constant calculation fixed. The type of the new constant is now
+      defined after the calculation is done. This should remove a lot
+      of wrong warnings (and errors with -Cr).
+
+  Revision 1.20  2000/12/31 11:14:10  jonas
+    + implemented/fixed docompare() mathods for all nodes (not tested)
+    + nopt.pas, nadd.pas, i386/n386opt.pas: optimized nodes for adding strings
+      and constant strings/chars together
+    * n386add.pas: don't copy temp strings (of size 256) to another temp string
+      when adding
+
+  Revision 1.19  2000/12/16 15:55:32  jonas
+    + warning when there is a chance to get a range check error because of
+      automatic type conversion to u32bit
+    * arithmetic operations with a cardinal and a signed operand are carried
+      out in 64bit when range checking is on ("merged" from fixes branch)
+
+  Revision 1.18  2000/11/29 00:30:31  florian
+    * unused units removed from uses clause
+    * some changes for widestrings
+
+  Revision 1.17  2000/11/20 15:30:42  jonas
+    * changed types of values used for constant expression evaluation to
+      tconstexprint
+
+  Revision 1.16  2000/11/13 11:30:55  florian
+    * some bugs with interfaces and NIL fixed
+
+  Revision 1.15  2000/11/04 14:25:20  florian
+    + merged Attila's changes for interfaces, not tested yet
+
+  Revision 1.14  2000/10/31 22:02:47  peter
+    * symtable splitted, no real code changes
+
+  Revision 1.13  2000/10/14 10:14:50  peter
+    * moehrendorf oct 2000 rewrite
+
+  Revision 1.12  2000/10/01 19:48:23  peter
+    * lot of compile updates for cg11
+
+  Revision 1.11  2000/09/30 16:08:45  peter
+    * more cg11 updates
+
+  Revision 1.10  2000/09/28 19:49:52  florian
+  *** empty log message ***
+
+  Revision 1.9  2000/09/27 21:33:22  florian
+    * finally nadd.pas compiles
+
+  Revision 1.8  2000/09/27 20:25:44  florian
+    * more stuff fixed
+
+  Revision 1.7  2000/09/27 18:14:31  florian
+    * fixed a lot of syntax errors in the n*.pas stuff
+
+  Revision 1.6  2000/09/24 15:06:19  peter
+    * use defines.inc
+
+  Revision 1.5  2000/09/22 22:42:52  florian
+    * more fixes
+
+  Revision 1.4  2000/09/21 12:22:42  jonas
+    * put piece of code between -dnewoptimizations2 since it wasn't
+      necessary otherwise
+    + support for full boolean evaluation (from tcadd)
+
+  Revision 1.3  2000/09/20 21:50:59  florian
+    * updated
+
+  Revision 1.2  2000/08/29 08:24:45  jonas
+    * some modifications to -dcardinalmulfix code
+
+  Revision 1.1  2000/08/26 12:24:20  florian
+    * initial release
 }

+ 84 - 3
compiler/nbas.pas

@@ -22,7 +22,7 @@
 }
 unit nbas;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -675,8 +675,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.23  2002-05-14 19:34:41  peter
-    * removed old logs and updated copyright year
+  Revision 1.24  2002-05-16 19:46:37  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.22  2002/04/23 19:16:34  peter
     * add pinline unit that inserts compiler supported functions using
@@ -711,4 +714,82 @@ end.
     - list field removed of the tnode class because it's not used currently
       and can cause hard-to-find bugs
 
+  Revision 1.18  2001/11/02 22:58:01  peter
+    * procsym definition rewrite
+
+  Revision 1.17  2001/09/02 21:12:06  peter
+    * move class of definitions into type section for delphi
+
+  Revision 1.16  2001/08/26 13:36:38  florian
+    * some cg reorganisation
+    * some PPC updates
+
+  Revision 1.15  2001/08/24 13:47:26  jonas
+    * moved "reverseparameters" from ninl.pas to ncal.pas
+    + support for non-persistent temps in ttempcreatenode.create, for use
+      with typeconversion nodes
+
+  Revision 1.14  2001/08/23 14:28:35  jonas
+    + tempcreate/ref/delete nodes (allows the use of temps in the
+      resulttype and first pass)
+    * made handling of read(ln)/write(ln) processor independent
+    * moved processor independent handling for str and reset/rewrite-typed
+      from firstpass to resulttype pass
+    * changed names of helpers in text.inc to be generic for use as
+      compilerprocs + added "iocheck" directive for most of them
+    * reading of ordinals is done by procedures instead of functions
+      because otherwise FPC_IOCHECK overwrote the result before it could
+      be stored elsewhere (range checking still works)
+    * compilerprocs can now be used in the system unit before they are
+      implemented
+    * added note to errore.msg that booleans can't be read using read/readln
+
+  Revision 1.13  2001/08/06 21:40:46  peter
+    * funcret moved from tprocinfo to tprocdef
+
+  Revision 1.12  2001/06/11 17:41:12  jonas
+    * fixed web bug 1501 in conjunction with -Or
+
+  Revision 1.11  2001/05/18 22:31:06  peter
+    * tasmnode.pass_2 is independent of cpu, moved to ncgbas
+    * include ncgbas for independent nodes
+
+  Revision 1.10  2001/04/13 01:22:08  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.9  2001/04/02 21:20:30  peter
+    * resulttype rewrite
+
+  Revision 1.8  2001/02/05 20:45:49  peter
+    * fixed buf 1364
+
+  Revision 1.7  2000/12/31 11:14:10  jonas
+    + implemented/fixed docompare() mathods for all nodes (not tested)
+    + nopt.pas, nadd.pas, i386/n386opt.pas: optimized nodes for adding strings
+      and constant strings/chars together
+    * n386add.pas: don't copy temp strings (of size 256) to another temp string
+      when adding
+
+  Revision 1.6  2000/12/25 00:07:26  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.5  2000/11/29 00:30:31  florian
+    * unused units removed from uses clause
+    * some changes for widestrings
+
+  Revision 1.4  2000/10/31 22:02:47  peter
+    * symtable splitted, no real code changes
+
+  Revision 1.3  2000/10/27 14:57:16  jonas
+    + implementation for tasmnode.getcopy
+
+  Revision 1.2  2000/10/14 21:52:54  peter
+    * fixed memory leaks
+
+  Revision 1.1  2000/10/14 10:14:50  peter
+    * moehrendorf oct 2000 rewrite
+
 }

+ 259 - 4
compiler/ncal.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Florian Klaempfl
+    Copyright (c) 1998-2000 by Florian Klaempfl
 
     This file implements the node for sub procedure calling
 
@@ -23,7 +23,7 @@
 }
 unit ncal;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -1870,8 +1870,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.74  2002-05-14 19:34:41  peter
-    * removed old logs and updated copyright year
+  Revision 1.75  2002-05-16 19:46:37  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.73  2002/05/12 16:53:06  peter
     * moved entry and exitcode to ncgutil and cgobj
@@ -1970,4 +1973,256 @@ end.
   Revision 1.62  2002/01/19 11:57:05  peter
     * fixed path appending for lib
 
+  Revision 1.61  2001/12/31 16:59:41  peter
+    * protected/private symbols parsing fixed
+
+  Revision 1.60  2001/12/11 13:21:36  jonas
+    * fixed to my previous patch: the hightree must always be converted to a
+      longint
+
+  Revision 1.59  2001/12/10 14:28:47  jonas
+    * gen_high_tree now uses an inline node of type in_high_x in most cases
+      so that it doesn't duplicate any code anymore from ninl.pas (and
+      dynamic array support was still missing)
+
+  Revision 1.58  2001/11/20 18:49:43  peter
+    * require overload for cross object overloading
+
+  Revision 1.57  2001/11/18 20:18:54  peter
+    * use cp_value_equal_const instead of cp_all
+
+  Revision 1.56  2001/11/18 18:43:13  peter
+    * overloading supported in child classes
+    * fixed parsing of classes with private and virtual and overloaded
+      so it is compatible with delphi
+
+  Revision 1.55  2001/11/02 23:16:50  peter
+    * removed obsolete chainprocsym and test_procsym code
+
+  Revision 1.54  2001/11/02 22:58:01  peter
+    * procsym definition rewrite
+
+  Revision 1.53  2001/10/28 17:22:25  peter
+    * allow assignment of overloaded procedures to procvars when we know
+      which procedure to take
+
+  Revision 1.51  2001/10/13 09:01:14  jonas
+    * fixed bug with using procedures as procvar parameters in TP/Delphi mode
+
+  Revision 1.50  2001/10/12 16:04:32  peter
+    * nested inline fix (merged)
+
+  Revision 1.49  2001/09/02 21:12:06  peter
+    * move class of definitions into type section for delphi
+
+  Revision 1.48  2001/08/30 15:39:59  jonas
+    * fixed docompare for the fields I added to tcallnode in my previous
+      commit
+    * removed nested comment warning
+
+  Revision 1.47  2001/08/29 12:18:07  jonas
+    + new createinternres() constructor for tcallnode to support setting a
+      custom resulttype
+    * compilerproc typeconversions now set the resulttype from the type
+      conversion for the generated call node, because the resulttype of
+      of the compilerproc helper isn't always exact (e.g. the ones that
+      return shortstrings, actually return a shortstring[x], where x is
+      specified by the typeconversion node)
+    * ti386callnode.pass_2 now always uses resulttype instead of
+      procsym.definition.rettype (so the custom resulttype, if any, is
+      always used). Note that this "rettype" stuff is only for use with
+      compilerprocs.
+
+  Revision 1.46  2001/08/28 13:24:46  jonas
+    + compilerproc implementation of most string-related type conversions
+    - removed all code from the compiler which has been replaced by
+      compilerproc implementations (using (ifdef hascompilerproc) is not
+      necessary in the compiler)
+
+  Revision 1.45  2001/08/26 13:36:39  florian
+    * some cg reorganisation
+    * some PPC updates
+
+  Revision 1.44  2001/08/24 13:47:27  jonas
+    * moved "reverseparameters" from ninl.pas to ncal.pas
+    + support for non-persistent temps in ttempcreatenode.create, for use
+      with typeconversion nodes
+
+  Revision 1.43  2001/08/23 14:28:35  jonas
+    + tempcreate/ref/delete nodes (allows the use of temps in the
+      resulttype and first pass)
+    * made handling of read(ln)/write(ln) processor independent
+    * moved processor independent handling for str and reset/rewrite-typed
+      from firstpass to resulttype pass
+    * changed names of helpers in text.inc to be generic for use as
+      compilerprocs + added "iocheck" directive for most of them
+    * reading of ordinals is done by procedures instead of functions
+      because otherwise FPC_IOCHECK overwrote the result before it could
+      be stored elsewhere (range checking still works)
+    * compilerprocs can now be used in the system unit before they are
+      implemented
+    * added note to errore.msg that booleans can't be read using read/readln
+
+  Revision 1.42  2001/08/19 21:11:20  florian
+    * some bugs fix:
+      - overload; with external procedures fixed
+      - better selection of routine to do an overloaded
+        type case
+      - ... some more
+
+  Revision 1.41  2001/08/13 12:41:56  jonas
+    * made code for str(x,y) completely processor independent
+
+  Revision 1.40  2001/08/06 21:40:46  peter
+    * funcret moved from tprocinfo to tprocdef
+
+  Revision 1.39  2001/08/01 15:07:29  jonas
+    + "compilerproc" directive support, which turns both the public and mangled
+      name to lowercase(declaration_name). This prevents a normal user from
+      accessing the routine, but they can still be easily looked up within
+      the compiler. This is used for helper procedures and should facilitate
+      the writing of more processor independent code in the code generator
+      itself (mostly written by Peter)
+    + new "createintern" constructor for tcal nodes to create a call to
+      helper exported using the "compilerproc" directive
+    + support for high(dynamic_array) using the the above new things
+    + definition of 'HASCOMPILERPROC' symbol (to be able to check in the
+      compiler and rtl whether the "compilerproc" directive is supported)
+
+  Revision 1.38  2001/07/30 20:52:25  peter
+    * fixed array constructor passing with type conversions
+
+  Revision 1.37  2001/07/09 21:15:40  peter
+    * Length made internal
+    * Add array support for Length
+
+  Revision 1.36  2001/07/01 20:16:15  peter
+    * alignmentinfo record added
+    * -Oa argument supports more alignment settings that can be specified
+      per type: PROC,LOOP,VARMIN,VARMAX,CONSTMIN,CONSTMAX,RECORDMIN
+      RECORDMAX,LOCALMIN,LOCALMAX. It is possible to set the mimimum
+      required alignment and the maximum usefull alignment. The final
+      alignment will be choosen per variable size dependent on these
+      settings
+
+  Revision 1.35  2001/06/04 18:08:19  peter
+    * procvar support for varargs
+
+  Revision 1.34  2001/06/04 11:48:02  peter
+    * better const to var checking
+
+  Revision 1.33  2001/05/20 12:09:31  peter
+    * fixed exit with ansistring return from function call, no_fast_exit
+      should be set in det_resulttype instead of pass_1
+
+  Revision 1.32  2001/04/26 21:55:05  peter
+    * defcoll must be assigned in insert_typeconv
+
+  Revision 1.31  2001/04/21 12:03:11  peter
+    * m68k updates merged from fixes branch
+
+  Revision 1.30  2001/04/18 22:01:54  peter
+    * registration of targets and assemblers
+
+  Revision 1.29  2001/04/13 23:52:29  peter
+    * don't allow passing signed-unsigned ords to var parameter, this
+      forbids smallint-word, shortint-byte, longint-cardinal mixtures.
+      It's still allowed in tp7 -So mode.
+
+  Revision 1.28  2001/04/13 22:22:59  peter
+    * call set_varstate for procvar calls
+
+  Revision 1.27  2001/04/13 01:22:08  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.26  2001/04/04 22:42:39  peter
+    * move constant folding into det_resulttype
+
+  Revision 1.25  2001/04/02 21:20:30  peter
+    * resulttype rewrite
+
+  Revision 1.24  2001/03/12 12:47:46  michael
+  + Patches from peter
+
+  Revision 1.23  2001/02/26 19:44:52  peter
+    * merged generic m68k updates from fixes branch
+
+  Revision 1.22  2001/01/08 21:46:46  peter
+    * don't push high value for open array with cdecl;external;
+
+  Revision 1.21  2000/12/31 11:14:10  jonas
+    + implemented/fixed docompare() mathods for all nodes (not tested)
+    + nopt.pas, nadd.pas, i386/n386opt.pas: optimized nodes for adding strings
+      and constant strings/chars together
+    * n386add.pas: don't copy temp strings (of size 256) to another temp string
+      when adding
+
+  Revision 1.20  2000/12/25 00:07:26  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.19  2000/12/17 14:35:12  peter
+    * fixed crash with procvar load in tp mode
+
+  Revision 1.18  2000/11/29 00:30:32  florian
+    * unused units removed from uses clause
+    * some changes for widestrings
+
+  Revision 1.17  2000/11/22 15:12:06  jonas
+    * fixed inline-related problems (partially "merges")
+
+  Revision 1.16  2000/11/11 16:14:52  peter
+    * fixed crash with settextbuf,ptr
+
+  Revision 1.15  2000/11/06 21:36:25  peter
+    * fixed var parameter varstate bug
+
+  Revision 1.14  2000/11/04 14:25:20  florian
+    + merged Attila's changes for interfaces, not tested yet
+
+  Revision 1.13  2000/10/31 22:02:47  peter
+    * symtable splitted, no real code changes
+
+  Revision 1.12  2000/10/21 18:16:11  florian
+    * a lot of changes:
+       - basic dyn. array support
+       - basic C++ support
+       - some work for interfaces done
+       ....
+
+  Revision 1.11  2000/10/21 14:35:27  peter
+    * readd to many remove p. for tcallnode.is_equal()
+
+  Revision 1.10  2000/10/14 21:52:55  peter
+    * fixed memory leaks
+
+  Revision 1.9  2000/10/14 10:14:50  peter
+    * moehrendorf oct 2000 rewrite
+
+  Revision 1.8  2000/10/01 19:48:24  peter
+    * lot of compile updates for cg11
+
+  Revision 1.7  2000/09/28 19:49:52  florian
+  *** empty log message ***
+
+  Revision 1.6  2000/09/27 18:14:31  florian
+    * fixed a lot of syntax errors in the n*.pas stuff
+
+  Revision 1.5  2000/09/24 21:15:34  florian
+    * some errors fix to get more stuff compilable
+
+  Revision 1.4  2000/09/24 20:17:44  florian
+    * more conversion work done
+
+  Revision 1.3  2000/09/24 15:06:19  peter
+    * use defines.inc
+
+  Revision 1.2  2000/09/20 21:52:38  florian
+    * removed a lot of errors
+
+  Revision 1.1  2000/09/20 20:52:16  florian
+    * initial revision
+
 }

+ 54 - 3
compiler/ncgbas.pas

@@ -22,7 +22,7 @@
 }
 unit ncgbas;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -294,8 +294,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.17  2002-05-14 19:34:42  peter
-    * removed old logs and updated copyright year
+  Revision 1.18  2002-05-16 19:46:37  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.16  2002/05/13 19:54:37  peter
     * removed n386ld and n386util units
@@ -351,4 +354,52 @@ end.
     - list field removed of the tnode class because it's not used currently
       and can cause hard-to-find bugs
 
+  Revision 1.10  2001/12/31 16:54:14  peter
+    * fixed inline crash with assembler routines
+
+  Revision 1.9  2001/11/02 22:58:01  peter
+    * procsym definition rewrite
+
+  Revision 1.8  2001/10/25 21:22:35  peter
+    * calling convention rewrite
+
+  Revision 1.7  2001/08/26 13:36:39  florian
+    * some cg reorganisation
+    * some PPC updates
+
+  Revision 1.6  2001/08/24 13:47:27  jonas
+    * moved "reverseparameters" from ninl.pas to ncal.pas
+    + support for non-persistent temps in ttempcreatenode.create, for use
+      with typeconversion nodes
+
+  Revision 1.5  2001/08/23 14:28:35  jonas
+    + tempcreate/ref/delete nodes (allows the use of temps in the
+      resulttype and first pass)
+    * made handling of read(ln)/write(ln) processor independent
+    * moved processor independent handling for str and reset/rewrite-typed
+      from firstpass to resulttype pass
+    * changed names of helpers in text.inc to be generic for use as
+      compilerprocs + added "iocheck" directive for most of them
+    * reading of ordinals is done by procedures instead of functions
+      because otherwise FPC_IOCHECK overwrote the result before it could
+      be stored elsewhere (range checking still works)
+    * compilerprocs can now be used in the system unit before they are
+      implemented
+    * added note to errore.msg that booleans can't be read using read/readln
+
+  Revision 1.4  2001/06/02 19:22:15  peter
+    * refs count for relabeled asmsymbols fixed
+
+  Revision 1.3  2001/05/18 22:31:06  peter
+    * tasmnode.pass_2 is independent of cpu, moved to ncgbas
+    * include ncgbas for independent nodes
+
+  Revision 1.2  2001/04/13 01:22:08  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.1  2000/10/14 10:14:50  peter
+    * moehrendorf oct 2000 rewrite
+
 }

+ 24 - 3
compiler/ncgcnv.pas

@@ -23,7 +23,7 @@
 }
 unit ncgcnv;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -468,8 +468,11 @@ end.
 
 {
   $Log$
-  Revision 1.13  2002-05-14 19:34:42  peter
-    * removed old logs and updated copyright year
+  Revision 1.14  2002-05-16 19:46:37  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.12  2002/05/12 16:53:07  peter
     * moved entry and exitcode to ncgutil and cgobj
@@ -543,4 +546,22 @@ end.
     - list field removed of the tnode class because it's not used currently
       and can cause hard-to-find bugs
 
+  Revision 1.4  2001/12/31 09:53:15  jonas
+    * changed remaining "getregister32" calls to "getregisterint"
+
+  Revision 1.3  2001/10/04 14:33:28  jonas
+    * fixed range check errors
+
+  Revision 1.2  2001/09/30 16:16:28  jonas
+    - removed unused units form uses-clause and unused local vars
+
+  Revision 1.1  2001/09/29 21:32:47  jonas
+    * almost all second pass typeconvnode helpers are now processor independent
+    * fixed converting boolean to int64/qword
+    * fixed register allocation bugs which could cause internalerror 10
+    * isnode and asnode are completely processor indepent now as well
+    * fpc_do_as now returns its class argument (necessary to be able to use it
+      properly with compilerproc)
+
+
 }

+ 35 - 53
compiler/ncgcon.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Florian Klaempfl
+    Copyright (c) 1998-2000 by Florian Klaempfl
 
     Generate assembler for constant nodes which are the same for
     all (most) processors
@@ -23,7 +23,7 @@
 }
 unit ncgcon;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -175,10 +175,9 @@ implementation
 
     procedure tcgstringconstnode.pass_2;
       var
-         hp1,hp2 : tai;
+         hp1 : tai;
          l1,l2,
          lastlabel   : tasmlabel;
-         lastlabelhp : tai;
          pc       : pchar;
          same_string : boolean;
          l,j,
@@ -196,7 +195,6 @@ implementation
          location_reset(location,LOC_CREFERENCE,def_cgsize(resulttype.def));
          { const already used ? }
          lastlabel:=nil;
-         lastlabelhp:=nil;
          if not assigned(lab_str) then
            begin
               if is_shortstring(resulttype.def) then
@@ -211,10 +209,7 @@ implementation
                   while assigned(hp1) do
                     begin
                        if hp1.typ=ait_label then
-                         begin
-                           lastlabel:=tai_label(hp1).l;
-                           lastlabelhp:=hp1;
-                         end
+                         lastlabel:=tai_label(hp1).l
                        else
                          begin
                             { when changing that code, be careful that }
@@ -229,49 +224,14 @@ implementation
                                  same_string:=true;
                                  { if shortstring then check the length byte first and
                                    set the start index to 1 }
-                                 case st_type of
-                                   st_shortstring:
-                                     begin
-                                       if len=ord(tai_string(hp1).str[0]) then
-                                        j:=1
-                                       else
-                                        same_string:=false;
-                                     end;
-                                   st_ansistring,
-                                   st_widestring :
-                                     begin
-                                       { before the string the following sequence must be found:
-                                         <label>
-                                           constsymbol <datalabel>
-                                           const32 <len>
-                                           const32 <len>
-                                           const32 -1
-                                         we must then return <label> to reuse
-                                       }
-                                       hp2:=tai(lastlabelhp.previous);
-                                       if assigned(hp2) and
-                                          (hp2.typ=ait_const_32bit) and
-                                          (tai_const(hp2).value=-1) and
-                                          assigned(hp2.previous) and
-                                          (tai(hp2.previous).typ=ait_const_32bit) and
-                                          (tai_const(hp2.previous).value=len) and
-                                          assigned(hp2.previous.previous) and
-                                          (tai(hp2.previous.previous).typ=ait_const_32bit) and
-                                          (tai_const(hp2.previous.previous).value=len) and
-                                          assigned(hp2.previous.previous.previous) and
-                                          (tai(hp2.previous.previous.previous).typ=ait_const_symbol) and
-                                          assigned(hp2.previous.previous.previous.previous) and
-                                          (tai(hp2.previous.previous.previous.previous).typ=ait_label) then
-                                         begin
-                                           lastlabel:=tai_label(hp2.previous.previous.previous.previous).l;
-                                           j:=0;
-                                         end
-                                       else
-                                         same_string:=false;
-                                     end;
-                                   else
+                                 if is_shortstring(resulttype.def) then
+                                  begin
+                                    if len<>ord(tai_string(hp1).str[0]) then
                                      same_string:=false;
-                                 end;
+                                    j:=1;
+                                  end
+                                 else
+                                  j:=0;
                                  { don't check if the length byte was already wrong }
                                  if same_string then
                                   begin
@@ -289,6 +249,15 @@ implementation
                                  if same_string then
                                   begin
                                     lab_str:=lastlabel;
+                                    { create a new entry for ansistrings, but reuse the data }
+                                    if (st_type in [st_ansistring,st_widestring]) then
+                                     begin
+                                       getdatalabel(l2);
+                                       Consts.concat(Tai_label.Create(l2));
+                                       Consts.concat(Tai_const_symbol.Create(lab_str));
+                                       { return the offset of the real string }
+                                       lab_str:=l2;
+                                     end;
                                     break;
                                   end;
                               end;
@@ -519,8 +488,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.8  2002-05-14 19:27:33  peter
-    * fixed reusing of ansistrings
+  Revision 1.9  2002-05-16 19:46:37  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.7  2002/04/04 19:05:57  peter
     * removed unused units
@@ -559,4 +531,14 @@ end.
       "Luc Langlois" <[email protected]>) (lo/hi don't work as in FPC
       when used with int64's under Delphi)
 
+  Revision 1.3  2001/12/31 09:52:02  jonas
+    * empty widestrings can also be optimized to the constant '0'
+
+  Revision 1.2  2001/10/20 19:28:37  peter
+    * interface 2 guid support
+    * guid constants support
+
+  Revision 1.1  2001/09/30 16:17:17  jonas
+    * made most constant and mem handling processor independent
+
 }

+ 58 - 4
compiler/ncgflw.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Florian Klaempfl
+    Copyright (c) 1998-2000 by Florian Klaempfl
 
     Generate assembler for nodes that influence the flow which are
     the same for all (most?) processors
@@ -23,7 +23,7 @@
 }
 unit ncgflw;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -611,8 +611,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.16  2002-05-14 19:34:42  peter
-    * removed old logs and updated copyright year
+  Revision 1.17  2002-05-16 19:46:37  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.15  2002/05/13 19:54:37  peter
     * removed n386ld and n386util units
@@ -682,5 +685,56 @@ end.
   Revision 1.8  2002/03/04 19:10:11  peter
     * removed compiler warnings
 
+  Revision 1.7  2001/12/30 17:24:48  jonas
+    * range checking is now processor independent (part in cgobj,
+      part in cg64f32) and should work correctly again (it needed
+      some changes after the changes of the low and high of
+      tordef's to int64)
+    * maketojumpbool() is now processor independent (in ncgutil)
+    * getregister32 is now called getregisterint
+
+  Revision 1.6  2001/12/29 15:28:57  jonas
+    * powerpc/cgcpu.pas compiles :)
+    * several powerpc-related fixes
+    * cpuasm unit is now based on common tainst unit
+    + nppcmat unit for powerpc (almost complete)
+
+  Revision 1.4  2001/11/02 22:58:01  peter
+    * procsym definition rewrite
+
+  Revision 1.3  2001/10/04 14:33:28  jonas
+    * fixed range check errors
+
+  Revision 1.2  2001/09/30 16:19:58  jonas
+    - removed unused units
+
+  Revision 1.1  2001/09/28 20:39:33  jonas
+    * changed all flow control structures (except for exception handling
+      related things) to processor independent code (in new ncgflw unit)
+    + generic cgobj unit which contains lots of code generator helpers with
+      global "cg" class instance variable
+    + cgcpu unit for i386 (implements processor specific routines of the above
+      unit)
+    * updated cgbase and cpubase for the new code generator units
+    * include ncgflw unit in cpunode unit
+
+  Revision 1.4  2001/09/09 17:10:25  jonas
+    * some more things implemented
+
+  Revision 1.3  2001/09/06 15:25:55  jonas
+    * changed type of tcg from object to class ->  abstract methods are now
+      a lot cleaner :)
+    + more updates: load_*_loc methods, op_*_* methods, g_flags2reg method
+      (if possible with geenric implementation and necessary ppc
+       implementations)
+    * worked a bit further on cgflw, now working on exitnode
+
+  Revision 1.2  2001/09/05 20:21:03  jonas
+    * new cgflow based on n386flw with all nodes until forn "translated"
+    + a_cmp_*_loc_label methods for tcg
+    + base implementatino for a_cmp_ref_*_label methods
+    * small bugfixes to powerpc cg
+
+
 }
 

+ 7 - 4
compiler/ncgld.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Florian Klaempfl
+    Copyright (c) 1998-2000 by Florian Klaempfl
 
     Generate assembler for nodes that handle loads and assignments which
     are the same for all (most) processors
@@ -23,7 +23,7 @@
 }
 unit ncgld;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -906,8 +906,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.5  2002-05-14 19:34:42  peter
-    * removed old logs and updated copyright year
+  Revision 1.6  2002-05-16 19:46:37  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.4  2002/05/13 19:54:37  peter
     * removed n386ld and n386util units

+ 17 - 4
compiler/ncgmem.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Florian Klaempfl
+    Copyright (c) 1998-2000 by Florian Klaempfl
 
     Generate assembler for memory related nodes which are
     the same for all (most?) processors
@@ -23,7 +23,7 @@
 }
 unit ncgmem;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -454,8 +454,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.10  2002-05-14 19:34:42  peter
-    * removed old logs and updated copyright year
+  Revision 1.11  2002-05-16 19:46:37  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.9  2002/05/12 16:53:07  peter
     * moved entry and exitcode to ncgutil and cgobj
@@ -518,4 +521,14 @@ end.
     - list field removed of the tnode class because it's not used currently
       and can cause hard-to-find bugs
 
+  Revision 1.3  2001/12/31 09:53:15  jonas
+    * changed remaining "getregister32" calls to "getregisterint"
+
+  Revision 1.2  2001/11/02 22:58:02  peter
+    * procsym definition rewrite
+
+  Revision 1.1  2001/09/30 16:17:17  jonas
+    * made most constant and mem handling processor independent
+
+
 }

+ 14 - 4
compiler/ncgutil.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Florian Klaempfl
+    Copyright (c) 1998-2000 by Florian Klaempfl
 
     Helper routines for all code generators
 
@@ -22,7 +22,7 @@
 }
 unit ncgutil;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -1607,8 +1607,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.14  2002-05-14 19:34:42  peter
-    * removed old logs and updated copyright year
+  Revision 1.15  2002-05-16 19:46:37  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.13  2002/05/13 19:54:37  peter
     * removed n386ld and n386util units
@@ -1691,4 +1694,11 @@ end.
   Revision 1.2  2002/03/04 19:10:11  peter
     * removed compiler warnings
 
+  Revision 1.1  2001/12/30 17:24:48  jonas
+    * range checking is now processor independent (part in cgobj,
+      part in cg64f32) and should work correctly again (it needed
+      some changes after the changes of the low and high of
+      tordef's to int64)
+    * maketojumpbool() is now processor independent (in ncgutil)
+    * getregister32 is now called getregisterint
 }

+ 200 - 4
compiler/ncnv.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 2000-2002 by Florian Klaempfl
+    Copyright (c) 2000-2001 by Florian Klaempfl
 
     Type checking and register allocation for type converting nodes
 
@@ -22,7 +22,7 @@
 }
 unit ncnv;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -1739,8 +1739,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.56  2002-05-14 19:34:42  peter
-    * removed old logs and updated copyright year
+  Revision 1.57  2002-05-16 19:46:37  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.55  2002/05/12 16:53:07  peter
     * moved entry and exitcode to ncgutil and cgobj
@@ -1795,4 +1798,197 @@ end.
   Revision 1.48  2002/02/03 09:30:03  peter
     * more fixes for protected handling
 
+  Revision 1.47  2001/12/10 14:34:04  jonas
+    * fixed type conversions from dynamic arrays to open arrays
+
+  Revision 1.46  2001/12/06 17:57:34  florian
+    + parasym to tparaitem added
+
+  Revision 1.45  2001/12/03 21:48:41  peter
+    * freemem change to value parameter
+    * torddef low/high range changed to int64
+
+  Revision 1.44  2001/11/02 23:24:11  jonas
+    * fixed web bug 1665 (allow char to chararray type conversion) ("merged")
+
+  Revision 1.43  2001/11/02 22:58:02  peter
+    * procsym definition rewrite
+
+  Revision 1.42  2001/10/28 17:22:25  peter
+    * allow assignment of overloaded procedures to procvars when we know
+      which procedure to take
+
+  Revision 1.41  2001/10/20 19:28:37  peter
+    * interface 2 guid support
+    * guid constants support
+
+  Revision 1.40  2001/10/20 17:21:54  peter
+    * fixed size of constset when change from small to normalset
+
+  Revision 1.39  2001/09/30 16:12:46  jonas
+    - removed unnecessary i386 pass_2 of as- and isnode and added dummy generic ones
+
+  Revision 1.38  2001/09/29 21:32:46  jonas
+    * almost all second pass typeconvnode helpers are now processor independent
+    * fixed converting boolean to int64/qword
+    * fixed register allocation bugs which could cause internalerror 10
+    * isnode and asnode are completely processor indepent now as well
+    * fpc_do_as now returns its class argument (necessary to be able to use it
+      properly with compilerproc)
+
+  Revision 1.37  2001/09/03 13:27:42  jonas
+    * compilerproc implementation of set addition/substraction/...
+    * changed the declaration of some set helpers somewhat to accomodate the
+      above change
+    * i386 still uses the old code for comparisons of sets, because its
+      helpers return the results in the flags
+    * dummy tc_normal_2_small_set type conversion because I need the original
+      resulttype of the set add nodes
+    NOTE: you have to start a cycle with 1.0.5!
+
+  Revision 1.36  2001/09/02 21:12:06  peter
+    * move class of definitions into type section for delphi
+
+  Revision 1.35  2001/08/29 19:49:03  jonas
+    * some fixes in compilerprocs for chararray to string conversions
+    * conversion from string to chararray is now also done via compilerprocs
+
+  Revision 1.34  2001/08/29 12:18:07  jonas
+    + new createinternres() constructor for tcallnode to support setting a
+      custom resulttype
+    * compilerproc typeconversions now set the resulttype from the type
+      conversion for the generated call node, because the resulttype of
+      of the compilerproc helper isn't always exact (e.g. the ones that
+      return shortstrings, actually return a shortstring[x], where x is
+      specified by the typeconversion node)
+    * ti386callnode.pass_2 now always uses resulttype instead of
+      procsym.definition.rettype (so the custom resulttype, if any, is
+      always used). Note that this "rettype" stuff is only for use with
+      compilerprocs.
+
+  Revision 1.33  2001/08/28 13:24:46  jonas
+    + compilerproc implementation of most string-related type conversions
+    - removed all code from the compiler which has been replaced by
+      compilerproc implementations (using (ifdef hascompilerproc) is not
+      necessary in the compiler)
+
+  Revision 1.32  2001/08/26 13:36:40  florian
+    * some cg reorganisation
+    * some PPC updates
+
+  Revision 1.31  2001/08/05 13:19:51  peter
+    * partly fix for proc of obj=nil
+
+  Revision 1.30  2001/07/30 20:59:27  peter
+    * m68k updates from v10 merged
+
+  Revision 1.29  2001/07/08 21:00:15  peter
+    * various widestring updates, it works now mostly without charset
+      mapping supported
+
+  Revision 1.28  2001/05/13 15:43:46  florian
+    * made resultype_char_to_char a little bit robuster
+
+  Revision 1.27  2001/05/08 21:06:30  florian
+    * some more support for widechars commited especially
+      regarding type casting and constants
+
+  Revision 1.26  2001/05/04 15:52:03  florian
+    * some Delphi incompatibilities fixed:
+       - out, dispose and new can be used as idenfiers now
+       - const p = apointerype(nil); is supported now
+    + support for const p = apointertype(pointer(1234)); added
+
+  Revision 1.25  2001/04/13 22:20:58  peter
+    * remove wrongly placed first_call_helper
+
+  Revision 1.24  2001/04/13 01:22:08  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.23  2001/04/04 22:42:39  peter
+    * move constant folding into det_resulttype
+
+  Revision 1.22  2001/04/02 21:20:30  peter
+    * resulttype rewrite
+
+  Revision 1.21  2001/03/08 17:44:47  jonas
+    * fixed web bug 1430
+
+  Revision 1.20  2001/02/21 11:49:50  jonas
+    * evaluate typecasts of const pointers to ordinals inline ('merged')
+
+  Revision 1.19  2001/02/20 18:37:10  peter
+    * removed unused code
+
+  Revision 1.18  2001/02/20 13:14:18  marco
+   * Fix from Peter for passing a procedure of method to a other method in a method
+
+  Revision 1.17  2001/02/08 13:09:03  jonas
+    * fixed web bug 1396: tpointerord is now a cardinal instead of a longint,
+      but added a hack in ncnv so that pointer(-1) still works
+
+  Revision 1.16  2000/12/31 11:14:10  jonas
+    + implemented/fixed docompare() mathods for all nodes (not tested)
+    + nopt.pas, nadd.pas, i386/n386opt.pas: optimized nodes for adding strings
+      and constant strings/chars together
+    * n386add.pas: don't copy temp strings (of size 256) to another temp string
+      when adding
+
+  Revision 1.15  2000/12/08 12:41:01  jonas
+    * fixed bug in sign extension patch
+
+  Revision 1.14  2000/12/07 17:19:42  jonas
+    * new constant handling: from now on, hex constants >$7fffffff are
+      parsed as unsigned constants (otherwise, $80000000 got sign extended
+      and became $ffffffff80000000), all constants in the longint range
+      become longints, all constants >$7fffffff and <=cardinal($ffffffff)
+      are cardinals and the rest are int64's.
+    * added lots of longint typecast to prevent range check errors in the
+      compiler and rtl
+    * type casts of symbolic ordinal constants are now preserved
+    * fixed bug where the original resulttype.def wasn't restored correctly
+      after doing a 64bit rangecheck
+
+  Revision 1.13  2000/11/29 00:30:32  florian
+    * unused units removed from uses clause
+    * some changes for widestrings
+
+  Revision 1.12  2000/11/20 16:06:04  jonas
+    + allow evaluation of 64bit constant expressions at compile time
+    * disable range checking for explicit typecasts of constant expressions
+
+  Revision 1.11  2000/11/12 23:24:11  florian
+    * interfaces are basically running
+
+  Revision 1.10  2000/11/04 14:25:20  florian
+    + merged Attila's changes for interfaces, not tested yet
+
+  Revision 1.9  2000/10/31 22:02:48  peter
+    * symtable splitted, no real code changes
+
+  Revision 1.8  2000/10/14 21:52:55  peter
+    * fixed memory leaks
+
+  Revision 1.7  2000/10/14 10:14:50  peter
+    * moehrendorf oct 2000 rewrite
+
+  Revision 1.6  2000/10/01 19:48:24  peter
+    * lot of compile updates for cg11
+
+  Revision 1.5  2000/09/28 19:49:52  florian
+  *** empty log message ***
+
+  Revision 1.4  2000/09/27 18:14:31  florian
+    * fixed a lot of syntax errors in the n*.pas stuff
+
+  Revision 1.3  2000/09/26 20:06:13  florian
+    * hmm, still a lot of work to get things compilable
+
+  Revision 1.2  2000/09/26 14:59:34  florian
+    * more conversion work done
+
+  Revision 1.1  2000/09/25 15:37:14  florian
+    * more fixes
 }

+ 99 - 3
compiler/ncon.pas

@@ -22,7 +22,7 @@
 }
 unit ncon;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -721,8 +721,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.30  2002-05-14 19:34:42  peter
-    * removed old logs and updated copyright year
+  Revision 1.31  2002-05-16 19:46:37  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.29  2002/05/12 16:53:07  peter
     * moved entry and exitcode to ncgutil and cgobj
@@ -762,4 +765,97 @@ end.
   Revision 1.25  2002/03/04 19:10:11  peter
     * removed compiler warnings
 
+  Revision 1.24  2001/10/20 19:28:38  peter
+    * interface 2 guid support
+    * guid constants support
+
+  Revision 1.23  2001/09/17 21:29:12  peter
+    * merged netbsd, fpu-overflow from fixes branch
+
+  Revision 1.22  2001/09/02 21:12:06  peter
+    * move class of definitions into type section for delphi
+
+  Revision 1.21  2001/08/26 13:36:40  florian
+    * some cg reorganisation
+    * some PPC updates
+
+  Revision 1.20  2001/08/06 10:18:39  jonas
+    * restype wasn't copied for some constant nodetypes in getcopy
+
+  Revision 1.19  2001/07/08 21:00:15  peter
+    * various widestring updates, it works now mostly without charset
+      mapping supported
+
+  Revision 1.18  2001/05/08 21:06:30  florian
+    * some more support for widechars commited especially
+      regarding type casting and constants
+
+  Revision 1.17  2001/04/13 01:22:09  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.16  2001/04/02 21:20:30  peter
+    * resulttype rewrite
+
+  Revision 1.15  2000/12/31 11:14:10  jonas
+    + implemented/fixed docompare() mathods for all nodes (not tested)
+    + nopt.pas, nadd.pas, i386/n386opt.pas: optimized nodes for adding strings
+      and constant strings/chars together
+    * n386add.pas: don't copy temp strings (of size 256) to another temp string
+      when adding
+
+  Revision 1.14  2000/12/16 15:58:48  jonas
+    * genintconstnode now returns cardinals instead of int64 constants if possible
+
+  Revision 1.13  2000/12/15 13:26:01  jonas
+    * only return int64's from functions if it int64funcresok is defined
+    + added int64funcresok define to options.pas
+
+  Revision 1.12  2000/12/07 17:19:42  jonas
+    * new constant handling: from now on, hex constants >$7fffffff are
+      parsed as unsigned constants (otherwise, $80000000 got sign extended
+      and became $ffffffff80000000), all constants in the longint range
+      become longints, all constants >$7fffffff and <=cardinal($ffffffff)
+      are cardinals and the rest are int64's.
+    * added lots of longint typecast to prevent range check errors in the
+      compiler and rtl
+    * type casts of symbolic ordinal constants are now preserved
+    * fixed bug where the original resulttype.def wasn't restored correctly
+      after doing a 64bit rangecheck
+
+  Revision 1.11  2000/11/29 00:30:32  florian
+    * unused units removed from uses clause
+    * some changes for widestrings
+
+  Revision 1.10  2000/10/31 22:02:48  peter
+    * symtable splitted, no real code changes
+
+  Revision 1.9  2000/10/14 21:52:55  peter
+    * fixed memory leaks
+
+  Revision 1.8  2000/10/14 10:14:50  peter
+    * moehrendorf oct 2000 rewrite
+
+  Revision 1.7  2000/09/28 19:49:52  florian
+  *** empty log message ***
+
+  Revision 1.6  2000/09/27 20:25:44  florian
+    * more stuff fixed
+
+  Revision 1.5  2000/09/27 18:14:31  florian
+    * fixed a lot of syntax errors in the n*.pas stuff
+
+  Revision 1.4  2000/09/26 14:59:34  florian
+    * more conversion work done
+
+  Revision 1.3  2000/09/24 21:15:34  florian
+    * some errors fix to get more stuff compilable
+
+  Revision 1.2  2000/09/24 15:06:19  peter
+    * use defines.inc
+
+  Revision 1.1  2000/09/22 21:44:48  florian
+    + initial revision
+
 }

+ 8 - 2
compiler/new/symtable/defs.pas

@@ -911,7 +911,7 @@ end;
 
 {***************************************************************************
                              TGLOBALVMTENTRY
-***************************************************************************}
+******************************************************* *******************}
 
 constructor Tglobalvmtentry.init(Aowner:Pobjectdef;proc:Pprocdef);
 
@@ -3132,7 +3132,13 @@ end.
 
 {
   $Log$
-  Revision 1.1  2000-07-13 06:30:13  michael
+  Revision 1.2  2002-05-16 19:46:52  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
+
+  Revision 1.1  2000/07/13 06:30:13  michael
   + Initial import
 
   Revision 1.6  2000/03/16 12:52:47  daniel

+ 102 - 4
compiler/nflw.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Florian Klaempfl
+    Copyright (c) 1998-2000 by Florian Klaempfl
 
     Type checking and register allocation for nodes that influence
     the flow
@@ -23,7 +23,7 @@
 }
 unit nflw;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -1113,8 +1113,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.30  2002-05-14 19:34:42  peter
-    * removed old logs and updated copyright year
+  Revision 1.31  2002-05-16 19:46:38  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.29  2002/05/12 16:53:07  peter
     * moved entry and exitcode to ncgutil and cgobj
@@ -1150,4 +1153,99 @@ end.
     - list field removed of the tnode class because it's not used currently
       and can cause hard-to-find bugs
 
+  Revision 1.27  2001/11/19 14:21:30  jonas
+    * upper constant limits for "for" loops are now also converted to the
+      type of the counter var ('merged')
+
+  Revision 1.26  2001/11/02 22:58:02  peter
+    * procsym definition rewrite
+
+  Revision 1.25  2001/10/16 15:10:35  jonas
+    * fixed goto/label/try bugs
+
+  Revision 1.24  2001/09/02 21:12:07  peter
+    * move class of definitions into type section for delphi
+
+  Revision 1.23  2001/08/30 20:56:38  peter
+    * exit() with exceptions fix
+
+  Revision 1.22  2001/08/26 13:36:40  florian
+    * some cg reorganisation
+    * some PPC updates
+
+  Revision 1.21  2001/08/06 21:40:47  peter
+    * funcret moved from tprocinfo to tprocdef
+
+  Revision 1.20  2001/04/26 21:56:08  peter
+    * moved some code from exitnode.create to det_resulttype
+
+  Revision 1.19  2001/04/21 15:36:29  peter
+    * fixed crash with for counter
+
+  Revision 1.18  2001/04/15 09:48:30  peter
+    * fixed crash in labelnode
+    * easier detection of goto and label in try blocks
+
+  Revision 1.17  2001/04/14 14:07:10  peter
+    * moved more code from pass_1 to det_resulttype
+
+  Revision 1.16  2001/04/13 01:22:09  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.15  2001/04/02 21:20:30  peter
+    * resulttype rewrite
+
+  Revision 1.14  2001/03/25 12:27:59  peter
+    * set funcret to assigned (merged)
+
+  Revision 1.13  2001/02/26 19:44:53  peter
+    * merged generic m68k updates from fixes branch
+
+  Revision 1.12  2000/12/31 11:14:10  jonas
+    + implemented/fixed docompare() mathods for all nodes (not tested)
+    + nopt.pas, nadd.pas, i386/n386opt.pas: optimized nodes for adding strings
+      and constant strings/chars together
+    * n386add.pas: don't copy temp strings (of size 256) to another temp string
+      when adding
+
+  Revision 1.11  2000/11/29 00:30:33  florian
+    * unused units removed from uses clause
+    * some changes for widestrings
+
+  Revision 1.10  2000/11/04 14:25:20  florian
+    + merged Attila's changes for interfaces, not tested yet
+
+  Revision 1.9  2000/10/31 22:02:48  peter
+    * symtable splitted, no real code changes
+
+  Revision 1.8  2000/10/21 18:16:11  florian
+    * a lot of changes:
+       - basic dyn. array support
+       - basic C++ support
+       - some work for interfaces done
+       ....
+
+  Revision 1.7  2000/10/14 21:52:55  peter
+    * fixed memory leaks
+
+  Revision 1.6  2000/10/14 10:14:50  peter
+    * moehrendorf oct 2000 rewrite
+
+  Revision 1.5  2000/10/01 19:48:24  peter
+    * lot of compile updates for cg11
+
+  Revision 1.4  2000/09/28 19:49:52  florian
+  *** empty log message ***
+
+  Revision 1.3  2000/09/24 21:15:34  florian
+    * some errors fix to get more stuff compilable
+
+  Revision 1.2  2000/09/24 15:06:19  peter
+    * use defines.inc
+
+  Revision 1.1  2000/09/22 22:46:03  florian
+    + initial revision
+
 }

+ 271 - 4
compiler/ninl.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Florian Klaempfl
+    Copyright (c) 1998-2000 by Florian Klaempfl
 
     Type checking and register allocation for inline nodes
 
@@ -22,7 +22,7 @@
 }
 unit ninl;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -2267,8 +2267,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.74  2002-05-14 19:34:42  peter
-    * removed old logs and updated copyright year
+  Revision 1.75  2002-05-16 19:46:38  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.73  2002/05/12 16:53:07  peter
     * moved entry and exitcode to ncgutil and cgobj
@@ -2327,4 +2330,268 @@ end.
   Revision 1.68  2002/01/19 11:53:56  peter
     * constant evaluation for assinged added
 
+  Revision 1.67  2001/12/28 14:09:21  jonas
+    * fixed web bug 1735 (argument of inc/dec must be made unique) ("merged")
+
+  Revision 1.66  2001/12/10 14:26:22  jonas
+    - removed unnecessary resulttypepass call
+
+  Revision 1.65  2001/12/04 15:59:03  jonas
+    * converted lo/hi to processor independent code, generated code is the
+      same as before (when turning on the optimizer)
+
+  Revision 1.64  2001/12/03 14:21:34  jonas
+    * fixed web bug 1693 (dynarray support for length)
+
+  Revision 1.63  2001/10/24 16:17:36  jonas
+    * fixed web bug 1621 (write(typed_file,function_call) works again)
+    * allow write(typed_file,procvar_call) too (it was already allowed for
+      text file writes)
+
+  Revision 1.62  2001/09/30 16:16:28  jonas
+    - removed unused units form uses-clause and unused local vars
+
+  Revision 1.61  2001/09/24 16:09:55  jonas
+    * check if amount of dimensions passed to setlength for dynamic arrays
+      is correct
+
+  Revision 1.60  2001/09/24 11:35:55  jonas
+    * fix from Pavel V. Ozersk to accept multiple dimensions for setlength
+      and dynamical arrays
+
+  Revision 1.59  2001/09/17 21:29:12  peter
+    * merged netbsd, fpu-overflow from fixes branch
+
+  Revision 1.58  2001/09/05 15:19:43  jonas
+    * the result of high/low nodes wasn't always resulttypepassed
+
+  Revision 1.57  2001/09/04 14:32:45  jonas
+    * simplified det_resulttype code for include/exclude
+    * include/exclude doesn't use any helpers anymore in the i386 secondpass
+
+  Revision 1.56  2001/09/04 11:38:55  jonas
+    + searchsystype() and searchsystype() functions in symtable
+    * changed ninl and nadd to use these functions
+    * i386 set comparison functions now return their results in al instead
+      of in the flags so that they can be sued as compilerprocs
+    - removed all processor specific code from n386add.pas that has to do
+      with set handling, it's now all done in nadd.pas
+    * fixed fpc_set_contains_sets in genset.inc
+    * fpc_set_in_byte is now coded inline in n386set.pas and doesn't use a
+      helper anymore
+    * some small fixes in compproc.inc/set.inc regarding the declaration of
+      internal helper types (fpc_small_set and fpc_normal_set)
+
+  Revision 1.55  2001/09/02 21:12:07  peter
+    * move class of definitions into type section for delphi
+
+  Revision 1.54  2001/08/28 13:24:46  jonas
+    + compilerproc implementation of most string-related type conversions
+    - removed all code from the compiler which has been replaced by
+      compilerproc implementations (using $ifdef hascompilerproc is not
+      necessary in the compiler)
+
+  Revision 1.53  2001/08/27 11:04:41  jonas
+    * avoid nonsense range error when using cardinal with value
+      > high(longint) as code para with val()
+
+  Revision 1.52  2001/08/26 13:36:40  florian
+    * some cg reorganisation
+    * some PPC updates
+
+  Revision 1.51  2001/08/24 13:47:27  jonas
+    * moved "reverseparameters" from ninl.pas to ncal.pas
+    + support for non-persistent temps in ttempcreatenode.create, for use
+      with typeconversion nodes
+
+  Revision 1.50  2001/08/24 12:33:54  jonas
+    * fixed big bug in handle_str that caused it to (almost) always call
+      fpc_<stringtype>_longint
+    * fixed small bug in handle_read_write that caused wrong warnigns about
+      uninitialized vars with read(ln)
+    + handle_val (processor independent val() handling)
+
+  Revision 1.49  2001/08/23 14:28:35  jonas
+    + tempcreate/ref/delete nodes (allows the use of temps in the
+      resulttype and first pass)
+    * made handling of read(ln)/write(ln) processor independent
+    * moved processor independent handling for str and reset/rewrite-typed
+      from firstpass to resulttype pass
+    * changed names of helpers in text.inc to be generic for use as
+      compilerprocs + added "iocheck" directive for most of them
+    * reading of ordinals is done by procedures instead of functions
+      because otherwise FPC_IOCHECK overwrote the result before it could
+      be stored elsewhere (range checking still works)
+    * compilerprocs can now be used in the system unit before they are
+      implemented
+    * added note to errore.msg that booleans can't be read using read/readln
+
+  Revision 1.48  2001/08/13 15:39:52  jonas
+    * made in_reset_typedfile/in_rewrite_typedfile handling processor
+      independent
+
+  Revision 1.47  2001/08/13 12:41:57  jonas
+    * made code for str(x,y) completely processor independent
+
+  Revision 1.46  2001/08/06 12:47:31  jonas
+    * parameters to FPC_TYPED_WRITE can't be regvars (merged)
+
+  Revision 1.45  2001/08/06 09:44:10  jonas
+    + support for high(dynarray) using compilerproc (forgot to commit
+      previously)
+
+  Revision 1.44  2001/07/09 21:15:40  peter
+    * Length made internal
+    * Add array support for Length
+
+  Revision 1.43  2001/07/08 21:00:15  peter
+    * various widestring updates, it works now mostly without charset
+      mapping supported
+
+  Revision 1.42  2001/06/04 11:48:01  peter
+    * better const to var checking
+
+  Revision 1.41  2001/06/03 20:12:53  peter
+    * changed int64($ffffffff) that is buggy under 1.0.x to expression
+      with a shl
+
+  Revision 1.40  2001/05/06 17:16:43  jonas
+    + added warning about missing implementation for high(dynamic_array)
+
+  Revision 1.39  2001/04/26 21:57:05  peter
+    * moved code from firstpass to det_resulttype and remove extraneous
+      calls to firstcallparan for in_str,in_write,in_val
+
+  Revision 1.38  2001/04/21 12:03:11  peter
+    * m68k updates merged from fixes branch
+
+  Revision 1.37  2001/04/13 22:22:30  peter
+    * call set_varstate for setlength
+    * ptr returns pointerconstnode instead of ordconstnode
+
+  Revision 1.36  2001/04/13 01:22:09  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.35  2001/04/05 21:02:13  peter
+    * fixed fpu inline functions typeconvs
+
+  Revision 1.34  2001/04/04 22:42:40  peter
+    * move constant folding into det_resulttype
+
+  Revision 1.33  2001/04/04 21:30:43  florian
+    * applied several fixes to get the DD8 Delphi Unit compiled
+     e.g. "forward"-interfaces are working now
+
+  Revision 1.32  2001/04/02 21:20:31  peter
+    * resulttype rewrite
+
+  Revision 1.31  2001/03/23 00:16:07  florian
+    + some stuff to compile FreeCLX added
+
+  Revision 1.30  2001/03/12 12:47:46  michael
+  + Patches from peter
+
+  Revision 1.29  2001/03/03 12:38:08  jonas
+    * fixed low() for signed types < 64bit
+
+  Revision 1.28  2001/02/26 19:44:53  peter
+    * merged generic m68k updates from fixes branch
+
+  Revision 1.27  2001/02/22 11:24:40  jonas
+    * fixed bug in previous fix (hopped over revision 1.26 because that one
+      also removed the fix for high(cardinal))
+
+  Revision 1.26  2001/02/21 20:50:59  peter
+    * fix to compile again, but high(cardinal) with $R+ still fails!
+
+  Revision 1.25  2001/02/21 12:57:46  jonas
+    * fixed high/low for cardinal, int64 and qword
+
+  Revision 1.24  2001/01/06 19:54:11  peter
+    * merged fix for 1310
+
+  Revision 1.23  2001/01/06 18:28:39  peter
+    * fixed wrong notes about locals
+
+  Revision 1.22  2000/12/31 11:14:10  jonas
+    + implemented/fixed docompare() mathods for all nodes (not tested)
+    + nopt.pas, nadd.pas, i386/n386opt.pas: optimized nodes for adding strings
+      and constant strings/chars together
+    * n386add.pas: don't copy temp strings (of size 256) to another temp string
+      when adding
+
+  Revision 1.21  2000/12/25 00:07:26  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.20  2000/12/17 14:35:41  peter
+    * fixed crash with val()
+
+  Revision 1.19  2000/11/29 00:30:33  florian
+    * unused units removed from uses clause
+    * some changes for widestrings
+
+  Revision 1.18  2000/11/12 15:27:22  jonas
+    * also don't do conversion for chars/booleans (hopefully final change :/)
+
+  Revision 1.17  2000/11/11 21:08:13  jonas
+    * don't do inc/dec to add/sub conversion for enums
+
+  Revision 1.16  2000/11/11 16:18:35  peter
+    * ptr returns farpointer
+
+  Revision 1.15  2000/11/11 15:59:07  jonas
+    * convert inc/dec to add/sub when range/overflow checking is on
+
+  Revision 1.14  2000/11/09 17:46:54  florian
+    * System.TypeInfo fixed
+    + System.Finalize implemented
+    + some new keywords for interface support added
+
+  Revision 1.13  2000/11/04 16:48:32  florian
+    * innr.inc renamed to make compiler compilation easier because the rtl contains
+      a file of the same name
+
+  Revision 1.12  2000/10/31 22:02:48  peter
+    * symtable splitted, no real code changes
+
+  Revision 1.11  2000/10/26 14:15:06  jonas
+    * fixed setlength for shortstrings
+
+  Revision 1.10  2000/10/21 18:16:11  florian
+    * a lot of changes:
+       - basic dyn. array support
+       - basic C++ support
+       - some work for interfaces done
+       ....
+
+  Revision 1.9  2000/10/15 08:38:46  jonas
+    * added missing getcopy for previous addition
+
+  Revision 1.8  2000/10/14 18:27:53  jonas
+    * merged fix for inc/dec on 64bit types from tcinl
+
+  Revision 1.7  2000/10/14 10:14:50  peter
+    * moehrendorf oct 2000 rewrite
+
+  Revision 1.6  2000/10/01 19:48:24  peter
+    * lot of compile updates for cg11
+
+  Revision 1.5  2000/09/28 19:49:52  florian
+  *** empty log message ***
+
+  Revision 1.4  2000/09/28 16:34:47  florian
+  *** empty log message ***
+
+  Revision 1.3  2000/09/27 21:33:22  florian
+    * finally nadd.pas compiles
+
+  Revision 1.2  2000/09/27 20:25:44  florian
+    * more stuff fixed
+
+  Revision 1.1  2000/09/26 14:59:34  florian
+    * more conversion work done
+
 }

+ 116 - 3
compiler/nld.pas

@@ -22,7 +22,7 @@
 }
 unit nld;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -955,8 +955,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.40  2002-05-14 19:34:42  peter
-    * removed old logs and updated copyright year
+  Revision 1.41  2002-05-16 19:46:38  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.39  2002/05/12 16:53:07  peter
     * moved entry and exitcode to ncgutil and cgobj
@@ -1024,4 +1027,114 @@ end.
   Revision 1.32  2002/01/19 11:52:32  peter
     * dynarr:=nil support added
 
+  Revision 1.31  2001/12/28 15:02:00  jonas
+    * fixed web bug 1684 (it already didn't crash anymore, but it also didn't
+      generate an error) ("merged")
+
+  Revision 1.30  2001/11/07 13:52:52  jonas
+    * only save/restore nf_forcevaria flag when reversing order of
+      arrayconstructor elements, since the other flags are element specific
+
+  Revision 1.29  2001/11/02 22:58:02  peter
+    * procsym definition rewrite
+
+  Revision 1.28  2001/10/31 17:34:20  jonas
+    * fixed web bug 1651
+
+  Revision 1.27  2001/10/28 17:22:25  peter
+    * allow assignment of overloaded procedures to procvars when we know
+      which procedure to take
+
+  Revision 1.26  2001/10/12 13:51:51  jonas
+    * fixed internalerror(10) due to previous fpu overflow fixes ("merged")
+    * fixed bug in n386add (introduced after compilerproc changes for string
+      operations) where calcregisters wasn't called for shortstring addnodes
+    * NOTE: from now on, the location of a binary node must now always be set
+       before you call calcregisters() for it
+
+  Revision 1.25  2001/09/02 21:12:07  peter
+    * move class of definitions into type section for delphi
+
+  Revision 1.24  2001/08/30 15:48:34  jonas
+    * fix from Peter for getting correct symtableentry for funcret loads
+
+  Revision 1.23  2001/08/26 13:36:41  florian
+    * some cg reorganisation
+    * some PPC updates
+
+  Revision 1.22  2001/08/12 22:11:52  peter
+    * errordef.typesym is not updated anymore
+
+  Revision 1.21  2001/08/06 21:40:47  peter
+    * funcret moved from tprocinfo to tprocdef
+
+  Revision 1.20  2001/07/30 20:52:25  peter
+    * fixed array constructor passing with type conversions
+
+  Revision 1.19  2001/06/04 18:07:47  peter
+    * remove unused typenode for procvar load. Don't know what happened why
+      this code was not there already with revision 1.17.
+
+  Revision 1.18  2001/06/04 11:48:01  peter
+    * better const to var checking
+
+  Revision 1.17  2001/05/19 21:19:57  peter
+    * remove unused typenode for procvars to prevent error
+    * typenode.allowed flag to allow a typenode
+
+  Revision 1.16  2001/05/09 19:57:51  peter
+    * typenode doesn't generate code, give error in pass_1 instead of
+      getting an abstract methode runtime error
+
+  Revision 1.15  2001/04/14 14:06:31  peter
+    * move more code from loadnode.pass_1 to det_resulttype
+
+  Revision 1.14  2001/04/13 01:22:10  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.13  2001/04/05 21:03:08  peter
+    * array constructor fix
+
+  Revision 1.12  2001/04/04 22:42:40  peter
+    * move constant folding into det_resulttype
+
+  Revision 1.11  2001/04/02 21:20:31  peter
+    * resulttype rewrite
+
+  Revision 1.10  2000/12/31 11:14:10  jonas
+    + implemented/fixed docompare() mathods for all nodes (not tested)
+    + nopt.pas, nadd.pas, i386/n386opt.pas: optimized nodes for adding strings
+      and constant strings/chars together
+    * n386add.pas: don't copy temp strings (of size 256) to another temp string
+      when adding
+
+  Revision 1.9  2000/11/29 00:30:33  florian
+    * unused units removed from uses clause
+    * some changes for widestrings
+
+  Revision 1.8  2000/11/04 14:25:20  florian
+    + merged Attila's changes for interfaces, not tested yet
+
+  Revision 1.7  2000/10/31 22:02:49  peter
+    * symtable splitted, no real code changes
+
+  Revision 1.6  2000/10/14 10:14:50  peter
+    * moehrendorf oct 2000 rewrite
+
+  Revision 1.5  2000/10/01 19:48:24  peter
+    * lot of compile updates for cg11
+
+  Revision 1.4  2000/09/28 19:49:52  florian
+  *** empty log message ***
+
+  Revision 1.3  2000/09/27 18:14:31  florian
+    * fixed a lot of syntax errors in the n*.pas stuff
+
+  Revision 1.2  2000/09/25 15:37:14  florian
+    * more fixes
+
+  Revision 1.1  2000/09/25 14:55:05  florian
+    * initial revision
 }

+ 99 - 3
compiler/nmat.pas

@@ -22,7 +22,7 @@
 }
 unit nmat;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -678,8 +678,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.32  2002-05-14 19:34:43  peter
-    * removed old logs and updated copyright year
+  Revision 1.33  2002-05-16 19:46:39  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.31  2002/04/07 13:26:10  carl
   + change unit use
@@ -701,4 +704,97 @@ end.
   Revision 1.28  2002/02/11 11:45:51  michael
   * Compilation without mmx support fixed from Peter
 
+  Revision 1.27  2001/12/29 15:27:24  jonas
+    * made 'mod powerof2' -> 'and' optimization processor independent
+
+  Revision 1.26  2001/12/27 15:33:58  jonas
+    * fixed fpuregister counting errors ("merged")
+
+  Revision 1.25  2001/11/02 22:58:02  peter
+    * procsym definition rewrite
+
+  Revision 1.24  2001/10/12 13:51:51  jonas
+    * fixed internalerror(10) due to previous fpu overflow fixes ("merged")
+    * fixed bug in n386add (introduced after compilerproc changes for string
+      operations) where calcregisters wasn't called for shortstring addnodes
+    * NOTE: from now on, the location of a binary node must now always be set
+       before you call calcregisters() for it
+
+  Revision 1.23  2001/09/05 15:22:09  jonas
+    * made multiplying, dividing and mod'ing of int64 and qword processor
+      independent with compilerprocs (+ small optimizations by using shift/and
+      where possible)
+
+  Revision 1.22  2001/09/02 21:12:07  peter
+    * move class of definitions into type section for delphi
+
+  Revision 1.21  2001/08/26 13:36:41  florian
+    * some cg reorganisation
+    * some PPC updates
+
+  Revision 1.20  2001/04/13 01:22:10  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.19  2001/04/05 21:00:27  peter
+    * fix constant not evaluation
+
+  Revision 1.18  2001/04/04 22:42:40  peter
+    * move constant folding into det_resulttype
+
+  Revision 1.17  2001/04/02 21:20:31  peter
+    * resulttype rewrite
+
+  Revision 1.16  2001/03/20 18:11:03  jonas
+    * not (cardinal) now has cardinal instead of longint result (bug reported
+      in mailinglist) ("merged")
+
+  Revision 1.15  2001/03/04 10:38:55  jonas
+    * fixed 'qword mod/div pos_const' to have qword result
+
+  Revision 1.14  2001/02/20 21:48:17  peter
+    * remove nasm hack
+
+  Revision 1.13  2001/01/06 18:28:39  peter
+    * fixed wrong notes about locals
+
+  Revision 1.12  2001/01/05 17:36:57  florian
+  * the info about exception frames is stored now on the stack
+  instead on the heap
+
+  Revision 1.11  2000/12/25 00:07:26  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.10  2000/12/16 15:54:01  jonas
+    * 'resulttype.def of cardinal shl/shr x' is cardinal instead of longint
+
+  Revision 1.9  2000/11/29 00:30:34  florian
+    * unused units removed from uses clause
+    * some changes for widestrings
+
+  Revision 1.8  2000/10/31 22:02:49  peter
+    * symtable splitted, no real code changes
+
+  Revision 1.7  2000/10/01 19:48:24  peter
+    * lot of compile updates for cg11
+
+  Revision 1.6  2000/09/27 21:33:22  florian
+    * finally nadd.pas compiles
+
+  Revision 1.5  2000/09/27 20:25:44  florian
+    * more stuff fixed
+
+  Revision 1.4  2000/09/24 15:06:19  peter
+    * use defines.inc
+
+  Revision 1.3  2000/09/22 22:48:54  florian
+    * some fixes
+
+  Revision 1.2  2000/09/22 22:09:54  florian
+    * more stuff converted
+
+  Revision 1.1  2000/09/20 21:35:12  florian
+    * initial revision
 }

+ 92 - 3
compiler/nmem.pas

@@ -22,7 +22,7 @@
 }
 unit nmem;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -894,8 +894,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.31  2002-05-14 19:34:43  peter
-    * removed old logs and updated copyright year
+  Revision 1.32  2002-05-16 19:46:39  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.30  2002/05/12 16:53:07  peter
     * moved entry and exitcode to ncgutil and cgobj
@@ -947,4 +950,90 @@ end.
         constructs with either too many or too little parameters)
     (both merged, includes second typo fix of pexpr.pas)
 
+  Revision 1.25  2001/12/06 17:57:34  florian
+    + parasym to tparaitem added
+
+  Revision 1.24  2001/12/03 21:48:42  peter
+    * freemem change to value parameter
+    * torddef low/high range changed to int64
+
+  Revision 1.23  2001/11/02 22:58:02  peter
+    * procsym definition rewrite
+
+  Revision 1.22  2001/10/28 17:22:25  peter
+    * allow assignment of overloaded procedures to procvars when we know
+      which procedure to take
+
+  Revision 1.20  2001/09/02 21:12:07  peter
+    * move class of definitions into type section for delphi
+
+  Revision 1.19  2001/08/26 13:36:42  florian
+    * some cg reorganisation
+    * some PPC updates
+
+  Revision 1.18  2001/04/13 22:15:21  peter
+    * removed wrongly placed set_varstate in subscriptnode
+
+  Revision 1.17  2001/04/13 01:22:10  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.16  2001/04/02 21:20:31  peter
+    * resulttype rewrite
+
+  Revision 1.15  2001/03/23 00:16:07  florian
+    + some stuff to compile FreeCLX added
+
+  Revision 1.14  2000/12/31 11:14:11  jonas
+    + implemented/fixed docompare() mathods for all nodes (not tested)
+    + nopt.pas, nadd.pas, i386/n386opt.pas: optimized nodes for adding strings
+      and constant strings/chars together
+    * n386add.pas: don't copy temp strings (of size 256) to another temp string
+      when adding
+
+  Revision 1.13  2000/12/25 00:07:26  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.12  2000/12/05 15:19:50  jonas
+    * fixed webbug 1268 ("merged")
+
+  Revision 1.11  2000/11/29 00:30:34  florian
+    * unused units removed from uses clause
+    * some changes for widestrings
+
+  Revision 1.10  2000/11/04 14:25:20  florian
+    + merged Attila's changes for interfaces, not tested yet
+
+  Revision 1.9  2000/10/31 22:02:49  peter
+    * symtable splitted, no real code changes
+
+  Revision 1.8  2000/10/21 18:16:11  florian
+    * a lot of changes:
+       - basic dyn. array support
+       - basic C++ support
+       - some work for interfaces done
+       ....
+
+  Revision 1.7  2000/10/14 21:52:55  peter
+    * fixed memory leaks
+
+  Revision 1.6  2000/10/14 10:14:51  peter
+    * moehrendorf oct 2000 rewrite
+
+  Revision 1.5  2000/10/01 19:48:24  peter
+    * lot of compile updates for cg11
+
+  Revision 1.4  2000/09/28 19:49:52  florian
+  *** empty log message ***
+
+  Revision 1.3  2000/09/25 15:37:14  florian
+    * more fixes
+
+  Revision 1.2  2000/09/25 15:05:25  florian
+    * some updates
+
+  Revision 1.1  2000/09/25 09:58:22  florian
+    * first revision for testing purpose
 }

+ 114 - 4
compiler/nobj.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Florian Klaempfl
+    Copyright (c) 1998-2000 by Florian Klaempfl
 
     Routines for the code generation of data structures
     like VMT, Messages, VTables, Interfaces descs
@@ -23,7 +23,7 @@
 }
 unit nobj;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -1269,8 +1269,11 @@ initialization
 end.
 {
   $Log$
-  Revision 1.18  2002-05-14 19:34:43  peter
-    * removed old logs and updated copyright year
+  Revision 1.19  2002-05-16 19:46:39  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.17  2002/05/12 16:53:08  peter
     * moved entry and exitcode to ncgutil and cgobj
@@ -1313,4 +1316,111 @@ end.
     * fixed vmt generation for private procedures that were skipped after
       my previous changes
 
+  Revision 1.12  2001/12/31 16:59:41  peter
+    * protected/private symbols parsing fixed
+
+  Revision 1.11  2001/11/20 18:49:43  peter
+    * require overload for cross object overloading
+
+  Revision 1.10  2001/11/18 20:18:54  peter
+    * use cp_value_equal_const instead of cp_all
+
+  Revision 1.9  2001/11/18 18:43:14  peter
+    * overloading supported in child classes
+    * fixed parsing of classes with private and virtual and overloaded
+      so it is compatible with delphi
+
+  Revision 1.8  2001/11/02 22:58:02  peter
+    * procsym definition rewrite
+
+  Revision 1.7  2001/10/25 21:22:35  peter
+    * calling convention rewrite
+
+  Revision 1.6  2001/10/20 19:28:38  peter
+    * interface 2 guid support
+    * guid constants support
+
+  Revision 1.5  2001/10/20 17:20:14  peter
+    * fixed generation of rtti for virtualmethods
+
+  Revision 1.4  2001/09/19 11:04:42  michael
+  * Smartlinking with interfaces fixed
+  * Better smartlinking for rtti and init tables
+
+  Revision 1.3  2001/08/30 20:13:53  peter
+    * rtti/init table updates
+    * rttisym for reusable global rtti/init info
+    * support published for interfaces
+
+  Revision 1.2  2001/08/22 21:16:20  florian
+    * some interfaces related problems regarding
+      mapping of interface implementions fixed
+
+  Revision 1.1  2001/04/21 13:37:16  peter
+    * made tclassheader using class of to implement cpu dependent code
+
+  Revision 1.20  2001/04/18 22:01:54  peter
+    * registration of targets and assemblers
+
+  Revision 1.19  2001/04/13 01:22:07  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.18  2001/04/04 21:30:43  florian
+    * applied several fixes to get the DD8 Delphi Unit compiled
+     e.g. "forward"-interfaces are working now
+
+  Revision 1.17  2000/12/25 00:07:26  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.16  2000/11/29 00:30:30  florian
+    * unused units removed from uses clause
+    * some changes for widestrings
+
+  Revision 1.15  2000/11/19 16:23:35  florian
+  *** empty log message ***
+
+  Revision 1.14  2000/11/12 23:24:10  florian
+    * interfaces are basically running
+
+  Revision 1.13  2000/11/08 00:07:40  florian
+     * potential range check error fixed
+
+  Revision 1.12  2000/11/06 23:13:53  peter
+    * uppercase manglednames
+
+  Revision 1.11  2000/11/04 17:31:00  florian
+    * fixed some problems of previous commit
+
+  Revision 1.10  2000/11/04 14:25:19  florian
+    + merged Attila's changes for interfaces, not tested yet
+
+  Revision 1.9  2000/11/01 23:04:37  peter
+    * tprocdef.fullprocname added for better casesensitve writing of
+      procedures
+
+  Revision 1.8  2000/10/31 22:02:47  peter
+    * symtable splitted, no real code changes
+
+  Revision 1.7  2000/10/14 10:14:47  peter
+    * moehrendorf oct 2000 rewrite
+
+  Revision 1.6  2000/09/24 21:19:50  peter
+    * delphi compile fixes
+
+  Revision 1.5  2000/09/24 15:06:17  peter
+    * use defines.inc
+
+  Revision 1.4  2000/08/27 16:11:51  peter
+    * moved some util functions from globals,cobjects to cutils
+    * splitted files into finput,fmodule
+
+  Revision 1.3  2000/07/13 12:08:26  michael
+  + patched to 1.1.0 with former 1.09patch from peter
+
+  Revision 1.2  2000/07/13 11:32:41  michael
+  + removed logs
+
 }

+ 83 - 3
compiler/node.pas

@@ -22,7 +22,7 @@
 }
 unit node;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -806,8 +806,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.25  2002-05-14 19:34:43  peter
-    * removed old logs and updated copyright year
+  Revision 1.26  2002-05-16 19:46:39  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.24  2002/04/21 19:02:04  peter
     * removed newn and disposen nodes, the code is now directly
@@ -839,4 +842,81 @@ end.
   Revision 1.21  2002/01/19 11:52:32  peter
     * dynarr:=nil support added
 
+  Revision 1.20  2001/10/20 19:28:38  peter
+    * interface 2 guid support
+    * guid constants support
+
+  Revision 1.19  2001/08/23 14:28:36  jonas
+    + tempcreate/ref/delete nodes (allows the use of temps in the
+      resulttype and first pass)
+    * made handling of read(ln)/write(ln) processor independent
+    * moved processor independent handling for str and reset/rewrite-typed
+      from firstpass to resulttype pass
+    * changed names of helpers in text.inc to be generic for use as
+      compilerprocs + added "iocheck" directive for most of them
+    * reading of ordinals is done by procedures instead of functions
+      because otherwise FPC_IOCHECK overwrote the result before it could
+      be stored elsewhere (range checking still works)
+    * compilerprocs can now be used in the system unit before they are
+      implemented
+    * added note to errore.msg that booleans can't be read using read/readln
+
+  Revision 1.18  2001/07/30 20:59:27  peter
+    * m68k updates from v10 merged
+
+  Revision 1.17  2001/06/04 18:14:16  peter
+    * store blocktype info in tnode
+
+  Revision 1.16  2001/06/04 11:53:13  peter
+    + varargs directive
+
+  Revision 1.15  2001/04/13 01:22:10  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.14  2001/04/02 21:20:31  peter
+    * resulttype rewrite
+
+  Revision 1.13  2001/01/13 00:08:09  peter
+    * added missing addoptn
+
+  Revision 1.12  2001/01/01 11:38:45  peter
+    * forgot to remove node.inc and nodeh.inc that were merged into node.pas
+      already.
+
+  Revision 1.11  2000/12/25 00:07:26  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.10  2000/11/29 00:30:34  florian
+    * unused units removed from uses clause
+    * some changes for widestrings
+
+  Revision 1.9  2000/10/31 22:02:49  peter
+    * symtable splitted, no real code changes
+
+  Revision 1.8  2000/10/01 19:48:24  peter
+    * lot of compile updates for cg11
+
+  Revision 1.7  2000/09/30 16:08:45  peter
+    * more cg11 updates
+
+  Revision 1.6  2000/09/28 19:49:52  florian
+  *** empty log message ***
+
+  Revision 1.5  2000/09/27 18:14:31  florian
+    * fixed a lot of syntax errors in the n*.pas stuff
+
+  Revision 1.4  2000/09/24 15:06:19  peter
+    * use defines.inc
+
+  Revision 1.3  2000/09/22 21:45:35  florian
+    * some updates e.g. getcopy added
+
+  Revision 1.2  2000/09/20 21:52:38  florian
+    * removed a lot of errors
+
+  Revision 1.1  2000/08/26 12:27:35  florian
+    * initial release
 }

+ 25 - 4
compiler/nopt.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Jonas Maebe
+    Copyright (c) 1998-2000 by Jonas Maebe
 
     This unit implements optimized nodes
 
@@ -22,7 +22,7 @@
 }
 unit nopt;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -278,8 +278,11 @@ end.
 
 {
   $Log$
-  Revision 1.7  2002-05-14 19:34:43  peter
-    * removed old logs and updated copyright year
+  Revision 1.8  2002-05-16 19:46:39  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.6  2002/04/02 17:11:29  peter
     * tlocation,treference update
@@ -292,4 +295,22 @@ end.
       with string operations
     * adapted some routines to use the new cg methods
 
+  Revision 1.5  2001/09/02 21:12:07  peter
+    * move class of definitions into type section for delphi
+
+  Revision 1.4  2001/08/26 13:36:43  florian
+    * some cg reorganisation
+    * some PPC updates
+
+  Revision 1.3  2001/04/13 01:22:10  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.2  2001/04/02 21:20:31  peter
+    * resulttype rewrite
+
+  Revision 1.1  2001/01/04 11:24:19  jonas
+    + initial implementation (still needs to be made more modular)
+
 }

+ 74 - 4
compiler/nset.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 2000-2002 by Florian Klaempfl
+    Copyright (c) 2000-2001 by Florian Klaempfl
 
     Type checking and register allocation for set/case nodes
 
@@ -22,7 +22,7 @@
 }
 unit nset;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -574,8 +574,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.22  2002-05-14 19:34:43  peter
-    * removed old logs and updated copyright year
+  Revision 1.23  2002-05-16 19:46:39  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.21  2002/05/12 16:53:08  peter
     * moved entry and exitcode to ncgutil and cgobj
@@ -625,4 +628,71 @@ end.
     - list field removed of the tnode class because it's not used currently
       and can cause hard-to-find bugs
 
+  Revision 1.17  2001/12/06 17:57:35  florian
+    + parasym to tparaitem added
+
+  Revision 1.16  2001/10/12 13:51:51  jonas
+    * fixed internalerror(10) due to previous fpu overflow fixes ("merged")
+    * fixed bug in n386add (introduced after compilerproc changes for string
+      operations) where calcregisters wasn't called for shortstring addnodes
+    * NOTE: from now on, the location of a binary node must now always be set
+       before you call calcregisters() for it
+
+  Revision 1.15  2001/09/02 21:12:07  peter
+    * move class of definitions into type section for delphi
+
+  Revision 1.14  2001/08/26 13:36:43  florian
+    * some cg reorganisation
+    * some PPC updates
+
+  Revision 1.13  2001/04/13 01:22:10  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.12  2001/04/02 21:20:31  peter
+    * resulttype rewrite
+
+  Revision 1.11  2000/12/31 11:14:11  jonas
+    + implemented/fixed docompare() mathods for all nodes (not tested)
+    + nopt.pas, nadd.pas, i386/n386opt.pas: optimized nodes for adding strings
+      and constant strings/chars together
+    * n386add.pas: don't copy temp strings (of size 256) to another temp string
+      when adding
+
+  Revision 1.10  2000/12/18 17:44:26  jonas
+    * more int64 case fixes
+
+  Revision 1.9  2000/11/29 00:30:34  florian
+    * unused units removed from uses clause
+    * some changes for widestrings
+
+  Revision 1.8  2000/11/04 14:25:20  florian
+    + merged Attila's changes for interfaces, not tested yet
+
+  Revision 1.7  2000/10/31 22:02:49  peter
+    * symtable splitted, no real code changes
+
+  Revision 1.6  2000/10/21 18:16:11  florian
+    * a lot of changes:
+       - basic dyn. array support
+       - basic C++ support
+       - some work for interfaces done
+       ....
+
+  Revision 1.5  2000/10/14 10:14:51  peter
+    * moehrendorf oct 2000 rewrite
+
+  Revision 1.4  2000/10/01 19:48:25  peter
+    * lot of compile updates for cg11
+
+  Revision 1.3  2000/09/27 18:14:31  florian
+    * fixed a lot of syntax errors in the n*.pas stuff
+
+  Revision 1.2  2000/09/24 20:17:44  florian
+    * more conversion work done
+
+  Revision 1.1  2000/09/24 19:38:39  florian
+    * initial implementation
+
 }

+ 37 - 4
compiler/ogbase.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Peter Vreman
+    Copyright (c) 1998-2000 by Peter Vreman
 
     Contains the base stuff for binary object file writers
 
@@ -22,7 +22,7 @@
 }
 unit ogbase;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
     uses
@@ -578,7 +578,40 @@ implementation
 end.
 {
   $Log$
-  Revision 1.9  2002-05-14 19:34:43  peter
-    * removed old logs and updated copyright year
+  Revision 1.10  2002-05-16 19:46:39  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
+
+  Revision 1.8  2001/12/31 16:54:14  peter
+    * fixed inline crash with assembler routines
+
+  Revision 1.7  2001/04/13 01:22:10  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.6  2001/03/05 21:40:38  peter
+    * more things for tcoffobjectinput
+
+  Revision 1.5  2000/12/25 00:07:26  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.4  2000/12/24 12:25:31  peter
+    + cstreams unit
+    * dynamicarray object to class
+
+  Revision 1.3  2000/12/23 19:59:35  peter
+    * object to class for ow/og objects
+    * split objectdata from objectoutput
+
+  Revision 1.2  2000/11/13 21:56:07  peter
+    * removed some virtual from methods
+    * sectionsize method implemented (fixes lineinfo stabs)
+
+  Revision 1.1  2000/11/12 22:20:37  peter
+    * create generic tobjectsection for binary writers
 
 }

+ 71 - 5
compiler/ogcoff.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Peter Vreman and Pierre Muller
+    Copyright (c) 1998-2000 by Peter Vreman and Pierre Muller
 
     Contains the binary coff reader and writer
 
@@ -26,7 +26,7 @@
 }
 unit ogcoff;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -1181,12 +1181,15 @@ implementation
 initialization
   RegisterAssembler(as_i386_coff_info,TCoffAssembler);
   RegisterAssembler(as_i386_pecoff_info,TPECoffAssembler);
-  RegisterAssembler(as_i386_pecoffwdosx_info,TPECoffAssembler);
+  RegisterAssembler(as_i386_pecoffwdosx_info,TPECoffAssembler); 
 end.
 {
   $Log$
-  Revision 1.19  2002-05-14 19:34:43  peter
-    * removed old logs and updated copyright year
+  Revision 1.20  2002-05-16 19:46:39  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.18  2002/04/04 19:05:58  peter
     * removed unused units
@@ -1195,4 +1198,67 @@ end.
   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
+    * merged netbsd, fpu-overflow from fixes branch
+
+  Revision 1.15  2001/05/06 17:13:23  jonas
+    * completed incomplete typed constant records
+
+  Revision 1.14  2001/05/04 19:50:58  peter
+    * finally added the missing outputbinary field that was missing
+
+  Revision 1.13  2001/04/18 22:01:54  peter
+    * registration of targets and assemblers
+
+  Revision 1.12  2001/04/13 01:22:10  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.11  2001/04/02 21:20:31  peter
+    * resulttype rewrite
+
+  Revision 1.10  2001/03/13 18:45:07  peter
+    * fixed some memory leaks
+
+  Revision 1.9  2001/03/05 21:40:38  peter
+    * more things for tcoffobjectinput
+
+  Revision 1.8  2000/12/25 00:07:26  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.7  2000/12/24 12:25:31  peter
+    + cstreams unit
+    * dynamicarray object to class
+
+  Revision 1.6  2000/12/23 19:59:35  peter
+    * object to class for ow/og objects
+    * split objectdata from objectoutput
+
+  Revision 1.5  2000/12/21 12:06:38  jonas
+    * changed type of all "flags" variables/parameters/fields to cardinal
+      and removed longint typecasts around constants
+
+  Revision 1.4  2000/12/20 15:59:04  jonas
+    * fixed range check errors
+
+  Revision 1.3  2000/12/18 21:56:35  peter
+    * fixed stab reloc writing
+
+  Revision 1.2  2000/12/07 17:19:42  jonas
+    * new constant handling: from now on, hex constants >$7fffffff are
+      parsed as unsigned constants (otherwise, $80000000 got sign extended
+      and became $ffffffff80000000), all constants in the longint range
+      become longints, all constants >$7fffffff and <=cardinal($ffffffff)
+      are cardinals and the rest are int64's.
+    * added lots of longint typecast to prevent range check errors in the
+      compiler and rtl
+    * type casts of symbolic ordinal constants are now preserved
+    * fixed bug where the original resulttype wasn't restored correctly
+      after doing a 64bit rangecheck
+
+  Revision 1.1  2000/11/12 22:20:37  peter
+    * create generic toutputsection for binary writers
+
 }

+ 42 - 4
compiler/ogelf.pas

@@ -1,6 +1,6 @@
 {
     $Id$
-    Copyright (c) 1998-2002 by Peter Vreman
+    Copyright (c) 1998-2000 by Peter Vreman
 
     Contains the binary elf writer
 
@@ -26,7 +26,7 @@
 }
 unit ogelf;
 
-{$i defines.inc}
+{$i fpcdefs.inc}
 
 interface
 
@@ -874,8 +874,11 @@ initialization
 end.
 {
   $Log$
-  Revision 1.13  2002-05-14 19:34:43  peter
-    * removed old logs and updated copyright year
+  Revision 1.14  2002-05-16 19:46:39  carl
+  + defines.inc -> fpcdefs.inc to avoid conflicts if compiling by hand
+  + try to fix temp allocation (still in ifdef)
+  + generic constructor calls
+  + start of tassembler / tmodulebase class cleanup
 
   Revision 1.12  2002/05/12 16:53:08  peter
     * moved entry and exitcode to ncgutil and cgobj
@@ -898,4 +901,39 @@ end.
     * 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
+    * finally added the missing outputbinary field that was missing
+
+  Revision 1.8  2001/04/18 22:01:54  peter
+    * registration of targets and assemblers
+
+  Revision 1.7  2001/04/13 01:22:10  peter
+    * symtable change to classes
+    * range check generation and errors fixed, make cycle DEBUG=1 works
+    * memory leaks fixed
+
+  Revision 1.6  2001/03/05 21:40:39  peter
+    * more things for tcoffobjectinput
+
+  Revision 1.5  2000/12/25 00:07:26  peter
+    + new tlinkedlist class (merge of old tstringqueue,tcontainer and
+      tlinkedlist objects)
+
+  Revision 1.4  2000/12/24 12:25:32  peter
+    + cstreams unit
+    * dynamicarray object to class
+
+  Revision 1.3  2000/12/23 19:59:35  peter
+    * object to class for ow/og objects
+    * split objectdata from objectoutput
+
+  Revision 1.2  2000/11/12 22:45:14  peter
+    * moved setting of stab hdrsym
+
+  Revision 1.1  2000/11/12 22:20:37  peter
+    * create generic toutputsection for binary writers
+
 }

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است