Browse Source

+ globtype,tokens,version unit splitted from globals

peter 27 years ago
parent
commit
1b369bb4bb
67 changed files with 651 additions and 431 deletions
  1. 5 2
      compiler/aasm.pas
  2. 10 5
      compiler/ag68kgas.pas
  3. 10 3
      compiler/ag68kmit.pas
  4. 6 2
      compiler/ag68kmot.pas
  5. 6 2
      compiler/ag68kmpw.pas
  6. 10 3
      compiler/aopt386.pas
  7. 6 2
      compiler/asmutils.pas
  8. 5 2
      compiler/assemble.pas
  9. 6 2
      compiler/cg386add.pas
  10. 12 8
      compiler/cg386cal.pas
  11. 6 2
      compiler/cg386con.pas
  12. 6 2
      compiler/cg386inl.pas
  13. 6 2
      compiler/cg386ld.pas
  14. 6 2
      compiler/cg386mat.pas
  15. 7 3
      compiler/cg386mem.pas
  16. 6 2
      compiler/cg386set.pas
  17. 6 2
      compiler/cg68kadd.pas
  18. 6 2
      compiler/cg68kcal.pas
  19. 6 2
      compiler/cg68kcnv.pas
  20. 101 40
      compiler/cg68kcon.pas
  21. 6 2
      compiler/cg68kflw.pas
  22. 6 2
      compiler/cg68kinl.pas
  23. 6 2
      compiler/cg68kmat.pas
  24. 8 4
      compiler/cg68kmem.pas
  25. 6 2
      compiler/cg68kset.pas
  26. 46 4
      compiler/cga68k.pas
  27. 2 110
      compiler/comphook.pas
  28. 7 6
      compiler/daopt386.pas
  29. 5 1
      compiler/files.pas
  30. 6 2
      compiler/gdb.pas
  31. 6 2
      compiler/htypechk.pas
  32. 6 2
      compiler/link.pas
  33. 16 4
      compiler/messages.pas
  34. 5 2
      compiler/opts386.pas
  35. 5 2
      compiler/opts68k.pas
  36. 5 2
      compiler/os2_targ.pas
  37. 7 4
      compiler/parser.pas
  38. 6 2
      compiler/pass_1.pas
  39. 6 2
      compiler/pass_2.pas
  40. 7 4
      compiler/pbase.pas
  41. 5 2
      compiler/pdecl.pas
  42. 8 7
      compiler/pexports.pas
  43. 6 2
      compiler/pexpr.pas
  44. 7 4
      compiler/pmodules.pas
  45. 9 7
      compiler/popt386.pas
  46. 6 2
      compiler/pstatmnt.pas
  47. 6 2
      compiler/psystem.pas
  48. 5 2
      compiler/ptconst.pas
  49. 5 2
      compiler/ra386att.pas
  50. 5 2
      compiler/ra386int.pas
  51. 5 2
      compiler/ra68kmot.pas
  52. 17 76
      compiler/scanner.pas
  53. 7 2
      compiler/switches.pas
  54. 7 3
      compiler/tcadd.pas
  55. 6 2
      compiler/tccal.pas
  56. 6 2
      compiler/tccnv.pas
  57. 6 2
      compiler/tcflw.pas
  58. 6 2
      compiler/tcmat.pas
  59. 6 2
      compiler/tcmem.pas
  60. 6 2
      compiler/tcset.pas
  61. 7 1
      compiler/tgeni386.pas
  62. 12 30
      compiler/tokens.pas
  63. 7 3
      compiler/tree.pas
  64. 6 2
      compiler/types.pas
  65. 5 2
      compiler/verbose.pas
  66. 63 0
      compiler/version.pas
  67. 18 15
      compiler/win_targ.pas

+ 5 - 2
compiler/aasm.pas

@@ -327,7 +327,7 @@ type
 implementation
 implementation
 
 
 uses
 uses
-  strings,verbose,systems;
+  strings,verbose,systems,globtype;
 
 
 {****************************************************************************
 {****************************************************************************
                              TAI
                              TAI
@@ -916,7 +916,10 @@ uses
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.26  1998-12-01 23:36:31  pierre
+  Revision 1.27  1998-12-11 00:02:37  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.26  1998/12/01 23:36:31  pierre
    * zero padded alignment was buggy
    * zero padded alignment was buggy
 
 
   Revision 1.25  1998/11/30 09:42:52  pierre
   Revision 1.25  1998/11/30 09:42:52  pierre

+ 10 - 5
compiler/ag68kgas.pas

@@ -44,7 +44,8 @@ unit ag68kgas;
    implementation
    implementation
 
 
     uses
     uses
-      dos,globals,systems,m68k,
+      globtype,systems,
+      dos,globals,m68k,
       strings,files,verbose
       strings,files,verbose
 {$ifdef GDB}
 {$ifdef GDB}
       ,gdb
       ,gdb
@@ -56,8 +57,11 @@ unit ag68kgas;
 
 
     var
     var
 {$ifdef GDB}
 {$ifdef GDB}
-      n_line  : byte;     { different types of source lines }
+      n_line       : byte;     { different types of source lines }
+      linecount,
       includecount : longint;
       includecount : longint;
+      funcname     : pchar;
+      stabslastfileinfo : tfileposinfo;
 {$endif}
 {$endif}
       lastsec    : tsection; { last section type written }
       lastsec    : tsection; { last section type written }
       lastsecidx,
       lastsecidx,
@@ -249,8 +253,6 @@ unit ag68kgas;
     var
     var
       curr_n    : byte;
       curr_n    : byte;
       infile    : pinputfile;
       infile    : pinputfile;
-      funcname  : pchar;
-      linecount : longint;
 
 
       procedure tm68kgasasmlist.WriteFileLineInfo(var fileinfo : tfileposinfo);
       procedure tm68kgasasmlist.WriteFileLineInfo(var fileinfo : tfileposinfo);
         begin
         begin
@@ -699,7 +701,10 @@ ait_stab_function_name : funcname:=pai_stab_function_name(hp)^.str;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.20  1998-11-12 11:19:35  pierre
+  Revision 1.21  1998-12-11 00:02:39  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.20  1998/11/12 11:19:35  pierre
    * fix for first line of function break
    * fix for first line of function break
 
 
   Revision 1.19  1998/10/29 11:35:36  florian
   Revision 1.19  1998/10/29 11:35:36  florian

+ 10 - 3
compiler/ag68kmit.pas

@@ -43,7 +43,8 @@ unit ag68kmit;
    implementation
    implementation
 
 
     uses
     uses
-      dos,globals,systems,cobjects,m68k,
+      globtype,systems,
+      dos,globals,cobjects,m68k,
       strings,files,verbose
       strings,files,verbose
 {$ifdef GDB}
 {$ifdef GDB}
       ,gdb
       ,gdb
@@ -55,8 +56,11 @@ unit ag68kmit;
 
 
     var
     var
 {$ifdef GDB}
 {$ifdef GDB}
-      n_line  : byte;     { different types of source lines }
+      n_line       : byte;     { different types of source lines }
+      linecount,
       includecount : longint;
       includecount : longint;
+      funcname     : pchar;
+      stabslastfileinfo : tfileposinfo;
 {$endif}
 {$endif}
       lastsec    : tsection; { last section type written }
       lastsec    : tsection; { last section type written }
       lastsecidx,
       lastsecidx,
@@ -661,7 +665,10 @@ ait_stab_function_name : funcname:=pai_stab_function_name(hp)^.str;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.17  1998-11-30 09:42:57  pierre
+  Revision 1.18  1998-12-11 00:02:40  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.17  1998/11/30 09:42:57  pierre
     * some range check bugs fixed (still not working !)
     * some range check bugs fixed (still not working !)
     + added DLL writing support for win32 (also accepts variables)
     + added DLL writing support for win32 (also accepts variables)
     + TempAnsi for code that could be used for Temporary ansi strings
     + TempAnsi for code that could be used for Temporary ansi strings

+ 6 - 2
compiler/ag68kmot.pas

@@ -38,7 +38,8 @@ unit ag68kmot;
   implementation
   implementation
 
 
     uses
     uses
-      dos,globals,systems,cobjects,m68k,
+      globtype,systems,
+      dos,globals,cobjects,m68k,
       strings,files,verbose
       strings,files,verbose
 {$ifdef GDB}
 {$ifdef GDB}
       ,gdb
       ,gdb
@@ -541,7 +542,10 @@ ait_labeled_instruction :
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.15  1998-11-30 09:42:58  pierre
+  Revision 1.16  1998-12-11 00:02:41  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.15  1998/11/30 09:42:58  pierre
     * some range check bugs fixed (still not working !)
     * some range check bugs fixed (still not working !)
     + added DLL writing support for win32 (also accepts variables)
     + added DLL writing support for win32 (also accepts variables)
     + TempAnsi for code that could be used for Temporary ansi strings
     + TempAnsi for code that could be used for Temporary ansi strings

+ 6 - 2
compiler/ag68kmpw.pas

@@ -36,7 +36,8 @@ unit ag68kmpw;
   implementation
   implementation
 
 
     uses
     uses
-      dos,globals,systems,cobjects,m68k,
+      globtype,systems,
+      dos,globals,cobjects,m68k,
       strings,files,verbose
       strings,files,verbose
 {$ifdef GDB}
 {$ifdef GDB}
       ,gdb
       ,gdb
@@ -580,7 +581,10 @@ ait_labeled_instruction :
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.7  1998-11-12 11:19:39  pierre
+  Revision 1.8  1998-12-11 00:02:42  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.7  1998/11/12 11:19:39  pierre
    * fix for first line of function break
    * fix for first line of function break
 
 
   Revision 1.6  1998/10/29 11:35:39  florian
   Revision 1.6  1998/10/29 11:35:39  florian

+ 10 - 3
compiler/aopt386.pas

@@ -25,13 +25,17 @@ Unit aopt386;
 
 
 Interface
 Interface
 
 
-Uses aasm;
+Uses
+  aasm;
 
 
 Procedure Optimize(AsmL: PAasmOutput);
 Procedure Optimize(AsmL: PAasmOutput);
 
 
 Implementation
 Implementation
 
 
-Uses globals, i386, DAOpt386, POpt386, CSOpt386;
+Uses
+  globtype,
+  globals,i386,DAOpt386,POpt386,CSOpt386;
+
 
 
 Procedure Optimize(AsmL: PAasmOutput);
 Procedure Optimize(AsmL: PAasmOutput);
 Var BlockEnd: Pai;
 Var BlockEnd: Pai;
@@ -59,7 +63,10 @@ End.
 
 
 {
 {
  $Log$
  $Log$
- Revision 1.22  1998-08-19 16:07:57  jonas
+ Revision 1.23  1998-12-11 00:02:43  peter
+   + globtype,tokens,version unit splitted from globals
+
+ Revision 1.22  1998/08/19 16:07:57  jonas
    * changed optimizer switches + cleanup of DestroyRefs in daopt386.pas
    * changed optimizer switches + cleanup of DestroyRefs in daopt386.pas
 
 
  Revision 1.21  1998/08/06 19:40:29  jonas
  Revision 1.21  1998/08/06 19:40:29  jonas

+ 6 - 2
compiler/asmutils.pas

@@ -53,7 +53,8 @@ Unit AsmUtils;
 Interface
 Interface
 
 
 Uses
 Uses
-  symtable,aasm,hcodegen,verbose,systems,globals,files,strings,
+  globtype,systems,
+  symtable,aasm,hcodegen,verbose,globals,files,strings,
   cobjects,
   cobjects,
 {$ifdef i386}
 {$ifdef i386}
   i386;
   i386;
@@ -1787,7 +1788,10 @@ end;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.15  1998-11-17 00:26:11  peter
+  Revision 1.16  1998-12-11 00:02:44  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.15  1998/11/17 00:26:11  peter
     * fixed for $H+
     * fixed for $H+
 
 
   Revision 1.14  1998/11/05 23:48:17  peter
   Revision 1.14  1998/11/05 23:48:17  peter

+ 5 - 2
compiler/assemble.pas

@@ -25,7 +25,7 @@ unit assemble;
 interface
 interface
 
 
 uses
 uses
-  dos,cobjects,globals,aasm;
+  dos,cobjects,globtype,globals,aasm;
 
 
 const
 const
 {$ifdef tp}
 {$ifdef tp}
@@ -533,7 +533,10 @@ end;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.32  1998-11-06 09:46:46  pierre
+  Revision 1.33  1998-12-11 00:02:45  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.32  1998/11/06 09:46:46  pierre
    * assemble failure increments status errorcount again !!
    * assemble failure increments status errorcount again !!
 
 
   Revision 1.31  1998/10/26 22:23:28  peter
   Revision 1.31  1998/10/26 22:23:28  peter

+ 6 - 2
compiler/cg386add.pas

@@ -33,7 +33,8 @@ interface
 implementation
 implementation
 
 
     uses
     uses
-      cobjects,verbose,globals,systems,
+      globtype,systems,
+      cobjects,verbose,globals,
       symtable,aasm,types,
       symtable,aasm,types,
       hcodegen,temp_gen,pass_2,
       hcodegen,temp_gen,pass_2,
       i386,cgai386,tgeni386;
       i386,cgai386,tgeni386;
@@ -1638,7 +1639,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.33  1998-12-10 11:16:00  florian
+  Revision 1.34  1998-12-11 00:02:46  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.33  1998/12/10 11:16:00  florian
     + some basic operations with qwords and int64 added: +, xor, and, or;
     + some basic operations with qwords and int64 added: +, xor, and, or;
       the register allocation works fine
       the register allocation works fine
 
 

+ 12 - 8
compiler/cg386cal.pas

@@ -39,7 +39,8 @@ interface
 implementation
 implementation
 
 
     uses
     uses
-      cobjects,verbose,globals,systems,
+      globtype,systems,
+      cobjects,verbose,globals,
       aasm,types,
       aasm,types,
 {$ifdef GDB}
 {$ifdef GDB}
       gdb,
       gdb,
@@ -95,17 +96,17 @@ implementation
                            end;
                            end;
                stringdef : begin
                stringdef : begin
                              if is_open_string(defcoll^.data) then
                              if is_open_string(defcoll^.data) then
-			       begin
-			         if is_open_string(p^.left^.resulttype) then
-				  begin
+                               begin
+                                 if is_open_string(p^.left^.resulttype) then
+                                  begin
                                     r:=new_reference(highframepointer,highoffset+4);
                                     r:=new_reference(highframepointer,highoffset+4);
                                     exprasmlist^.concat(new(pai386,op_ref_reg(A_MOV,S_L,r,R_EDI)));
                                     exprasmlist^.concat(new(pai386,op_ref_reg(A_MOV,S_L,r,R_EDI)));
                                     hreg:=R_EDI;
                                     hreg:=R_EDI;
                                     len:=-2;
                                     len:=-2;
-				  end
-				 else 
+                                  end
+                                 else
                                   len:=pstringdef(p^.left^.resulttype)^.len
                                   len:=pstringdef(p^.left^.resulttype)^.len
-			       end
+                               end
                              else
                              else
                              { passing a string to an array of char }
                              { passing a string to an array of char }
                                begin
                                begin
@@ -1626,7 +1627,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.52  1998-12-10 14:39:29  florian
+  Revision 1.53  1998-12-11 00:02:47  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.52  1998/12/10 14:39:29  florian
     * bug with p(const a : ansistring) fixed
     * bug with p(const a : ansistring) fixed
     * duplicate constant ansistrings were handled wrong, fixed
     * duplicate constant ansistrings were handled wrong, fixed
 
 

+ 6 - 2
compiler/cg386con.pas

@@ -40,7 +40,8 @@ interface
 implementation
 implementation
 
 
     uses
     uses
-      cobjects,verbose,globals,systems,
+      globtype,systems,
+      cobjects,verbose,globals,
       symtable,aasm,types,
       symtable,aasm,types,
       hcodegen,temp_gen,pass_2,
       hcodegen,temp_gen,pass_2,
       i386,cgai386,tgeni386;
       i386,cgai386,tgeni386;
@@ -372,7 +373,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.25  1998-12-10 14:39:30  florian
+  Revision 1.26  1998-12-11 00:02:49  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.25  1998/12/10 14:39:30  florian
     * bug with p(const a : ansistring) fixed
     * bug with p(const a : ansistring) fixed
     * duplicate constant ansistrings were handled wrong, fixed
     * duplicate constant ansistrings were handled wrong, fixed
 
 

+ 6 - 2
compiler/cg386inl.pas

@@ -32,7 +32,8 @@ interface
 implementation
 implementation
 
 
     uses
     uses
-      cobjects,verbose,globals,systems,files,
+      globtype,systems,
+      cobjects,verbose,globals,files,
       symtable,aasm,types,
       symtable,aasm,types,
       hcodegen,temp_gen,pass_2,
       hcodegen,temp_gen,pass_2,
       i386,cgai386,tgeni386,cg386ld,cg386cal;
       i386,cgai386,tgeni386,cg386ld,cg386cal;
@@ -970,7 +971,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.20  1998-11-27 14:50:32  peter
+  Revision 1.21  1998-12-11 00:02:50  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.20  1998/11/27 14:50:32  peter
     + open strings, $P switch support
     + open strings, $P switch support
 
 
   Revision 1.19  1998/11/26 13:10:40  peter
   Revision 1.19  1998/11/26 13:10:40  peter

+ 6 - 2
compiler/cg386ld.pas

@@ -35,7 +35,8 @@ interface
 implementation
 implementation
 
 
     uses
     uses
-      cobjects,verbose,globals,systems,
+      globtype,systems,
+      cobjects,verbose,globals,
       symtable,aasm,types,
       symtable,aasm,types,
       hcodegen,temp_gen,pass_2,
       hcodegen,temp_gen,pass_2,
       cgai386,tgeni386,cg386cnv;
       cgai386,tgeni386,cg386cnv;
@@ -726,7 +727,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.37  1998-12-10 09:47:17  florian
+  Revision 1.38  1998-12-11 00:02:51  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.37  1998/12/10 09:47:17  florian
     + basic operations with int64/qord (compiler with -dint64)
     + basic operations with int64/qord (compiler with -dint64)
     + rtti of enumerations extended: names are now written
     + rtti of enumerations extended: names are now written
 
 

+ 6 - 2
compiler/cg386mat.pas

@@ -35,7 +35,8 @@ interface
 implementation
 implementation
 
 
     uses
     uses
-      cobjects,verbose,globals,systems,
+      globtype,systems,
+      cobjects,verbose,globals,
       symtable,aasm,types,
       symtable,aasm,types,
       hcodegen,temp_gen,pass_2,
       hcodegen,temp_gen,pass_2,
       i386,cgai386,tgeni386;
       i386,cgai386,tgeni386;
@@ -534,7 +535,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.12  1998-11-26 21:45:29  jonas
+  Revision 1.13  1998-12-11 00:02:52  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.12  1998/11/26 21:45:29  jonas
     - removed A_CLTD opcode (use A_CDQ instead)
     - removed A_CLTD opcode (use A_CDQ instead)
     * changed cbw, cwde and cwd to cbtw, cwtl and cwtd in att_op2str array
     * changed cbw, cwde and cwd to cbtw, cwtl and cwtd in att_op2str array
     * in daopt386: adapted AsmInstr array to reflect changes + fixed line too long
     * in daopt386: adapted AsmInstr array to reflect changes + fixed line too long

+ 7 - 3
compiler/cg386mem.pas

@@ -43,7 +43,8 @@ interface
 implementation
 implementation
 
 
     uses
     uses
-      cobjects,verbose,globals,systems,
+      globtype,systems,
+      cobjects,verbose,globals,
       symtable,aasm,types,
       symtable,aasm,types,
       hcodegen,temp_gen,pass_2,
       hcodegen,temp_gen,pass_2,
       i386,cgai386,tgeni386;
       i386,cgai386,tgeni386;
@@ -94,7 +95,7 @@ implementation
 
 
               gettempofsizereference(target_os.size_of_pointer,p^.location.reference);
               gettempofsizereference(target_os.size_of_pointer,p^.location.reference);
               emitpushreferenceaddr(exprasmlist,p^.location.reference);
               emitpushreferenceaddr(exprasmlist,p^.location.reference);
-              
+
               emitcall('FPC_GETMEM',true);
               emitcall('FPC_GETMEM',true);
               if ppointerdef(p^.resulttype)^.definition^.needs_inittable then
               if ppointerdef(p^.resulttype)^.definition^.needs_inittable then
                 begin
                 begin
@@ -743,7 +744,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.21  1998-12-10 09:47:18  florian
+  Revision 1.22  1998-12-11 00:02:55  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.21  1998/12/10 09:47:18  florian
     + basic operations with int64/qord (compiler with -dint64)
     + basic operations with int64/qord (compiler with -dint64)
     + rtti of enumerations extended: names are now written
     + rtti of enumerations extended: names are now written
 
 

+ 6 - 2
compiler/cg386set.pas

@@ -34,7 +34,8 @@ interface
 implementation
 implementation
 
 
     uses
     uses
-      cobjects,verbose,globals,systems,
+      globtype,systems,
+      cobjects,verbose,globals,
       symtable,aasm,types,
       symtable,aasm,types,
       hcodegen,temp_gen,pass_2,
       hcodegen,temp_gen,pass_2,
       i386,cgai386,tgeni386;
       i386,cgai386,tgeni386;
@@ -787,7 +788,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.19  1998-10-09 08:56:25  pierre
+  Revision 1.20  1998-12-11 00:02:56  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.19  1998/10/09 08:56:25  pierre
     * several memory leaks fixed
     * several memory leaks fixed
 
 
   Revision 1.18  1998/10/08 17:17:14  pierre
   Revision 1.18  1998/10/08 17:17:14  pierre

+ 6 - 2
compiler/cg68kadd.pas

@@ -31,7 +31,8 @@ interface
 implementation
 implementation
 
 
     uses
     uses
-      cobjects,verbose,globals,systems,
+      globtype,systems,
+      cobjects,verbose,globals,
       symtable,aasm,types,
       symtable,aasm,types,
       temp_gen,hcodegen,pass_2,
       temp_gen,hcodegen,pass_2,
       m68k,cga68k,tgen68k;
       m68k,cga68k,tgen68k;
@@ -1280,7 +1281,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.14  1998-10-20 15:09:23  florian
+  Revision 1.15  1998-12-11 00:02:57  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.14  1998/10/20 15:09:23  florian
     + binary operators for ansi strings
     + binary operators for ansi strings
 
 
   Revision 1.13  1998/10/20 08:06:43  pierre
   Revision 1.13  1998/10/20 08:06:43  pierre

+ 6 - 2
compiler/cg68kcal.pas

@@ -39,7 +39,8 @@ interface
 implementation
 implementation
 
 
     uses
     uses
-      cobjects,verbose,globals,systems,
+      globtype,systems,
+      cobjects,verbose,globals,
       aasm,types,
       aasm,types,
       hcodegen,temp_gen,pass_2,
       hcodegen,temp_gen,pass_2,
       m68k,cga68k,tgen68k,cg68kld;
       m68k,cga68k,tgen68k,cg68kld;
@@ -1062,7 +1063,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.16  1998-11-13 15:40:15  pierre
+  Revision 1.17  1998-12-11 00:02:58  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.16  1998/11/13 15:40:15  pierre
     + added -Se in Makefile cvstest target
     + added -Se in Makefile cvstest target
     + lexlevel cleanup
     + lexlevel cleanup
       normal_function_level main_program_level and unit_init_level defined
       normal_function_level main_program_level and unit_init_level defined

+ 6 - 2
compiler/cg68kcnv.pas

@@ -37,7 +37,8 @@ interface
 implementation
 implementation
 
 
    uses
    uses
-     cobjects,verbose,globals,systems,
+     globtype,systems,
+     cobjects,verbose,globals,
      symtable,aasm,types,
      symtable,aasm,types,
      hcodegen,temp_gen,pass_2,
      hcodegen,temp_gen,pass_2,
      m68k,cga68k,tgen68k;
      m68k,cga68k,tgen68k;
@@ -1362,7 +1363,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.11  1998-11-05 12:02:36  peter
+  Revision 1.12  1998-12-11 00:02:59  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.11  1998/11/05 12:02:36  peter
     * released useansistring
     * released useansistring
     * removed -Sv, its now available in fpc modes
     * removed -Sv, its now available in fpc modes
 
 

+ 101 - 40
compiler/cg68kcon.pas

@@ -40,6 +40,7 @@ interface
 implementation
 implementation
 
 
     uses
     uses
+      globtype,systems,
       cobjects,verbose,globals,
       cobjects,verbose,globals,
       symtable,aasm,types,
       symtable,aasm,types,
       hcodegen,temp_gen,pass_2,
       hcodegen,temp_gen,pass_2,
@@ -137,16 +138,20 @@ implementation
     procedure secondstringconst(var p : ptree);
     procedure secondstringconst(var p : ptree);
       var
       var
          hp1 : pai;
          hp1 : pai;
-         l1,
+         l1,l2,
          lastlabel   : plabel;
          lastlabel   : plabel;
          pc          : pchar;
          pc          : pchar;
          same_string : boolean;
          same_string : boolean;
-         i           : longint;
+         i,mylength  : longint;
       begin
       begin
          lastlabel:=nil;
          lastlabel:=nil;
          { const already used ? }
          { const already used ? }
          if not assigned(p^.lab_str) then
          if not assigned(p^.lab_str) then
            begin
            begin
+              if is_shortstring(p^.resulttype) then
+               mylength:=p^.length+2
+              else
+               mylength:=p^.length+1;
               { tries to found an old entry }
               { tries to found an old entry }
               hp1:=pai(consts^.first);
               hp1:=pai(consts^.first);
               while assigned(hp1) do
               while assigned(hp1) do
@@ -162,7 +167,7 @@ implementation
                         { typed consts have no leading length or   }
                         { typed consts have no leading length or   }
                         { they have no trailing zero               }
                         { they have no trailing zero               }
                         if (hp1^.typ=ait_string) and (lastlabel<>nil) and
                         if (hp1^.typ=ait_string) and (lastlabel<>nil) and
-                          (pai_string(hp1)^.len=p^.length+2) then
+                           (pai_string(hp1)^.len=mylength) then
                           begin
                           begin
                              same_string:=true;
                              same_string:=true;
                              for i:=0 to p^.length do
                              for i:=0 to p^.length do
@@ -199,18 +204,22 @@ implementation
                              consts^.concat(new(pai_const,init_32bit(0)))
                              consts^.concat(new(pai_const,init_32bit(0)))
                            else
                            else
                              begin
                              begin
-                                getlabel(l1);
+                                getdatalabel(l1);
+                                getdatalabel(l2);
+                                consts^.concat(new(pai_label,init(l2)));
                                 consts^.concat(new(pai_const,init_symbol(strpnew(lab2str(l1)))));
                                 consts^.concat(new(pai_const,init_symbol(strpnew(lab2str(l1)))));
                                 consts^.concat(new(pai_const,init_32bit(p^.length)));
                                 consts^.concat(new(pai_const,init_32bit(p^.length)));
                                 consts^.concat(new(pai_const,init_32bit(p^.length)));
                                 consts^.concat(new(pai_const,init_32bit(p^.length)));
                                 consts^.concat(new(pai_const,init_32bit(-1)));
                                 consts^.concat(new(pai_const,init_32bit(-1)));
                                 consts^.concat(new(pai_label,init(l1)));
                                 consts^.concat(new(pai_label,init(l1)));
-                                getmem(pc,p^.length+1);
-                                move(p^.value_str^,pc^,p^.length+1);
+                                getmem(pc,p^.length+2);
+                                move(p^.value_str^,pc^,p^.length);
                                 pc[p^.length]:=#0;
                                 pc[p^.length]:=#0;
                                 { to overcome this problem we set the length explicitly }
                                 { to overcome this problem we set the length explicitly }
                                 { with the ending null char }
                                 { with the ending null char }
                                 consts^.concat(new(pai_string,init_length_pchar(pc,p^.length+1)));
                                 consts^.concat(new(pai_string,init_length_pchar(pc,p^.length+1)));
+                                { return the offset of the real string }
+                                p^.lab_str:=l2;
                              end;
                              end;
                         end;
                         end;
                       st_shortstring:
                       st_shortstring:
@@ -224,9 +233,9 @@ implementation
                               getmem(pc,p^.length+3);
                               getmem(pc,p^.length+3);
                               move(p^.value_str^,pc[1],p^.length+1);
                               move(p^.value_str^,pc[1],p^.length+1);
                               pc[0]:=chr(p^.length);
                               pc[0]:=chr(p^.length);
-                              pc[p^.length+1]:=#0;
                               { to overcome this problem we set the length explicitly }
                               { to overcome this problem we set the length explicitly }
                               { with the ending null char }
                               { with the ending null char }
+                              pc[p^.length+1]:=#0;
                               consts^.concat(new(pai_string,init_length_pchar(pc,p^.length+2)));
                               consts^.concat(new(pai_string,init_length_pchar(pc,p^.length+2)));
                             end;
                             end;
                         end;
                         end;
@@ -245,49 +254,99 @@ implementation
 
 
     procedure secondsetconst(var p : ptree);
     procedure secondsetconst(var p : ptree);
       var
       var
-         lastlabel : plabel;
-         i : longint;
+         hp1         : pai;
+         lastlabel   : plabel;
+         i           : longint;
+         neededtyp   : tait;
       begin
       begin
 {$ifdef SMALLSETORD}
 {$ifdef SMALLSETORD}
+        { small sets are loaded as constants }
         if psetdef(p^.resulttype)^.settype=smallset then
         if psetdef(p^.resulttype)^.settype=smallset then
          begin
          begin
            p^.location.loc:=LOC_MEM;
            p^.location.loc:=LOC_MEM;
            p^.location.reference.isintvalue:=true;
            p^.location.reference.isintvalue:=true;
-           p^.location.reference.offset:=p^.value_set^[0];
-         end
-        else
-         begin
-           getdatalabel(lastlabel);
-           p^.lab_set:=lastlabel;
-           if (cs_smartlink in aktmoduleswitches) then
-            consts^.concat(new(pai_cut,init));
-           consts^.concat(new(pai_label,init(duplabel(lastlabel))));
-           for i:=0 to 31 do
-             consts^.concat(new(pai_const,init_8bit(p^.value_set^[i])));
-           clear_reference(p^.location.reference);
-           p^.location.reference.symbol:=stringdup(lab2str(p^.lab_set));
-           p^.location.loc:=LOC_MEM;
+           p^.location.reference.offset:=plongint(p^.value_set)^;
+           exit;
          end;
          end;
-{$else}
-        getdatalabel(lastlabel);
-        p^.lab_set:=lastlabel;
-        if (cs_smartlink in aktmoduleswitches) then
-         consts^.concat(new(pai_cut,init));
-        consts^.concat(new(pai_label,init(lastlabel)));
+{$endif}
         if psetdef(p^.resulttype)^.settype=smallset then
         if psetdef(p^.resulttype)^.settype=smallset then
-         begin
-           move(p^.value_set^,i,sizeof(longint));
-           consts^.concat(new(pai_const,init_32bit(i)));
-         end
+         neededtyp:=ait_const_32bit
         else
         else
-         begin
-           for i:=0 to 31 do
-             consts^.concat(new(pai_const,init_8bit(p^.value_set^[i])));
-         end;
+         neededtyp:=ait_const_8bit;
+        lastlabel:=nil;
+        { const already used ? }
+        if not assigned(p^.lab_set) then
+          begin
+             { tries to found an old entry }
+             hp1:=pai(consts^.first);
+             while assigned(hp1) do
+               begin
+                  if hp1^.typ=ait_label then
+                    lastlabel:=pai_label(hp1)^.l
+                  else
+                    begin
+                      if (lastlabel<>nil) and (hp1^.typ=neededtyp) then
+                        begin
+                          if (hp1^.typ=ait_const_8bit) then
+                           begin
+                             { compare normal set }
+                             i:=0;
+                             while assigned(hp1) and (i<32) do
+                              begin
+                                if pai_const(hp1)^.value<>p^.value_set^[i] then
+                                 break;
+                                inc(i);
+                                hp1:=pai(hp1^.next);
+                              end;
+                             if i=32 then
+                              begin
+                                { found! }
+                                p^.lab_set:=lastlabel;
+                                break;
+                              end;
+                             { leave when the end of consts is reached, so no
+                               hp1^.next is done }
+                             if not assigned(hp1) then
+                              break;
+                           end
+                          else
+                           begin
+                             { compare small set }
+                             if plongint(p^.value_set)^=pai_const(hp1)^.value then
+                              begin
+                                { found! }
+                                p^.lab_set:=lastlabel;
+                                break;
+                              end;
+                           end;
+                        end;
+                      lastlabel:=nil;
+                    end;
+                  hp1:=pai(hp1^.next);
+               end;
+             { :-(, we must generate a new entry }
+             if not assigned(p^.lab_set) then
+               begin
+                 getdatalabel(lastlabel);
+                 p^.lab_set:=lastlabel;
+                 if (cs_smartlink in aktmoduleswitches) then
+                  consts^.concat(new(pai_cut,init));
+                 consts^.concat(new(pai_label,init(lastlabel)));
+                 if psetdef(p^.resulttype)^.settype=smallset then
+                  begin
+                    move(p^.value_set^,i,sizeof(longint));
+                    consts^.concat(new(pai_const,init_32bit(i)));
+                  end
+                 else
+                  begin
+                    for i:=0 to 31 do
+                      consts^.concat(new(pai_const,init_8bit(p^.value_set^[i])));
+                  end;
+               end;
+          end;
         clear_reference(p^.location.reference);
         clear_reference(p^.location.reference);
         p^.location.reference.symbol:=stringdup(lab2str(p^.lab_set));
         p^.location.reference.symbol:=stringdup(lab2str(p^.lab_set));
         p^.location.loc:=LOC_MEM;
         p^.location.loc:=LOC_MEM;
-{$endif SMALLSETORD}
       end;
       end;
 
 
 
 
@@ -302,11 +361,13 @@ implementation
          p^.location.reference.offset:=0;
          p^.location.reference.offset:=0;
       end;
       end;
 
 
-
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.4  1998-11-06 09:47:29  pierre
+  Revision 1.5  1998-12-11 00:03:01  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.4  1998/11/06 09:47:29  pierre
    * problem of const with ansi fixed
    * problem of const with ansi fixed
 
 
   Revision 1.3  1998/11/05 12:02:37  peter
   Revision 1.3  1998/11/05 12:02:37  peter

+ 6 - 2
compiler/cg68kflw.pas

@@ -44,7 +44,8 @@ interface
 implementation
 implementation
 
 
     uses
     uses
-      cobjects,verbose,globals,systems,
+      globtype,systems,
+      cobjects,verbose,globals,
       symtable,aasm,types,
       symtable,aasm,types,
       hcodegen,temp_gen,pass_2,
       hcodegen,temp_gen,pass_2,
       m68k,cga68k,tgen68k;
       m68k,cga68k,tgen68k;
@@ -778,7 +779,10 @@ do_jmp:
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.7  1998-10-14 11:28:19  florian
+  Revision 1.8  1998-12-11 00:03:02  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.7  1998/10/14 11:28:19  florian
     * emitpushreferenceaddress gets now the asmlist as parameter
     * emitpushreferenceaddress gets now the asmlist as parameter
     * m68k version compiles with -duseansistrings
     * m68k version compiles with -duseansistrings
 
 

+ 6 - 2
compiler/cg68kinl.pas

@@ -32,7 +32,8 @@ interface
 implementation
 implementation
 
 
     uses
     uses
-      cobjects,verbose,globals,systems,
+      globtype,systems,
+      cobjects,verbose,globals,
       aasm,types,symtable,
       aasm,types,symtable,
       hcodegen,temp_gen,pass_2,
       hcodegen,temp_gen,pass_2,
       m68k,cga68k,tgen68k,cg68kld,cg68kcal;
       m68k,cga68k,tgen68k,cg68kld,cg68kcal;
@@ -898,7 +899,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.14  1998-11-05 12:02:38  peter
+  Revision 1.15  1998-12-11 00:03:03  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.14  1998/11/05 12:02:38  peter
     * released useansistring
     * released useansistring
     * removed -Sv, its now available in fpc modes
     * removed -Sv, its now available in fpc modes
 
 

+ 6 - 2
compiler/cg68kmat.pas

@@ -35,7 +35,8 @@ interface
 implementation
 implementation
 
 
     uses
     uses
-      cobjects,verbose,globals,systems,
+      globtype,systems,
+      cobjects,verbose,globals,
       symtable,aasm,types,
       symtable,aasm,types,
       hcodegen,temp_gen,pass_2,
       hcodegen,temp_gen,pass_2,
       m68k,cga68k,tgen68k;
       m68k,cga68k,tgen68k;
@@ -448,7 +449,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.3  1998-10-13 16:50:10  pierre
+  Revision 1.4  1998-12-11 00:03:05  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.3  1998/10/13 16:50:10  pierre
     * undid some changes of Peter that made the compiler wrong
     * undid some changes of Peter that made the compiler wrong
       for m68k (I had to reinsert some ifdefs)
       for m68k (I had to reinsert some ifdefs)
     * removed several memory leaks under m68k
     * removed several memory leaks under m68k

+ 8 - 4
compiler/cg68kmem.pas

@@ -43,7 +43,8 @@ interface
 implementation
 implementation
 
 
     uses
     uses
-      cobjects,verbose,globals,systems,
+      globtype,systems,
+      cobjects,verbose,globals,
       symtable,aasm,types,
       symtable,aasm,types,
       hcodegen,temp_gen,pass_2,
       hcodegen,temp_gen,pass_2,
       m68k,cga68k,tgen68k;
       m68k,cga68k,tgen68k;
@@ -96,7 +97,7 @@ implementation
 
 
               gettempofsizereference(target_os.size_of_pointer,p^.location.reference);
               gettempofsizereference(target_os.size_of_pointer,p^.location.reference);
               emitpushreferenceaddr(exprasmlist,p^.location.reference);
               emitpushreferenceaddr(exprasmlist,p^.location.reference);
-              
+
               emitcall('FPC_GETMEM',true);
               emitcall('FPC_GETMEM',true);
 {!!!!!!!}
 {!!!!!!!}
 (*              if ppointerdef(p^.resulttype)^.definition^.needs_inittable then
 (*              if ppointerdef(p^.resulttype)^.definition^.needs_inittable then
@@ -595,7 +596,7 @@ implementation
                    emit_bounds_check(hp^,ind);
                    emit_bounds_check(hp^,ind);
                 end;
                 end;
            end;
            end;
- 
+
          { ------------------------ HANDLE INDEXING ----------------------- }
          { ------------------------ HANDLE INDEXING ----------------------- }
          { In Motorola 680x0 mode, displacement can only be of 64K max.     }
          { In Motorola 680x0 mode, displacement can only be of 64K max.     }
          { Therefore instead of doing a direct displacement, we must first  }
          { Therefore instead of doing a direct displacement, we must first  }
@@ -724,7 +725,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.9  1998-11-25 19:12:55  pierre
+  Revision 1.10  1998-12-11 00:03:06  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.9  1998/11/25 19:12:55  pierre
     * var:=new(pointer_type) support added
     * var:=new(pointer_type) support added
 
 
   Revision 1.8  1998/10/14 11:28:21  florian
   Revision 1.8  1998/10/14 11:28:21  florian

+ 6 - 2
compiler/cg68kset.pas

@@ -34,7 +34,8 @@ interface
 implementation
 implementation
 
 
     uses
     uses
-      cobjects,verbose,globals,systems,
+      globtype,systems,
+      cobjects,verbose,globals,
       symtable,aasm,types,
       symtable,aasm,types,
       hcodegen,temp_gen,pass_2,
       hcodegen,temp_gen,pass_2,
       m68k,cga68k,tgen68k;
       m68k,cga68k,tgen68k;
@@ -814,7 +815,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.7  1998-10-15 12:41:19  pierre
+  Revision 1.8  1998-12-11 00:03:08  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.7  1998/10/15 12:41:19  pierre
     * last memory leaks found when compiler
     * last memory leaks found when compiler
       a native atari compiler fixed
       a native atari compiler fixed
 
 

+ 46 - 4
compiler/cga68k.pas

@@ -25,7 +25,7 @@ unit cga68k;
   interface
   interface
 
 
     uses
     uses
-       cobjects,tree,m68k,aasm,symtable;
+       globtype,cobjects,tree,m68k,aasm,symtable;
 
 
     procedure emitl(op : tasmop;var l : plabel);
     procedure emitl(op : tasmop;var l : plabel);
     procedure emit_reg_reg(i : tasmop;s : topsize;reg1,reg2 : tregister);
     procedure emit_reg_reg(i : tasmop;s : topsize;reg1,reg2 : tregister);
@@ -48,6 +48,7 @@ unit cga68k;
     procedure maybe_loada5;
     procedure maybe_loada5;
     procedure emit_bounds_check(hp: treference; index: tregister);
     procedure emit_bounds_check(hp: treference; index: tregister);
     procedure loadstring(p:ptree);
     procedure loadstring(p:ptree);
+    procedure decransiref(const ref : treference);
 
 
     procedure floatload(t : tfloattype;const ref : treference; var location:tlocation);
     procedure floatload(t : tfloattype;const ref : treference; var location:tlocation);
     { return a float op_size from a floatb type  }
     { return a float op_size from a floatb type  }
@@ -71,6 +72,9 @@ unit cga68k;
     procedure genexitcode(list : paasmoutput;parasize:longint;
     procedure genexitcode(list : paasmoutput;parasize:longint;
                           nostackframe,inlined:boolean);
                           nostackframe,inlined:boolean);
 
 
+    procedure removetemps(list : paasmoutput;p : plinkedlist);
+    procedure releasedata(p : plinkedlist);
+
 {$ifdef test_dest_loc}
 {$ifdef test_dest_loc}
 const   { used to avoid temporary assignments }
 const   { used to avoid temporary assignments }
         dest_loc_known : boolean = false;
         dest_loc_known : boolean = false;
@@ -134,7 +138,7 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
          emitpushreferenceaddr(exprasmlist,ref);
          emitpushreferenceaddr(exprasmlist,ref);
          emitcall('FPC_ANSISTR_DECR_REF',true);
          emitcall('FPC_ANSISTR_DECR_REF',true);
       end;
       end;
-      
+
     procedure loadstring(p:ptree);
     procedure loadstring(p:ptree);
       begin
       begin
         case p^.right^.resulttype^.deftype of
         case p^.right^.resulttype^.deftype of
@@ -602,7 +606,7 @@ begin
       if (cs_debuginfo in aktmoduleswitches) then
       if (cs_debuginfo in aktmoduleswitches) then
          list^.insert(new(pai_force_line,init));
          list^.insert(new(pai_force_line,init));
 {$endif GDB}
 {$endif GDB}
-      
+
     { omit stack frame ? }
     { omit stack frame ? }
     if procinfo.framepointer=stack_pointer then
     if procinfo.framepointer=stack_pointer then
         begin
         begin
@@ -1354,10 +1358,48 @@ end;
 
 
 {$endif test_dest_loc}
 {$endif test_dest_loc}
 
 
+    procedure removetemps(list : paasmoutput;p : plinkedlist);
+
+      var
+         hp : ptemptodestroy;
+
+      begin
+         hp:=ptemptodestroy(p^.first);
+         while assigned(hp) do
+           begin
+              if is_ansistring(hp^.typ) then
+                begin
+                   emitpushreferenceaddr(list,hp^.address);
+                   list^.concat(new(pai68k,
+                     op_csymbol(A_JSR,S_NO,newcsymbol('FPC_ANSISTR_DECR_REF',0))));
+                   if not (cs_compilesystem in aktmoduleswitches) then
+                     concat_external('FPC_ANSISTR_DECR_REF',EXT_NEAR);
+                end;
+              hp:=ptemptodestroy(hp^.next);
+           end;
+      end;
+
+    procedure releasedata(p : plinkedlist);
+
+      var
+         hp : ptemptodestroy;
+
+      begin
+         hp:=ptemptodestroy(p^.first);
+         while assigned(hp) do
+           begin
+              ungetiftemp(hp^.address);
+              hp:=ptemptodestroy(hp^.next);
+           end;
+      end;
+
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.30  1998-11-30 09:43:05  pierre
+  Revision 1.31  1998-12-11 00:03:09  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.30  1998/11/30 09:43:05  pierre
     * some range check bugs fixed (still not working !)
     * some range check bugs fixed (still not working !)
     + added DLL writing support for win32 (also accepts variables)
     + added DLL writing support for win32 (also accepts variables)
     + TempAnsi for code that could be used for Temporary ansi strings
     + TempAnsi for code that could be used for Temporary ansi strings

+ 2 - 110
compiler/comphook.pas

@@ -257,118 +257,10 @@ begin
 end;
 end;
 
 
 
 
-
-
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.12  1998-11-16 15:41:39  peter
-    * tp7 didn't like my ifopt H+ :(
-
-  Revision 1.11  1998/11/16 12:17:59  peter
-    * H+ fixes
-
-  Revision 1.10  1998/10/27 13:45:25  pierre
-    * classes get a vmt allways
-    * better error info (tried to remove
-      several error strings introduced by the tpexcept handling)
-
-  Revision 1.9  1998/10/26 17:15:16  pierre
-    + added two level of longjump to
-      allow clean freeing of used memory on errors
-
-  Revision 1.8  1998/09/15 10:49:32  pierre
-  merged from fixes branch
-
-  Revision 1.7.2.1  1998/09/15 10:30:17  pierre
-  RHIDE output corrected
-
-  Revision 1.7  1998/09/04 17:34:21  pierre
-    * bug with datalabel corrected
-    + assembler errors better commented
-    * one nested record crash removed
-
-  Revision 1.6  1998/09/01 17:37:59  peter
-    * nicer output when column=0
-
-  Revision 1.5  1998/08/18 15:11:51  peter
-    * recompiles again
-
-  Revision 1.4  1998/08/18 14:17:08  pierre
-    * bug about assigning the return value of a function to
-      a procvar fixed : warning
-      assigning a proc to a procvar need @ in FPC mode !!
-    * missing file/line info restored
-
-  Revision 1.3  1998/08/18 09:24:40  pierre
-    * small warning position bug fixed
-    * support_mmx switches splitting was missing
-    * rhide error and warning output corrected
-
-  Revision 1.2  1998/08/11 14:02:45  peter
-    * don't write line if no sourcefile is set
-
-  Revision 1.1  1998/08/10 10:18:24  peter
-    + Compiler,Comphook unit which are the new interface units to the
-      compiler
-
-  Revision 1.14  1998/08/04 13:22:48  pierre
-    * weird bug fixed :
-      a pchar ' ' (simple space or any other letter) was found to
-      be equal to a string of length zero !!!
-      thus printing out non sense
-      found that out while checking Control-C !!
-    + added column info also in RHIDE format as
-      it might be usefull later
-
-  Revision 1.13  1998/07/14 14:47:12  peter
-    * released NEWINPUT
-
-  Revision 1.12  1998/07/07 11:20:19  peter
-    + NEWINPUT for a better inputfile and scanner object
-
-  Revision 1.11  1998/06/19 15:40:00  peter
-    * bp7 fix
-
-  Revision 1.10  1998/06/16 11:32:19  peter
-    * small cosmetic fixes
-
-  Revision 1.9  1998/05/23 01:21:33  peter
-    + aktasmmode, aktoptprocessor, aktoutputformat
-    + smartlink per module $SMARTLINK-/+ (like MMX) and moved to aktswitches
-    + $LIBNAME to set the library name where the unit will be put in
-    * splitted cgi386 a bit (codeseg to large for bp7)
-    * nasm, tasm works again. nasm moved to ag386nsm.pas
-
-  Revision 1.8  1998/05/21 19:33:38  peter
-    + better procedure directive handling and only one table
-
-  Revision 1.7  1998/05/12 10:47:01  peter
-    * moved printstatus to verb_def
-    + V_Normal which is between V_Error and V_Warning and doesn't have a
-      prefix like error: warning: and is included in V_Default
-    * fixed some messages
-    * first time parameter scan is only for -v and -T
-    - removed old style messages
-
-  Revision 1.6  1998/05/11 13:07:58  peter
-    + $ifdef NEWPPU for the new ppuformat
-    + $define GDB not longer required
-    * removed all warnings and stripped some log comments
-    * no findfirst/findnext anymore to remove smartlink *.o files
-
-  Revision 1.5  1998/04/30 15:59:43  pierre
-    * GDB works again better :
-      correct type info in one pass
-    + UseTokenInfo for better source position
-    * fixed one remaining bug in scanner for line counts
-    * several little fixes
+  Revision 1.13  1998-12-11 00:03:12  peter
+    + globtype,tokens,version unit splitted from globals
 
 
-  Revision 1.4  1998/04/29 10:34:09  pierre
-    + added some code for ansistring (not complete nor working yet)
-    * corrected operator overloading
-    * corrected nasm output
-    + started inline procedures
-    + added starstarn : use ** for exponentiation (^ gave problems)
-    + started UseTokenInfo cond to get accurate positions
 }
 }

+ 7 - 6
compiler/daopt386.pas

@@ -30,11 +30,9 @@ Unit DAOpt386;
 
 
 Interface
 Interface
 
 
-Uses AAsm, CObjects
-  {$ifdef i386}
-    ,i386
-  {$endif}
-  ;
+Uses
+  GlobType,
+  CObjects,Aasm,i386;
 
 
 
 
 Type
 Type
@@ -2085,7 +2083,10 @@ End.
 
 
 {
 {
  $Log$
  $Log$
- Revision 1.30  1998-12-02 16:23:39  jonas
+ Revision 1.31  1998-12-11 00:03:13  peter
+   + globtype,tokens,version unit splitted from globals
+
+ Revision 1.30  1998/12/02 16:23:39  jonas
    * changed "if longintvar in set" to case or "if () or () .." statements
    * changed "if longintvar in set" to case or "if () or () .." statements
    * tree.pas: changed inlinenumber (and associated constructor/vars) to a byte
    * tree.pas: changed inlinenumber (and associated constructor/vars) to a byte
 
 

+ 5 - 1
compiler/files.pas

@@ -30,6 +30,7 @@ unit files;
   interface
   interface
 
 
     uses
     uses
+       globtype,
        cobjects,globals,ppu;
        cobjects,globals,ppu;
 
 
     const
     const
@@ -1054,7 +1055,10 @@ unit files;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.78  1998-12-04 10:18:07  florian
+  Revision 1.79  1998-12-11 00:03:14  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.78  1998/12/04 10:18:07  florian
     * some stuff for procedures of object added
     * some stuff for procedures of object added
     * bug with overridden virtual constructors fixed (reported by Italo Gomes)
     * bug with overridden virtual constructors fixed (reported by Italo Gomes)
 
 

+ 6 - 2
compiler/gdb.pas

@@ -25,10 +25,11 @@ unit gdb;
   interface
   interface
 
 
     uses
     uses
+      globtype,
 {$ifdef i386}
 {$ifdef i386}
        i386,
        i386,
 {$endif i386}
 {$endif i386}
-       strings,cobjects,globals,aasm;
+      strings,cobjects,globals,aasm;
 
 
     {stab constants }
     {stab constants }
 Const
 Const
@@ -256,7 +257,10 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.4  1998-11-12 11:19:45  pierre
+  Revision 1.5  1998-12-11 00:03:16  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.4  1998/11/12 11:19:45  pierre
    * fix for first line of function break
    * fix for first line of function break
 
 
   Revision 1.3  1998/09/22 17:13:45  pierre
   Revision 1.3  1998/09/22 17:13:45  pierre

+ 6 - 2
compiler/htypechk.pas

@@ -53,7 +53,8 @@ interface
 implementation
 implementation
 
 
     uses
     uses
-       cobjects,verbose,systems,globals,
+       globtype,systems,tokens,
+       cobjects,verbose,globals,
        aasm,types,
        aasm,types,
        hcodegen;
        hcodegen;
 
 
@@ -712,7 +713,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.11  1998-12-10 09:47:21  florian
+  Revision 1.12  1998-12-11 00:03:18  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.11  1998/12/10 09:47:21  florian
     + basic operations with int64/qord (compiler with -dint64)
     + basic operations with int64/qord (compiler with -dint64)
     + rtti of enumerations extended: names are now written
     + rtti of enumerations extended: names are now written
 
 

+ 6 - 2
compiler/link.pas

@@ -64,7 +64,8 @@ Var
 Implementation
 Implementation
 
 
 uses
 uses
-  Script,globals,systems,verbose
+  globtype,systems,
+  script,globals,verbose
 {$ifdef i386}
 {$ifdef i386}
   ,win_targ
   ,win_targ
 {$endif}
 {$endif}
@@ -531,7 +532,10 @@ end;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.41  1998-12-01 23:39:46  pierre
+  Revision 1.42  1998-12-11 00:03:19  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.41  1998/12/01 23:39:46  pierre
    * postprocessexec for win32 changed
    * postprocessexec for win32 changed
 
 
   Revision 1.40  1998/12/01 12:51:20  peter
   Revision 1.40  1998/12/01 12:51:20  peter

+ 16 - 4
compiler/messages.pas

@@ -88,7 +88,7 @@ var
   f       : text;
   f       : text;
   line,i  : longint;
   line,i  : longint;
   ptxt    : pchar;
   ptxt    : pchar;
-  s       : string;
+  s,s1    : string;
   buf     : pointer;
   buf     : pointer;
 begin
 begin
   getmem(buf,bufsize);
   getmem(buf,bufsize);
@@ -133,8 +133,17 @@ begin
         if i>0 then
         if i>0 then
          begin
          begin
            {txt}
            {txt}
-           move(s[i+1],ptxt^,length(s)-i);
-           inc(ptxt,length(s)-i);
+           s1:=Copy(s,i+1,255);
+           { support <lf> for empty lines }
+           if s1='<lf>' then
+            begin
+              s1:='';
+              { update the msgsize also! }
+              dec(msgsize,4);
+            end;
+           {txt}
+           move(s1[1],ptxt^,length(s1));
+           inc(ptxt,length(s1));
            ptxt^:=#0;
            ptxt^:=#0;
            inc(ptxt);
            inc(ptxt);
          end;
          end;
@@ -248,7 +257,10 @@ end;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.5  1998-09-16 16:41:42  peter
+  Revision 1.6  1998-12-11 00:03:20  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.5  1998/09/16 16:41:42  peter
     * merged fixes
     * merged fixes
 
 
   Revision 1.3.2.1  1998/09/16 16:11:04  peter
   Revision 1.3.2.1  1998/09/16 16:11:04  peter

+ 5 - 2
compiler/opts386.pas

@@ -35,7 +35,7 @@ type
 implementation
 implementation
 
 
 uses
 uses
-  systems,globals;
+  globtype,systems,globals;
 
 
 procedure toption386.interpret_proc_specific_options(const opt:string);
 procedure toption386.interpret_proc_specific_options(const opt:string);
 var
 var
@@ -97,7 +97,10 @@ end;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.14  1998-11-12 09:00:26  michael
+  Revision 1.15  1998-12-11 00:03:22  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.14  1998/11/12 09:00:26  michael
   * Fixed syntax error
   * Fixed syntax error
 
 
   Revision 1.13  1998/11/11 20:11:39  jonas
   Revision 1.13  1998/11/11 20:11:39  jonas

+ 5 - 2
compiler/opts68k.pas

@@ -34,7 +34,7 @@ type
 implementation
 implementation
 
 
 uses
 uses
-  systems,globals;
+  globtype,systems,globals;
 
 
 procedure toption68k.interpret_proc_specific_options(const opt:string);
 procedure toption68k.interpret_proc_specific_options(const opt:string);
 var
 var
@@ -71,7 +71,10 @@ end;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.6  1998-10-13 13:10:21  peter
+  Revision 1.7  1998-12-11 00:03:23  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.6  1998/10/13 13:10:21  peter
     * new style for m68k/i386 infos and enums
     * new style for m68k/i386 infos and enums
 
 
   Revision 1.5  1998/09/25 09:57:09  peter
   Revision 1.5  1998/09/25 09:57:09  peter

+ 5 - 2
compiler/os2_targ.pas

@@ -47,7 +47,7 @@ type
 
 
 implementation
 implementation
 
 
-uses    dos,strings,globals,link,files;
+uses    globtype,dos,strings,globals,link,files;
 
 
 const   profile_flag:boolean=false;
 const   profile_flag:boolean=false;
 
 
@@ -329,7 +329,10 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.5  1998-10-16 14:20:53  daniel
+  Revision 1.6  1998-12-11 00:03:25  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.5  1998/10/16 14:20:53  daniel
   * Faster keyword scanning.
   * Faster keyword scanning.
   * Import library and smartlink library in one file.
   * Import library and smartlink library in one file.
 
 

+ 7 - 4
compiler/parser.pas

@@ -45,9 +45,9 @@ unit parser;
   implementation
   implementation
 
 
     uses
     uses
-      cobjects,comphook,systems,globals,
-      hcodegen,verbose, { leave this order, else hcodegen.message will be used !! }
-      symtable,files,aasm,
+      globtype,version,tokens,systems,
+      cobjects,comphook,globals,verbose,
+      symtable,files,aasm,hcodegen,
       assemble,link,script,gendef,
       assemble,link,script,gendef,
 {$ifdef UseBrowser}
 {$ifdef UseBrowser}
       browser,
       browser,
@@ -424,7 +424,10 @@ unit parser;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.62  1998-12-01 12:51:21  peter
+  Revision 1.63  1998-12-11 00:03:26  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.62  1998/12/01 12:51:21  peter
     * fixed placing of ppas.sh and link.res when using -FE
     * fixed placing of ppas.sh and link.res when using -FE
 
 
   Revision 1.61  1998/11/10 10:09:11  peter
   Revision 1.61  1998/11/10 10:09:11  peter

+ 6 - 2
compiler/pass_1.pas

@@ -36,7 +36,8 @@ interface
 implementation
 implementation
 
 
     uses
     uses
-      cobjects,verbose,systems,globals,
+      globtype,systems,
+      cobjects,verbose,globals,
       aasm,symtable,types,
       aasm,symtable,types,
       hcodegen,htypechk,
       hcodegen,htypechk,
       tcadd,tccal,tccnv,tccon,tcflw,
       tcadd,tccal,tccnv,tccon,tcflw,
@@ -366,7 +367,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.98  1998-11-23 17:49:03  pierre
+  Revision 1.99  1998-12-11 00:03:27  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.98  1998/11/23 17:49:03  pierre
    * ansistring support in extdebug code
    * ansistring support in extdebug code
 
 
   Revision 1.97  1998/11/05 14:26:47  peter
   Revision 1.97  1998/11/05 14:26:47  peter

+ 6 - 2
compiler/pass_2.pas

@@ -41,7 +41,8 @@ procedure secondpass(var p : ptree);
 implementation
 implementation
 
 
    uses
    uses
-     cobjects,verbose,comphook,systems,globals,files,
+     globtype,systems,
+     cobjects,verbose,comphook,globals,files,
      symtable,types,aasm,scanner,
      symtable,types,aasm,scanner,
      pass_1,hcodegen,temp_gen
      pass_1,hcodegen,temp_gen
 {$ifdef GDB}
 {$ifdef GDB}
@@ -497,7 +498,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.10  1998-11-18 15:44:14  peter
+  Revision 1.11  1998-12-11 00:03:28  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.10  1998/11/18 15:44:14  peter
     * VALUEPARA for tp7 compatible value parameters
     * VALUEPARA for tp7 compatible value parameters
 
 
   Revision 1.9  1998/11/13 15:40:21  pierre
   Revision 1.9  1998/11/13 15:40:21  pierre

+ 7 - 4
compiler/pbase.pas

@@ -25,7 +25,7 @@ unit pbase;
   interface
   interface
 
 
     uses
     uses
-       cobjects,globals,symtable;
+       cobjects,tokens,globals,symtable;
 
 
     const
     const
        { forward types should only be possible inside  }
        { forward types should only be possible inside  }
@@ -93,14 +93,14 @@ unit pbase;
 
 
     function tokenstring(i : ttoken):string;
     function tokenstring(i : ttoken):string;
       begin
       begin
-        tokenstring:=tokens[i].str;
+        tokenstring:=tokeninfo[i].str;
       end;
       end;
 
 
     { consumes token i, write error if token is different }
     { consumes token i, write error if token is different }
     procedure consume(i : ttoken);
     procedure consume(i : ttoken);
       begin
       begin
         if (token<>i) and (idtoken<>i) then
         if (token<>i) and (idtoken<>i) then
-          Message2(scan_f_syn_expected,tokens[i].str,tokens[token].str)
+          Message2(scan_f_syn_expected,tokeninfo[i].str,tokeninfo[token].str)
         else
         else
           begin
           begin
             if token=_END then
             if token=_END then
@@ -180,7 +180,10 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.17  1998-09-26 17:45:31  peter
+  Revision 1.18  1998-12-11 00:03:29  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.17  1998/09/26 17:45:31  peter
     + idtoken and only one token table
     + idtoken and only one token table
 
 
   Revision 1.16  1998/09/23 15:39:08  pierre
   Revision 1.16  1998/09/23 15:39:08  pierre

+ 5 - 2
compiler/pdecl.pas

@@ -25,7 +25,7 @@ unit pdecl;
   interface
   interface
 
 
     uses
     uses
-      globals,symtable;
+      globtype,tokens,globals,symtable;
 
 
     var
     var
        { pointer to the last read type symbol, (for "forward" }
        { pointer to the last read type symbol, (for "forward" }
@@ -2124,7 +2124,10 @@ unit pdecl;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.88  1998-11-30 09:43:20  pierre
+  Revision 1.89  1998-12-11 00:03:30  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.88  1998/11/30 09:43:20  pierre
     * some range check bugs fixed (still not working !)
     * some range check bugs fixed (still not working !)
     + added DLL writing support for win32 (also accepts variables)
     + added DLL writing support for win32 (also accepts variables)
     + TempAnsi for code that could be used for Temporary ansi strings
     + TempAnsi for code that could be used for Temporary ansi strings

+ 8 - 7
compiler/pexports.pas

@@ -30,24 +30,22 @@ unit pexports;
   implementation
   implementation
 
 
     uses
     uses
-{* Changes made by Ozerski 23.10.1998}
-       cobjects,globals,scanner,symtable,pbase,verbose,
-       export,GenDef,Strings;
-{* End changes}
+      globtype,systems,tokens,
+      strings,cobjects,globals,verbose,
+      scanner,symtable,pbase,
+      export,GenDef;
 
 
     procedure read_exports;
     procedure read_exports;
 
 
       var
       var
          hp : pexported_item;
          hp : pexported_item;
          code : word;
          code : word;
-{* Changes made by Ozerski 23.10.1998}
          DefString:string;
          DefString:string;
          ProcName:string;
          ProcName:string;
          InternalProcName:string;
          InternalProcName:string;
       begin
       begin
          DefString:='';
          DefString:='';
          InternalProcName:='';
          InternalProcName:='';
-{* End changes}
          consume(_EXPORTS);
          consume(_EXPORTS);
          while true do
          while true do
            begin
            begin
@@ -137,7 +135,10 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.5  1998-11-30 13:26:25  pierre
+  Revision 1.6  1998-12-11 00:03:31  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.5  1998/11/30 13:26:25  pierre
     * the code for ordering the exported procs/vars was buggy
     * the code for ordering the exported procs/vars was buggy
     + added -WB to force binding (Ozerski way of creating DLL)
     + added -WB to force binding (Ozerski way of creating DLL)
       this is off by default as direct writing of .edata section seems
       this is off by default as direct writing of .edata section seems

+ 6 - 2
compiler/pexpr.pas

@@ -46,7 +46,8 @@ unit pexpr;
   implementation
   implementation
 
 
     uses
     uses
-       cobjects,globals,scanner,aasm,pass_1,systems,
+       globtype,systems,tokens,
+       cobjects,globals,scanner,aasm,pass_1,
        hcodegen,types,verbose,strings
        hcodegen,types,verbose,strings
        { parser specific stuff }
        { parser specific stuff }
        ,pbase,pdecl
        ,pbase,pdecl
@@ -1927,7 +1928,10 @@ unit pexpr;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.77  1998-12-04 10:18:09  florian
+  Revision 1.78  1998-12-11 00:03:32  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.77  1998/12/04 10:18:09  florian
     * some stuff for procedures of object added
     * some stuff for procedures of object added
     * bug with overridden virtual constructors fixed (reported by Italo Gomes)
     * bug with overridden virtual constructors fixed (reported by Italo Gomes)
 
 

+ 7 - 4
compiler/pmodules.pas

@@ -36,9 +36,9 @@ unit pmodules;
   implementation
   implementation
 
 
     uses
     uses
-       cobjects,comphook,systems,globals,
-       symtable,aasm,files,
-       hcodegen,verbose,
+       globtype,version,systems,tokens,
+       cobjects,comphook,globals,verbose,files,
+       symtable,aasm,hcodegen,
        link,assemble,import,export,gendef,ppu
        link,assemble,import,export,gendef,ppu
 {$ifdef i386}
 {$ifdef i386}
        ,i386
        ,i386
@@ -1228,7 +1228,10 @@ unit pmodules;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.88  1998-12-08 10:18:11  peter
+  Revision 1.89  1998-12-11 00:03:34  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.88  1998/12/08 10:18:11  peter
     + -gh for heaptrc unit
     + -gh for heaptrc unit
 
 
   Revision 1.87  1998/12/01 23:40:53  pierre
   Revision 1.87  1998/12/01 23:40:53  pierre

+ 9 - 7
compiler/popt386.pas

@@ -31,11 +31,10 @@ Procedure PeepHoleOptPass2(AsmL: PAasmOutput);
 
 
 Implementation
 Implementation
 
 
-Uses globals, systems, verbose, hcodegen
-   {$ifdef i386}
-     ,i386, DAOpt386
-   {$endif i386}
-     ;
+Uses
+  globtype,systems,
+  globals,verbose,hcodegen,
+  i386,DAOpt386;
 
 
 Function RegUsedAfterInstruction(Reg: TRegister; p: Pai; Var UsedRegs: TRegSet): Boolean;
 Function RegUsedAfterInstruction(Reg: TRegister; p: Pai; Var UsedRegs: TRegSet): Boolean;
 Begin
 Begin
@@ -1555,7 +1554,10 @@ End.
 
 
 {
 {
  $Log$
  $Log$
- Revision 1.26  1998-12-09 18:16:13  jonas
+ Revision 1.27  1998-12-11 00:03:35  peter
+   + globtype,tokens,version unit splitted from globals
+
+ Revision 1.26  1998/12/09 18:16:13  jonas
    * corrected small syntax error in part between {ifdef ver0_99_11}
    * corrected small syntax error in part between {ifdef ver0_99_11}
    + added fistp/fild optimization between {ifdef ver0_99_11}
    + added fistp/fild optimization between {ifdef ver0_99_11}
 
 
@@ -1565,7 +1567,7 @@ End.
 
 
  Revision 1.24  1998/11/26 15:41:45  jonas
  Revision 1.24  1998/11/26 15:41:45  jonas
    + change "setxx mem; movb mem, reg8" to "setxx reg8" if mem is a local
    + change "setxx mem; movb mem, reg8" to "setxx reg8" if mem is a local
-     variable/parameter or function result (between {$ifdef ver0_99_11})
+     variable/parameter or function result (between $ifdef ver0_99_11)
 
 
  Revision 1.23  1998/11/03 16:26:09  jonas
  Revision 1.23  1998/11/03 16:26:09  jonas
    * "call x;jmp y" optimization not done anymore for P6 and equivalents
    * "call x;jmp y" optimization not done anymore for P6 and equivalents

+ 6 - 2
compiler/pstatmnt.pas

@@ -39,7 +39,8 @@ unit pstatmnt;
   implementation
   implementation
 
 
     uses
     uses
-       strings,cobjects,globals,files,verbose,systems,
+       globtype,systems,tokens,
+       strings,cobjects,globals,files,verbose,
        symtable,aasm,pass_1,types,scanner,hcodegen,ppu
        symtable,aasm,pass_1,types,scanner,hcodegen,ppu
        ,pbase,pexpr,pdecl
        ,pbase,pexpr,pdecl
 {$ifdef i386}
 {$ifdef i386}
@@ -1224,7 +1225,10 @@ unit pstatmnt;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.51  1998-12-10 09:47:24  florian
+  Revision 1.52  1998-12-11 00:03:37  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.51  1998/12/10 09:47:24  florian
     + basic operations with int64/qord (compiler with -dint64)
     + basic operations with int64/qord (compiler with -dint64)
     + rtti of enumerations extended: names are now written
     + rtti of enumerations extended: names are now written
 
 

+ 6 - 2
compiler/psystem.pas

@@ -32,7 +32,8 @@ procedure createconstdefs;
 
 
 implementation
 implementation
 
 
-uses globals,tree;
+uses
+  globtype,globals,tree;
 
 
 procedure insertinternsyms(p : psymtable);
 procedure insertinternsyms(p : psymtable);
 {
 {
@@ -252,7 +253,10 @@ end;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.13  1998-12-10 09:47:25  florian
+  Revision 1.14  1998-12-11 00:03:40  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.13  1998/12/10 09:47:25  florian
     + basic operations with int64/qord (compiler with -dint64)
     + basic operations with int64/qord (compiler with -dint64)
     + rtti of enumerations extended: names are now written
     + rtti of enumerations extended: names are now written
 
 

+ 5 - 2
compiler/ptconst.pas

@@ -34,6 +34,7 @@ unit ptconst;
   implementation
   implementation
 
 
     uses
     uses
+       globtype,systems,tokens,
        cobjects,globals,scanner,aasm,tree,pass_1,
        cobjects,globals,scanner,aasm,tree,pass_1,
        hcodegen,types,verbose
        hcodegen,types,verbose
        { parser specific stuff }
        { parser specific stuff }
@@ -58,7 +59,6 @@ unit ptconst;
          p,hp      : ptree;
          p,hp      : ptree;
          i,l,offset,
          i,l,offset,
          strlength : longint;
          strlength : longint;
-         lsym      : pvarsym;
          ll        : plabel;
          ll        : plabel;
          s         : string;
          s         : string;
          ca        : pchar;
          ca        : pchar;
@@ -647,7 +647,10 @@ unit ptconst;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.30  1998-11-27 14:34:42  peter
+  Revision 1.31  1998-12-11 00:03:41  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.30  1998/11/27 14:34:42  peter
     * give error when string[0] decl is found
     * give error when string[0] decl is found
 
 
   Revision 1.29  1998/11/23 18:26:44  pierre
   Revision 1.29  1998/11/23 18:26:44  pierre

+ 5 - 2
compiler/ra386att.pas

@@ -50,7 +50,7 @@ Unit Ra386att;
 Interface
 Interface
 
 
 uses
 uses
-  i386,tree;
+  globtype,i386,tree;
 
 
    function assemble: ptree;
    function assemble: ptree;
 
 
@@ -3969,7 +3969,10 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.25  1998-12-09 13:23:40  jonas
+  Revision 1.26  1998-12-11 00:03:42  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.25  1998/12/09 13:23:40  jonas
     * replaced two "in [A_...]" constructs I had missed before
     * replaced two "in [A_...]" constructs I had missed before
     * for shrd/shld: "if operands[1].operandtype = OPR_CONSTANT" instead of
     * for shrd/shld: "if operands[1].operandtype = OPR_CONSTANT" instead of
       "if operands[3].operandtype ..."
       "if operands[3].operandtype ..."

+ 5 - 2
compiler/ra386int.pas

@@ -53,7 +53,7 @@ Interface
   {$R-} { needed for the in [] }
   {$R-} { needed for the in [] }
 {$endif}
 {$endif}
 uses
 uses
-  tree,i386;
+  globtype,tree,i386;
 
 
    function assemble: ptree;
    function assemble: ptree;
 
 
@@ -3517,7 +3517,10 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.17  1998-12-08 23:03:46  jonas
+  Revision 1.18  1998-12-11 00:03:43  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.17  1998/12/08 23:03:46  jonas
     * allow constant offsets for go32v2 in assembler blocks
     * allow constant offsets for go32v2 in assembler blocks
 
 
   Revision 1.16  1998/12/02 16:23:36  jonas
   Revision 1.16  1998/12/02 16:23:36  jonas

+ 5 - 2
compiler/ra68kmot.pas

@@ -45,7 +45,7 @@ Unit Ra68kMot;
 Interface
 Interface
 
 
 Uses
 Uses
-  m68k,tree;
+  globtype,m68k,tree;
 
 
    function assemble: ptree;
    function assemble: ptree;
 
 
@@ -2178,7 +2178,10 @@ Begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.6  1998-10-13 16:50:19  pierre
+  Revision 1.7  1998-12-11 00:03:45  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.6  1998/10/13 16:50:19  pierre
     * undid some changes of Peter that made the compiler wrong
     * undid some changes of Peter that made the compiler wrong
       for m68k (I had to reinsert some ifdefs)
       for m68k (I had to reinsert some ifdefs)
     * removed several memory leaks under m68k
     * removed several memory leaks under m68k

+ 17 - 76
compiler/scanner.pas

@@ -28,6 +28,7 @@ unit scanner;
   interface
   interface
 
 
     uses
     uses
+       globtype,version,tokens,
        cobjects,globals,verbose,comphook,files;
        cobjects,globals,verbose,comphook,files;
 
 
     const
     const
@@ -128,6 +129,7 @@ implementation
 {*****************************************************************************
 {*****************************************************************************
                               Helper routines
                               Helper routines
 *****************************************************************************}
 *****************************************************************************}
+
     type
     type
       tokenidxrec=record
       tokenidxrec=record
         first,last : ttoken;
         first,last : ttoken;
@@ -139,22 +141,6 @@ implementation
       { use any special name that is an invalid file name to avoid problems }
       { use any special name that is an invalid file name to avoid problems }
       macro_special_name = '____Macro____';
       macro_special_name = '____Macro____';
 
 
-{$ifdef new__is_keyword}
-    function encode(const s:string):longint;
-
-    var i,result:longint;
-
-    begin
-        result:=0;
-        for i:=1 to 6 do
-            begin
-                if length(s)<i then
-                    break;
-                result:=result*32+byte(s[i])-65;
-            end;
-        encode:=result;
-    end;
-{$endif new__is_keyword}
 
 
     procedure create_tokenidx;
     procedure create_tokenidx;
     { create an index with the first and last token for every possible token
     { create an index with the first and last token for every possible token
@@ -164,19 +150,16 @@ implementation
       begin
       begin
         for t:=low(ttoken) to high(ttoken) do
         for t:=low(ttoken) to high(ttoken) do
          begin
          begin
-           if not tokens[t].special then
+           if not tokeninfo[t].special then
             begin
             begin
-              if ord(tokenidx[length(tokens[t].str)].first)=0 then
-               tokenidx[length(tokens[t].str)].first:=t;
-              tokenidx[length(tokens[t].str)].last:=t;
-              {$ifdef new__is_keyword}
-              tokens[t].encoded:=encode(tokens[t].str);
-              {$endif new__is_keyword}
+              if ord(tokenidx[length(tokeninfo[t].str)].first)=0 then
+               tokenidx[length(tokeninfo[t].str)].first:=t;
+              tokenidx[length(tokeninfo[t].str)].last:=t;
             end;
             end;
          end;
          end;
       end;
       end;
 
 
-{$ifndef new__is_keyword}
+
     function is_keyword(const s:string):boolean;
     function is_keyword(const s:string):boolean;
       var
       var
         low,high,mid : longint;
         low,high,mid : longint;
@@ -191,36 +174,14 @@ implementation
         while low<high do
         while low<high do
          begin
          begin
            mid:=(high+low+1) shr 1;
            mid:=(high+low+1) shr 1;
-           if pattern<tokens[ttoken(mid)].str then
-            high:=mid-1
-           else
-            low:=mid;
-         end;
-        is_keyword:=(pattern=tokens[ttoken(high)].str) and
-                    (tokens[ttoken(high)].keyword in aktmodeswitches);
-      end;
-{$else}
-
-    function is_keyword(const s:string):boolean;
-      var
-        encoded,low,high,mid : longint;
-      begin
-        encoded:=encode(s);
-        low:=ord(tokenidx[length(s)].first);
-        high:=ord(tokenidx[length(s)].last);
-        while low<high do
-         begin
-           mid:=(high+low+1) shr 1;
-           if encoded<tokens[ttoken(mid)].encoded then
+           if pattern<tokeninfo[ttoken(mid)].str then
             high:=mid-1
             high:=mid-1
            else
            else
             low:=mid;
             low:=mid;
          end;
          end;
-        is_keyword:=(encoded=tokens[ttoken(high)].encoded) and
-                    ((length(s)<6) or (pattern=tokens[Ttoken(high)].str)) and
-                    (tokens[ttoken(high)].keyword in aktmodeswitches);
+        is_keyword:=(pattern=tokeninfo[ttoken(high)].str) and
+                    (tokeninfo[ttoken(high)].keyword in aktmodeswitches);
       end;
       end;
-{$endif new__is_keyword}
 
 
 
 
 {*****************************************************************************
 {*****************************************************************************
@@ -949,10 +910,6 @@ implementation
         m       : longint;
         m       : longint;
         mac     : pmacrosym;
         mac     : pmacrosym;
         asciinr : string[3];
         asciinr : string[3];
-{$ifdef new__is_keyword}
-        encoded : longint;
-        p       : ^byte;
-{$endif}
       label
       label
          exit_label;
          exit_label;
       begin
       begin
@@ -1012,38 +969,19 @@ implementation
          { keyword or any other known token ? }
          { keyword or any other known token ? }
            if length(pattern) in [2..tokenidlen] then
            if length(pattern) in [2..tokenidlen] then
             begin
             begin
-              {$ifdef new__is_keyword}
-              encoded:=0;
-              p:=@pattern[1];
-              l:=1;
-              while (length(pattern)>=l) and (l<7) do
-                begin
-                    encoded:=encoded*32+p^-65;
-                    inc(p);
-                    inc(l);
-                end;
-              {$endif new__is_keyword}
               low:=ord(tokenidx[length(pattern)].first);
               low:=ord(tokenidx[length(pattern)].first);
               high:=ord(tokenidx[length(pattern)].last);
               high:=ord(tokenidx[length(pattern)].last);
               while low<high do
               while low<high do
                begin
                begin
                  mid:=(high+low+1) shr 1;
                  mid:=(high+low+1) shr 1;
-                 {$ifndef new__is_keyword}
-                 if pattern<tokens[ttoken(mid)].str then
-                 {$else}
-                 if encoded<tokens[ttoken(mid)].encoded then
-                 {$endif new__is_keyword}
+                 if pattern<tokeninfo[ttoken(mid)].str then
                   high:=mid-1
                   high:=mid-1
                  else
                  else
                   low:=mid;
                   low:=mid;
                end;
                end;
-             {$ifndef new__is_token}
-              if pattern=tokens[ttoken(high)].str then
-             {$else}
-              if encoded=tokens[ttoken(high)].encoded then
-             {$endif new__is_token}
+              if pattern=tokeninfo[ttoken(high)].str then
                begin
                begin
-                 if tokens[ttoken(high)].keyword in aktmodeswitches then
+                 if tokeninfo[ttoken(high)].keyword in aktmodeswitches then
                   token:=ttoken(high);
                   token:=ttoken(high);
                  idtoken:=ttoken(high);
                  idtoken:=ttoken(high);
                end;
                end;
@@ -1548,7 +1486,10 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.68  1998-11-16 15:41:44  peter
+  Revision 1.69  1998-12-11 00:03:46  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.68  1998/11/16 15:41:44  peter
     * tp7 didn't like my ifopt H+ :(
     * tp7 didn't like my ifopt H+ :(
 
 
   Revision 1.67  1998/11/16 12:18:06  peter
   Revision 1.67  1998/11/16 12:18:06  peter

+ 7 - 2
compiler/switches.pas

@@ -28,7 +28,9 @@ function CheckSwitch(switch,state:char):boolean;
 
 
 
 
 implementation
 implementation
-uses globals,verbose,files,systems;
+uses
+  globtype,systems,
+  globals,verbose,files;
 
 
 {****************************************************************************
 {****************************************************************************
                           Main Switches Parsing
                           Main Switches Parsing
@@ -164,7 +166,10 @@ end;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.17  1998-11-27 14:50:46  peter
+  Revision 1.18  1998-12-11 00:03:47  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.17  1998/11/27 14:50:46  peter
     + open strings, $P switch support
     + open strings, $P switch support
 
 
   Revision 1.16  1998/10/13 16:50:22  pierre
   Revision 1.16  1998/10/13 16:50:22  pierre

+ 7 - 3
compiler/tcadd.pas

@@ -32,7 +32,8 @@ interface
 implementation
 implementation
 
 
     uses
     uses
-      cobjects,verbose,globals,systems,
+      globtype,systems,tokens,
+      cobjects,verbose,globals,
       symtable,aasm,types,
       symtable,aasm,types,
       hcodegen,htypechk,pass_1
       hcodegen,htypechk,pass_1
 {$ifdef i386}
 {$ifdef i386}
@@ -134,7 +135,7 @@ implementation
                  slashn:
                  slashn:
                    t:=gencallnode(overloaded_operators[slash],nil);
                    t:=gencallnode(overloaded_operators[slash],nil);
                  ltn:
                  ltn:
-                   t:=gencallnode(overloaded_operators[globals.lt],nil);
+                   t:=gencallnode(overloaded_operators[tokens.lt],nil);
                  gtn:
                  gtn:
                    t:=gencallnode(overloaded_operators[gt],nil);
                    t:=gencallnode(overloaded_operators[gt],nil);
                  lten:
                  lten:
@@ -950,7 +951,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.16  1998-12-10 09:47:31  florian
+  Revision 1.17  1998-12-11 00:03:51  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.16  1998/12/10 09:47:31  florian
     + basic operations with int64/qord (compiler with -dint64)
     + basic operations with int64/qord (compiler with -dint64)
     + rtti of enumerations extended: names are now written
     + rtti of enumerations extended: names are now written
 
 

+ 6 - 2
compiler/tccal.pas

@@ -35,7 +35,8 @@ interface
 implementation
 implementation
 
 
     uses
     uses
-      cobjects,verbose,globals,systems,
+      globtype,systems,
+      cobjects,verbose,globals,
       aasm,types,
       aasm,types,
       hcodegen,htypechk,pass_1
       hcodegen,htypechk,pass_1
 {$ifdef i386}
 {$ifdef i386}
@@ -993,7 +994,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.16  1998-12-10 14:57:52  pierre
+  Revision 1.17  1998-12-11 00:03:52  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.16  1998/12/10 14:57:52  pierre
    * fix for operators
    * fix for operators
 
 
   Revision 1.15  1998/12/10 09:47:32  florian
   Revision 1.15  1998/12/10 09:47:32  florian

+ 6 - 2
compiler/tccnv.pas

@@ -39,7 +39,8 @@ interface
 implementation
 implementation
 
 
    uses
    uses
-      cobjects,verbose,globals,systems,
+      globtype,systems,tokens,
+      cobjects,verbose,globals,
       symtable,aasm,types,
       symtable,aasm,types,
       hcodegen,htypechk,pass_1
       hcodegen,htypechk,pass_1
 {$ifdef i386}
 {$ifdef i386}
@@ -955,7 +956,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.11  1998-12-04 10:18:12  florian
+  Revision 1.12  1998-12-11 00:03:53  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.11  1998/12/04 10:18:12  florian
     * some stuff for procedures of object added
     * some stuff for procedures of object added
     * bug with overridden virtual constructors fixed (reported by Italo Gomes)
     * bug with overridden virtual constructors fixed (reported by Italo Gomes)
 
 

+ 6 - 2
compiler/tcflw.pas

@@ -42,7 +42,8 @@ interface
 implementation
 implementation
 
 
     uses
     uses
-      cobjects,verbose,globals,systems,
+      globtype,systems,
+      cobjects,verbose,globals,
       symtable,aasm,types,
       symtable,aasm,types,
       hcodegen,htypechk,temp_gen,pass_1
       hcodegen,htypechk,temp_gen,pass_1
 {$ifdef i386}
 {$ifdef i386}
@@ -482,7 +483,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.3  1998-10-19 08:55:10  pierre
+  Revision 1.4  1998-12-11 00:03:55  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.3  1998/10/19 08:55:10  pierre
     * wrong stabs info corrected once again !!
     * wrong stabs info corrected once again !!
     + variable vmt offset with vmt field only if required
     + variable vmt offset with vmt field only if required
       implemented now !!!
       implemented now !!!

+ 6 - 2
compiler/tcmat.pas

@@ -35,7 +35,8 @@ interface
 implementation
 implementation
 
 
     uses
     uses
-      cobjects,verbose,globals,systems,
+      globtype,systems,tokens,
+      cobjects,verbose,globals,
       symtable,aasm,types,
       symtable,aasm,types,
       hcodegen,htypechk,pass_1
       hcodegen,htypechk,pass_1
 {$ifdef i386}
 {$ifdef i386}
@@ -331,7 +332,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.7  1998-11-13 10:16:38  peter
+  Revision 1.8  1998-12-11 00:03:56  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.7  1998/11/13 10:16:38  peter
     * fixed constant not(boolean)
     * fixed constant not(boolean)
 
 
   Revision 1.6  1998/11/05 14:26:01  peter
   Revision 1.6  1998/11/05 14:26:01  peter

+ 6 - 2
compiler/tcmem.pas

@@ -43,7 +43,8 @@ interface
 implementation
 implementation
 
 
     uses
     uses
-      cobjects,verbose,globals,systems,
+      globtype,systems,
+      cobjects,verbose,globals,
       symtable,aasm,types,
       symtable,aasm,types,
       hcodegen,htypechk,pass_1
       hcodegen,htypechk,pass_1
 {$ifdef i386}
 {$ifdef i386}
@@ -507,7 +508,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.4  1998-11-25 19:12:53  pierre
+  Revision 1.5  1998-12-11 00:03:57  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.4  1998/11/25 19:12:53  pierre
     * var:=new(pointer_type) support added
     * var:=new(pointer_type) support added
 
 
   Revision 1.3  1998/09/26 15:03:05  florian
   Revision 1.3  1998/09/26 15:03:05  florian

+ 6 - 2
compiler/tcset.pas

@@ -35,7 +35,8 @@ interface
 implementation
 implementation
 
 
     uses
     uses
-      cobjects,verbose,globals,systems,
+      globtype,systems,
+      cobjects,verbose,globals,
       symtable,aasm,types,
       symtable,aasm,types,
       hcodegen,htypechk,pass_1
       hcodegen,htypechk,pass_1
 {$ifdef i386}
 {$ifdef i386}
@@ -233,7 +234,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.3  1998-11-13 10:17:06  peter
+  Revision 1.4  1998-12-11 00:03:58  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.3  1998/11/13 10:17:06  peter
     + constant eval for in
     + constant eval for in
 
 
   Revision 1.2  1998/10/06 20:49:13  peter
   Revision 1.2  1998/10/06 20:49:13  peter

+ 7 - 1
compiler/tgeni386.pas

@@ -85,6 +85,9 @@ unit tgeni386;
 
 
 implementation
 implementation
 
 
+    uses
+      globtype;
+
     procedure pushusedregisters(var pushed : tpushed;b : byte);
     procedure pushusedregisters(var pushed : tpushed;b : byte);
 
 
       var
       var
@@ -366,7 +369,10 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.13  1998-10-21 08:40:03  florian
+  Revision 1.14  1998-12-11 00:03:59  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.13  1998/10/21 08:40:03  florian
     + ansistring operator +
     + ansistring operator +
     + $h and string[n] for n>255 added
     + $h and string[n] for n>255 added
     * small problem with TP fixed
     * small problem with TP fixed

+ 12 - 30
compiler/token.inc → compiler/tokens.pas

@@ -19,6 +19,11 @@
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  ****************************************************************************
  ****************************************************************************
 }
 }
+unit tokens;
+interface
+
+uses
+  globtype;
 
 
 const
 const
   tokenidlen=14;
   tokenidlen=14;
@@ -183,7 +188,7 @@ type
   end;
   end;
 
 
 const
 const
-  tokens:array[ttoken] of tokenrec=(
+  tokeninfo:array[ttoken] of tokenrec=(
     { Operators which can be overloaded }
     { Operators which can be overloaded }
       (str:'+'             ;special:true ;keyword:m_none),
       (str:'+'             ;special:true ;keyword:m_none),
       (str:'-'             ;special:true ;keyword:m_none),
       (str:'-'             ;special:true ;keyword:m_none),
@@ -262,7 +267,7 @@ const
       (str:'CVAR'          ;special:false;keyword:m_none),
       (str:'CVAR'          ;special:false;keyword:m_none),
       (str:'ELSE'          ;special:false;keyword:m_all),
       (str:'ELSE'          ;special:false;keyword:m_all),
       (str:'EXIT'          ;special:false;keyword:m_all),
       (str:'EXIT'          ;special:false;keyword:m_all),
-      (str:'FAIL'          ;special:false;keyword:m_none), { only set within constructors  PM }
+      (str:'FAIL'          ;special:false;keyword:m_none), { only set within constructors PM }
       (str:'FILE'          ;special:false;keyword:m_all),
       (str:'FILE'          ;special:false;keyword:m_all),
       (str:'GOTO'          ;special:false;keyword:m_all),
       (str:'GOTO'          ;special:false;keyword:m_all),
       (str:'NAME'          ;special:false;keyword:m_none),
       (str:'NAME'          ;special:false;keyword:m_none),
@@ -334,35 +339,12 @@ const
       (str:'INITIALIZATION';special:false;keyword:m_class)
       (str:'INITIALIZATION';special:false;keyword:m_class)
   );
   );
 
 
+implementation
+
+end.
 {
 {
   $Log$
   $Log$
-  Revision 1.7  1998-11-27 14:50:54  peter
-    + open strings, $P switch support
-
-  Revision 1.6  1998/11/13 15:40:33  pierre
-    + added -Se in Makefile cvstest target
-    + lexlevel cleanup
-      normal_function_level main_program_level and unit_init_level defined
-    * tins_cache grown to A_EMMS (gave range check error in asm readers)
-      (test added in code !)
-    * -Un option was wrong
-    * _FAIL and _SELF only keyword inside
-      constructors and methods respectively
-
-  Revision 1.5  1998/11/10 10:09:19  peter
-    * va_list -> array of const
-
-  Revision 1.4  1998/11/09 11:44:42  peter
-    + va_list for printf support
-
-  Revision 1.3  1998/10/16 14:21:05  daniel
-  * Faster keyword scanning.
-  * Import library and smartlink library in one file.
-
-  Revision 1.2  1998/09/30 12:12:30  peter
-    * fixed far,near which are not keywords
-
-  Revision 1.1  1998/09/26 17:45:47  peter
-    + idtoken and only one token table
+  Revision 1.1  1998-12-11 00:04:02  peter
+    + globtype,tokens,version unit splitted from globals
 
 
 }
 }

+ 7 - 3
compiler/tree.pas

@@ -29,7 +29,7 @@ unit tree;
   interface
   interface
 
 
     uses
     uses
-       cobjects,globals,symtable,aasm
+       globtype,cobjects,symtable,aasm
 {$ifdef i386}
 {$ifdef i386}
        ,i386
        ,i386
 {$endif}
 {$endif}
@@ -336,7 +336,8 @@ unit tree;
   implementation
   implementation
 
 
     uses
     uses
-       systems,verbose,files,types;
+       systems,
+       globals,verbose,files,types;
 
 
 
 
     function getnode : ptree;
     function getnode : ptree;
@@ -1655,7 +1656,10 @@ unit tree;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.57  1998-12-04 10:18:13  florian
+  Revision 1.58  1998-12-11 00:04:02  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.57  1998/12/04 10:18:13  florian
     * some stuff for procedures of object added
     * some stuff for procedures of object added
     * bug with overridden virtual constructors fixed (reported by Italo Gomes)
     * bug with overridden virtual constructors fixed (reported by Italo Gomes)
 
 

+ 6 - 2
compiler/types.pas

@@ -136,7 +136,8 @@ unit types;
 
 
   implementation
   implementation
 
 
-    uses verbose,aasm;
+    uses
+      globtype,verbose,aasm;
 
 
 
 
     function equal_paras(def1,def2 : pdefcoll;value_equal_const : boolean) : boolean;
     function equal_paras(def1,def2 : pdefcoll;value_equal_const : boolean) : boolean;
@@ -1047,7 +1048,10 @@ unit types;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.41  1998-12-10 09:47:33  florian
+  Revision 1.42  1998-12-11 00:04:03  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.41  1998/12/10 09:47:33  florian
     + basic operations with int64/qord (compiler with -dint64)
     + basic operations with int64/qord (compiler with -dint64)
     + rtti of enumerations extended: names are now written
     + rtti of enumerations extended: names are now written
 
 

+ 5 - 2
compiler/verbose.pas

@@ -84,7 +84,7 @@ procedure DoneVerbose;
 implementation
 implementation
 uses
 uses
   files,comphook,
   files,comphook,
-  globals;
+  version,globals;
 
 
 var
 var
   redirexitsave : pointer;
   redirexitsave : pointer;
@@ -429,7 +429,10 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.30  1998-12-02 16:23:38  jonas
+  Revision 1.31  1998-12-11 00:04:04  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.30  1998/12/02 16:23:38  jonas
     * changed "if longintvar in set" to case or "if () or () .." statements
     * changed "if longintvar in set" to case or "if () or () .." statements
     * tree.pas: changed inlinenumber (and associated constructor/vars) to a byte
     * tree.pas: changed inlinenumber (and associated constructor/vars) to a byte
 
 

+ 63 - 0
compiler/version.pas

@@ -0,0 +1,63 @@
+{
+    $Id$
+    Copyright (C) 1993-98 by Florian Klaempfl
+
+    Version/target constants
+
+    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
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+ ****************************************************************************
+}
+unit version;
+interface
+
+    const
+       { version string }
+       wordversion = (0 shl 9)+99;
+
+       version_nr = '0';
+       release_nr = '99';
+       patch_nr   = '9';
+       version_string = version_nr+'.'+release_nr+'.'+patch_nr;
+
+       { target string }
+{$ifdef i386}
+       target_string = 'i386';
+{$endif}
+{$ifdef m68k}
+       target_string = 'M680x0';
+{$endif}
+{$ifdef alpha}
+       target_string = 'Alpha';
+{$endif}
+
+       { date string }
+{$ifdef FPC}
+       date_string = {$I %DATE%};
+{$else}
+       date_string = 'N/A';
+{$endif}
+
+
+implementation
+
+end.
+{
+  $Log$
+  Revision 1.1  1998-12-11 00:04:06  peter
+    + globtype,tokens,version unit splitted from globals
+
+}
+

+ 18 - 15
compiler/win_targ.pas

@@ -53,7 +53,7 @@ unit win_targ;
   implementation
   implementation
 
 
     uses
     uses
-       aasm,files,strings,globals,cobjects,systems,verbose
+       aasm,files,strings,globtype,globals,cobjects,systems,verbose
 {$ifdef GDB}
 {$ifdef GDB}
        ,gdb
        ,gdb
 {$endif}
 {$endif}
@@ -413,20 +413,20 @@ unit win_targ;
          last_index:=0;
          last_index:=0;
       end;
       end;
 
 
-    
-    
+
+
     procedure texportlibwin32.exportvar(hp : pexported_item);
     procedure texportlibwin32.exportvar(hp : pexported_item);
       begin
       begin
          { same code used !! PM }
          { same code used !! PM }
          exportprocedure(hp);
          exportprocedure(hp);
       end;
       end;
-      
-    
+
+
     procedure texportlibwin32.exportprocedure(hp : pexported_item);
     procedure texportlibwin32.exportprocedure(hp : pexported_item);
-    
+
       { must be ordered at least for win32 !! }
       { must be ordered at least for win32 !! }
       var hp2 : pexported_item;
       var hp2 : pexported_item;
-    
+
     begin
     begin
         hp2:=pexported_item(current_module^._exports^.first);
         hp2:=pexported_item(current_module^._exports^.first);
         { first test the index value }
         { first test the index value }
@@ -460,7 +460,7 @@ unit win_targ;
              hp^.name:=stringdup(hp^.sym^.name);
              hp^.name:=stringdup(hp^.sym^.name);
              hp^.options:=hp^.options or eo_name;
              hp^.options:=hp^.options or eo_name;
           end;
           end;
-          
+
         { now place in correct order }
         { now place in correct order }
         hp2:=pexported_item(current_module^._exports^.first);
         hp2:=pexported_item(current_module^._exports^.first);
         while assigned(hp2) and
         while assigned(hp2) and
@@ -485,8 +485,8 @@ unit win_targ;
         else
         else
           current_module^._exports^.concat(hp);
           current_module^._exports^.concat(hp);
     end;
     end;
-    
-    
+
+
     procedure texportlibwin32.generatelib;
     procedure texportlibwin32.generatelib;
 
 
       var
       var
@@ -499,7 +499,7 @@ unit win_targ;
          tempexport : plinkedlist;
          tempexport : plinkedlist;
          address_table,name_table_pointers,
          address_table,name_table_pointers,
          name_table,ordinal_table : paasmoutput;
          name_table,ordinal_table : paasmoutput;
-         
+
       begin
       begin
          ordinal_max:=0;
          ordinal_max:=0;
          ordinal_min:=$7FFFFFFF;
          ordinal_min:=$7FFFFFFF;
@@ -530,7 +530,7 @@ unit win_targ;
          current_index:=ordinal_base;
          current_index:=ordinal_base;
          { we must also count the holes !! }
          { we must also count the holes !! }
          entries:=ordinal_max-ordinal_base+1;
          entries:=ordinal_max-ordinal_base+1;
-         
+
          exportssection^.concat(new(pai_section,init(sec_edata)));
          exportssection^.concat(new(pai_section,init(sec_edata)));
          { export flags }
          { export flags }
          exportssection^.concat(new(pai_const,init_32bit(0)));
          exportssection^.concat(new(pai_const,init_32bit(0)));
@@ -617,7 +617,7 @@ unit win_targ;
                 end;
                 end;
               hp:=pexported_item(current_module^._exports^.first);;
               hp:=pexported_item(current_module^._exports^.first);;
            end;
            end;
-         
+
 
 
 
 
          { write the export adress table }
          { write the export adress table }
@@ -636,7 +636,7 @@ unit win_targ;
               inc(current_index);
               inc(current_index);
               hp:=pexported_item(hp^.next);
               hp:=pexported_item(hp^.next);
            end;
            end;
-         
+
          exportssection^.concatlist(address_table);
          exportssection^.concatlist(address_table);
          exportssection^.concatlist(name_table_pointers);
          exportssection^.concatlist(name_table_pointers);
          exportssection^.concatlist(ordinal_table);
          exportssection^.concatlist(ordinal_table);
@@ -696,7 +696,10 @@ unit win_targ;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.18  1998-12-02 10:26:13  pierre
+  Revision 1.19  1998-12-11 00:04:06  peter
+    + globtype,tokens,version unit splitted from globals
+
+  Revision 1.18  1998/12/02 10:26:13  pierre
     * writing of .edata was wrong for indexes above number of exported items
     * writing of .edata was wrong for indexes above number of exported items
     * importing by index only did not work !
     * importing by index only did not work !