Browse Source

+ support overriding tdef/tsym methods with target-specific functionality:
o made all (non-abstract) tdef and tsym constructors virtual
o added c*def/c*sym classref types for every (non-abstract) t*def/t*sym
class
o added cpusym unit for every architecture that derives a tcpu*def/tcpu*sym
class from the base classes, and initialises the c*def/c*sym classes with
them. This is done so that the llvm target will be able to derive from
the tcpu*def/sym classes without umpteen ifdefs, and it also means that
the WPO can devirtualise everything because the c* variables are only
initialised with one class type
o replaced all t*def/t*sym constructor calls with c*def/c*sym constructor
calls

git-svn-id: trunk@27361 -

Jonas Maebe 11 years ago
parent
commit
b57c95043f
62 changed files with 3208 additions and 475 deletions
  1. 15 0
      .gitattributes
  2. 174 0
      compiler/aarch64/symcpu.pas
  3. 4 2
      compiler/alpha/cpunode.pas
  4. 174 0
      compiler/alpha/symcpu.pas
  5. 3 1
      compiler/arm/cpunode.pas
  6. 174 0
      compiler/arm/symcpu.pas
  7. 3 1
      compiler/avr/cpunode.pas
  8. 174 0
      compiler/avr/symcpu.pas
  9. 2 2
      compiler/cg64f32.pas
  10. 174 0
      compiler/generic/symcpu.pas
  11. 3 1
      compiler/i386/cpunode.pas
  12. 174 0
      compiler/i386/symcpu.pas
  13. 3 1
      compiler/i8086/cpunode.pas
  14. 174 0
      compiler/i8086/symcpu.pas
  15. 174 0
      compiler/ia64/symcpu.pas
  16. 3 1
      compiler/jvm/cpunode.pas
  17. 1 1
      compiler/jvm/njvmcon.pas
  18. 2 2
      compiler/jvm/njvmutil.pas
  19. 25 25
      compiler/jvm/pjvm.pas
  20. 174 0
      compiler/jvm/symcpu.pas
  21. 4 2
      compiler/m68k/cpunode.pas
  22. 174 0
      compiler/m68k/symcpu.pas
  23. 4 1
      compiler/mips/cpunode.pas
  24. 174 0
      compiler/mips/symcpu.pas
  25. 1 1
      compiler/nadd.pas
  26. 3 3
      compiler/ncal.pas
  27. 1 1
      compiler/ncnv.pas
  28. 1 1
      compiler/ncon.pas
  29. 6 6
      compiler/nflw.pas
  30. 1 1
      compiler/ngenutil.pas
  31. 4 4
      compiler/ninl.pas
  32. 3 3
      compiler/nld.pas
  33. 10 10
      compiler/nmem.pas
  34. 2 2
      compiler/nset.pas
  35. 1 1
      compiler/optloop.pas
  36. 1 1
      compiler/opttail.pas
  37. 21 21
      compiler/pdecl.pas
  38. 6 6
      compiler/pdecobj.pas
  39. 14 14
      compiler/pdecsub.pas
  40. 20 20
      compiler/pdecvar.pas
  41. 7 7
      compiler/pexpr.pas
  42. 7 7
      compiler/pgenutil.pas
  43. 10 10
      compiler/pmodules.pas
  44. 174 0
      compiler/powerpc/symcpu.pas
  45. 3 1
      compiler/powerpc64/cpunode.pas
  46. 174 0
      compiler/powerpc64/symcpu.pas
  47. 11 1
      compiler/pp.lpi
  48. 15 15
      compiler/pparautl.pas
  49. 3 3
      compiler/pstatmnt.pas
  50. 1 1
      compiler/psub.pas
  51. 139 139
      compiler/psystem.pas
  52. 24 24
      compiler/ptype.pas
  53. 4 0
      compiler/scanner.pas
  54. 3 1
      compiler/sparc/cpunode.pas
  55. 174 0
      compiler/sparc/symcpu.pas
  56. 9 9
      compiler/symcreat.pas
  57. 118 78
      compiler/symdef.pas
  58. 68 39
      compiler/symsym.pas
  59. 3 3
      compiler/symtable.pas
  60. 3 1
      compiler/vis/cpunode.pas
  61. 3 1
      compiler/x86_64/cpunode.pas
  62. 174 0
      compiler/x86_64/symcpu.pas

+ 15 - 0
.gitattributes

@@ -30,6 +30,7 @@ compiler/aarch64/ra64sri.inc svneol=native#text/plain
 compiler/aarch64/ra64sta.inc svneol=native#text/plain
 compiler/aarch64/ra64sta.inc svneol=native#text/plain
 compiler/aarch64/ra64std.inc svneol=native#text/plain
 compiler/aarch64/ra64std.inc svneol=native#text/plain
 compiler/aarch64/ra64sup.inc svneol=native#text/plain
 compiler/aarch64/ra64sup.inc svneol=native#text/plain
+compiler/aarch64/symcpu.pas svneol=native#text/plain
 compiler/aasmbase.pas svneol=native#text/plain
 compiler/aasmbase.pas svneol=native#text/plain
 compiler/aasmdata.pas svneol=native#text/plain
 compiler/aasmdata.pas svneol=native#text/plain
 compiler/aasmsym.pas svneol=native#text/plain
 compiler/aasmsym.pas svneol=native#text/plain
@@ -52,6 +53,7 @@ compiler/alpha/cputarg.pas svneol=native#text/plain
 compiler/alpha/radirect.pas svneol=native#text/plain
 compiler/alpha/radirect.pas svneol=native#text/plain
 compiler/alpha/rasm.pas svneol=native#text/plain
 compiler/alpha/rasm.pas svneol=native#text/plain
 compiler/alpha/rgcpu.pas svneol=native#text/plain
 compiler/alpha/rgcpu.pas svneol=native#text/plain
+compiler/alpha/symcpu.pas svneol=native#text/plain
 compiler/alpha/tgcpu.pas svneol=native#text/plain
 compiler/alpha/tgcpu.pas svneol=native#text/plain
 compiler/aopt.pas svneol=native#text/plain
 compiler/aopt.pas svneol=native#text/plain
 compiler/aoptbase.pas svneol=native#text/plain
 compiler/aoptbase.pas svneol=native#text/plain
@@ -102,6 +104,7 @@ compiler/arm/rarmsta.inc svneol=native#text/plain
 compiler/arm/rarmstd.inc svneol=native#text/plain
 compiler/arm/rarmstd.inc svneol=native#text/plain
 compiler/arm/rarmsup.inc svneol=native#text/plain
 compiler/arm/rarmsup.inc svneol=native#text/plain
 compiler/arm/rgcpu.pas svneol=native#text/plain
 compiler/arm/rgcpu.pas svneol=native#text/plain
+compiler/arm/symcpu.pas svneol=native#text/plain
 compiler/asmutils.pas svneol=native#text/plain
 compiler/asmutils.pas svneol=native#text/plain
 compiler/assemble.pas svneol=native#text/plain
 compiler/assemble.pas svneol=native#text/plain
 compiler/avr/aasmcpu.pas svneol=native#text/plain
 compiler/avr/aasmcpu.pas svneol=native#text/plain
@@ -134,6 +137,7 @@ compiler/avr/ravrsta.inc svneol=native#text/plain
 compiler/avr/ravrstd.inc svneol=native#text/plain
 compiler/avr/ravrstd.inc svneol=native#text/plain
 compiler/avr/ravrsup.inc svneol=native#text/plain
 compiler/avr/ravrsup.inc svneol=native#text/plain
 compiler/avr/rgcpu.pas svneol=native#text/plain
 compiler/avr/rgcpu.pas svneol=native#text/plain
+compiler/avr/symcpu.pas svneol=native#text/plain
 compiler/browcol.pas svneol=native#text/plain
 compiler/browcol.pas svneol=native#text/plain
 compiler/bsdcompile -text
 compiler/bsdcompile -text
 compiler/catch.pas svneol=native#text/plain
 compiler/catch.pas svneol=native#text/plain
@@ -175,6 +179,7 @@ compiler/fpcdefs.inc svneol=native#text/plain
 compiler/fppu.pas svneol=native#text/plain
 compiler/fppu.pas svneol=native#text/plain
 compiler/gendef.pas svneol=native#text/plain
 compiler/gendef.pas svneol=native#text/plain
 compiler/generic/cpuinfo.pas svneol=native#text/plain
 compiler/generic/cpuinfo.pas svneol=native#text/plain
+compiler/generic/symcpu.pas svneol=native#text/plain
 compiler/globals.pas svneol=native#text/plain
 compiler/globals.pas svneol=native#text/plain
 compiler/globstat.pas svneol=native#text/pascal
 compiler/globstat.pas svneol=native#text/pascal
 compiler/globtype.pas svneol=native#text/plain
 compiler/globtype.pas svneol=native#text/plain
@@ -229,6 +234,7 @@ compiler/i386/ra386att.pas svneol=native#text/plain
 compiler/i386/ra386int.pas svneol=native#text/plain
 compiler/i386/ra386int.pas svneol=native#text/plain
 compiler/i386/rgcpu.pas svneol=native#text/plain
 compiler/i386/rgcpu.pas svneol=native#text/plain
 compiler/i386/rropt386.pas svneol=native#text/plain
 compiler/i386/rropt386.pas svneol=native#text/plain
+compiler/i386/symcpu.pas svneol=native#text/plain
 compiler/i8086/aoptcpu.pas svneol=native#text/plain
 compiler/i8086/aoptcpu.pas svneol=native#text/plain
 compiler/i8086/aoptcpub.pas svneol=native#text/plain
 compiler/i8086/aoptcpub.pas svneol=native#text/plain
 compiler/i8086/aoptcpud.pas svneol=native#text/plain
 compiler/i8086/aoptcpud.pas svneol=native#text/plain
@@ -272,10 +278,12 @@ compiler/i8086/r8086std.inc svneol=native#text/plain
 compiler/i8086/ra8086att.pas svneol=native#text/plain
 compiler/i8086/ra8086att.pas svneol=native#text/plain
 compiler/i8086/ra8086int.pas svneol=native#text/plain
 compiler/i8086/ra8086int.pas svneol=native#text/plain
 compiler/i8086/rgcpu.pas svneol=native#text/plain
 compiler/i8086/rgcpu.pas svneol=native#text/plain
+compiler/i8086/symcpu.pas svneol=native#text/plain
 compiler/ia64/aasmcpu.pas svneol=native#text/plain
 compiler/ia64/aasmcpu.pas svneol=native#text/plain
 compiler/ia64/cpubase.pas svneol=native#text/plain
 compiler/ia64/cpubase.pas svneol=native#text/plain
 compiler/ia64/cpuinfo.pas svneol=native#text/plain
 compiler/ia64/cpuinfo.pas svneol=native#text/plain
 compiler/ia64/ia64reg.dat svneol=native#text/plain
 compiler/ia64/ia64reg.dat svneol=native#text/plain
+compiler/ia64/symcpu.pas svneol=native#text/plain
 compiler/impdef.pas svneol=native#text/plain
 compiler/impdef.pas svneol=native#text/plain
 compiler/import.pas svneol=native#text/plain
 compiler/import.pas svneol=native#text/plain
 compiler/jvm/aasmcpu.pas svneol=native#text/plain
 compiler/jvm/aasmcpu.pas svneol=native#text/plain
@@ -313,6 +321,7 @@ compiler/jvm/rjvmrni.inc svneol=native#text/plain
 compiler/jvm/rjvmsri.inc svneol=native#text/plain
 compiler/jvm/rjvmsri.inc svneol=native#text/plain
 compiler/jvm/rjvmstd.inc svneol=native#text/plain
 compiler/jvm/rjvmstd.inc svneol=native#text/plain
 compiler/jvm/rjvmsup.inc svneol=native#text/plain
 compiler/jvm/rjvmsup.inc svneol=native#text/plain
+compiler/jvm/symcpu.pas svneol=native#text/plain
 compiler/jvm/tgcpu.pas svneol=native#text/plain
 compiler/jvm/tgcpu.pas svneol=native#text/plain
 compiler/ldscript.pas svneol=native#text/plain
 compiler/ldscript.pas svneol=native#text/plain
 compiler/link.pas svneol=native#text/plain
 compiler/link.pas svneol=native#text/plain
@@ -350,6 +359,7 @@ compiler/m68k/r68ksup.inc svneol=native#text/plain
 compiler/m68k/ra68k.pas svneol=native#text/plain
 compiler/m68k/ra68k.pas svneol=native#text/plain
 compiler/m68k/ra68kmot.pas svneol=native#text/plain
 compiler/m68k/ra68kmot.pas svneol=native#text/plain
 compiler/m68k/rgcpu.pas svneol=native#text/plain
 compiler/m68k/rgcpu.pas svneol=native#text/plain
+compiler/m68k/symcpu.pas svneol=native#text/plain
 compiler/macho.pas svneol=native#text/plain
 compiler/macho.pas svneol=native#text/plain
 compiler/machoutils.pas svneol=native#text/plain
 compiler/machoutils.pas svneol=native#text/plain
 compiler/mips/aasmcpu.pas svneol=native#text/plain
 compiler/mips/aasmcpu.pas svneol=native#text/plain
@@ -391,6 +401,7 @@ compiler/mips/rmipssta.inc svneol=native#text/plain
 compiler/mips/rmipsstd.inc svneol=native#text/plain
 compiler/mips/rmipsstd.inc svneol=native#text/plain
 compiler/mips/rmipssup.inc svneol=native#text/plain
 compiler/mips/rmipssup.inc svneol=native#text/plain
 compiler/mips/strinst.inc svneol=native#text/plain
 compiler/mips/strinst.inc svneol=native#text/plain
+compiler/mips/symcpu.pas svneol=native#text/plain
 compiler/msg/errorct.msg svneol=native#text/plain
 compiler/msg/errorct.msg svneol=native#text/plain
 compiler/msg/errord.msg svneol=native#text/plain
 compiler/msg/errord.msg svneol=native#text/plain
 compiler/msg/errorda.msg svneol=native#text/plain
 compiler/msg/errorda.msg svneol=native#text/plain
@@ -525,6 +536,7 @@ compiler/powerpc/rppcsri.inc svneol=native#text/plain
 compiler/powerpc/rppcstab.inc svneol=native#text/plain
 compiler/powerpc/rppcstab.inc svneol=native#text/plain
 compiler/powerpc/rppcstd.inc svneol=native#text/plain
 compiler/powerpc/rppcstd.inc svneol=native#text/plain
 compiler/powerpc/rppcsup.inc svneol=native#text/plain
 compiler/powerpc/rppcsup.inc svneol=native#text/plain
+compiler/powerpc/symcpu.pas svneol=native#text/plain
 compiler/powerpc64/aoptcpu.pas svneol=native#text/plain
 compiler/powerpc64/aoptcpu.pas svneol=native#text/plain
 compiler/powerpc64/aoptcpub.pas svneol=native#text/plain
 compiler/powerpc64/aoptcpub.pas svneol=native#text/plain
 compiler/powerpc64/aoptcpuc.pas svneol=native#text/plain
 compiler/powerpc64/aoptcpuc.pas svneol=native#text/plain
@@ -561,6 +573,7 @@ compiler/powerpc64/rppcsri.inc svneol=native#text/plain
 compiler/powerpc64/rppcstab.inc svneol=native#text/plain
 compiler/powerpc64/rppcstab.inc svneol=native#text/plain
 compiler/powerpc64/rppcstd.inc svneol=native#text/plain
 compiler/powerpc64/rppcstd.inc svneol=native#text/plain
 compiler/powerpc64/rppcsup.inc svneol=native#text/plain
 compiler/powerpc64/rppcsup.inc svneol=native#text/plain
+compiler/powerpc64/symcpu.pas svneol=native#text/plain
 compiler/pp.lpi svneol=native#text/plain
 compiler/pp.lpi svneol=native#text/plain
 compiler/pp.pas svneol=native#text/plain
 compiler/pp.pas svneol=native#text/plain
 compiler/pparautl.pas svneol=native#text/plain
 compiler/pparautl.pas svneol=native#text/plain
@@ -640,6 +653,7 @@ compiler/sparc/rspstd.inc svneol=native#text/plain
 compiler/sparc/rspsup.inc svneol=native#text/plain
 compiler/sparc/rspsup.inc svneol=native#text/plain
 compiler/sparc/spreg.dat svneol=native#text/plain
 compiler/sparc/spreg.dat svneol=native#text/plain
 compiler/sparc/strinst.inc svneol=native#text/plain
 compiler/sparc/strinst.inc svneol=native#text/plain
+compiler/sparc/symcpu.pas svneol=native#text/plain
 compiler/switches.pas svneol=native#text/plain
 compiler/switches.pas svneol=native#text/plain
 compiler/symbase.pas svneol=native#text/plain
 compiler/symbase.pas svneol=native#text/plain
 compiler/symconst.pas svneol=native#text/plain
 compiler/symconst.pas svneol=native#text/plain
@@ -820,6 +834,7 @@ compiler/x86_64/r8664std.inc svneol=native#text/plain
 compiler/x86_64/rax64att.pas svneol=native#text/plain
 compiler/x86_64/rax64att.pas svneol=native#text/plain
 compiler/x86_64/rax64int.pas svneol=native#text/plain
 compiler/x86_64/rax64int.pas svneol=native#text/plain
 compiler/x86_64/rgcpu.pas svneol=native#text/plain
 compiler/x86_64/rgcpu.pas svneol=native#text/plain
+compiler/x86_64/symcpu.pas svneol=native#text/plain
 compiler/x86_64/win64unw.pas svneol=native#text/plain
 compiler/x86_64/win64unw.pas svneol=native#text/plain
 compiler/x86_64/x8664ats.inc svneol=native#text/plain
 compiler/x86_64/x8664ats.inc svneol=native#text/plain
 compiler/x86_64/x8664att.inc svneol=native#text/plain
 compiler/x86_64/x8664att.inc svneol=native#text/plain

+ 174 - 0
compiler/aarch64/symcpu.pas

@@ -0,0 +1,174 @@
+{
+    Copyright (c) 2014 by Florian Klaempfl
+
+    Symbol table overrides for AARCH64
+
+    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 symcpu;
+
+{$i fpcdefs.inc}
+
+interface
+
+uses
+  symdef,symsym;
+
+type
+  { defs }
+  tcpufiledef = class(tfiledef)
+  end;
+
+  tcpuvariantdef = class(tvariantdef)
+  end;
+
+  tcpuformaldef = class(tformaldef)
+  end;
+
+  tcpuforwarddef = class(tforwarddef)
+  end;
+
+  tcpuundefineddef = class(tundefineddef)
+  end;
+
+  tcpuerrordef = class(terrordef)
+  end;
+
+  tcpupointerdef = class(tpointerdef)
+  end;
+
+  tcpurecorddef = class(trecorddef)
+  end;
+
+  tcpuimplementedinterface = class(timplementedinterface)
+  end;
+
+  tcpuobjectdef = class(tobjectdef)
+  end;
+
+  tcpuclassrefdef = class(tclassrefdef)
+  end;
+
+  tcpuarraydef = class(tarraydef)
+  end;
+
+  tcpuorddef = class(torddef)
+  end;
+
+  tcpufloatdef = class(tfloatdef)
+  end;
+
+  tcpuprocvardef = class(tprocvardef)
+  end;
+
+  tcpuprocdef = class(tprocdef)
+  end;
+
+  tcpustringdef = class(tstringdef)
+  end;
+
+  tcpuenumdef = class(tenumdef)
+  end;
+
+  tcpusetdef = class(tsetdef)
+  end;
+
+  { syms }
+  tcpulabelsym = class(tlabelsym)
+  end;
+
+  tcpuunitsym = class(tunitsym)
+  end;
+
+  tcpunamespacesym = class(tnamespacesym)
+  end;
+
+  tcpuprocsym = class(tprocsym)
+  end;
+
+  tcpuypesym = class(ttypesym)
+  end;
+
+  tcpufieldvarsym = class(tfieldvarsym)
+  end;
+
+  tcpulocalvarsym = class(tlocalvarsym)
+  end;
+
+  tcpuparavarsym = class(tparavarsym)
+  end;
+
+  tcpustaticvarsym = class(tstaticvarsym)
+  end;
+
+  tcpuabsolutevarsym = class(tabsolutevarsym)
+  end;
+
+  tcpupropertysym = class(tpropertysym)
+  end;
+
+  tcpuconstsym = class(tconstsym)
+  end;
+
+  tcpuenumsym = class(tenumsym)
+  end;
+
+  tcpusyssym = class(tsyssym)
+  end;
+
+
+implementation
+
+begin
+  { used tdef classes }
+  cfiledef:=tcpufiledef;
+  cvariantdef:=tcpuvariantdef;
+  cformaldef:=tcpuformaldef;
+  cforwarddef:=tcpuforwarddef;
+  cundefineddef:=tcpuundefineddef;
+  cerrordef:=tcpuerrordef;
+  cpointerdef:=tcpupointerdef;
+  crecorddef:=tcpurecorddef;
+  cimplementedinterface:=tcpuimplementedinterface;
+  cobjectdef:=tcpuobjectdef;
+  cclassrefdef:=tcpuclassrefdef;
+  carraydef:=tcpuarraydef;
+  corddef:=tcpuorddef;
+  cfloatdef:=tcpufloatdef;
+  cprocvardef:=tcpuprocvardef;
+  cprocdef:=tcpuprocdef;
+  cstringdef:=tcpustringdef;
+  cenumdef:=tcpuenumdef;
+  csetdef:=tcpusetdef;
+
+  { used tsym classes }
+  clabelsym:=tcpulabelsym;
+  cunitsym:=tcpuunitsym;
+  cnamespacesym:=tcpunamespacesym;
+  cprocsym:=tcpuprocsym;
+  ctypesym:=tcpuypesym;
+  cfieldvarsym:=tcpufieldvarsym;
+  clocalvarsym:=tcpulocalvarsym;
+  cparavarsym:=tcpuparavarsym;
+  cstaticvarsym:=tcpustaticvarsym;
+  cabsolutevarsym:=tcpuabsolutevarsym;
+  cpropertysym:=tcpupropertysym;
+  cconstsym:=tcpuconstsym;
+  cenumsym:=tcpuenumsym;
+  csyssym:=tcpusyssym;
+end.
+

+ 4 - 2
compiler/alpha/cpunode.pas

@@ -32,7 +32,7 @@ unit cpunode;
 
 
     uses
     uses
        { generic nodes }
        { generic nodes }
-       ncgbas,ncgld,ncgflw,ncgcnv,ncgmem,ncgcon,ncgcal,ncgset,ncginl
+       ncgbas,ncgld,ncgflw,ncgcnv,ncgmem,ncgcon,ncgcal,ncgset,ncginl,
        { to be able to only parts of the generic code,
        { to be able to only parts of the generic code,
          the processor specific nodes must be included
          the processor specific nodes must be included
          after the generic one (FK)
          after the generic one (FK)
@@ -48,7 +48,9 @@ unit cpunode;
        { this not really a node }
        { this not really a node }
 //       naxpobj,
 //       naxpobj,
 //       naxpmat,
 //       naxpmat,
-//       naxpcnv
+//       naxpcnv,
+         { symtable }
+         symcpu
        ;
        ;
 
 
 end.
 end.

+ 174 - 0
compiler/alpha/symcpu.pas

@@ -0,0 +1,174 @@
+{
+    Copyright (c) 2014 by Florian Klaempfl
+
+    Symbol table overrides for Alpha
+
+    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 symcpu;
+
+{$i fpcdefs.inc}
+
+interface
+
+uses
+  symdef,symsym;
+
+type
+  { defs }
+  tcpufiledef = class(tfiledef)
+  end;
+
+  tcpuvariantdef = class(tvariantdef)
+  end;
+
+  tcpuformaldef = class(tformaldef)
+  end;
+
+  tcpuforwarddef = class(tforwarddef)
+  end;
+
+  tcpuundefineddef = class(tundefineddef)
+  end;
+
+  tcpuerrordef = class(terrordef)
+  end;
+
+  tcpupointerdef = class(tpointerdef)
+  end;
+
+  tcpurecorddef = class(trecorddef)
+  end;
+
+  tcpuimplementedinterface = class(timplementedinterface)
+  end;
+
+  tcpuobjectdef = class(tobjectdef)
+  end;
+
+  tcpuclassrefdef = class(tclassrefdef)
+  end;
+
+  tcpuarraydef = class(tarraydef)
+  end;
+
+  tcpuorddef = class(torddef)
+  end;
+
+  tcpufloatdef = class(tfloatdef)
+  end;
+
+  tcpuprocvardef = class(tprocvardef)
+  end;
+
+  tcpuprocdef = class(tprocdef)
+  end;
+
+  tcpustringdef = class(tstringdef)
+  end;
+
+  tcpuenumdef = class(tenumdef)
+  end;
+
+  tcpusetdef = class(tsetdef)
+  end;
+
+  { syms }
+  tcpulabelsym = class(tlabelsym)
+  end;
+
+  tcpuunitsym = class(tunitsym)
+  end;
+
+  tcpunamespacesym = class(tnamespacesym)
+  end;
+
+  tcpuprocsym = class(tprocsym)
+  end;
+
+  tcpuypesym = class(ttypesym)
+  end;
+
+  tcpufieldvarsym = class(tfieldvarsym)
+  end;
+
+  tcpulocalvarsym = class(tlocalvarsym)
+  end;
+
+  tcpuparavarsym = class(tparavarsym)
+  end;
+
+  tcpustaticvarsym = class(tstaticvarsym)
+  end;
+
+  tcpuabsolutevarsym = class(tabsolutevarsym)
+  end;
+
+  tcpupropertysym = class(tpropertysym)
+  end;
+
+  tcpuconstsym = class(tconstsym)
+  end;
+
+  tcpuenumsym = class(tenumsym)
+  end;
+
+  tcpusyssym = class(tsyssym)
+  end;
+
+
+implementation
+
+begin
+  { used tdef classes }
+  cfiledef:=tcpufiledef;
+  cvariantdef:=tcpuvariantdef;
+  cformaldef:=tcpuformaldef;
+  cforwarddef:=tcpuforwarddef;
+  cundefineddef:=tcpuundefineddef;
+  cerrordef:=tcpuerrordef;
+  cpointerdef:=tcpupointerdef;
+  crecorddef:=tcpurecorddef;
+  cimplementedinterface:=tcpuimplementedinterface;
+  cobjectdef:=tcpuobjectdef;
+  cclassrefdef:=tcpuclassrefdef;
+  carraydef:=tcpuarraydef;
+  corddef:=tcpuorddef;
+  cfloatdef:=tcpufloatdef;
+  cprocvardef:=tcpuprocvardef;
+  cprocdef:=tcpuprocdef;
+  cstringdef:=tcpustringdef;
+  cenumdef:=tcpuenumdef;
+  csetdef:=tcpusetdef;
+
+  { used tsym classes }
+  clabelsym:=tcpulabelsym;
+  cunitsym:=tcpuunitsym;
+  cnamespacesym:=tcpunamespacesym;
+  cprocsym:=tcpuprocsym;
+  ctypesym:=tcpuypesym;
+  cfieldvarsym:=tcpufieldvarsym;
+  clocalvarsym:=tcpulocalvarsym;
+  cparavarsym:=tcpuparavarsym;
+  cstaticvarsym:=tcpustaticvarsym;
+  cabsolutevarsym:=tcpuabsolutevarsym;
+  cpropertysym:=tcpupropertysym;
+  cconstsym:=tcpuconstsym;
+  cenumsym:=tcpuenumsym;
+  csyssym:=tcpusyssym;
+end.
+

+ 3 - 1
compiler/arm/cpunode.pas

@@ -41,7 +41,9 @@ unit cpunode;
        narmcnv,
        narmcnv,
        narmcon,
        narmcon,
        narmset,
        narmset,
-       narmmem
+       narmmem,
+       { symtable }
+       symcpu
        ;
        ;
 
 
 
 

+ 174 - 0
compiler/arm/symcpu.pas

@@ -0,0 +1,174 @@
+{
+    Copyright (c) 2014 by Florian Klaempfl
+
+    Symbol table overrides for ARM
+
+    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 symcpu;
+
+{$i fpcdefs.inc}
+
+interface
+
+uses
+  symdef,symsym;
+
+type
+  { defs }
+  tcpufiledef = class(tfiledef)
+  end;
+
+  tcpuvariantdef = class(tvariantdef)
+  end;
+
+  tcpuformaldef = class(tformaldef)
+  end;
+
+  tcpuforwarddef = class(tforwarddef)
+  end;
+
+  tcpuundefineddef = class(tundefineddef)
+  end;
+
+  tcpuerrordef = class(terrordef)
+  end;
+
+  tcpupointerdef = class(tpointerdef)
+  end;
+
+  tcpurecorddef = class(trecorddef)
+  end;
+
+  tcpuimplementedinterface = class(timplementedinterface)
+  end;
+
+  tcpuobjectdef = class(tobjectdef)
+  end;
+
+  tcpuclassrefdef = class(tclassrefdef)
+  end;
+
+  tcpuarraydef = class(tarraydef)
+  end;
+
+  tcpuorddef = class(torddef)
+  end;
+
+  tcpufloatdef = class(tfloatdef)
+  end;
+
+  tcpuprocvardef = class(tprocvardef)
+  end;
+
+  tcpuprocdef = class(tprocdef)
+  end;
+
+  tcpustringdef = class(tstringdef)
+  end;
+
+  tcpuenumdef = class(tenumdef)
+  end;
+
+  tcpusetdef = class(tsetdef)
+  end;
+
+  { syms }
+  tcpulabelsym = class(tlabelsym)
+  end;
+
+  tcpuunitsym = class(tunitsym)
+  end;
+
+  tcpunamespacesym = class(tnamespacesym)
+  end;
+
+  tcpuprocsym = class(tprocsym)
+  end;
+
+  tcpuypesym = class(ttypesym)
+  end;
+
+  tcpufieldvarsym = class(tfieldvarsym)
+  end;
+
+  tcpulocalvarsym = class(tlocalvarsym)
+  end;
+
+  tcpuparavarsym = class(tparavarsym)
+  end;
+
+  tcpustaticvarsym = class(tstaticvarsym)
+  end;
+
+  tcpuabsolutevarsym = class(tabsolutevarsym)
+  end;
+
+  tcpupropertysym = class(tpropertysym)
+  end;
+
+  tcpuconstsym = class(tconstsym)
+  end;
+
+  tcpuenumsym = class(tenumsym)
+  end;
+
+  tcpusyssym = class(tsyssym)
+  end;
+
+
+implementation
+
+begin
+  { used tdef classes }
+  cfiledef:=tcpufiledef;
+  cvariantdef:=tcpuvariantdef;
+  cformaldef:=tcpuformaldef;
+  cforwarddef:=tcpuforwarddef;
+  cundefineddef:=tcpuundefineddef;
+  cerrordef:=tcpuerrordef;
+  cpointerdef:=tcpupointerdef;
+  crecorddef:=tcpurecorddef;
+  cimplementedinterface:=tcpuimplementedinterface;
+  cobjectdef:=tcpuobjectdef;
+  cclassrefdef:=tcpuclassrefdef;
+  carraydef:=tcpuarraydef;
+  corddef:=tcpuorddef;
+  cfloatdef:=tcpufloatdef;
+  cprocvardef:=tcpuprocvardef;
+  cprocdef:=tcpuprocdef;
+  cstringdef:=tcpustringdef;
+  cenumdef:=tcpuenumdef;
+  csetdef:=tcpusetdef;
+
+  { used tsym classes }
+  clabelsym:=tcpulabelsym;
+  cunitsym:=tcpuunitsym;
+  cnamespacesym:=tcpunamespacesym;
+  cprocsym:=tcpuprocsym;
+  ctypesym:=tcpuypesym;
+  cfieldvarsym:=tcpufieldvarsym;
+  clocalvarsym:=tcpulocalvarsym;
+  cparavarsym:=tcpuparavarsym;
+  cstaticvarsym:=tcpustaticvarsym;
+  cabsolutevarsym:=tcpuabsolutevarsym;
+  cpropertysym:=tcpupropertysym;
+  cconstsym:=tcpuconstsym;
+  cenumsym:=tcpuenumsym;
+  csyssym:=tcpusyssym;
+end.
+

+ 3 - 1
compiler/avr/cpunode.pas

@@ -36,7 +36,9 @@ unit cpunode;
        }
        }
        ,navradd
        ,navradd
        ,navrmat
        ,navrmat
-       ,navrcnv
+       ,navrcnv,
+       { symtable }
+       symcpu
        ;
        ;
 
 
 
 

+ 174 - 0
compiler/avr/symcpu.pas

@@ -0,0 +1,174 @@
+{
+    Copyright (c) 2014 by Florian Klaempfl
+
+    Symbol table overrides for AVR
+
+    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 symcpu;
+
+{$i fpcdefs.inc}
+
+interface
+
+uses
+  symdef,symsym;
+
+type
+  { defs }
+  tcpufiledef = class(tfiledef)
+  end;
+
+  tcpuvariantdef = class(tvariantdef)
+  end;
+
+  tcpuformaldef = class(tformaldef)
+  end;
+
+  tcpuforwarddef = class(tforwarddef)
+  end;
+
+  tcpuundefineddef = class(tundefineddef)
+  end;
+
+  tcpuerrordef = class(terrordef)
+  end;
+
+  tcpupointerdef = class(tpointerdef)
+  end;
+
+  tcpurecorddef = class(trecorddef)
+  end;
+
+  tcpuimplementedinterface = class(timplementedinterface)
+  end;
+
+  tcpuobjectdef = class(tobjectdef)
+  end;
+
+  tcpuclassrefdef = class(tclassrefdef)
+  end;
+
+  tcpuarraydef = class(tarraydef)
+  end;
+
+  tcpuorddef = class(torddef)
+  end;
+
+  tcpufloatdef = class(tfloatdef)
+  end;
+
+  tcpuprocvardef = class(tprocvardef)
+  end;
+
+  tcpuprocdef = class(tprocdef)
+  end;
+
+  tcpustringdef = class(tstringdef)
+  end;
+
+  tcpuenumdef = class(tenumdef)
+  end;
+
+  tcpusetdef = class(tsetdef)
+  end;
+
+  { syms }
+  tcpulabelsym = class(tlabelsym)
+  end;
+
+  tcpuunitsym = class(tunitsym)
+  end;
+
+  tcpunamespacesym = class(tnamespacesym)
+  end;
+
+  tcpuprocsym = class(tprocsym)
+  end;
+
+  tcpuypesym = class(ttypesym)
+  end;
+
+  tcpufieldvarsym = class(tfieldvarsym)
+  end;
+
+  tcpulocalvarsym = class(tlocalvarsym)
+  end;
+
+  tcpuparavarsym = class(tparavarsym)
+  end;
+
+  tcpustaticvarsym = class(tstaticvarsym)
+  end;
+
+  tcpuabsolutevarsym = class(tabsolutevarsym)
+  end;
+
+  tcpupropertysym = class(tpropertysym)
+  end;
+
+  tcpuconstsym = class(tconstsym)
+  end;
+
+  tcpuenumsym = class(tenumsym)
+  end;
+
+  tcpusyssym = class(tsyssym)
+  end;
+
+
+implementation
+
+begin
+  { used tdef classes }
+  cfiledef:=tcpufiledef;
+  cvariantdef:=tcpuvariantdef;
+  cformaldef:=tcpuformaldef;
+  cforwarddef:=tcpuforwarddef;
+  cundefineddef:=tcpuundefineddef;
+  cerrordef:=tcpuerrordef;
+  cpointerdef:=tcpupointerdef;
+  crecorddef:=tcpurecorddef;
+  cimplementedinterface:=tcpuimplementedinterface;
+  cobjectdef:=tcpuobjectdef;
+  cclassrefdef:=tcpuclassrefdef;
+  carraydef:=tcpuarraydef;
+  corddef:=tcpuorddef;
+  cfloatdef:=tcpufloatdef;
+  cprocvardef:=tcpuprocvardef;
+  cprocdef:=tcpuprocdef;
+  cstringdef:=tcpustringdef;
+  cenumdef:=tcpuenumdef;
+  csetdef:=tcpusetdef;
+
+  { used tsym classes }
+  clabelsym:=tcpulabelsym;
+  cunitsym:=tcpuunitsym;
+  cnamespacesym:=tcpunamespacesym;
+  cprocsym:=tcpuprocsym;
+  ctypesym:=tcpuypesym;
+  cfieldvarsym:=tcpufieldvarsym;
+  clocalvarsym:=tcpulocalvarsym;
+  cparavarsym:=tcpuparavarsym;
+  cstaticvarsym:=tcpustaticvarsym;
+  cabsolutevarsym:=tcpuabsolutevarsym;
+  cpropertysym:=tcpupropertysym;
+  cconstsym:=tcpuconstsym;
+  cenumsym:=tcpuenumsym;
+  csyssym:=tcpusyssym;
+end.
+

+ 2 - 2
compiler/cg64f32.pas

@@ -863,7 +863,7 @@ unit cg64f32;
              { if the high dword = 0, the low dword can be considered a }
              { if the high dword = 0, the low dword can be considered a }
              { simple cardinal                                          }
              { simple cardinal                                          }
              cg.a_label(list,poslabel);
              cg.a_label(list,poslabel);
-             hdef:=torddef.create(u32bit,0,$ffffffff);
+             hdef:=corddef.create(u32bit,0,$ffffffff);
 
 
              location_copy(temploc,l);
              location_copy(temploc,l);
              temploc.size:=OS_32;
              temploc.size:=OS_32;
@@ -903,7 +903,7 @@ unit cg64f32;
                  { if we get here, the 64bit value lies between }
                  { if we get here, the 64bit value lies between }
                  { longint($80000000) and -1 (JM)               }
                  { longint($80000000) and -1 (JM)               }
                  cg.a_label(list,neglabel);
                  cg.a_label(list,neglabel);
-                 hdef:=torddef.create(s32bit,int64(longint($80000000)),int64(-1));
+                 hdef:=corddef.create(s32bit,int64(longint($80000000)),int64(-1));
                  location_copy(temploc,l);
                  location_copy(temploc,l);
                  temploc.size:=OS_32;
                  temploc.size:=OS_32;
                  hlcg.g_rangecheck(list,temploc,hdef,todef);
                  hlcg.g_rangecheck(list,temploc,hdef,todef);

+ 174 - 0
compiler/generic/symcpu.pas

@@ -0,0 +1,174 @@
+{
+    Copyright (c) 2014 by Florian Klaempfl
+
+    Symbol table overrides for <generic>
+
+    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 symcpu;
+
+{$i fpcdefs.inc}
+
+interface
+
+uses
+  symdef,symsym;
+
+type
+  { defs }
+  tcpufiledef = class(tfiledef)
+  end;
+
+  tcpuvariantdef = class(tvariantdef)
+  end;
+
+  tcpuformaldef = class(tformaldef)
+  end;
+
+  tcpuforwarddef = class(tforwarddef)
+  end;
+
+  tcpuundefineddef = class(tundefineddef)
+  end;
+
+  tcpuerrordef = class(terrordef)
+  end;
+
+  tcpupointerdef = class(tpointerdef)
+  end;
+
+  tcpurecorddef = class(trecorddef)
+  end;
+
+  tcpuimplementedinterface = class(timplementedinterface)
+  end;
+
+  tcpuobjectdef = class(tobjectdef)
+  end;
+
+  tcpuclassrefdef = class(tclassrefdef)
+  end;
+
+  tcpuarraydef = class(tarraydef)
+  end;
+
+  tcpuorddef = class(torddef)
+  end;
+
+  tcpufloatdef = class(tfloatdef)
+  end;
+
+  tcpuprocvardef = class(tprocvardef)
+  end;
+
+  tcpuprocdef = class(tprocdef)
+  end;
+
+  tcpustringdef = class(tstringdef)
+  end;
+
+  tcpuenumdef = class(tenumdef)
+  end;
+
+  tcpusetdef = class(tsetdef)
+  end;
+
+  { syms }
+  tcpulabelsym = class(tlabelsym)
+  end;
+
+  tcpuunitsym = class(tunitsym)
+  end;
+
+  tcpunamespacesym = class(tnamespacesym)
+  end;
+
+  tcpuprocsym = class(tprocsym)
+  end;
+
+  tcpuypesym = class(ttypesym)
+  end;
+
+  tcpufieldvarsym = class(tfieldvarsym)
+  end;
+
+  tcpulocalvarsym = class(tlocalvarsym)
+  end;
+
+  tcpuparavarsym = class(tparavarsym)
+  end;
+
+  tcpustaticvarsym = class(tstaticvarsym)
+  end;
+
+  tcpuabsolutevarsym = class(tabsolutevarsym)
+  end;
+
+  tcpupropertysym = class(tpropertysym)
+  end;
+
+  tcpuconstsym = class(tconstsym)
+  end;
+
+  tcpuenumsym = class(tenumsym)
+  end;
+
+  tcpusyssym = class(tsyssym)
+  end;
+
+
+implementation
+
+begin
+  { used tdef classes }
+  cfiledef:=tcpufiledef;
+  cvariantdef:=tcpuvariantdef;
+  cformaldef:=tcpuformaldef;
+  cforwarddef:=tcpuforwarddef;
+  cundefineddef:=tcpuundefineddef;
+  cerrordef:=tcpuerrordef;
+  cpointerdef:=tcpupointerdef;
+  crecorddef:=tcpurecorddef;
+  cimplementedinterface:=tcpuimplementedinterface;
+  cobjectdef:=tcpuobjectdef;
+  cclassrefdef:=tcpuclassrefdef;
+  carraydef:=tcpuarraydef;
+  corddef:=tcpuorddef;
+  cfloatdef:=tcpufloatdef;
+  cprocvardef:=tcpuprocvardef;
+  cprocdef:=tcpuprocdef;
+  cstringdef:=tcpustringdef;
+  cenumdef:=tcpuenumdef;
+  csetdef:=tcpusetdef;
+
+  { used tsym classes }
+  clabelsym:=tcpulabelsym;
+  cunitsym:=tcpuunitsym;
+  cnamespacesym:=tcpunamespacesym;
+  cprocsym:=tcpuprocsym;
+  ctypesym:=tcpuypesym;
+  cfieldvarsym:=tcpufieldvarsym;
+  clocalvarsym:=tcpulocalvarsym;
+  cparavarsym:=tcpuparavarsym;
+  cstaticvarsym:=tcpustaticvarsym;
+  cabsolutevarsym:=tcpuabsolutevarsym;
+  cpropertysym:=tcpupropertysym;
+  cconstsym:=tcpuconstsym;
+  cenumsym:=tcpuenumsym;
+  csyssym:=tcpusyssym;
+end.
+

+ 3 - 1
compiler/i386/cpunode.pas

@@ -57,7 +57,9 @@ unit cpunode;
 {$ifdef TEST_WIN32_SEH}
 {$ifdef TEST_WIN32_SEH}
        n386flw,
        n386flw,
 {$endif TEST_WIN32_SEH}
 {$endif TEST_WIN32_SEH}
-       n386mat
+       n386mat,
+       { symtable }
+       symcpu
        ;
        ;
 
 
 end.
 end.

+ 174 - 0
compiler/i386/symcpu.pas

@@ -0,0 +1,174 @@
+{
+    Copyright (c) 2014 by Florian Klaempfl
+
+    Symbol table overrides for i386
+
+    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 symcpu;
+
+{$i fpcdefs.inc}
+
+interface
+
+uses
+  symdef,symsym;
+
+type
+  { defs }
+  tcpufiledef = class(tfiledef)
+  end;
+
+  tcpuvariantdef = class(tvariantdef)
+  end;
+
+  tcpuformaldef = class(tformaldef)
+  end;
+
+  tcpuforwarddef = class(tforwarddef)
+  end;
+
+  tcpuundefineddef = class(tundefineddef)
+  end;
+
+  tcpuerrordef = class(terrordef)
+  end;
+
+  tcpupointerdef = class(tpointerdef)
+  end;
+
+  tcpurecorddef = class(trecorddef)
+  end;
+
+  tcpuimplementedinterface = class(timplementedinterface)
+  end;
+
+  tcpuobjectdef = class(tobjectdef)
+  end;
+
+  tcpuclassrefdef = class(tclassrefdef)
+  end;
+
+  tcpuarraydef = class(tarraydef)
+  end;
+
+  tcpuorddef = class(torddef)
+  end;
+
+  tcpufloatdef = class(tfloatdef)
+  end;
+
+  tcpuprocvardef = class(tprocvardef)
+  end;
+
+  tcpuprocdef = class(tprocdef)
+  end;
+
+  tcpustringdef = class(tstringdef)
+  end;
+
+  tcpuenumdef = class(tenumdef)
+  end;
+
+  tcpusetdef = class(tsetdef)
+  end;
+
+  { syms }
+  tcpulabelsym = class(tlabelsym)
+  end;
+
+  tcpuunitsym = class(tunitsym)
+  end;
+
+  tcpunamespacesym = class(tnamespacesym)
+  end;
+
+  tcpuprocsym = class(tprocsym)
+  end;
+
+  tcpuypesym = class(ttypesym)
+  end;
+
+  tcpufieldvarsym = class(tfieldvarsym)
+  end;
+
+  tcpulocalvarsym = class(tlocalvarsym)
+  end;
+
+  tcpuparavarsym = class(tparavarsym)
+  end;
+
+  tcpustaticvarsym = class(tstaticvarsym)
+  end;
+
+  tcpuabsolutevarsym = class(tabsolutevarsym)
+  end;
+
+  tcpupropertysym = class(tpropertysym)
+  end;
+
+  tcpuconstsym = class(tconstsym)
+  end;
+
+  tcpuenumsym = class(tenumsym)
+  end;
+
+  tcpusyssym = class(tsyssym)
+  end;
+
+
+implementation
+
+begin
+  { used tdef classes }
+  cfiledef:=tcpufiledef;
+  cvariantdef:=tcpuvariantdef;
+  cformaldef:=tcpuformaldef;
+  cforwarddef:=tcpuforwarddef;
+  cundefineddef:=tcpuundefineddef;
+  cerrordef:=tcpuerrordef;
+  cpointerdef:=tcpupointerdef;
+  crecorddef:=tcpurecorddef;
+  cimplementedinterface:=tcpuimplementedinterface;
+  cobjectdef:=tcpuobjectdef;
+  cclassrefdef:=tcpuclassrefdef;
+  carraydef:=tcpuarraydef;
+  corddef:=tcpuorddef;
+  cfloatdef:=tcpufloatdef;
+  cprocvardef:=tcpuprocvardef;
+  cprocdef:=tcpuprocdef;
+  cstringdef:=tcpustringdef;
+  cenumdef:=tcpuenumdef;
+  csetdef:=tcpusetdef;
+
+  { used tsym classes }
+  clabelsym:=tcpulabelsym;
+  cunitsym:=tcpuunitsym;
+  cnamespacesym:=tcpunamespacesym;
+  cprocsym:=tcpuprocsym;
+  ctypesym:=tcpuypesym;
+  cfieldvarsym:=tcpufieldvarsym;
+  clocalvarsym:=tcpulocalvarsym;
+  cparavarsym:=tcpuparavarsym;
+  cstaticvarsym:=tcpustaticvarsym;
+  cabsolutevarsym:=tcpuabsolutevarsym;
+  cpropertysym:=tcpupropertysym;
+  cconstsym:=tcpuconstsym;
+  cenumsym:=tcpuenumsym;
+  csyssym:=tcpusyssym;
+end.
+

+ 3 - 1
compiler/i8086/cpunode.pas

@@ -54,7 +54,9 @@ unit cpunode;
        n386set},
        n386set},
        n8086inl,
        n8086inl,
        n8086mat,
        n8086mat,
-       n8086con
+       n8086con,
+       { symtable }
+       symcpu
        ;
        ;
 
 
 end.
 end.

+ 174 - 0
compiler/i8086/symcpu.pas

@@ -0,0 +1,174 @@
+{
+    Copyright (c) 2014 by Florian Klaempfl
+
+    Symbol table overrides for i8086
+
+    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 symcpu;
+
+{$i fpcdefs.inc}
+
+interface
+
+uses
+  symdef,symsym;
+
+type
+  { defs }
+  tcpufiledef = class(tfiledef)
+  end;
+
+  tcpuvariantdef = class(tvariantdef)
+  end;
+
+  tcpuformaldef = class(tformaldef)
+  end;
+
+  tcpuforwarddef = class(tforwarddef)
+  end;
+
+  tcpuundefineddef = class(tundefineddef)
+  end;
+
+  tcpuerrordef = class(terrordef)
+  end;
+
+  tcpupointerdef = class(tpointerdef)
+  end;
+
+  tcpurecorddef = class(trecorddef)
+  end;
+
+  tcpuimplementedinterface = class(timplementedinterface)
+  end;
+
+  tcpuobjectdef = class(tobjectdef)
+  end;
+
+  tcpuclassrefdef = class(tclassrefdef)
+  end;
+
+  tcpuarraydef = class(tarraydef)
+  end;
+
+  tcpuorddef = class(torddef)
+  end;
+
+  tcpufloatdef = class(tfloatdef)
+  end;
+
+  tcpuprocvardef = class(tprocvardef)
+  end;
+
+  tcpuprocdef = class(tprocdef)
+  end;
+
+  tcpustringdef = class(tstringdef)
+  end;
+
+  tcpuenumdef = class(tenumdef)
+  end;
+
+  tcpusetdef = class(tsetdef)
+  end;
+
+  { syms }
+  tcpulabelsym = class(tlabelsym)
+  end;
+
+  tcpuunitsym = class(tunitsym)
+  end;
+
+  tcpunamespacesym = class(tnamespacesym)
+  end;
+
+  tcpuprocsym = class(tprocsym)
+  end;
+
+  tcpuypesym = class(ttypesym)
+  end;
+
+  tcpufieldvarsym = class(tfieldvarsym)
+  end;
+
+  tcpulocalvarsym = class(tlocalvarsym)
+  end;
+
+  tcpuparavarsym = class(tparavarsym)
+  end;
+
+  tcpustaticvarsym = class(tstaticvarsym)
+  end;
+
+  tcpuabsolutevarsym = class(tabsolutevarsym)
+  end;
+
+  tcpupropertysym = class(tpropertysym)
+  end;
+
+  tcpuconstsym = class(tconstsym)
+  end;
+
+  tcpuenumsym = class(tenumsym)
+  end;
+
+  tcpusyssym = class(tsyssym)
+  end;
+
+
+implementation
+
+begin
+  { used tdef classes }
+  cfiledef:=tcpufiledef;
+  cvariantdef:=tcpuvariantdef;
+  cformaldef:=tcpuformaldef;
+  cforwarddef:=tcpuforwarddef;
+  cundefineddef:=tcpuundefineddef;
+  cerrordef:=tcpuerrordef;
+  cpointerdef:=tcpupointerdef;
+  crecorddef:=tcpurecorddef;
+  cimplementedinterface:=tcpuimplementedinterface;
+  cobjectdef:=tcpuobjectdef;
+  cclassrefdef:=tcpuclassrefdef;
+  carraydef:=tcpuarraydef;
+  corddef:=tcpuorddef;
+  cfloatdef:=tcpufloatdef;
+  cprocvardef:=tcpuprocvardef;
+  cprocdef:=tcpuprocdef;
+  cstringdef:=tcpustringdef;
+  cenumdef:=tcpuenumdef;
+  csetdef:=tcpusetdef;
+
+  { used tsym classes }
+  clabelsym:=tcpulabelsym;
+  cunitsym:=tcpuunitsym;
+  cnamespacesym:=tcpunamespacesym;
+  cprocsym:=tcpuprocsym;
+  ctypesym:=tcpuypesym;
+  cfieldvarsym:=tcpufieldvarsym;
+  clocalvarsym:=tcpulocalvarsym;
+  cparavarsym:=tcpuparavarsym;
+  cstaticvarsym:=tcpustaticvarsym;
+  cabsolutevarsym:=tcpuabsolutevarsym;
+  cpropertysym:=tcpupropertysym;
+  cconstsym:=tcpuconstsym;
+  cenumsym:=tcpuenumsym;
+  csyssym:=tcpusyssym;
+end.
+

+ 174 - 0
compiler/ia64/symcpu.pas

@@ -0,0 +1,174 @@
+{
+    Copyright (c) 2014 by Florian Klaempfl
+
+    Symbol table overrides for IA64
+
+    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 symcpu;
+
+{$i fpcdefs.inc}
+
+interface
+
+uses
+  symdef,symsym;
+
+type
+  { defs }
+  tcpufiledef = class(tfiledef)
+  end;
+
+  tcpuvariantdef = class(tvariantdef)
+  end;
+
+  tcpuformaldef = class(tformaldef)
+  end;
+
+  tcpuforwarddef = class(tforwarddef)
+  end;
+
+  tcpuundefineddef = class(tundefineddef)
+  end;
+
+  tcpuerrordef = class(terrordef)
+  end;
+
+  tcpupointerdef = class(tpointerdef)
+  end;
+
+  tcpurecorddef = class(trecorddef)
+  end;
+
+  tcpuimplementedinterface = class(timplementedinterface)
+  end;
+
+  tcpuobjectdef = class(tobjectdef)
+  end;
+
+  tcpuclassrefdef = class(tclassrefdef)
+  end;
+
+  tcpuarraydef = class(tarraydef)
+  end;
+
+  tcpuorddef = class(torddef)
+  end;
+
+  tcpufloatdef = class(tfloatdef)
+  end;
+
+  tcpuprocvardef = class(tprocvardef)
+  end;
+
+  tcpuprocdef = class(tprocdef)
+  end;
+
+  tcpustringdef = class(tstringdef)
+  end;
+
+  tcpuenumdef = class(tenumdef)
+  end;
+
+  tcpusetdef = class(tsetdef)
+  end;
+
+  { syms }
+  tcpulabelsym = class(tlabelsym)
+  end;
+
+  tcpuunitsym = class(tunitsym)
+  end;
+
+  tcpunamespacesym = class(tnamespacesym)
+  end;
+
+  tcpuprocsym = class(tprocsym)
+  end;
+
+  tcpuypesym = class(ttypesym)
+  end;
+
+  tcpufieldvarsym = class(tfieldvarsym)
+  end;
+
+  tcpulocalvarsym = class(tlocalvarsym)
+  end;
+
+  tcpuparavarsym = class(tparavarsym)
+  end;
+
+  tcpustaticvarsym = class(tstaticvarsym)
+  end;
+
+  tcpuabsolutevarsym = class(tabsolutevarsym)
+  end;
+
+  tcpupropertysym = class(tpropertysym)
+  end;
+
+  tcpuconstsym = class(tconstsym)
+  end;
+
+  tcpuenumsym = class(tenumsym)
+  end;
+
+  tcpusyssym = class(tsyssym)
+  end;
+
+
+implementation
+
+begin
+  { used tdef classes }
+  cfiledef:=tcpufiledef;
+  cvariantdef:=tcpuvariantdef;
+  cformaldef:=tcpuformaldef;
+  cforwarddef:=tcpuforwarddef;
+  cundefineddef:=tcpuundefineddef;
+  cerrordef:=tcpuerrordef;
+  cpointerdef:=tcpupointerdef;
+  crecorddef:=tcpurecorddef;
+  cimplementedinterface:=tcpuimplementedinterface;
+  cobjectdef:=tcpuobjectdef;
+  cclassrefdef:=tcpuclassrefdef;
+  carraydef:=tcpuarraydef;
+  corddef:=tcpuorddef;
+  cfloatdef:=tcpufloatdef;
+  cprocvardef:=tcpuprocvardef;
+  cprocdef:=tcpuprocdef;
+  cstringdef:=tcpustringdef;
+  cenumdef:=tcpuenumdef;
+  csetdef:=tcpusetdef;
+
+  { used tsym classes }
+  clabelsym:=tcpulabelsym;
+  cunitsym:=tcpuunitsym;
+  cnamespacesym:=tcpunamespacesym;
+  cprocsym:=tcpuprocsym;
+  ctypesym:=tcpuypesym;
+  cfieldvarsym:=tcpufieldvarsym;
+  clocalvarsym:=tcpulocalvarsym;
+  cparavarsym:=tcpuparavarsym;
+  cstaticvarsym:=tcpustaticvarsym;
+  cabsolutevarsym:=tcpuabsolutevarsym;
+  cpropertysym:=tcpupropertysym;
+  cconstsym:=tcpuconstsym;
+  cenumsym:=tcpuenumsym;
+  csyssym:=tcpusyssym;
+end.
+

+ 3 - 1
compiler/jvm/cpunode.pas

@@ -35,6 +35,8 @@ implementation
     njvmadd,njvmcal,njvmmat,njvmcnv,njvmcon,njvminl,njvmmem,njvmflw,njvmld,
     njvmadd,njvmcal,njvmmat,njvmcnv,njvmcon,njvminl,njvmmem,njvmflw,njvmld,
     njvmset,njvmvmt
     njvmset,njvmvmt
     { these are not really nodes }
     { these are not really nodes }
-    ,rgcpu,tgcpu,njvmutil,njvmtcon;
+    ,rgcpu,tgcpu,njvmutil,njvmtcon,
+    { symtable }
+    symcpu;
 
 
 end.
 end.

+ 1 - 1
compiler/jvm/njvmcon.pas

@@ -445,7 +445,7 @@ implementation
         { add a read-only typed constant }
         { add a read-only typed constant }
         new(ps);
         new(ps);
         ps^:=value_set^;
         ps^:=value_set^;
-        csym:=tconstsym.create_ptr('_$setconst'+tostr(current_module.symlist.count),constset,ps,resultdef);
+        csym:=cconstsym.create_ptr('_$setconst'+tostr(current_module.symlist.count),constset,ps,resultdef);
         csym.visibility:=vis_private;
         csym.visibility:=vis_private;
         include(csym.symoptions,sp_internal);
         include(csym.symoptions,sp_internal);
         current_module.localsymtable.insert(csym);
         current_module.localsymtable.insert(csym);

+ 2 - 2
compiler/jvm/njvmutil.pas

@@ -197,7 +197,7 @@ implementation
         java.lang.ThreadLocal class which will wrap the actual variable value }
         java.lang.ThreadLocal class which will wrap the actual variable value }
       if vo_is_thread_var in sym.varoptions then
       if vo_is_thread_var in sym.varoptions then
         begin
         begin
-          vs:=tstaticvarsym.create(sym.realname+'$threadvar',sym.varspez,
+          vs:=cstaticvarsym.create(sym.realname+'$threadvar',sym.varspez,
             jvmgetthreadvardef(sym.vardef),
             jvmgetthreadvardef(sym.vardef),
             sym.varoptions - [vo_is_thread_var]);
             sym.varoptions - [vo_is_thread_var]);
           sym.owner.insert(vs);
           sym.owner.insert(vs);
@@ -467,7 +467,7 @@ implementation
       if (tprocdef(pd).proctypeoption=potype_proginit) then
       if (tprocdef(pd).proctypeoption=potype_proginit) then
         begin
         begin
           { add the args parameter }
           { add the args parameter }
-          pvs:=tparavarsym.create('$args',1,vs_const,search_system_type('TJSTRINGARRAY').typedef,[]);
+          pvs:=cparavarsym.create('$args',1,vs_const,search_system_type('TJSTRINGARRAY').typedef,[]);
           tprocdef(pd).parast.insert(pvs);
           tprocdef(pd).parast.insert(pvs);
           tprocdef(pd).calcparas;
           tprocdef(pd).calcparas;
         end;
         end;

+ 25 - 25
compiler/jvm/pjvm.pas

@@ -131,7 +131,7 @@ implementation
               end;
               end;
             if not assigned(sym) then
             if not assigned(sym) then
               begin
               begin
-                ps:=tprocsym.create('Create');
+                ps:=cprocsym.create('Create');
                 obj.symtable.insert(ps);
                 obj.symtable.insert(ps);
               end;
               end;
             { determine symtable level }
             { determine symtable level }
@@ -139,7 +139,7 @@ implementation
             while not(topowner.owner.symtabletype in [staticsymtable,globalsymtable]) do
             while not(topowner.owner.symtabletype in [staticsymtable,globalsymtable]) do
               topowner:=topowner.owner.defowner;
               topowner:=topowner.owner.defowner;
             { create procdef }
             { create procdef }
-            pd:=tprocdef.create(topowner.owner.symtablelevel+1);
+            pd:=cprocdef.create(topowner.owner.symtablelevel+1);
             if df_generic in obj.defoptions then
             if df_generic in obj.defoptions then
               include(pd.defoptions,df_generic);
               include(pd.defoptions,df_generic);
             { method of this objectdef }
             { method of this objectdef }
@@ -304,7 +304,7 @@ implementation
         { create new class (different internal name than enum to prevent name
         { create new class (different internal name than enum to prevent name
           clash; at unit level because we don't want its methods to be nested
           clash; at unit level because we don't want its methods to be nested
           inside a function in case its a local type) }
           inside a function in case its a local type) }
-        enumclass:=tobjectdef.create(odt_javaclass,'$'+current_module.realmodulename^+'$'+name+'$InternEnum$'+tostr(def.defid),java_jlenum);
+        enumclass:=cobjectdef.create(odt_javaclass,'$'+current_module.realmodulename^+'$'+name+'$InternEnum$'+tostr(def.defid),java_jlenum);
         tenumdef(def).classdef:=enumclass;
         tenumdef(def).classdef:=enumclass;
         include(enumclass.objectoptions,oo_is_enum_class);
         include(enumclass.objectoptions,oo_is_enum_class);
         include(enumclass.objectoptions,oo_is_sealed);
         include(enumclass.objectoptions,oo_is_sealed);
@@ -314,11 +314,11 @@ implementation
           name that can be used in generated Pascal code without risking an
           name that can be used in generated Pascal code without risking an
           identifier conflict (since it is local to this class; the global name
           identifier conflict (since it is local to this class; the global name
           is unique because it's an identifier that contains $-signs) }
           is unique because it's an identifier that contains $-signs) }
-        enumclass.symtable.insert(ttypesym.create('__FPC_TEnumClassAlias',enumclass));
+        enumclass.symtable.insert(ctypesym.create('__FPC_TEnumClassAlias',enumclass));
 
 
         { also create an alias for the enum type so that we can iterate over
         { also create an alias for the enum type so that we can iterate over
           all enum values when creating the body of the class constructor }
           all enum values when creating the body of the class constructor }
-        temptypesym:=ttypesym.create('__FPC_TEnumAlias',nil);
+        temptypesym:=ctypesym.create('__FPC_TEnumAlias',nil);
         { don't pass def to the ttypesym constructor, because then it
         { don't pass def to the ttypesym constructor, because then it
           will replace the current (real) typesym of that def with the alias }
           will replace the current (real) typesym of that def with the alias }
         temptypesym.typedef:=def;
         temptypesym.typedef:=def;
@@ -350,23 +350,23 @@ implementation
         { create static fields representing all enums }
         { create static fields representing all enums }
         for i:=0 to tenumdef(def).symtable.symlist.count-1 do
         for i:=0 to tenumdef(def).symtable.symlist.count-1 do
           begin
           begin
-            fsym:=tfieldvarsym.create(tenumsym(tenumdef(def).symtable.symlist[i]).realname,vs_final,enumclass,[]);
+            fsym:=cfieldvarsym.create(tenumsym(tenumdef(def).symtable.symlist[i]).realname,vs_final,enumclass,[]);
             enumclass.symtable.insert(fsym);
             enumclass.symtable.insert(fsym);
             sym:=make_field_static(enumclass.symtable,fsym);
             sym:=make_field_static(enumclass.symtable,fsym);
             { add alias for the field representing ordinal(0), for use in
             { add alias for the field representing ordinal(0), for use in
               initialization code }
               initialization code }
             if tenumsym(tenumdef(def).symtable.symlist[i]).value=0 then
             if tenumsym(tenumdef(def).symtable.symlist[i]).value=0 then
               begin
               begin
-                aliassym:=tstaticvarsym.create('__FPC_Zero_Initializer',vs_final,enumclass,[vo_is_external]);
+                aliassym:=cstaticvarsym.create('__FPC_Zero_Initializer',vs_final,enumclass,[vo_is_external]);
                 enumclass.symtable.insert(aliassym);
                 enumclass.symtable.insert(aliassym);
                 aliassym.set_raw_mangledname(sym.mangledname);
                 aliassym.set_raw_mangledname(sym.mangledname);
               end;
               end;
           end;
           end;
         { create local "array of enumtype" type for the "values" functionality
         { create local "array of enumtype" type for the "values" functionality
           (used internally by the JDK) }
           (used internally by the JDK) }
-        arrdef:=tarraydef.create(0,tenumdef(def).symtable.symlist.count-1,s32inttype);
+        arrdef:=carraydef.create(0,tenumdef(def).symtable.symlist.count-1,s32inttype);
         arrdef.elementdef:=enumclass;
         arrdef.elementdef:=enumclass;
-        arrsym:=ttypesym.create('__FPC_TEnumValues',arrdef);
+        arrsym:=ctypesym.create('__FPC_TEnumValues',arrdef);
         enumclass.symtable.insert(arrsym);
         enumclass.symtable.insert(arrsym);
         { insert "public static values: array of enumclass" that returns $VALUES.clone()
         { insert "public static values: array of enumclass" that returns $VALUES.clone()
           (rather than a dynamic array and using clone --which we don't support yet for arrays--
           (rather than a dynamic array and using clone --which we don't support yet for arrays--
@@ -380,12 +380,12 @@ implementation
         if tenumdef(def).has_jumps then
         if tenumdef(def).has_jumps then
           begin
           begin
             { add field for the value }
             { add field for the value }
-            fsym:=tfieldvarsym.create('__fpc_fenumval',vs_final,s32inttype,[]);
+            fsym:=cfieldvarsym.create('__fpc_fenumval',vs_final,s32inttype,[]);
             enumclass.symtable.insert(fsym);
             enumclass.symtable.insert(fsym);
             tobjectsymtable(enumclass.symtable).addfield(fsym,vis_strictprivate);
             tobjectsymtable(enumclass.symtable).addfield(fsym,vis_strictprivate);
             { add class field with hash table that maps from FPC-declared ordinal value -> enum instance }
             { add class field with hash table that maps from FPC-declared ordinal value -> enum instance }
             juhashmap:=search_system_type('JUHASHMAP').typedef;
             juhashmap:=search_system_type('JUHASHMAP').typedef;
-            fsym:=tfieldvarsym.create('__fpc_ord2enum',vs_final,juhashmap,[]);
+            fsym:=cfieldvarsym.create('__fpc_ord2enum',vs_final,juhashmap,[]);
             enumclass.symtable.insert(fsym);
             enumclass.symtable.insert(fsym);
             make_field_static(enumclass.symtable,fsym);
             make_field_static(enumclass.symtable,fsym);
             { add custom constructor }
             { add custom constructor }
@@ -442,14 +442,14 @@ implementation
           "Values" instance method -- that's also the reason why we insert the
           "Values" instance method -- that's also the reason why we insert the
           field only now, because we cannot disable duplicate identifier
           field only now, because we cannot disable duplicate identifier
           checking when creating the "Values" method }
           checking when creating the "Values" method }
-        fsym:=tfieldvarsym.create('$VALUES',vs_final,arrdef,[]);
+        fsym:=cfieldvarsym.create('$VALUES',vs_final,arrdef,[]);
         fsym.visibility:=vis_strictprivate;
         fsym.visibility:=vis_strictprivate;
         enumclass.symtable.insert(fsym,false);
         enumclass.symtable.insert(fsym,false);
         sym:=make_field_static(enumclass.symtable,fsym);
         sym:=make_field_static(enumclass.symtable,fsym);
         { alias for accessing the field in generated Pascal code }
         { alias for accessing the field in generated Pascal code }
         sl:=tpropaccesslist.create;
         sl:=tpropaccesslist.create;
         sl.addsym(sl_load,sym);
         sl.addsym(sl_load,sym);
-        enumclass.symtable.insert(tabsolutevarsym.create_ref('__fpc_FVALUES',arrdef,sl));
+        enumclass.symtable.insert(cabsolutevarsym.create_ref('__fpc_FVALUES',arrdef,sl));
         { add initialization of the static class fields created above }
         { add initialization of the static class fields created above }
         if not str_parse_method_dec('constructor fpc_enum_class_constructor;',potype_class_constructor,true,enumclass,pd) then
         if not str_parse_method_dec('constructor fpc_enum_class_constructor;',potype_class_constructor,true,enumclass,pd) then
           internalerror(2011062303);
           internalerror(2011062303);
@@ -489,13 +489,13 @@ implementation
         { create new class (different internal name than pvar to prevent name
         { create new class (different internal name than pvar to prevent name
           clash; at unit level because we don't want its methods to be nested
           clash; at unit level because we don't want its methods to be nested
           inside a function in case its a local type) }
           inside a function in case its a local type) }
-        pvclass:=tobjectdef.create(odt_javaclass,'$'+current_module.realmodulename^+'$'+name+'$InternProcvar$'+tostr(def.defid),java_procvarbase);
+        pvclass:=cobjectdef.create(odt_javaclass,'$'+current_module.realmodulename^+'$'+name+'$InternProcvar$'+tostr(def.defid),java_procvarbase);
         tprocvardef(def).classdef:=pvclass;
         tprocvardef(def).classdef:=pvclass;
         include(pvclass.objectoptions,oo_is_sealed);
         include(pvclass.objectoptions,oo_is_sealed);
         if df_generic in def.defoptions then
         if df_generic in def.defoptions then
           include(pvclass.defoptions,df_generic);
           include(pvclass.defoptions,df_generic);
         { associate typesym }
         { associate typesym }
-        pvclass.symtable.insert(ttypesym.create('__FPC_TProcVarClassAlias',pvclass));
+        pvclass.symtable.insert(ctypesym.create('__FPC_TProcVarClassAlias',pvclass));
         { set external name to match procvar type name }
         { set external name to match procvar type name }
         if not islocal then
         if not islocal then
           pvclass.objextname:=stringdup(name)
           pvclass.objextname:=stringdup(name)
@@ -517,7 +517,7 @@ implementation
 
 
         { add local alias for the procvartype that we can use when implementing
         { add local alias for the procvartype that we can use when implementing
           the invoke method }
           the invoke method }
-        temptypesym:=ttypesym.create('__FPC_ProcVarAlias',nil);
+        temptypesym:=ctypesym.create('__FPC_ProcVarAlias',nil);
         { don't pass def to the ttypesym constructor, because then it
         { don't pass def to the ttypesym constructor, because then it
           will replace the current (real) typesym of that def with the alias }
           will replace the current (real) typesym of that def with the alias }
         temptypesym.typedef:=def;
         temptypesym.typedef:=def;
@@ -533,12 +533,12 @@ implementation
            not islocal and
            not islocal and
            not force_no_callback_intf then
            not force_no_callback_intf then
           begin
           begin
-            pvintf:=tobjectdef.create(odt_interfacejava,'Callback',nil);
+            pvintf:=cobjectdef.create(odt_interfacejava,'Callback',nil);
             pvintf.objextname:=stringdup('Callback');
             pvintf.objextname:=stringdup('Callback');
             if df_generic in def.defoptions then
             if df_generic in def.defoptions then
               include(pvintf.defoptions,df_generic);
               include(pvintf.defoptions,df_generic);
             { associate typesym }
             { associate typesym }
-            pvclass.symtable.insert(ttypesym.create('Callback',pvintf));
+            pvclass.symtable.insert(ctypesym.create('Callback',pvintf));
 
 
             { add a method prototype matching the procvar (like the invoke
             { add a method prototype matching the procvar (like the invoke
               in the procvarclass itself) }
               in the procvarclass itself) }
@@ -648,7 +648,7 @@ implementation
         jvm_create_procvar_class_intern('__fpc_virtualclassmethod_pv_t'+tostr(wrapperpd.defid),wrapperpv,true);
         jvm_create_procvar_class_intern('__fpc_virtualclassmethod_pv_t'+tostr(wrapperpd.defid),wrapperpv,true);
         { create alias for the procvar type so we can use it in generated
         { create alias for the procvar type so we can use it in generated
           Pascal code }
           Pascal code }
-        typ:=ttypesym.create('__fpc_virtualclassmethod_pv_t'+tostr(wrapperpd.defid),wrapperpv);
+        typ:=ctypesym.create('__fpc_virtualclassmethod_pv_t'+tostr(wrapperpd.defid),wrapperpv);
         wrapperpv.classdef.typesym.visibility:=vis_strictprivate;
         wrapperpv.classdef.typesym.visibility:=vis_strictprivate;
         symtablestack.top.insert(typ);
         symtablestack.top.insert(typ);
         symtablestack.pop(pd.owner);
         symtablestack.pop(pd.owner);
@@ -741,7 +741,7 @@ implementation
             begin
             begin
               { make sure we don't emit a definition for this field (we'll do
               { make sure we don't emit a definition for this field (we'll do
                 that for the constsym already) -> mark as external }
                 that for the constsym already) -> mark as external }
-              ssym:=tstaticvarsym.create(internal_static_field_name(csym.realname),vs_final,csym.constdef,[vo_is_external]);
+              ssym:=cstaticvarsym.create(internal_static_field_name(csym.realname),vs_final,csym.constdef,[vo_is_external]);
               csym.owner.insert(ssym);
               csym.owner.insert(ssym);
               { alias storage to the constsym }
               { alias storage to the constsym }
               ssym.set_mangledname(csym.realname);
               ssym.set_mangledname(csym.realname);
@@ -779,7 +779,7 @@ implementation
                 has been compiler -> insert a copy in the unit's staticsymtable
                 has been compiler -> insert a copy in the unit's staticsymtable
               }
               }
               symtablestack.push(current_module.localsymtable);
               symtablestack.push(current_module.localsymtable);
-              ssym:=tstaticvarsym.create(internal_static_field_name(csym.realname),vs_final,tsetdef(csym.constdef).getcopy,[vo_is_external,vo_has_local_copy]);
+              ssym:=cstaticvarsym.create(internal_static_field_name(csym.realname),vs_final,tsetdef(csym.constdef).getcopy,[vo_is_external,vo_has_local_copy]);
               symtablestack.top.insert(ssym);
               symtablestack.top.insert(ssym);
               symtablestack.pop(current_module.localsymtable);
               symtablestack.pop(current_module.localsymtable);
               { alias storage to the constsym }
               { alias storage to the constsym }
@@ -998,7 +998,7 @@ implementation
           { create procdef }
           { create procdef }
           if not assigned(orgaccesspd) then
           if not assigned(orgaccesspd) then
             begin
             begin
-              pd:=tprocdef.create(normal_function_level);
+              pd:=cprocdef.create(normal_function_level);
               if df_generic in obj.defoptions then
               if df_generic in obj.defoptions then
                 include(pd.defoptions,df_generic);
                 include(pd.defoptions,df_generic);
               { method of this objectdef }
               { method of this objectdef }
@@ -1030,7 +1030,7 @@ implementation
           if not assigned(sym) or
           if not assigned(sym) or
              (sym.owner<>p.owner)  then
              (sym.owner<>p.owner)  then
             begin
             begin
-              ps:=tprocsym.create(name);
+              ps:=cprocsym.create(name);
               obj.symtable.insert(ps);
               obj.symtable.insert(ps);
             end
             end
           else
           else
@@ -1060,7 +1060,7 @@ implementation
               if not assigned(orgaccesspd) then
               if not assigned(orgaccesspd) then
                 begin
                 begin
                   { parameter with value to set }
                   { parameter with value to set }
-                  pvs:=tparavarsym.create('__fpc_newval__',10,vs_const,p.propdef,[]);
+                  pvs:=cparavarsym.create('__fpc_newval__',10,vs_const,p.propdef,[]);
                   pd.parast.insert(pvs);
                   pd.parast.insert(pvs);
                 end;
                 end;
               if (ppo_hasparameters in p.propoptions) and
               if (ppo_hasparameters in p.propoptions) and
@@ -1076,7 +1076,7 @@ implementation
             callthroughpropname:=callthroughpropname+'__getter_wrapper'
             callthroughpropname:=callthroughpropname+'__getter_wrapper'
           else
           else
             callthroughpropname:=callthroughpropname+'__setter_wrapper';
             callthroughpropname:=callthroughpropname+'__setter_wrapper';
-          callthroughprop:=tpropertysym.create(callthroughpropname);
+          callthroughprop:=cpropertysym.create(callthroughpropname);
           callthroughprop.visibility:=p.visibility;
           callthroughprop.visibility:=p.visibility;
 
 
           if getter then
           if getter then

+ 174 - 0
compiler/jvm/symcpu.pas

@@ -0,0 +1,174 @@
+{
+    Copyright (c) 2014 by Florian Klaempfl
+
+    Symbol table overrides for JVM
+
+    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 symcpu;
+
+{$i fpcdefs.inc}
+
+interface
+
+uses
+  symdef,symsym;
+
+type
+  { defs }
+  tcpufiledef = class(tfiledef)
+  end;
+
+  tcpuvariantdef = class(tvariantdef)
+  end;
+
+  tcpuformaldef = class(tformaldef)
+  end;
+
+  tcpuforwarddef = class(tforwarddef)
+  end;
+
+  tcpuundefineddef = class(tundefineddef)
+  end;
+
+  tcpuerrordef = class(terrordef)
+  end;
+
+  tcpupointerdef = class(tpointerdef)
+  end;
+
+  tcpurecorddef = class(trecorddef)
+  end;
+
+  tcpuimplementedinterface = class(timplementedinterface)
+  end;
+
+  tcpuobjectdef = class(tobjectdef)
+  end;
+
+  tcpuclassrefdef = class(tclassrefdef)
+  end;
+
+  tcpuarraydef = class(tarraydef)
+  end;
+
+  tcpuorddef = class(torddef)
+  end;
+
+  tcpufloatdef = class(tfloatdef)
+  end;
+
+  tcpuprocvardef = class(tprocvardef)
+  end;
+
+  tcpuprocdef = class(tprocdef)
+  end;
+
+  tcpustringdef = class(tstringdef)
+  end;
+
+  tcpuenumdef = class(tenumdef)
+  end;
+
+  tcpusetdef = class(tsetdef)
+  end;
+
+  { syms }
+  tcpulabelsym = class(tlabelsym)
+  end;
+
+  tcpuunitsym = class(tunitsym)
+  end;
+
+  tcpunamespacesym = class(tnamespacesym)
+  end;
+
+  tcpuprocsym = class(tprocsym)
+  end;
+
+  tcpuypesym = class(ttypesym)
+  end;
+
+  tcpufieldvarsym = class(tfieldvarsym)
+  end;
+
+  tcpulocalvarsym = class(tlocalvarsym)
+  end;
+
+  tcpuparavarsym = class(tparavarsym)
+  end;
+
+  tcpustaticvarsym = class(tstaticvarsym)
+  end;
+
+  tcpuabsolutevarsym = class(tabsolutevarsym)
+  end;
+
+  tcpupropertysym = class(tpropertysym)
+  end;
+
+  tcpuconstsym = class(tconstsym)
+  end;
+
+  tcpuenumsym = class(tenumsym)
+  end;
+
+  tcpusyssym = class(tsyssym)
+  end;
+
+
+implementation
+
+begin
+  { used tdef classes }
+  cfiledef:=tcpufiledef;
+  cvariantdef:=tcpuvariantdef;
+  cformaldef:=tcpuformaldef;
+  cforwarddef:=tcpuforwarddef;
+  cundefineddef:=tcpuundefineddef;
+  cerrordef:=tcpuerrordef;
+  cpointerdef:=tcpupointerdef;
+  crecorddef:=tcpurecorddef;
+  cimplementedinterface:=tcpuimplementedinterface;
+  cobjectdef:=tcpuobjectdef;
+  cclassrefdef:=tcpuclassrefdef;
+  carraydef:=tcpuarraydef;
+  corddef:=tcpuorddef;
+  cfloatdef:=tcpufloatdef;
+  cprocvardef:=tcpuprocvardef;
+  cprocdef:=tcpuprocdef;
+  cstringdef:=tcpustringdef;
+  cenumdef:=tcpuenumdef;
+  csetdef:=tcpusetdef;
+
+  { used tsym classes }
+  clabelsym:=tcpulabelsym;
+  cunitsym:=tcpuunitsym;
+  cnamespacesym:=tcpunamespacesym;
+  cprocsym:=tcpuprocsym;
+  ctypesym:=tcpuypesym;
+  cfieldvarsym:=tcpufieldvarsym;
+  clocalvarsym:=tcpulocalvarsym;
+  cparavarsym:=tcpuparavarsym;
+  cstaticvarsym:=tcpustaticvarsym;
+  cabsolutevarsym:=tcpuabsolutevarsym;
+  cpropertysym:=tcpupropertysym;
+  cconstsym:=tcpuconstsym;
+  cenumsym:=tcpuenumsym;
+  csyssym:=tcpusyssym;
+end.
+

+ 4 - 2
compiler/m68k/cpunode.pas

@@ -46,7 +46,9 @@ unit cpunode;
 //       nppcobj,
 //       nppcobj,
 //       nppcmat,
 //       nppcmat,
          n68kmat,
          n68kmat,
-         n68kcnv
-       ;
+         n68kcnv,
+         { symtable }
+         symcpu
+         ;
 
 
 end.
 end.

+ 174 - 0
compiler/m68k/symcpu.pas

@@ -0,0 +1,174 @@
+{
+    Copyright (c) 2014 by Florian Klaempfl
+
+    Symbol table overrides for m68k
+
+    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 symcpu;
+
+{$i fpcdefs.inc}
+
+interface
+
+uses
+  symdef,symsym;
+
+type
+  { defs }
+  tcpufiledef = class(tfiledef)
+  end;
+
+  tcpuvariantdef = class(tvariantdef)
+  end;
+
+  tcpuformaldef = class(tformaldef)
+  end;
+
+  tcpuforwarddef = class(tforwarddef)
+  end;
+
+  tcpuundefineddef = class(tundefineddef)
+  end;
+
+  tcpuerrordef = class(terrordef)
+  end;
+
+  tcpupointerdef = class(tpointerdef)
+  end;
+
+  tcpurecorddef = class(trecorddef)
+  end;
+
+  tcpuimplementedinterface = class(timplementedinterface)
+  end;
+
+  tcpuobjectdef = class(tobjectdef)
+  end;
+
+  tcpuclassrefdef = class(tclassrefdef)
+  end;
+
+  tcpuarraydef = class(tarraydef)
+  end;
+
+  tcpuorddef = class(torddef)
+  end;
+
+  tcpufloatdef = class(tfloatdef)
+  end;
+
+  tcpuprocvardef = class(tprocvardef)
+  end;
+
+  tcpuprocdef = class(tprocdef)
+  end;
+
+  tcpustringdef = class(tstringdef)
+  end;
+
+  tcpuenumdef = class(tenumdef)
+  end;
+
+  tcpusetdef = class(tsetdef)
+  end;
+
+  { syms }
+  tcpulabelsym = class(tlabelsym)
+  end;
+
+  tcpuunitsym = class(tunitsym)
+  end;
+
+  tcpunamespacesym = class(tnamespacesym)
+  end;
+
+  tcpuprocsym = class(tprocsym)
+  end;
+
+  tcpuypesym = class(ttypesym)
+  end;
+
+  tcpufieldvarsym = class(tfieldvarsym)
+  end;
+
+  tcpulocalvarsym = class(tlocalvarsym)
+  end;
+
+  tcpuparavarsym = class(tparavarsym)
+  end;
+
+  tcpustaticvarsym = class(tstaticvarsym)
+  end;
+
+  tcpuabsolutevarsym = class(tabsolutevarsym)
+  end;
+
+  tcpupropertysym = class(tpropertysym)
+  end;
+
+  tcpuconstsym = class(tconstsym)
+  end;
+
+  tcpuenumsym = class(tenumsym)
+  end;
+
+  tcpusyssym = class(tsyssym)
+  end;
+
+
+implementation
+
+begin
+  { used tdef classes }
+  cfiledef:=tcpufiledef;
+  cvariantdef:=tcpuvariantdef;
+  cformaldef:=tcpuformaldef;
+  cforwarddef:=tcpuforwarddef;
+  cundefineddef:=tcpuundefineddef;
+  cerrordef:=tcpuerrordef;
+  cpointerdef:=tcpupointerdef;
+  crecorddef:=tcpurecorddef;
+  cimplementedinterface:=tcpuimplementedinterface;
+  cobjectdef:=tcpuobjectdef;
+  cclassrefdef:=tcpuclassrefdef;
+  carraydef:=tcpuarraydef;
+  corddef:=tcpuorddef;
+  cfloatdef:=tcpufloatdef;
+  cprocvardef:=tcpuprocvardef;
+  cprocdef:=tcpuprocdef;
+  cstringdef:=tcpustringdef;
+  cenumdef:=tcpuenumdef;
+  csetdef:=tcpusetdef;
+
+  { used tsym classes }
+  clabelsym:=tcpulabelsym;
+  cunitsym:=tcpuunitsym;
+  cnamespacesym:=tcpunamespacesym;
+  cprocsym:=tcpuprocsym;
+  ctypesym:=tcpuypesym;
+  cfieldvarsym:=tcpufieldvarsym;
+  clocalvarsym:=tcpulocalvarsym;
+  cparavarsym:=tcpuparavarsym;
+  cstaticvarsym:=tcpustaticvarsym;
+  cabsolutevarsym:=tcpuabsolutevarsym;
+  cpropertysym:=tcpupropertysym;
+  cconstsym:=tcpuconstsym;
+  cenumsym:=tcpuenumsym;
+  csyssym:=tcpusyssym;
+end.
+

+ 4 - 1
compiler/mips/cpunode.pas

@@ -37,6 +37,9 @@ implementation
       after the generic one (FK)
       after the generic one (FK)
     }
     }
     ncpuadd,ncpucall,ncpumat,ncpuinln,
     ncpuadd,ncpucall,ncpumat,ncpuinln,
-    ncpuld,ncpucnv,ncpuset;
+    ncpuld,ncpucnv,ncpuset,
+    { symtable }
+    symcpu
+    ;
 
 
 end.
 end.

+ 174 - 0
compiler/mips/symcpu.pas

@@ -0,0 +1,174 @@
+{
+    Copyright (c) 2014 by Florian Klaempfl
+
+    Symbol table overrides for MIPS
+
+    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 symcpu;
+
+{$i fpcdefs.inc}
+
+interface
+
+uses
+  symdef,symsym;
+
+type
+  { defs }
+  tcpufiledef = class(tfiledef)
+  end;
+
+  tcpuvariantdef = class(tvariantdef)
+  end;
+
+  tcpuformaldef = class(tformaldef)
+  end;
+
+  tcpuforwarddef = class(tforwarddef)
+  end;
+
+  tcpuundefineddef = class(tundefineddef)
+  end;
+
+  tcpuerrordef = class(terrordef)
+  end;
+
+  tcpupointerdef = class(tpointerdef)
+  end;
+
+  tcpurecorddef = class(trecorddef)
+  end;
+
+  tcpuimplementedinterface = class(timplementedinterface)
+  end;
+
+  tcpuobjectdef = class(tobjectdef)
+  end;
+
+  tcpuclassrefdef = class(tclassrefdef)
+  end;
+
+  tcpuarraydef = class(tarraydef)
+  end;
+
+  tcpuorddef = class(torddef)
+  end;
+
+  tcpufloatdef = class(tfloatdef)
+  end;
+
+  tcpuprocvardef = class(tprocvardef)
+  end;
+
+  tcpuprocdef = class(tprocdef)
+  end;
+
+  tcpustringdef = class(tstringdef)
+  end;
+
+  tcpuenumdef = class(tenumdef)
+  end;
+
+  tcpusetdef = class(tsetdef)
+  end;
+
+  { syms }
+  tcpulabelsym = class(tlabelsym)
+  end;
+
+  tcpuunitsym = class(tunitsym)
+  end;
+
+  tcpunamespacesym = class(tnamespacesym)
+  end;
+
+  tcpuprocsym = class(tprocsym)
+  end;
+
+  tcpuypesym = class(ttypesym)
+  end;
+
+  tcpufieldvarsym = class(tfieldvarsym)
+  end;
+
+  tcpulocalvarsym = class(tlocalvarsym)
+  end;
+
+  tcpuparavarsym = class(tparavarsym)
+  end;
+
+  tcpustaticvarsym = class(tstaticvarsym)
+  end;
+
+  tcpuabsolutevarsym = class(tabsolutevarsym)
+  end;
+
+  tcpupropertysym = class(tpropertysym)
+  end;
+
+  tcpuconstsym = class(tconstsym)
+  end;
+
+  tcpuenumsym = class(tenumsym)
+  end;
+
+  tcpusyssym = class(tsyssym)
+  end;
+
+
+implementation
+
+begin
+  { used tdef classes }
+  cfiledef:=tcpufiledef;
+  cvariantdef:=tcpuvariantdef;
+  cformaldef:=tcpuformaldef;
+  cforwarddef:=tcpuforwarddef;
+  cundefineddef:=tcpuundefineddef;
+  cerrordef:=tcpuerrordef;
+  cpointerdef:=tcpupointerdef;
+  crecorddef:=tcpurecorddef;
+  cimplementedinterface:=tcpuimplementedinterface;
+  cobjectdef:=tcpuobjectdef;
+  cclassrefdef:=tcpuclassrefdef;
+  carraydef:=tcpuarraydef;
+  corddef:=tcpuorddef;
+  cfloatdef:=tcpufloatdef;
+  cprocvardef:=tcpuprocvardef;
+  cprocdef:=tcpuprocdef;
+  cstringdef:=tcpustringdef;
+  cenumdef:=tcpuenumdef;
+  csetdef:=tcpusetdef;
+
+  { used tsym classes }
+  clabelsym:=tcpulabelsym;
+  cunitsym:=tcpuunitsym;
+  cnamespacesym:=tcpunamespacesym;
+  cprocsym:=tcpuprocsym;
+  ctypesym:=tcpuypesym;
+  cfieldvarsym:=tcpufieldvarsym;
+  clocalvarsym:=tcpulocalvarsym;
+  cparavarsym:=tcpuparavarsym;
+  cstaticvarsym:=tcpustaticvarsym;
+  cabsolutevarsym:=tcpuabsolutevarsym;
+  cpropertysym:=tcpupropertysym;
+  cconstsym:=tcpuconstsym;
+  cenumsym:=tcpuenumsym;
+  csyssym:=tcpusyssym;
+end.
+

+ 1 - 1
compiler/nadd.pas

@@ -1580,7 +1580,7 @@ implementation
                         llow:=rlow;
                         llow:=rlow;
                         lhigh:=rhigh;
                         lhigh:=rhigh;
                       end;
                       end;
-                    nd:=tsetdef.create(tsetdef(ld).elementdef,min(llow,rlow).svalue,max(lhigh,rhigh).svalue);
+                    nd:=csetdef.create(tsetdef(ld).elementdef,min(llow,rlow).svalue,max(lhigh,rhigh).svalue);
                     inserttypeconv(left,nd);
                     inserttypeconv(left,nd);
                     if (rd.typ=setdef) then
                     if (rd.typ=setdef) then
                       inserttypeconv(right,nd)
                       inserttypeconv(right,nd)

+ 3 - 3
compiler/ncal.pas

@@ -1344,7 +1344,7 @@ implementation
            for i:=0 to varargsparas.count-1 do
            for i:=0 to varargsparas.count-1 do
              begin
              begin
                hp:=tparavarsym(varargsparas[i]);
                hp:=tparavarsym(varargsparas[i]);
-               hpn:=tparavarsym.create(hp.realname,hp.paranr,hp.varspez,hp.vardef,[]);
+               hpn:=cparavarsym.create(hp.realname,hp.paranr,hp.varspez,hp.vardef,[]);
                n.varargsparas.add(hpn);
                n.varargsparas.add(hpn);
                para:=tcallparanode(n.left);
                para:=tcallparanode(n.left);
                while assigned(para) do
                while assigned(para) do
@@ -1927,7 +1927,7 @@ implementation
                                   be marked as instantiatable (only the pointeddef will actually be
                                   be marked as instantiatable (only the pointeddef will actually be
                                   recorded, so it's no problem that the clasrefdef is only temporary)
                                   recorded, so it's no problem that the clasrefdef is only temporary)
                                 }
                                 }
-                                crefdef:=tclassrefdef.create(tcallnode(methodpointer).methodpointer.resultdef);
+                                crefdef:=cclassrefdef.create(tcallnode(methodpointer).methodpointer.resultdef);
                                 { and register it }
                                 { and register it }
                                 crefdef.register_created_object_type;
                                 crefdef.register_created_object_type;
                               end
                               end
@@ -2777,7 +2777,7 @@ implementation
               begin
               begin
                 if cpf_varargs_para in pt.callparaflags then
                 if cpf_varargs_para in pt.callparaflags then
                   begin
                   begin
-                    varargspara:=tparavarsym.create('va'+tostr(i),i,vs_value,pt.resultdef,[]);
+                    varargspara:=cparavarsym.create('va'+tostr(i),i,vs_value,pt.resultdef,[]);
                     dec(i);
                     dec(i);
                     { varargspara is left-right, use insert
                     { varargspara is left-right, use insert
                       instead of concat }
                       instead of concat }

+ 1 - 1
compiler/ncnv.pas

@@ -643,7 +643,7 @@ implementation
            p.free;
            p.free;
          end;
          end;
         { set the initial set type }
         { set the initial set type }
-        constp.resultdef:=tsetdef.create(hdef,constsetlo.svalue,constsethi.svalue);
+        constp.resultdef:=csetdef.create(hdef,constsetlo.svalue,constsethi.svalue);
         { determine the resultdef for the tree }
         { determine the resultdef for the tree }
         typecheckpass(buildp);
         typecheckpass(buildp);
         { set the new tree }
         { set the new tree }

+ 1 - 1
compiler/ncon.pas

@@ -966,7 +966,7 @@ implementation
                 l:=len-1
                 l:=len-1
               else
               else
                 l:=0;
                 l:=0;
-              resultdef:=tarraydef.create(0,l,s32inttype);
+              resultdef:=carraydef.create(0,l,s32inttype);
               tarraydef(resultdef).elementdef:=cansichartype;
               tarraydef(resultdef).elementdef:=cansichartype;
               include(tarraydef(resultdef).arrayoptions,ado_IsConstString);
               include(tarraydef(resultdef).arrayoptions,ado_IsConstString);
             end;
             end;

+ 6 - 6
compiler/nflw.pas

@@ -351,7 +351,7 @@ implementation
          typecheckpass(tnode(state));
          typecheckpass(tnode(state));
          addstatement(mainstatement,state);
          addstatement(mainstatement,state);
          { the temporary items array }
          { the temporary items array }
-         itemsarraydef:=tarraydef.create(1,16,u32inttype);
+         itemsarraydef:=carraydef.create(1,16,u32inttype);
          itemsarraydef.elementdef:=objc_idtype;
          itemsarraydef.elementdef:=objc_idtype;
          items:=ctempcreatenode.create(itemsarraydef,itemsarraydef.size,tt_persistent,false);
          items:=ctempcreatenode.create(itemsarraydef,itemsarraydef.size,tt_persistent,false);
          addstatement(mainstatement,items);
          addstatement(mainstatement,items);
@@ -456,7 +456,7 @@ implementation
         if hp.resultdef.typ<>pointerdef then
         if hp.resultdef.typ<>pointerdef then
           internalerror(2010061904);
           internalerror(2010061904);
         inserttypeconv(hp,
         inserttypeconv(hp,
-          tarraydef.create_from_pointer(tpointerdef(hp.resultdef).pointeddef));
+          carraydef.create_from_pointer(tpointerdef(hp.resultdef).pointeddef));
         hp:=cvecnode.create(hp,ctemprefnode.create(innerloopcounter));
         hp:=cvecnode.create(hp,ctemprefnode.create(innerloopcounter));
         addstatement(innerloopbodystatement,
         addstatement(innerloopbodystatement,
           cassignmentnode.create(hloopvar,hp));
           cassignmentnode.create(hloopvar,hp));
@@ -570,7 +570,7 @@ implementation
             if assigned(tmpdef) and (tmpdef.typ=arraydef) and (tarraydef(tmpdef).arrayoptions = []) then
             if assigned(tmpdef) and (tmpdef.typ=arraydef) and (tarraydef(tmpdef).arrayoptions = []) then
               begin
               begin
                 elementcount:=elementcount*tarraydef(tmpdef).elecount;
                 elementcount:=elementcount*tarraydef(tmpdef).elecount;
-                convertdef:=tarraydef.create(0,elementcount-1,s32inttype);
+                convertdef:=carraydef.create(0,elementcount-1,s32inttype);
                 tarraydef(convertdef).elementdef:=tarraydef(tmpdef).elementdef;
                 tarraydef(convertdef).elementdef:=tarraydef(tmpdef).elementdef;
                 expression:=expr.getcopy;
                 expression:=expr.getcopy;
                 expression:=ctypeconvnode.create_internal(expression,convertdef);
                 expression:=ctypeconvnode.create_internal(expression,convertdef);
@@ -2011,7 +2011,7 @@ implementation
             else
             else
               begin
               begin
                 third:=cinlinenode.create(in_get_frame,false,nil);
                 third:=cinlinenode.create(in_get_frame,false,nil);
-                current_addr:=clabelnode.create(cnothingnode.create,tlabelsym.create('$raiseaddr'));
+                current_addr:=clabelnode.create(cnothingnode.create,clabelsym.create('$raiseaddr'));
                 addstatement(statements,current_addr);
                 addstatement(statements,current_addr);
                 right:=caddrnode.create(cloadnode.create(current_addr.labsym,current_addr.labsym.owner));
                 right:=caddrnode.create(cloadnode.create(current_addr.labsym,current_addr.labsym.owner));
               end;
               end;
@@ -2183,7 +2183,7 @@ implementation
           destroyed before procsym, leaving invalid pointers). }
           destroyed before procsym, leaving invalid pointers). }
         oldsymtablestack:=symtablestack;
         oldsymtablestack:=symtablestack;
         symtablestack:=nil;
         symtablestack:=nil;
-        result:=tprocdef.create(max(normal_function_level,st.symtablelevel)+1);
+        result:=cprocdef.create(max(normal_function_level,st.symtablelevel)+1);
         symtablestack:=oldsymtablestack;
         symtablestack:=oldsymtablestack;
         st.insertdef(result);
         st.insertdef(result);
         result.struct:=current_procinfo.procdef.struct;
         result.struct:=current_procinfo.procdef.struct;
@@ -2192,7 +2192,7 @@ implementation
         exclude(result.procoptions,po_delphi_nested_cc);
         exclude(result.procoptions,po_delphi_nested_cc);
         result.proctypeoption:=potype_exceptfilter;
         result.proctypeoption:=potype_exceptfilter;
         handle_calling_convention(result);
         handle_calling_convention(result);
-        sym:=tprocsym.create('$fin$'+tostr(seq));
+        sym:=cprocsym.create('$fin$'+tostr(seq));
         st.insert(sym);
         st.insert(sym);
         inc(seq);
         inc(seq);
 
 

+ 1 - 1
compiler/ngenutil.pas

@@ -582,7 +582,7 @@ implementation
     var
     var
       pd: tprocdef;
       pd: tprocdef;
     begin
     begin
-      pd:=tprocdef.create(main_program_level);
+      pd:=cprocdef.create(main_program_level);
       pd.procsym:=ps;
       pd.procsym:=ps;
       ps.ProcdefList.Add(pd);
       ps.ProcdefList.Add(pd);
       include(pd.procoptions,po_global);
       include(pd.procoptions,po_global);

+ 4 - 4
compiler/ninl.pas

@@ -410,7 +410,7 @@ implementation
           if not assigned(srsym) then
           if not assigned(srsym) then
             begin
             begin
               { no valid default variable found, so create it }
               { no valid default variable found, so create it }
-              srsym:=tlocalvarsym.create(defaultname,vs_const,def,[]);
+              srsym:=clocalvarsym.create(defaultname,vs_const,def,[]);
               srsymtable.insert(srsym);
               srsymtable.insert(srsym);
               { mark the staticvarsym as typedconst }
               { mark the staticvarsym as typedconst }
               include(tabstractvarsym(srsym).varoptions,vo_is_typed_const);
               include(tabstractvarsym(srsym).varoptions,vo_is_typed_const);
@@ -3353,7 +3353,7 @@ implementation
                     hp:=caddnode.create(subn,left,hp);
                     hp:=caddnode.create(subn,left,hp);
                   { assign result of addition }
                   { assign result of addition }
                   if not(is_integer(resultdef)) then
                   if not(is_integer(resultdef)) then
-                    inserttypeconv(hp,torddef.create(
+                    inserttypeconv(hp,corddef.create(
 {$ifdef cpu64bitaddr}
 {$ifdef cpu64bitaddr}
                       s64bit,
                       s64bit,
 {$else cpu64bitaddr}
 {$else cpu64bitaddr}
@@ -3462,7 +3462,7 @@ implementation
                      hpp := caddnode.create(subn,hp,hpp);
                      hpp := caddnode.create(subn,hp,hpp);
                    { assign result of addition }
                    { assign result of addition }
                    if not(is_integer(resultnode.resultdef)) then
                    if not(is_integer(resultnode.resultdef)) then
-                     inserttypeconv(hpp,torddef.create(
+                     inserttypeconv(hpp,corddef.create(
 {$ifdef cpu64bitaddr}
 {$ifdef cpu64bitaddr}
                        s64bit,
                        s64bit,
 {$else cpu64bitaddr}
 {$else cpu64bitaddr}
@@ -4177,7 +4177,7 @@ implementation
          temprangedef:=nil;
          temprangedef:=nil;
          getrange(unpackednode.resultdef,ulorange,uhirange);
          getrange(unpackednode.resultdef,ulorange,uhirange);
          getrange(packednode.resultdef,plorange,phirange);
          getrange(packednode.resultdef,plorange,phirange);
-         temprangedef:=torddef.create(torddef(sinttype).ordtype,ulorange,uhirange);
+         temprangedef:=corddef.create(torddef(sinttype).ordtype,ulorange,uhirange);
          sourcevecindex := ctemprefnode.create(loopvar);
          sourcevecindex := ctemprefnode.create(loopvar);
          targetvecindex := ctypeconvnode.create_internal(index.getcopy,sinttype);
          targetvecindex := ctypeconvnode.create_internal(index.getcopy,sinttype);
          targetvecindex := caddnode.create(subn,targetvecindex,cordconstnode.create(plorange,sinttype,true));
          targetvecindex := caddnode.create(subn,targetvecindex,cordconstnode.create(plorange,sinttype,true));

+ 3 - 3
compiler/nld.pas

@@ -342,7 +342,7 @@ implementation
                      resultdef:=tobjectdef(resultdef).extendeddef;
                      resultdef:=tobjectdef(resultdef).extendeddef;
                    if (po_classmethod in tprocdef(symtableentry.owner.defowner).procoptions) or
                    if (po_classmethod in tprocdef(symtableentry.owner.defowner).procoptions) or
                       (po_staticmethod in tprocdef(symtableentry.owner.defowner).procoptions) then
                       (po_staticmethod in tprocdef(symtableentry.owner.defowner).procoptions) then
-                     resultdef:=tclassrefdef.create(resultdef)
+                     resultdef:=cclassrefdef.create(resultdef)
                    else if (is_object(resultdef) or is_record(resultdef)) and
                    else if (is_object(resultdef) or is_record(resultdef)) and
                            (loadnf_load_self_pointer in loadnodeflags) then
                            (loadnf_load_self_pointer in loadnodeflags) then
                      resultdef:=getpointerdef(resultdef);
                      resultdef:=getpointerdef(resultdef);
@@ -350,7 +350,7 @@ implementation
                else if vo_is_vmt in tabstractvarsym(symtableentry).varoptions then
                else if vo_is_vmt in tabstractvarsym(symtableentry).varoptions then
                  begin
                  begin
                    resultdef:=tprocdef(symtableentry.owner.defowner).struct;
                    resultdef:=tprocdef(symtableentry.owner.defowner).struct;
-                   resultdef:=tclassrefdef.create(resultdef);
+                   resultdef:=cclassrefdef.create(resultdef);
                  end
                  end
                else
                else
                  resultdef:=tabstractvarsym(symtableentry).vardef;
                  resultdef:=tabstractvarsym(symtableentry).vardef;
@@ -1066,7 +1066,7 @@ implementation
             is_array_of_const(hdef) or
             is_array_of_const(hdef) or
             is_open_array(hdef) then
             is_open_array(hdef) then
            hdef:=voidtype;
            hdef:=voidtype;
-         resultdef:=tarraydef.create(0,len-1,s32inttype);
+         resultdef:=carraydef.create(0,len-1,s32inttype);
          tarraydef(resultdef).elementdef:=hdef;
          tarraydef(resultdef).elementdef:=hdef;
          include(tarraydef(resultdef).arrayoptions,ado_IsConstructor);
          include(tarraydef(resultdef).arrayoptions,ado_IsConstructor);
          if varia then
          if varia then

+ 10 - 10
compiler/nmem.pas

@@ -187,7 +187,7 @@ implementation
                           if assigned(current_structdef.genericdef) then
                           if assigned(current_structdef.genericdef) then
                             if current_structdef.genericdef=left.resultdef then
                             if current_structdef.genericdef=left.resultdef then
                               begin
                               begin
-                                resultdef:=tclassrefdef.create(current_structdef);
+                                resultdef:=cclassrefdef.create(current_structdef);
                                 defaultresultdef:=false;
                                 defaultresultdef:=false;
                               end
                               end
                             else
                             else
@@ -196,10 +196,10 @@ implementation
                       else
                       else
                         message(parser_e_cant_create_generics_of_this_type);
                         message(parser_e_cant_create_generics_of_this_type);
                       if defaultresultdef then
                       if defaultresultdef then
-                        resultdef:=tclassrefdef.create(left.resultdef);
+                        resultdef:=cclassrefdef.create(left.resultdef);
                     end
                     end
                   else
                   else
-                    resultdef:=tclassrefdef.create(left.resultdef);
+                    resultdef:=cclassrefdef.create(left.resultdef);
                 end
                 end
               else
               else
                 CGMessage(parser_e_pointer_to_class_expected);
                 CGMessage(parser_e_pointer_to_class_expected);
@@ -586,12 +586,12 @@ implementation
                   if not(nf_typedaddr in flags) then
                   if not(nf_typedaddr in flags) then
                     resultdef:=voidfarpointertype
                     resultdef:=voidfarpointertype
                   else
                   else
-                    resultdef:=tpointerdef.createx86(left.resultdef,x86pt_far);
+                    resultdef:=cpointerdef.createx86(left.resultdef,x86pt_far);
                 {$elseif defined(i386)}
                 {$elseif defined(i386)}
                   if not(nf_typedaddr in flags) then
                   if not(nf_typedaddr in flags) then
                     resultdef:=voidnearfspointertype
                     resultdef:=voidnearfspointertype
                   else
                   else
-                    resultdef:=tpointerdef.createx86(left.resultdef,x86pt_near_fs);
+                    resultdef:=cpointerdef.createx86(left.resultdef,x86pt_near_fs);
                 {$endif}
                 {$endif}
               end
               end
             else
             else
@@ -914,7 +914,7 @@ implementation
                     ((tarraydef(left.resultdef).lowrange<>tenumdef(htype).min) or
                     ((tarraydef(left.resultdef).lowrange<>tenumdef(htype).min) or
                      (tarraydef(left.resultdef).highrange<>tenumdef(htype).max)) then
                      (tarraydef(left.resultdef).highrange<>tenumdef(htype).max)) then
                    {Convert array indexes to low_bound..high_bound.}
                    {Convert array indexes to low_bound..high_bound.}
-                   inserttypeconv(right,tenumdef.create_subrange(tenumdef(right.resultdef),
+                   inserttypeconv(right,cenumdef.create_subrange(tenumdef(right.resultdef),
                                                       asizeint(Tarraydef(left.resultdef).lowrange),
                                                       asizeint(Tarraydef(left.resultdef).lowrange),
                                                       asizeint(Tarraydef(left.resultdef).highrange)
                                                       asizeint(Tarraydef(left.resultdef).highrange)
                                                      ))
                                                      ))
@@ -944,7 +944,7 @@ implementation
                        newordtyp:=Torddef(right.resultdef).ordtype
                        newordtyp:=Torddef(right.resultdef).ordtype
                      else
                      else
                        newordtyp:=torddef(ptrsinttype).ordtype;
                        newordtyp:=torddef(ptrsinttype).ordtype;
-                     inserttypeconv(right,Torddef.create(newordtyp,
+                     inserttypeconv(right,corddef.create(newordtyp,
                                                          int64(Tarraydef(left.resultdef).lowrange),
                                                          int64(Tarraydef(left.resultdef).lowrange),
                                                          int64(Tarraydef(left.resultdef).highrange)
                                                          int64(Tarraydef(left.resultdef).highrange)
                                                         ))
                                                         ))
@@ -957,7 +957,7 @@ implementation
                  inserttypeconv(right,u8inttype)
                  inserttypeconv(right,u8inttype)
                else if is_shortstring(left.resultdef) then
                else if is_shortstring(left.resultdef) then
                  {Convert shortstring indexes to 0..length.}
                  {Convert shortstring indexes to 0..length.}
-                 inserttypeconv(right,Torddef.create(u8bit,0,int64(Tstringdef(left.resultdef).len)))
+                 inserttypeconv(right,corddef.create(u8bit,0,int64(Tstringdef(left.resultdef).len)))
                else
                else
                  {Convert indexes into dynamically allocated strings to aword.}
                  {Convert indexes into dynamically allocated strings to aword.}
                  inserttypeconv(right,uinttype);
                  inserttypeconv(right,uinttype);
@@ -1024,7 +1024,7 @@ implementation
                   ) then
                   ) then
                 begin
                 begin
                   { convert pointer to array }
                   { convert pointer to array }
-                  htype:=tarraydef.create_from_pointer(tpointerdef(left.resultdef).pointeddef);
+                  htype:=carraydef.create_from_pointer(tpointerdef(left.resultdef).pointeddef);
                   inserttypeconv(left,htype);
                   inserttypeconv(left,htype);
                   if right.nodetype=rangen then
                   if right.nodetype=rangen then
                     resultdef:=htype
                     resultdef:=htype
@@ -1051,7 +1051,7 @@ implementation
                 end;
                 end;
                 if right.nodetype=rangen then
                 if right.nodetype=rangen then
                   begin
                   begin
-                    htype:=Tarraydef.create_from_pointer(elementdef);
+                    htype:=carraydef.create_from_pointer(elementdef);
                     resultdef:=htype;
                     resultdef:=htype;
                   end
                   end
                 else
                 else

+ 2 - 2
compiler/nset.pas

@@ -754,11 +754,11 @@ implementation
 
 
          if (labels^.label_type = ltConstString) then
          if (labels^.label_type = ltConstString) then
            begin
            begin
-             endlabel:=clabelnode.create(cnothingnode.create,tlabelsym.create('$casestrofend'));
+             endlabel:=clabelnode.create(cnothingnode.create,clabelsym.create('$casestrofend'));
              stmt_block:=internalstatements(stmt);
              stmt_block:=internalstatements(stmt);
              for i:=0 to blocks.count-1 do
              for i:=0 to blocks.count-1 do
                begin
                begin
-                 pcaseblock(blocks[i])^.statementlabel:=clabelnode.create(cnothingnode.create,tlabelsym.create('$casestrof'));
+                 pcaseblock(blocks[i])^.statementlabel:=clabelnode.create(cnothingnode.create,clabelsym.create('$casestrof'));
                  addstatement(stmt,pcaseblock(blocks[i])^.statementlabel);
                  addstatement(stmt,pcaseblock(blocks[i])^.statementlabel);
                  addstatement(stmt,pcaseblock(blocks[i])^.statement);
                  addstatement(stmt,pcaseblock(blocks[i])^.statement);
                  pcaseblock(blocks[i])^.statement:=nil;
                  pcaseblock(blocks[i])^.statement:=nil;

+ 1 - 1
compiler/optloop.pas

@@ -155,7 +155,7 @@ unit optloop;
                     if (counts mod unrolls<>0) and
                     if (counts mod unrolls<>0) and
                       ((counts mod unrolls)=unrolls-i) then
                       ((counts mod unrolls)=unrolls-i) then
                       begin
                       begin
-                        tfornode(node).entrylabel:=clabelnode.create(cnothingnode.create,tlabelsym.create('$optunrol'));
+                        tfornode(node).entrylabel:=clabelnode.create(cnothingnode.create,clabelsym.create('$optunrol'));
                         addstatement(unrollstatement,tfornode(node).entrylabel);
                         addstatement(unrollstatement,tfornode(node).entrylabel);
                       end;
                       end;
 
 

+ 1 - 1
compiler/opttail.pas

@@ -198,7 +198,7 @@ unit opttail;
                is_managed_type(vardef)) then
                is_managed_type(vardef)) then
                exit;
                exit;
 
 
-        labelsym:=tlabelsym.create('$opttail');
+        labelsym:=clabelsym.create('$opttail');
         labelnode:=clabelnode.create(cnothingnode.create,labelsym);
         labelnode:=clabelnode.create(cnothingnode.create,labelsym);
         if find_and_replace_tailcalls(n) then
         if find_and_replace_tailcalls(n) then
           begin
           begin

+ 21 - 21
compiler/pdecl.pas

@@ -93,9 +93,9 @@ implementation
            ordconstn:
            ordconstn:
              begin
              begin
                if p.resultdef.typ=pointerdef then
                if p.resultdef.typ=pointerdef then
-                 hp:=tconstsym.create_ordptr(orgname,constpointer,tordconstnode(p).value.uvalue,p.resultdef)
+                 hp:=cconstsym.create_ordptr(orgname,constpointer,tordconstnode(p).value.uvalue,p.resultdef)
                else
                else
-                 hp:=tconstsym.create_ord(orgname,constord,tordconstnode(p).value,p.resultdef);
+                 hp:=cconstsym.create_ord(orgname,constord,tordconstnode(p).value,p.resultdef);
              end;
              end;
            stringconstn:
            stringconstn:
              begin
              begin
@@ -103,7 +103,7 @@ implementation
                  begin
                  begin
                    initwidestring(pw);
                    initwidestring(pw);
                    copywidestring(pcompilerwidestring(tstringconstnode(p).value_str),pw);
                    copywidestring(pcompilerwidestring(tstringconstnode(p).value_str),pw);
-                   hp:=tconstsym.create_wstring(orgname,constwstring,pw);
+                   hp:=cconstsym.create_wstring(orgname,constwstring,pw);
                  end
                  end
                else
                else
                  begin
                  begin
@@ -113,30 +113,30 @@ implementation
                      keep it }
                      keep it }
                    if is_ansistring(p.resultdef) and
                    if is_ansistring(p.resultdef) and
                       (tstringdef(p.resultdef).encoding<>0) then
                       (tstringdef(p.resultdef).encoding<>0) then
-                     hp:=tconstsym.create_string(orgname,conststring,sp,tstringconstnode(p).len,p.resultdef)
+                     hp:=cconstsym.create_string(orgname,conststring,sp,tstringconstnode(p).len,p.resultdef)
                    else
                    else
-                     hp:=tconstsym.create_string(orgname,conststring,sp,tstringconstnode(p).len,nil);
+                     hp:=cconstsym.create_string(orgname,conststring,sp,tstringconstnode(p).len,nil);
                  end;
                  end;
              end;
              end;
            realconstn :
            realconstn :
              begin
              begin
                 new(pd);
                 new(pd);
                 pd^:=trealconstnode(p).value_real;
                 pd^:=trealconstnode(p).value_real;
-                hp:=tconstsym.create_ptr(orgname,constreal,pd,p.resultdef);
+                hp:=cconstsym.create_ptr(orgname,constreal,pd,p.resultdef);
              end;
              end;
            setconstn :
            setconstn :
              begin
              begin
                new(ps);
                new(ps);
                ps^:=tsetconstnode(p).value_set^;
                ps^:=tsetconstnode(p).value_set^;
-               hp:=tconstsym.create_ptr(orgname,constset,ps,p.resultdef);
+               hp:=cconstsym.create_ptr(orgname,constset,ps,p.resultdef);
              end;
              end;
            pointerconstn :
            pointerconstn :
              begin
              begin
-               hp:=tconstsym.create_ordptr(orgname,constpointer,tpointerconstnode(p).value,p.resultdef);
+               hp:=cconstsym.create_ordptr(orgname,constpointer,tpointerconstnode(p).value,p.resultdef);
              end;
              end;
            niln :
            niln :
              begin
              begin
-               hp:=tconstsym.create_ord(orgname,constnil,0,p.resultdef);
+               hp:=cconstsym.create_ord(orgname,constnil,0,p.resultdef);
              end;
              end;
            typen :
            typen :
              begin
              begin
@@ -146,7 +146,7 @@ implementation
                    begin
                    begin
                      new(pg);
                      new(pg);
                      pg^:=tobjectdef(p.resultdef).iidguid^;
                      pg^:=tobjectdef(p.resultdef).iidguid^;
-                     hp:=tconstsym.create_ptr(orgname,constguid,pg,p.resultdef);
+                     hp:=cconstsym.create_ptr(orgname,constguid,pg,p.resultdef);
                    end
                    end
                   else
                   else
                    Message1(parser_e_interface_has_no_guid,tobjectdef(p.resultdef).objrealname^);
                    Message1(parser_e_interface_has_no_guid,tobjectdef(p.resultdef).objrealname^);
@@ -166,7 +166,7 @@ implementation
                  in_sizeof_x,
                  in_sizeof_x,
                  in_bitsizeof_x:
                  in_bitsizeof_x:
                    begin
                    begin
-                     hp:=tconstsym.create_ord(orgname,constord,0,p.resultdef);
+                     hp:=cconstsym.create_ord(orgname,constord,0,p.resultdef);
                    end;
                    end;
                  { add other cases here if necessary }
                  { add other cases here if necessary }
                  else
                  else
@@ -266,13 +266,13 @@ implementation
                      to it from the structure or linking will fail }
                      to it from the structure or linking will fail }
                    if symtablestack.top.symtabletype in [recordsymtable,ObjectSymtable] then
                    if symtablestack.top.symtabletype in [recordsymtable,ObjectSymtable] then
                      begin
                      begin
-                       sym:=tfieldvarsym.create(orgname,varspez,hdef,[]);
+                       sym:=cfieldvarsym.create(orgname,varspez,hdef,[]);
                        symtablestack.top.insert(sym);
                        symtablestack.top.insert(sym);
                        sym:=make_field_static(symtablestack.top,tfieldvarsym(sym));
                        sym:=make_field_static(symtablestack.top,tfieldvarsym(sym));
                      end
                      end
                    else
                    else
                      begin
                      begin
-                       sym:=tstaticvarsym.create(orgname,varspez,hdef,[]);
+                       sym:=cstaticvarsym.create(orgname,varspez,hdef,[]);
                        sym.visibility:=symtablestack.top.currentvisibility;
                        sym.visibility:=symtablestack.top.currentvisibility;
                        symtablestack.top.insert(sym);
                        symtablestack.top.insert(sym);
                      end;
                      end;
@@ -339,20 +339,20 @@ implementation
            else
            else
              begin
              begin
                 if token=_ID then
                 if token=_ID then
-                  labelsym:=tlabelsym.create(orgpattern)
+                  labelsym:=clabelsym.create(orgpattern)
                 else
                 else
-                  labelsym:=tlabelsym.create(pattern);
+                  labelsym:=clabelsym.create(pattern);
                 symtablestack.top.insert(labelsym);
                 symtablestack.top.insert(labelsym);
                 if m_non_local_goto in current_settings.modeswitches then
                 if m_non_local_goto in current_settings.modeswitches then
                   begin
                   begin
                     if symtablestack.top.symtabletype=localsymtable then
                     if symtablestack.top.symtabletype=localsymtable then
                       begin
                       begin
-                        labelsym.jumpbuf:=tlocalvarsym.create('LABEL$_'+labelsym.name,vs_value,rec_jmp_buf,[]);
+                        labelsym.jumpbuf:=clocalvarsym.create('LABEL$_'+labelsym.name,vs_value,rec_jmp_buf,[]);
                         symtablestack.top.insert(labelsym.jumpbuf);
                         symtablestack.top.insert(labelsym.jumpbuf);
                       end
                       end
                     else
                     else
                       begin
                       begin
-                        labelsym.jumpbuf:=tstaticvarsym.create('LABEL$_'+labelsym.name,vs_value,rec_jmp_buf,[]);
+                        labelsym.jumpbuf:=cstaticvarsym.create('LABEL$_'+labelsym.name,vs_value,rec_jmp_buf,[]);
                         symtablestack.top.insert(labelsym.jumpbuf);
                         symtablestack.top.insert(labelsym.jumpbuf);
                         cnodeutils.insertbssdata(tstaticvarsym(labelsym.jumpbuf));
                         cnodeutils.insertbssdata(tstaticvarsym(labelsym.jumpbuf));
                       end;
                       end;
@@ -592,7 +592,7 @@ implementation
                   sym:=tsym(symtablestack.top.Find(typename));
                   sym:=tsym(symtablestack.top.Find(typename));
                   if not assigned(sym) then
                   if not assigned(sym) then
                     begin
                     begin
-                      sym:=ttypesym.create(orgtypename,tundefineddef.create);
+                      sym:=ctypesym.create(orgtypename,cundefineddef.create);
                       Include(sym.symoptions,sp_generic_dummy);
                       Include(sym.symoptions,sp_generic_dummy);
                       ttypesym(sym).typedef.typesym:=sym;
                       ttypesym(sym).typedef.typesym:=sym;
                       sym.visibility:=symtablestack.top.currentvisibility;
                       sym.visibility:=symtablestack.top.currentvisibility;
@@ -628,7 +628,7 @@ implementation
               { insert a new type if we don't reuse an existing symbol }
               { insert a new type if we don't reuse an existing symbol }
               if not assigned(newtype) then
               if not assigned(newtype) then
                 begin
                 begin
-                  newtype:=ttypesym.create(genorgtypename,hdef);
+                  newtype:=ctypesym.create(genorgtypename,hdef);
                   newtype.visibility:=symtablestack.top.currentvisibility;
                   newtype.visibility:=symtablestack.top.currentvisibility;
                   symtablestack.top.insert(newtype);
                   symtablestack.top.insert(newtype);
                 end;
                 end;
@@ -952,7 +952,7 @@ implementation
                                 getmem(sp,2);
                                 getmem(sp,2);
                                 sp[0]:=chr(tordconstnode(p).value.svalue);
                                 sp[0]:=chr(tordconstnode(p).value.svalue);
                                 sp[1]:=#0;
                                 sp[1]:=#0;
-                                sym:=tconstsym.create_string(orgname,constresourcestring,sp,1,nil);
+                                sym:=cconstsym.create_string(orgname,constresourcestring,sp,1,nil);
                              end
                              end
                            else
                            else
                              Message(parser_e_illegal_expression);
                              Message(parser_e_illegal_expression);
@@ -965,7 +965,7 @@ implementation
                                changestringtype(getansistringdef);
                                changestringtype(getansistringdef);
                              getmem(sp,len+1);
                              getmem(sp,len+1);
                              move(value_str^,sp^,len+1);
                              move(value_str^,sp^,len+1);
-                             sym:=tconstsym.create_string(orgname,constresourcestring,sp,len,nil);
+                             sym:=cconstsym.create_string(orgname,constresourcestring,sp,len,nil);
                           end;
                           end;
                       else
                       else
                         Message(parser_e_illegal_expression);
                         Message(parser_e_illegal_expression);

+ 6 - 6
compiler/pdecobj.pas

@@ -1327,7 +1327,7 @@ implementation
               begin
               begin
                 Message(parser_e_forward_mismatch);
                 Message(parser_e_forward_mismatch);
                 { recover }
                 { recover }
-                current_structdef:=tobjectdef.create(current_objectdef.objecttype,n,nil);
+                current_structdef:=cobjectdef.create(current_objectdef.objecttype,n,nil);
                 include(current_structdef.objectoptions,oo_is_forward);
                 include(current_structdef.objectoptions,oo_is_forward);
               end
               end
             else
             else
@@ -1340,7 +1340,7 @@ implementation
               Message(parser_f_no_anonym_objects);
               Message(parser_f_no_anonym_objects);
 
 
             { create new class }
             { create new class }
-            current_structdef:=tobjectdef.create(objecttype,n,nil);
+            current_structdef:=cobjectdef.create(objecttype,n,nil);
 
 
             { include always the forward flag, it'll be removed after the parent class have been
             { include always the forward flag, it'll be removed after the parent class have been
               added. This is to prevent circular childof loops }
               added. This is to prevent circular childof loops }
@@ -1369,14 +1369,14 @@ implementation
                             psystem, but java_jlobject is not yet available
                             psystem, but java_jlobject is not yet available
                             there... }
                             there... }
                           hrecst:=trecordsymtable.create('',1);
                           hrecst:=trecordsymtable.create('',1);
-                          fsym:=tfieldvarsym.create('$proc',vs_value,java_jlobject,[]);
+                          fsym:=cfieldvarsym.create('$proc',vs_value,java_jlobject,[]);
                           hrecst.insert(fsym);
                           hrecst.insert(fsym);
                           hrecst.addfield(fsym,vis_hidden);
                           hrecst.addfield(fsym,vis_hidden);
-                          fsym:=tfieldvarsym.create('$data',vs_value,java_jlobject,[]);
+                          fsym:=cfieldvarsym.create('$data',vs_value,java_jlobject,[]);
                           hrecst.insert(fsym);
                           hrecst.insert(fsym);
                           hrecst.addfield(fsym,vis_hidden);
                           hrecst.addfield(fsym,vis_hidden);
-                          methodpointertype:=trecorddef.create('',hrecst);
-                          systemunit.insert(ttypesym.create('$methodpointer',methodpointertype));
+                          methodpointertype:=crecorddef.create('',hrecst);
+                          systemunit.insert(ctypesym.create('$methodpointer',methodpointertype));
                         end
                         end
                       else if (current_objectdef.objname^='JLTHROWABLE') then
                       else if (current_objectdef.objname^='JLTHROWABLE') then
                         java_jlthrowable:=current_objectdef
                         java_jlthrowable:=current_objectdef

+ 14 - 14
compiler/pdecsub.pas

@@ -339,7 +339,7 @@ implementation
           sc.clear;
           sc.clear;
           repeat
           repeat
             inc(paranr);
             inc(paranr);
-            vs:=tparavarsym.create(orgpattern,paranr*10,varspez,generrordef,[]);
+            vs:=cparavarsym.create(orgpattern,paranr*10,varspez,generrordef,[]);
             currparast.insert(vs);
             currparast.insert(vs);
             if assigned(vs.owner) then
             if assigned(vs.owner) then
              sc.add(vs)
              sc.add(vs)
@@ -352,7 +352,7 @@ implementation
           if parseprocvar<>pv_none then
           if parseprocvar<>pv_none then
            begin
            begin
              { inline procvar definitions are always nested procvars }
              { inline procvar definitions are always nested procvars }
-             pv:=tprocvardef.create(normal_function_level+1);
+             pv:=cprocvardef.create(normal_function_level+1);
              if token=_LKLAMMER then
              if token=_LKLAMMER then
                parse_parameter_dec(pv);
                parse_parameter_dec(pv);
              if parseprocvar=pv_func then
              if parseprocvar=pv_func then
@@ -366,7 +366,7 @@ implementation
              { possible proc directives }
              { possible proc directives }
              if check_proc_directive(true) then
              if check_proc_directive(true) then
                begin
                begin
-                  dummytype:=ttypesym.create('unnamed',hdef);
+                  dummytype:=ctypesym.create('unnamed',hdef);
                   parse_var_proc_directives(tsym(dummytype));
                   parse_var_proc_directives(tsym(dummytype));
                   dummytype.typedef:=nil;
                   dummytype.typedef:=nil;
                   hdef.typesym:=nil;
                   hdef.typesym:=nil;
@@ -399,7 +399,7 @@ implementation
                 consume(_ARRAY);
                 consume(_ARRAY);
                 consume(_OF);
                 consume(_OF);
                 { define range and type of range }
                 { define range and type of range }
-                hdef:=tarraydef.create(0,-1,s32inttype);
+                hdef:=carraydef.create(0,-1,s32inttype);
                 { array of const ? }
                 { array of const ? }
                 if (token=_CONST) and (m_objpas in current_settings.modeswitches) then
                 if (token=_CONST) and (m_objpas in current_settings.modeswitches) then
                  begin
                  begin
@@ -946,13 +946,13 @@ implementation
               begin
               begin
                 aprocsym:=Tprocsym(symtablestack.top.Find(sp));
                 aprocsym:=Tprocsym(symtablestack.top.Find(sp));
                 if aprocsym=nil then
                 if aprocsym=nil then
-                  aprocsym:=tprocsym.create('$'+sp);
+                  aprocsym:=cprocsym.create('$'+sp);
               end
               end
             else
             else
             if (potype in [potype_class_constructor,potype_class_destructor]) then
             if (potype in [potype_class_constructor,potype_class_destructor]) then
-              aprocsym:=tprocsym.create('$'+lower(sp))
+              aprocsym:=cprocsym.create('$'+lower(sp))
             else
             else
-              aprocsym:=tprocsym.create(orgsp);
+              aprocsym:=cprocsym.create(orgsp);
             symtablestack.top.insert(aprocsym);
             symtablestack.top.insert(aprocsym);
           end;
           end;
 
 
@@ -966,7 +966,7 @@ implementation
               break;
               break;
             checkstack:=checkstack^.next;
             checkstack:=checkstack^.next;
           end;
           end;
-        pd:=tprocdef.create(st.symtablelevel+1);
+        pd:=cprocdef.create(st.symtablelevel+1);
         pd.struct:=astruct;
         pd.struct:=astruct;
         pd.procsym:=aprocsym;
         pd.procsym:=aprocsym;
         pd.proctypeoption:=potype;
         pd.proctypeoption:=potype;
@@ -1790,7 +1790,7 @@ begin
               tprocdef(pd).libsym:=sym;
               tprocdef(pd).libsym:=sym;
               if po_syscall_legacy in tprocdef(pd).procoptions then
               if po_syscall_legacy in tprocdef(pd).procoptions then
                 begin
                 begin
-                  vs:=tparavarsym.create('$syscalllib',paranr_syscall_legacy,vs_value,tabstractvarsym(sym).vardef,[vo_is_syscall_lib,vo_is_hidden_para,vo_has_explicit_paraloc]);
+                  vs:=cparavarsym.create('$syscalllib',paranr_syscall_legacy,vs_value,tabstractvarsym(sym).vardef,[vo_is_syscall_lib,vo_is_hidden_para,vo_has_explicit_paraloc]);
                   paramanager.parseparaloc(vs,'A6');
                   paramanager.parseparaloc(vs,'A6');
                   pd.parast.insert(vs);
                   pd.parast.insert(vs);
                 end
                 end
@@ -1822,7 +1822,7 @@ begin
              ) then
              ) then
             begin
             begin
               tprocdef(pd).libsym:=sym;
               tprocdef(pd).libsym:=sym;
-              vs:=tparavarsym.create('$syscalllib',paranr_syscall_basesysv,vs_value,tabstractvarsym(sym).vardef,[vo_is_syscall_lib,vo_is_hidden_para]);
+              vs:=cparavarsym.create('$syscalllib',paranr_syscall_basesysv,vs_value,tabstractvarsym(sym).vardef,[vo_is_syscall_lib,vo_is_hidden_para]);
               pd.parast.insert(vs);
               pd.parast.insert(vs);
             end
             end
           else
           else
@@ -1891,7 +1891,7 @@ begin
               tprocdef(pd).libsym:=sym;
               tprocdef(pd).libsym:=sym;
               if po_syscall_legacy in tprocdef(pd).procoptions then
               if po_syscall_legacy in tprocdef(pd).procoptions then
                 begin
                 begin
-                  vs:=tparavarsym.create('$syscalllib',paranr_syscall_legacy,vs_value,tabstractvarsym(sym).vardef,[vo_is_syscall_lib,vo_is_hidden_para,vo_has_explicit_paraloc]);
+                  vs:=cparavarsym.create('$syscalllib',paranr_syscall_legacy,vs_value,tabstractvarsym(sym).vardef,[vo_is_syscall_lib,vo_is_hidden_para,vo_has_explicit_paraloc]);
                   paramanager.parseparaloc(vs,'A6');
                   paramanager.parseparaloc(vs,'A6');
                   pd.parast.insert(vs);
                   pd.parast.insert(vs);
                 end
                 end
@@ -1901,17 +1901,17 @@ begin
                 end
                 end
               else if po_syscall_basesysv in tprocdef(pd).procoptions then
               else if po_syscall_basesysv in tprocdef(pd).procoptions then
                 begin
                 begin
-                  vs:=tparavarsym.create('$syscalllib',paranr_syscall_basesysv,vs_value,tabstractvarsym(sym).vardef,[vo_is_syscall_lib,vo_is_hidden_para]);
+                  vs:=cparavarsym.create('$syscalllib',paranr_syscall_basesysv,vs_value,tabstractvarsym(sym).vardef,[vo_is_syscall_lib,vo_is_hidden_para]);
                   pd.parast.insert(vs);
                   pd.parast.insert(vs);
                 end
                 end
               else if po_syscall_sysvbase in tprocdef(pd).procoptions then
               else if po_syscall_sysvbase in tprocdef(pd).procoptions then
                 begin
                 begin
-                  vs:=tparavarsym.create('$syscalllib',paranr_syscall_sysvbase,vs_value,tabstractvarsym(sym).vardef,[vo_is_syscall_lib,vo_is_hidden_para]);
+                  vs:=cparavarsym.create('$syscalllib',paranr_syscall_sysvbase,vs_value,tabstractvarsym(sym).vardef,[vo_is_syscall_lib,vo_is_hidden_para]);
                   pd.parast.insert(vs);
                   pd.parast.insert(vs);
                 end
                 end
               else if po_syscall_r12base in tprocdef(pd).procoptions then
               else if po_syscall_r12base in tprocdef(pd).procoptions then
                 begin
                 begin
-                  vs:=tparavarsym.create('$syscalllib',paranr_syscall_r12base,vs_value,tabstractvarsym(sym).vardef,[vo_is_syscall_lib,vo_is_hidden_para,vo_has_explicit_paraloc]);
+                  vs:=cparavarsym.create('$syscalllib',paranr_syscall_r12base,vs_value,tabstractvarsym(sym).vardef,[vo_is_syscall_lib,vo_is_hidden_para,vo_has_explicit_paraloc]);
                   paramanager.parseparaloc(vs,'R12');
                   paramanager.parseparaloc(vs,'R12');
                   pd.parast.insert(vs);
                   pd.parast.insert(vs);
                 end
                 end

+ 20 - 20
compiler/pdecvar.pas

@@ -254,7 +254,7 @@ implementation
               sym: tprocsym;
               sym: tprocsym;
             begin
             begin
               handle_calling_convention(pd);
               handle_calling_convention(pd);
-              sym:=tprocsym.create(prefix+lower(p.realname));
+              sym:=cprocsym.create(prefix+lower(p.realname));
               symtablestack.top.insert(sym);
               symtablestack.top.insert(sym);
               pd.procsym:=sym;
               pd.procsym:=sym;
               include(pd.procoptions,po_dispid);
               include(pd.procoptions,po_dispid);
@@ -315,7 +315,7 @@ implementation
                 begin
                 begin
                   { add an extra parameter, a placeholder of the value to set }
                   { add an extra parameter, a placeholder of the value to set }
                   inc(paranr);
                   inc(paranr);
-                  hparavs:=tparavarsym.create('$value',10*paranr,vs_value,p.propdef,[]);
+                  hparavs:=cparavarsym.create('$value',10*paranr,vs_value,p.propdef,[]);
                   writepd.parast.insert(hparavs);
                   writepd.parast.insert(hparavs);
 
 
                   writepd.proctypeoption:=potype_propsetter;
                   writepd.proctypeoption:=potype_propsetter;
@@ -353,8 +353,8 @@ implementation
          { Generate temp procdefs to search for matching read/write
          { Generate temp procdefs to search for matching read/write
            procedures. the readprocdef will store all definitions }
            procedures. the readprocdef will store all definitions }
          paranr:=0;
          paranr:=0;
-         readprocdef:=tprocdef.create(normal_function_level);
-         writeprocdef:=tprocdef.create(normal_function_level);
+         readprocdef:=cprocdef.create(normal_function_level);
+         writeprocdef:=cprocdef.create(normal_function_level);
 
 
          readprocdef.struct:=astruct;
          readprocdef.struct:=astruct;
          writeprocdef.struct:=astruct;
          writeprocdef.struct:=astruct;
@@ -372,7 +372,7 @@ implementation
               exit;
               exit;
            end;
            end;
          { Generate propertysym and insert in symtablestack }
          { Generate propertysym and insert in symtablestack }
-         p:=tpropertysym.create(orgpattern);
+         p:=cpropertysym.create(orgpattern);
          p.visibility:=symtablestack.top.currentvisibility;
          p.visibility:=symtablestack.top.currentvisibility;
          p.default:=longint($80000000);
          p.default:=longint($80000000);
          if is_classproperty then
          if is_classproperty then
@@ -403,7 +403,7 @@ implementation
                 sc.clear;
                 sc.clear;
                 repeat
                 repeat
                   inc(paranr);
                   inc(paranr);
-                  hreadparavs:=tparavarsym.create(orgpattern,10*paranr,varspez,generrordef,[]);
+                  hreadparavs:=cparavarsym.create(orgpattern,10*paranr,varspez,generrordef,[]);
                   p.parast.insert(hreadparavs);
                   p.parast.insert(hreadparavs);
                   sc.add(hreadparavs);
                   sc.add(hreadparavs);
                   consume(_ID);
                   consume(_ID);
@@ -414,7 +414,7 @@ implementation
                       begin
                       begin
                         consume(_OF);
                         consume(_OF);
                         { define range and type of range }
                         { define range and type of range }
-                        hdef:=tarraydef.create(0,-1,s32inttype);
+                        hdef:=carraydef.create(0,-1,s32inttype);
                         { define field type }
                         { define field type }
                         single_type(arraytype,[]);
                         single_type(arraytype,[]);
                         tarraydef(hdef).elementdef:=arraytype;
                         tarraydef(hdef).elementdef:=arraytype;
@@ -605,7 +605,7 @@ implementation
                             of the of the property }
                             of the of the property }
                           writeprocdef.returndef:=voidtype;
                           writeprocdef.returndef:=voidtype;
                           inc(paranr);
                           inc(paranr);
-                          hparavs:=tparavarsym.create('$value',10*paranr,vs_value,p.propdef,[]);
+                          hparavs:=cparavarsym.create('$value',10*paranr,vs_value,p.propdef,[]);
                           writeprocdef.parast.insert(hparavs);
                           writeprocdef.parast.insert(hparavs);
                           { Insert hidden parameters }
                           { Insert hidden parameters }
                           handle_calling_convention(writeprocdef);
                           handle_calling_convention(writeprocdef);
@@ -735,14 +735,14 @@ implementation
                             procsym :
                             procsym :
                               begin
                               begin
                                  { Create a temporary procvardef to handle parameters }
                                  { Create a temporary procvardef to handle parameters }
-                                 storedprocdef:=tprocvardef.create(normal_function_level);
+                                 storedprocdef:=cprocvardef.create(normal_function_level);
                                  include(storedprocdef.procoptions,po_methodpointer);
                                  include(storedprocdef.procoptions,po_methodpointer);
                                  { Return type must be boolean }
                                  { Return type must be boolean }
                                  storedprocdef.returndef:=pasbool8type;
                                  storedprocdef.returndef:=pasbool8type;
                                  { Add index parameter if needed }
                                  { Add index parameter if needed }
                                  if ppo_indexed in p.propoptions then
                                  if ppo_indexed in p.propoptions then
                                    begin
                                    begin
-                                     hparavs:=tparavarsym.create('$index',10,vs_value,p.indexdef,[]);
+                                     hparavs:=cparavarsym.create('$index',10,vs_value,p.indexdef,[]);
                                      storedprocdef.parast.insert(hparavs);
                                      storedprocdef.parast.insert(hparavs);
                                    end;
                                    end;
 
 
@@ -956,7 +956,7 @@ implementation
             (def.typesym=nil) and
             (def.typesym=nil) and
             check_proc_directive(true) then
             check_proc_directive(true) then
            begin
            begin
-              newtype:=ttypesym.create('unnamed',def);
+              newtype:=ctypesym.create('unnamed',def);
               parse_var_proc_directives(tsym(newtype));
               parse_var_proc_directives(tsym(newtype));
               newtype.typedef:=nil;
               newtype.typedef:=nil;
               def.typesym:=nil;
               def.typesym:=nil;
@@ -1181,7 +1181,7 @@ implementation
           case vs.typ of
           case vs.typ of
             localvarsym :
             localvarsym :
               begin
               begin
-                tcsym:=tstaticvarsym.create('$default'+vs.realname,vs_const,vs.vardef,[]);
+                tcsym:=cstaticvarsym.create('$default'+vs.realname,vs_const,vs.vardef,[]);
                 include(tcsym.symoptions,sp_internal);
                 include(tcsym.symoptions,sp_internal);
                 vs.defaultconstsym:=tcsym;
                 vs.defaultconstsym:=tcsym;
                 symtablestack.top.insert(tcsym);
                 symtablestack.top.insert(tcsym);
@@ -1241,7 +1241,7 @@ implementation
           if (pt.nodetype=stringconstn) or
           if (pt.nodetype=stringconstn) or
             (is_constcharnode(pt)) then
             (is_constcharnode(pt)) then
             begin
             begin
-              abssym:=tabsolutevarsym.create(vs.realname,vs.vardef);
+              abssym:=cabsolutevarsym.create(vs.realname,vs.vardef);
               abssym.fileinfo:=vs.fileinfo;
               abssym.fileinfo:=vs.fileinfo;
               if pt.nodetype=stringconstn then
               if pt.nodetype=stringconstn then
                 abssym.asmname:=stringdup(strpas(tstringconstnode(pt).value_str))
                 abssym.asmname:=stringdup(strpas(tstringconstnode(pt).value_str))
@@ -1253,7 +1253,7 @@ implementation
           { address }
           { address }
           else if is_constintnode(pt) then
           else if is_constintnode(pt) then
             begin
             begin
-              abssym:=tabsolutevarsym.create(vs.realname,vs.vardef);
+              abssym:=cabsolutevarsym.create(vs.realname,vs.vardef);
               abssym.fileinfo:=vs.fileinfo;
               abssym.fileinfo:=vs.fileinfo;
               abssym.abstyp:=toaddr;
               abssym.abstyp:=toaddr;
 {$ifndef cpu64bitaddr}
 {$ifndef cpu64bitaddr}
@@ -1345,7 +1345,7 @@ implementation
                   { we should check the result type of loadn }
                   { we should check the result type of loadn }
                   if not (tloadnode(hp).symtableentry.typ in [fieldvarsym,staticvarsym,localvarsym,paravarsym]) then
                   if not (tloadnode(hp).symtableentry.typ in [fieldvarsym,staticvarsym,localvarsym,paravarsym]) then
                     Message(parser_e_absolute_only_to_var_or_const);
                     Message(parser_e_absolute_only_to_var_or_const);
-                  abssym:=tabsolutevarsym.create(vs.realname,vs.vardef);
+                  abssym:=cabsolutevarsym.create(vs.realname,vs.vardef);
                   abssym.fileinfo:=vs.fileinfo;
                   abssym.fileinfo:=vs.fileinfo;
                   abssym.abstyp:=tovar;
                   abssym.abstyp:=tovar;
                   abssym.ref:=node_to_propaccesslist(pt);
                   abssym.ref:=node_to_propaccesslist(pt);
@@ -1407,11 +1407,11 @@ implementation
                  begin
                  begin
                    case symtablestack.top.symtabletype of
                    case symtablestack.top.symtabletype of
                      localsymtable :
                      localsymtable :
-                       vs:=tlocalvarsym.create(orgpattern,vs_value,generrordef,[]);
+                       vs:=clocalvarsym.create(orgpattern,vs_value,generrordef,[]);
                      staticsymtable,
                      staticsymtable,
                      globalsymtable :
                      globalsymtable :
                        begin
                        begin
-                         vs:=tstaticvarsym.create(orgpattern,vs_value,generrordef,[]);
+                         vs:=cstaticvarsym.create(orgpattern,vs_value,generrordef,[]);
                          if vd_threadvar in options then
                          if vd_threadvar in options then
                            include(vs.varoptions,vo_is_thread_var);
                            include(vs.varoptions,vo_is_thread_var);
                        end;
                        end;
@@ -1626,7 +1626,7 @@ implementation
                sorg:=orgpattern;
                sorg:=orgpattern;
                if token=_ID then
                if token=_ID then
                  begin
                  begin
-                   vs:=tfieldvarsym.create(sorg,vs_value,generrordef,[]);
+                   vs:=cfieldvarsym.create(sorg,vs_value,generrordef,[]);
 
 
                    { normally the visibility is set via addfield, but sometimes
                    { normally the visibility is set via addfield, but sometimes
                      we collect symbols so we can add them in a batch of
                      we collect symbols so we can add them in a batch of
@@ -1849,7 +1849,7 @@ implementation
                 begin
                 begin
                   consume(_ID);
                   consume(_ID);
                   consume(_COLON);
                   consume(_COLON);
-                  fieldvs:=tfieldvarsym.create(sorg,vs_value,generrordef,[]);
+                  fieldvs:=cfieldvarsym.create(sorg,vs_value,generrordef,[]);
                   variantdesc^^.variantselector:=fieldvs;
                   variantdesc^^.variantselector:=fieldvs;
                   symtablestack.top.insert(fieldvs);
                   symtablestack.top.insert(fieldvs);
                 end;
                 end;
@@ -1869,7 +1869,7 @@ implementation
               consume(_OF);
               consume(_OF);
 
 
               UnionSymtable:=trecordsymtable.create('',current_settings.packrecords);
               UnionSymtable:=trecordsymtable.create('',current_settings.packrecords);
-              UnionDef:=trecorddef.create('',unionsymtable);
+              UnionDef:=crecorddef.create('',unionsymtable);
               uniondef.isunion:=true;
               uniondef.isunion:=true;
 
 
               startvarrecsize:=UnionSymtable.datasize;
               startvarrecsize:=UnionSymtable.datasize;

+ 7 - 7
compiler/pexpr.pas

@@ -112,14 +112,14 @@ implementation
                 if tordconstnode(p).value>255 then
                 if tordconstnode(p).value>255 then
                   begin
                   begin
                     { longstring is currently unsupported (CEC)! }
                     { longstring is currently unsupported (CEC)! }
-{                    t:=tstringdef.createlong(tordconstnode(p).value))}
+{                    t:=cstringdef.createlong(tordconstnode(p).value))}
                     Message(parser_e_invalid_string_size);
                     Message(parser_e_invalid_string_size);
                     tordconstnode(p).value:=255;
                     tordconstnode(p).value:=255;
-                    def:=tstringdef.createshort(int64(tordconstnode(p).value));
+                    def:=cstringdef.createshort(int64(tordconstnode(p).value));
                   end
                   end
                 else
                 else
                   if tordconstnode(p).value<>255 then
                   if tordconstnode(p).value<>255 then
-                    def:=tstringdef.createshort(int64(tordconstnode(p).value));
+                    def:=cstringdef.createshort(int64(tordconstnode(p).value));
                 consume(_RECKKLAMMER);
                 consume(_RECKKLAMMER);
               end;
               end;
              p.free;
              p.free;
@@ -332,13 +332,13 @@ implementation
                                   include(current_procinfo.flags,pi_has_nested_exit);
                                   include(current_procinfo.flags,pi_has_nested_exit);
                                   exclude(current_procinfo.procdef.procoptions,po_inline);
                                   exclude(current_procinfo.procdef.procoptions,po_inline);
 
 
-                                  exit_procinfo.nestedexitlabel:=tlabelsym.create('$nestedexit');
+                                  exit_procinfo.nestedexitlabel:=clabelsym.create('$nestedexit');
 
 
                                   { the compiler is responsible to define this label }
                                   { the compiler is responsible to define this label }
                                   exit_procinfo.nestedexitlabel.defined:=true;
                                   exit_procinfo.nestedexitlabel.defined:=true;
                                   exit_procinfo.nestedexitlabel.used:=true;
                                   exit_procinfo.nestedexitlabel.used:=true;
 
 
-                                  exit_procinfo.nestedexitlabel.jumpbuf:=tlocalvarsym.create('LABEL$_'+exit_procinfo.nestedexitlabel.name,vs_value,rec_jmp_buf,[]);
+                                  exit_procinfo.nestedexitlabel.jumpbuf:=clocalvarsym.create('LABEL$_'+exit_procinfo.nestedexitlabel.name,vs_value,rec_jmp_buf,[]);
                                   exit_procinfo.procdef.localst.insert(exit_procinfo.nestedexitlabel);
                                   exit_procinfo.procdef.localst.insert(exit_procinfo.nestedexitlabel);
                                   exit_procinfo.procdef.localst.insert(exit_procinfo.nestedexitlabel.jumpbuf);
                                   exit_procinfo.procdef.localst.insert(exit_procinfo.nestedexitlabel.jumpbuf);
                                 end;
                                 end;
@@ -2741,7 +2741,7 @@ implementation
                 undefinedsym :
                 undefinedsym :
                   begin
                   begin
                     p1:=cnothingnode.Create;
                     p1:=cnothingnode.Create;
-                    p1.resultdef:=tundefineddef.create;
+                    p1.resultdef:=cundefineddef.create;
                     { clean up previously created dummy symbol }
                     { clean up previously created dummy symbol }
                     srsym.free;
                     srsym.free;
                   end;
                   end;
@@ -3004,7 +3004,7 @@ implementation
                                hdef:=hclassdef;
                                hdef:=hclassdef;
                              if (po_classmethod in current_procinfo.procdef.procoptions) or
                              if (po_classmethod in current_procinfo.procdef.procoptions) or
                                 (po_staticmethod in current_procinfo.procdef.procoptions) then
                                 (po_staticmethod in current_procinfo.procdef.procoptions) then
-                               hdef:=tclassrefdef.create(hdef);
+                               hdef:=cclassrefdef.create(hdef);
                              p1:=ctypenode.create(hdef);
                              p1:=ctypenode.create(hdef);
                              { we need to allow helpers here }
                              { we need to allow helpers here }
                              ttypenode(p1).helperallowed:=true;
                              ttypenode(p1).helperallowed:=true;

+ 7 - 7
compiler/pgenutil.pas

@@ -631,7 +631,7 @@ uses
             srsym:=tsym(genericdef.genericparas[i]);
             srsym:=tsym(genericdef.genericparas[i]);
             if not (sp_generic_para in srsym.symoptions) then
             if not (sp_generic_para in srsym.symoptions) then
               internalerror(2013092602);
               internalerror(2013092602);
-            generictype:=ttypesym.create(srsym.realname,tdef(genericdeflist[i]));
+            generictype:=ctypesym.create(srsym.realname,tdef(genericdeflist[i]));
             generictypelist.add(generictype);
             generictypelist.add(generictype);
           end;
           end;
 
 
@@ -728,7 +728,7 @@ uses
 
 
                 { First a new typesym so we can reuse this specialization and
                 { First a new typesym so we can reuse this specialization and
                   references to this specialization can be handled }
                   references to this specialization can be handled }
-                srsym:=ttypesym.create(finalspecializename,generrordef);
+                srsym:=ctypesym.create(finalspecializename,generrordef);
                 specializest.insert(srsym);
                 specializest.insert(srsym);
 
 
                 { specializations are declarations as such it is the wisest to
                 { specializations are declarations as such it is the wisest to
@@ -877,7 +877,7 @@ uses
         repeat
         repeat
           if token=_ID then
           if token=_ID then
             begin
             begin
-              generictype:=ttypesym.create(orgpattern,cundefinedtype);
+              generictype:=ctypesym.create(orgpattern,cundefinedtype);
               include(generictype.symoptions,sp_generic_para);
               include(generictype.symoptions,sp_generic_para);
               result.add(generictype);
               result.add(generictype);
             end;
             end;
@@ -924,7 +924,7 @@ uses
                       else
                       else
                         begin
                         begin
                           srsymtable:=trecordsymtable.create(defname,0);
                           srsymtable:=trecordsymtable.create(defname,0);
-                          basedef:=trecorddef.create(defname,srsymtable);
+                          basedef:=crecorddef.create(defname,srsymtable);
                           include(constraintdata.flags,gcf_record);
                           include(constraintdata.flags,gcf_record);
                           allowconstructor:=false;
                           allowconstructor:=false;
                         end;
                         end;
@@ -983,7 +983,7 @@ uses
                     if (basedef.typ<>objectdef) or
                     if (basedef.typ<>objectdef) or
                         not (tobjectdef(basedef).objecttype in [odt_javaclass,odt_class]) then
                         not (tobjectdef(basedef).objecttype in [odt_javaclass,odt_class]) then
                       internalerror(2012101101);
                       internalerror(2012101101);
-                  basedef:=tobjectdef.create(tobjectdef(basedef).objecttype,defname,tobjectdef(basedef));
+                  basedef:=cobjectdef.create(tobjectdef(basedef).objecttype,defname,tobjectdef(basedef));
                   for i:=0 to constraintdata.interfaces.count-1 do
                   for i:=0 to constraintdata.interfaces.count-1 do
                     tobjectdef(basedef).implementedinterfaces.add(
                     tobjectdef(basedef).implementedinterfaces.add(
                       timplementedinterface.create(tobjectdef(constraintdata.interfaces[i])));
                       timplementedinterface.create(tobjectdef(constraintdata.interfaces[i])));
@@ -994,7 +994,7 @@ uses
                     if basedef.typ<>errordef then
                     if basedef.typ<>errordef then
                       internalerror(2013021601);
                       internalerror(2013021601);
                     def:=tdef(constraintdata.interfaces[0]);
                     def:=tdef(constraintdata.interfaces[0]);
-                    basedef:=tobjectdef.create(tobjectdef(def).objecttype,defname,tobjectdef(def));
+                    basedef:=cobjectdef.create(tobjectdef(def).objecttype,defname,tobjectdef(def));
                     constraintdata.interfaces.delete(0);
                     constraintdata.interfaces.delete(0);
                   end;
                   end;
               if basedef.typ<>errordef then
               if basedef.typ<>errordef then
@@ -1080,7 +1080,7 @@ uses
           begin
           begin
             { we need to pass nil as def here, because the constructor wants
             { we need to pass nil as def here, because the constructor wants
               to set the typesym of the def which is not what we want }
               to set the typesym of the def which is not what we want }
-            gensym:=ttypesym.create(copy(name,1,pos('$',name)-1),nil);
+            gensym:=ctypesym.create(copy(name,1,pos('$',name)-1),nil);
             gensym.typedef:=current_structdef;
             gensym.typedef:=current_structdef;
             include(gensym.symoptions,sp_internal);
             include(gensym.symoptions,sp_internal);
             { the symbol should be only visible to the generic class
             { the symbol should be only visible to the generic class

+ 10 - 10
compiler/pmodules.pas

@@ -184,7 +184,7 @@ implementation
            assigned(hp.globalmacrosymtable) then
            assigned(hp.globalmacrosymtable) then
           macrosymtablestack.push(hp.globalmacrosymtable);
           macrosymtablestack.push(hp.globalmacrosymtable);
         { insert unitsym }
         { insert unitsym }
-        unitsym:=tunitsym.create(s,hp);
+        unitsym:=cunitsym.create(s,hp);
         inc(unitsym.refs);
         inc(unitsym.refs);
         tabstractunitsymtable(current_module.localsymtable).insertunit(unitsym);
         tabstractunitsymtable(current_module.localsymtable).insertunit(unitsym);
         { add to used units }
         { add to used units }
@@ -457,7 +457,7 @@ implementation
                 can not use the modulename because that can be different
                 can not use the modulename because that can be different
                 when -Un is used }
                 when -Un is used }
               current_tokenpos:=filepos;
               current_tokenpos:=filepos;
-              unitsym:=tunitsym.create(sorg,nil);
+              unitsym:=cunitsym.create(sorg,nil);
               tabstractunitsymtable(current_module.localsymtable).insertunit(unitsym);
               tabstractunitsymtable(current_module.localsymtable).insertunit(unitsym);
               { the current module uses the unit hp2 }
               { the current module uses the unit hp2 }
               current_module.addusedunit(hp2,true,unitsym);
               current_module.addusedunit(hp2,true,unitsym);
@@ -561,7 +561,7 @@ implementation
         if assigned(current_procinfo) then
         if assigned(current_procinfo) then
          internalerror(200304275);
          internalerror(200304275);
         {Generate a procsym for main}
         {Generate a procsym for main}
-        ps:=tprocsym.create('$'+name);
+        ps:=cprocsym.create('$'+name);
         { main are allways used }
         { main are allways used }
         inc(ps.refs);
         inc(ps.refs);
         st.insert(ps);
         st.insert(ps);
@@ -604,7 +604,7 @@ implementation
             (tf_pic_uses_got in target_info.flags) then
             (tf_pic_uses_got in target_info.flags) then
            begin
            begin
              { insert symbol for got access in assembler code}
              { insert symbol for got access in assembler code}
-             gotvarsym:=tstaticvarsym.create('_GLOBAL_OFFSET_TABLE_',
+             gotvarsym:=cstaticvarsym.create('_GLOBAL_OFFSET_TABLE_',
                           vs_value,voidpointertype,[vo_is_external]);
                           vs_value,voidpointertype,[vo_is_external]);
              gotvarsym.set_mangledname('_GLOBAL_OFFSET_TABLE_');
              gotvarsym.set_mangledname('_GLOBAL_OFFSET_TABLE_');
              current_module.localsymtable.insert(gotvarsym);
              current_module.localsymtable.insert(gotvarsym);
@@ -712,11 +712,11 @@ implementation
           { java_jlobject may not have been parsed yet (system unit); in any
           { java_jlobject may not have been parsed yet (system unit); in any
             case, we only use this to refer to the class type, so inheritance
             case, we only use this to refer to the class type, so inheritance
             does not matter }
             does not matter }
-          def:=tobjectdef.create(odt_javaclass,'__FPC_JVM_Module_Class_Alias$',nil);
+          def:=cobjectdef.create(odt_javaclass,'__FPC_JVM_Module_Class_Alias$',nil);
           include(def.objectoptions,oo_is_external);
           include(def.objectoptions,oo_is_external);
           include(def.objectoptions,oo_is_sealed);
           include(def.objectoptions,oo_is_sealed);
           def.objextname:=stringdup(current_module.realmodulename^);
           def.objextname:=stringdup(current_module.realmodulename^);
-          typesym:=ttypesym.create('__FPC_JVM_Module_Class_Alias$',def);
+          typesym:=ctypesym.create('__FPC_JVM_Module_Class_Alias$',def);
           symtablestack.top.insert(typesym);
           symtablestack.top.insert(typesym);
         end;
         end;
 {$endif jvm}
 {$endif jvm}
@@ -834,7 +834,7 @@ type
 
 
          { insert unitsym of this unit to prevent other units having
          { insert unitsym of this unit to prevent other units having
            the same name }
            the same name }
-         tabstractunitsymtable(current_module.localsymtable).insertunit(tunitsym.create(current_module.realmodulename^,current_module));
+         tabstractunitsymtable(current_module.localsymtable).insertunit(cunitsym.create(current_module.realmodulename^,current_module));
 
 
          { load default units, like the system unit }
          { load default units, like the system unit }
          loaddefaultunits;
          loaddefaultunits;
@@ -1708,7 +1708,7 @@ type
 
 
          {Insert the name of the main program into the symbol table.}
          {Insert the name of the main program into the symbol table.}
          if current_module.realmodulename^<>'' then
          if current_module.realmodulename^<>'' then
-           tabstractunitsymtable(current_module.localsymtable).insertunit(tunitsym.create(current_module.realmodulename^,current_module));
+           tabstractunitsymtable(current_module.localsymtable).insertunit(cunitsym.create(current_module.realmodulename^,current_module));
 
 
          Message1(parser_u_parsing_implementation,current_module.mainsource);
          Message1(parser_u_parsing_implementation,current_module.mainsource);
 
 
@@ -2063,7 +2063,7 @@ type
                internalerror(2013011201);
                internalerror(2013011201);
              for i:=0 to high(sc) do
              for i:=0 to high(sc) do
                begin
                begin
-                 ps:=tstaticvarsym.create(sc[i].name,vs_value,textsym.typedef,[]);
+                 ps:=cstaticvarsym.create(sc[i].name,vs_value,textsym.typedef,[]);
                  ps.isoindex:=sc[i].nr;
                  ps.isoindex:=sc[i].nr;
                  current_module.localsymtable.insert(ps,true);
                  current_module.localsymtable.insert(ps,true);
                  cnodeutils.insertbssdata(tstaticvarsym(ps));
                  cnodeutils.insertbssdata(tstaticvarsym(ps));
@@ -2089,7 +2089,7 @@ type
 
 
          {Insert the name of the main program into the symbol table.}
          {Insert the name of the main program into the symbol table.}
          if current_module.realmodulename^<>'' then
          if current_module.realmodulename^<>'' then
-           tabstractunitsymtable(current_module.localsymtable).insertunit(tunitsym.create(current_module.realmodulename^,current_module));
+           tabstractunitsymtable(current_module.localsymtable).insertunit(cunitsym.create(current_module.realmodulename^,current_module));
 
 
          Message1(parser_u_parsing_implementation,current_module.mainsource);
          Message1(parser_u_parsing_implementation,current_module.mainsource);
 
 

+ 174 - 0
compiler/powerpc/symcpu.pas

@@ -0,0 +1,174 @@
+{
+    Copyright (c) 2014 by Florian Klaempfl
+
+    Symbol table overrides for PowerPC
+
+    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 symcpu;
+
+{$i fpcdefs.inc}
+
+interface
+
+uses
+  symdef,symsym;
+
+type
+  { defs }
+  tcpufiledef = class(tfiledef)
+  end;
+
+  tcpuvariantdef = class(tvariantdef)
+  end;
+
+  tcpuformaldef = class(tformaldef)
+  end;
+
+  tcpuforwarddef = class(tforwarddef)
+  end;
+
+  tcpuundefineddef = class(tundefineddef)
+  end;
+
+  tcpuerrordef = class(terrordef)
+  end;
+
+  tcpupointerdef = class(tpointerdef)
+  end;
+
+  tcpurecorddef = class(trecorddef)
+  end;
+
+  tcpuimplementedinterface = class(timplementedinterface)
+  end;
+
+  tcpuobjectdef = class(tobjectdef)
+  end;
+
+  tcpuclassrefdef = class(tclassrefdef)
+  end;
+
+  tcpuarraydef = class(tarraydef)
+  end;
+
+  tcpuorddef = class(torddef)
+  end;
+
+  tcpufloatdef = class(tfloatdef)
+  end;
+
+  tcpuprocvardef = class(tprocvardef)
+  end;
+
+  tcpuprocdef = class(tprocdef)
+  end;
+
+  tcpustringdef = class(tstringdef)
+  end;
+
+  tcpuenumdef = class(tenumdef)
+  end;
+
+  tcpusetdef = class(tsetdef)
+  end;
+
+  { syms }
+  tcpulabelsym = class(tlabelsym)
+  end;
+
+  tcpuunitsym = class(tunitsym)
+  end;
+
+  tcpunamespacesym = class(tnamespacesym)
+  end;
+
+  tcpuprocsym = class(tprocsym)
+  end;
+
+  tcpuypesym = class(ttypesym)
+  end;
+
+  tcpufieldvarsym = class(tfieldvarsym)
+  end;
+
+  tcpulocalvarsym = class(tlocalvarsym)
+  end;
+
+  tcpuparavarsym = class(tparavarsym)
+  end;
+
+  tcpustaticvarsym = class(tstaticvarsym)
+  end;
+
+  tcpuabsolutevarsym = class(tabsolutevarsym)
+  end;
+
+  tcpupropertysym = class(tpropertysym)
+  end;
+
+  tcpuconstsym = class(tconstsym)
+  end;
+
+  tcpuenumsym = class(tenumsym)
+  end;
+
+  tcpusyssym = class(tsyssym)
+  end;
+
+
+implementation
+
+begin
+  { used tdef classes }
+  cfiledef:=tcpufiledef;
+  cvariantdef:=tcpuvariantdef;
+  cformaldef:=tcpuformaldef;
+  cforwarddef:=tcpuforwarddef;
+  cundefineddef:=tcpuundefineddef;
+  cerrordef:=tcpuerrordef;
+  cpointerdef:=tcpupointerdef;
+  crecorddef:=tcpurecorddef;
+  cimplementedinterface:=tcpuimplementedinterface;
+  cobjectdef:=tcpuobjectdef;
+  cclassrefdef:=tcpuclassrefdef;
+  carraydef:=tcpuarraydef;
+  corddef:=tcpuorddef;
+  cfloatdef:=tcpufloatdef;
+  cprocvardef:=tcpuprocvardef;
+  cprocdef:=tcpuprocdef;
+  cstringdef:=tcpustringdef;
+  cenumdef:=tcpuenumdef;
+  csetdef:=tcpusetdef;
+
+  { used tsym classes }
+  clabelsym:=tcpulabelsym;
+  cunitsym:=tcpuunitsym;
+  cnamespacesym:=tcpunamespacesym;
+  cprocsym:=tcpuprocsym;
+  ctypesym:=tcpuypesym;
+  cfieldvarsym:=tcpufieldvarsym;
+  clocalvarsym:=tcpulocalvarsym;
+  cparavarsym:=tcpuparavarsym;
+  cstaticvarsym:=tcpustaticvarsym;
+  cabsolutevarsym:=tcpuabsolutevarsym;
+  cpropertysym:=tcpupropertysym;
+  cconstsym:=tcpuconstsym;
+  cenumsym:=tcpuenumsym;
+  csyssym:=tcpusyssym;
+end.
+

+ 3 - 1
compiler/powerpc64/cpunode.pas

@@ -45,7 +45,9 @@ uses
   //       nppcopt,
   //       nppcopt,
   nppcmat,
   nppcmat,
   nppccnv,
   nppccnv,
-  nppcld
+  nppcld,
+  { symtable }
+  symcpu
   ;
   ;
 
 
 end.
 end.

+ 174 - 0
compiler/powerpc64/symcpu.pas

@@ -0,0 +1,174 @@
+{
+    Copyright (c) 2014 by Florian Klaempfl
+
+    Symbol table overrides for PowerPC64
+
+    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 symcpu;
+
+{$i fpcdefs.inc}
+
+interface
+
+uses
+  symdef,symsym;
+
+type
+  { defs }
+  tcpufiledef = class(tfiledef)
+  end;
+
+  tcpuvariantdef = class(tvariantdef)
+  end;
+
+  tcpuformaldef = class(tformaldef)
+  end;
+
+  tcpuforwarddef = class(tforwarddef)
+  end;
+
+  tcpuundefineddef = class(tundefineddef)
+  end;
+
+  tcpuerrordef = class(terrordef)
+  end;
+
+  tcpupointerdef = class(tpointerdef)
+  end;
+
+  tcpurecorddef = class(trecorddef)
+  end;
+
+  tcpuimplementedinterface = class(timplementedinterface)
+  end;
+
+  tcpuobjectdef = class(tobjectdef)
+  end;
+
+  tcpuclassrefdef = class(tclassrefdef)
+  end;
+
+  tcpuarraydef = class(tarraydef)
+  end;
+
+  tcpuorddef = class(torddef)
+  end;
+
+  tcpufloatdef = class(tfloatdef)
+  end;
+
+  tcpuprocvardef = class(tprocvardef)
+  end;
+
+  tcpuprocdef = class(tprocdef)
+  end;
+
+  tcpustringdef = class(tstringdef)
+  end;
+
+  tcpuenumdef = class(tenumdef)
+  end;
+
+  tcpusetdef = class(tsetdef)
+  end;
+
+  { syms }
+  tcpulabelsym = class(tlabelsym)
+  end;
+
+  tcpuunitsym = class(tunitsym)
+  end;
+
+  tcpunamespacesym = class(tnamespacesym)
+  end;
+
+  tcpuprocsym = class(tprocsym)
+  end;
+
+  tcpuypesym = class(ttypesym)
+  end;
+
+  tcpufieldvarsym = class(tfieldvarsym)
+  end;
+
+  tcpulocalvarsym = class(tlocalvarsym)
+  end;
+
+  tcpuparavarsym = class(tparavarsym)
+  end;
+
+  tcpustaticvarsym = class(tstaticvarsym)
+  end;
+
+  tcpuabsolutevarsym = class(tabsolutevarsym)
+  end;
+
+  tcpupropertysym = class(tpropertysym)
+  end;
+
+  tcpuconstsym = class(tconstsym)
+  end;
+
+  tcpuenumsym = class(tenumsym)
+  end;
+
+  tcpusyssym = class(tsyssym)
+  end;
+
+
+implementation
+
+begin
+  { used tdef classes }
+  cfiledef:=tcpufiledef;
+  cvariantdef:=tcpuvariantdef;
+  cformaldef:=tcpuformaldef;
+  cforwarddef:=tcpuforwarddef;
+  cundefineddef:=tcpuundefineddef;
+  cerrordef:=tcpuerrordef;
+  cpointerdef:=tcpupointerdef;
+  crecorddef:=tcpurecorddef;
+  cimplementedinterface:=tcpuimplementedinterface;
+  cobjectdef:=tcpuobjectdef;
+  cclassrefdef:=tcpuclassrefdef;
+  carraydef:=tcpuarraydef;
+  corddef:=tcpuorddef;
+  cfloatdef:=tcpufloatdef;
+  cprocvardef:=tcpuprocvardef;
+  cprocdef:=tcpuprocdef;
+  cstringdef:=tcpustringdef;
+  cenumdef:=tcpuenumdef;
+  csetdef:=tcpusetdef;
+
+  { used tsym classes }
+  clabelsym:=tcpulabelsym;
+  cunitsym:=tcpuunitsym;
+  cnamespacesym:=tcpunamespacesym;
+  cprocsym:=tcpuprocsym;
+  ctypesym:=tcpuypesym;
+  cfieldvarsym:=tcpufieldvarsym;
+  clocalvarsym:=tcpulocalvarsym;
+  cparavarsym:=tcpuparavarsym;
+  cstaticvarsym:=tcpustaticvarsym;
+  cabsolutevarsym:=tcpuabsolutevarsym;
+  cpropertysym:=tcpupropertysym;
+  cconstsym:=tcpuconstsym;
+  cenumsym:=tcpuenumsym;
+  csyssym:=tcpusyssym;
+end.
+

+ 11 - 1
compiler/pp.lpi

@@ -27,12 +27,22 @@
         <FormatVersion Value="1"/>
         <FormatVersion Value="1"/>
       </local>
       </local>
     </RunParams>
     </RunParams>
-    <Units Count="1">
+    <Units Count="3">
       <Unit0>
       <Unit0>
         <Filename Value="pp.pas"/>
         <Filename Value="pp.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
         <UnitName Value="pp"/>
         <UnitName Value="pp"/>
       </Unit0>
       </Unit0>
+      <Unit1>
+        <Filename Value="x86\symold86.pas"/>
+        <IsPartOfProject Value="True"/>
+        <UnitName Value="symold86"/>
+      </Unit1>
+      <Unit2>
+        <Filename Value="i8086\symcpu.pas"/>
+        <IsPartOfProject Value="True"/>
+        <UnitName Value="symcpu"/>
+      </Unit2>
     </Units>
     </Units>
   </ProjectOptions>
   </ProjectOptions>
   <CompilerOptions>
   <CompilerOptions>

+ 15 - 15
compiler/pparautl.pas

@@ -76,7 +76,7 @@ implementation
 {$endif}
 {$endif}
              paranr:=paranr_result;
              paranr:=paranr_result;
            { Generate result variable accessing function result }
            { Generate result variable accessing function result }
-           vs:=tparavarsym.create('$result',paranr,vs_var,pd.returndef,[vo_is_funcret,vo_is_hidden_para]);
+           vs:=cparavarsym.create('$result',paranr,vs_var,pd.returndef,[vo_is_funcret,vo_is_hidden_para]);
            pd.parast.insert(vs);
            pd.parast.insert(vs);
            { Store this symbol as funcretsym for procedures }
            { Store this symbol as funcretsym for procedures }
            if pd.typ=procdef then
            if pd.typ=procdef then
@@ -118,7 +118,7 @@ implementation
                { in case of errors, prevent invalid type cast }
                { in case of errors, prevent invalid type cast }
                (pd.owner.defowner.typ<>procdef) then
                (pd.owner.defowner.typ<>procdef) then
               begin
               begin
-                vs:=tparavarsym.create('$parentfp',paranr,vs_value
+                vs:=cparavarsym.create('$parentfp',paranr,vs_value
                       ,parentfpvoidpointertype,[vo_is_parentfp,vo_is_hidden_para]);
                       ,parentfpvoidpointertype,[vo_is_parentfp,vo_is_hidden_para]);
                 vs.varregable:=vr_none;
                 vs.varregable:=vr_none;
               end
               end
@@ -126,7 +126,7 @@ implementation
               begin
               begin
                 if not assigned(tprocdef(pd.owner.defowner).parentfpstruct) then
                 if not assigned(tprocdef(pd.owner.defowner).parentfpstruct) then
                   build_parentfpstruct(tprocdef(pd.owner.defowner));
                   build_parentfpstruct(tprocdef(pd.owner.defowner));
-                vs:=tparavarsym.create('$parentfp',paranr,vs_value
+                vs:=cparavarsym.create('$parentfp',paranr,vs_value
                       ,tprocdef(pd.owner.defowner).parentfpstructptrtype,[vo_is_parentfp,vo_is_hidden_para]);
                       ,tprocdef(pd.owner.defowner).parentfpstructptrtype,[vo_is_parentfp,vo_is_hidden_para]);
               end;
               end;
             pd.parast.insert(vs);
             pd.parast.insert(vs);
@@ -151,12 +151,12 @@ implementation
            (pd.parast.symtablelevel=normal_function_level) then
            (pd.parast.symtablelevel=normal_function_level) then
           begin
           begin
             { insert Objective-C self and selector parameters }
             { insert Objective-C self and selector parameters }
-            vs:=tparavarsym.create('$_cmd',paranr_objc_cmd,vs_value,objc_seltype,[vo_is_msgsel,vo_is_hidden_para]);
+            vs:=cparavarsym.create('$_cmd',paranr_objc_cmd,vs_value,objc_seltype,[vo_is_msgsel,vo_is_hidden_para]);
             pd.parast.insert(vs);
             pd.parast.insert(vs);
             { make accessible to code }
             { make accessible to code }
             sl:=tpropaccesslist.create;
             sl:=tpropaccesslist.create;
             sl.addsym(sl_load,vs);
             sl.addsym(sl_load,vs);
-            aliasvs:=tabsolutevarsym.create_ref('_CMD',objc_seltype,sl);
+            aliasvs:=cabsolutevarsym.create_ref('_CMD',objc_seltype,sl);
             include(aliasvs.varoptions,vo_is_msgsel);
             include(aliasvs.varoptions,vo_is_msgsel);
             tlocalsymtable(tprocdef(pd).localst).insert(aliasvs);
             tlocalsymtable(tprocdef(pd).localst).insert(aliasvs);
 
 
@@ -166,14 +166,14 @@ implementation
             else
             else
               hdef:=tprocdef(pd).struct;
               hdef:=tprocdef(pd).struct;
 
 
-            vs:=tparavarsym.create('$self',paranr_objc_self,vs_value,hdef,[vo_is_self,vo_is_hidden_para]);
+            vs:=cparavarsym.create('$self',paranr_objc_self,vs_value,hdef,[vo_is_self,vo_is_hidden_para]);
             pd.parast.insert(vs);
             pd.parast.insert(vs);
           end
           end
         else if (pd.typ=procvardef) and
         else if (pd.typ=procvardef) and
            pd.is_methodpointer then
            pd.is_methodpointer then
           begin
           begin
             { Generate self variable }
             { Generate self variable }
-            vs:=tparavarsym.create('$self',paranr_self,vs_value,voidpointertype,[vo_is_self,vo_is_hidden_para]);
+            vs:=cparavarsym.create('$self',paranr_self,vs_value,voidpointertype,[vo_is_self,vo_is_hidden_para]);
             pd.parast.insert(vs);
             pd.parast.insert(vs);
           end
           end
         else
         else
@@ -202,7 +202,7 @@ implementation
                  begin
                  begin
                    { can't use classrefdef as type because inheriting
                    { can't use classrefdef as type because inheriting
                      will then always file because of a type mismatch }
                      will then always file because of a type mismatch }
-                   vs:=tparavarsym.create('$vmt',paranr_vmt,vs_value,voidpointertype,[vo_is_vmt,vo_is_hidden_para]);
+                   vs:=cparavarsym.create('$vmt',paranr_vmt,vs_value,voidpointertype,[vo_is_vmt,vo_is_hidden_para]);
                    pd.parast.insert(vs);
                    pd.parast.insert(vs);
                  end;
                  end;
 
 
@@ -218,14 +218,14 @@ implementation
                 vsp:=vs_value;
                 vsp:=vs_value;
                 if (po_staticmethod in pd.procoptions) or
                 if (po_staticmethod in pd.procoptions) or
                    (po_classmethod in pd.procoptions) then
                    (po_classmethod in pd.procoptions) then
-                  hdef:=tclassrefdef.create(selfdef)
+                  hdef:=cclassrefdef.create(selfdef)
                 else
                 else
                   begin
                   begin
                     if is_object(selfdef) or (selfdef.typ<>objectdef) then
                     if is_object(selfdef) or (selfdef.typ<>objectdef) then
                       vsp:=vs_var;
                       vsp:=vs_var;
                     hdef:=selfdef;
                     hdef:=selfdef;
                   end;
                   end;
-                vs:=tparavarsym.create('$self',paranr_self,vsp,hdef,[vo_is_self,vo_is_hidden_para]);
+                vs:=cparavarsym.create('$self',paranr_self,vsp,hdef,[vo_is_self,vo_is_hidden_para]);
                 pd.parast.insert(vs);
                 pd.parast.insert(vs);
 
 
                 current_tokenpos:=storepos;
                 current_tokenpos:=storepos;
@@ -257,7 +257,7 @@ implementation
            if (df_generic in pd.defoptions) or
            if (df_generic in pd.defoptions) or
                not paramanager.ret_in_param(pd.returndef,pd) then
                not paramanager.ret_in_param(pd.returndef,pd) then
             begin
             begin
-              vs:=tlocalvarsym.create('$result',vs_value,pd.returndef,[vo_is_funcret]);
+              vs:=clocalvarsym.create('$result',vs_value,pd.returndef,[vo_is_funcret]);
               pd.localst.insert(vs);
               pd.localst.insert(vs);
               pd.funcretsym:=vs;
               pd.funcretsym:=vs;
             end;
             end;
@@ -273,7 +273,7 @@ implementation
                  hs:=pd.procsym.name;
                  hs:=pd.procsym.name;
                sl:=tpropaccesslist.create;
                sl:=tpropaccesslist.create;
                sl.addsym(sl_load,pd.funcretsym);
                sl.addsym(sl_load,pd.funcretsym);
-               aliasvs:=tabsolutevarsym.create_ref(hs,pd.returndef,sl);
+               aliasvs:=cabsolutevarsym.create_ref(hs,pd.returndef,sl);
                include(aliasvs.varoptions,vo_is_funcret);
                include(aliasvs.varoptions,vo_is_funcret);
                tlocalsymtable(pd.localst).insert(aliasvs);
                tlocalsymtable(pd.localst).insert(aliasvs);
              end;
              end;
@@ -283,7 +283,7 @@ implementation
             begin
             begin
               sl:=tpropaccesslist.create;
               sl:=tpropaccesslist.create;
               sl.addsym(sl_load,pd.funcretsym);
               sl.addsym(sl_load,pd.funcretsym);
-              aliasvs:=tabsolutevarsym.create_ref('RESULT',pd.returndef,sl);
+              aliasvs:=cabsolutevarsym.create_ref('RESULT',pd.returndef,sl);
               include(aliasvs.varoptions,vo_is_funcret);
               include(aliasvs.varoptions,vo_is_funcret);
               include(aliasvs.varoptions,vo_is_result);
               include(aliasvs.varoptions,vo_is_result);
               tlocalsymtable(pd.localst).insert(aliasvs);
               tlocalsymtable(pd.localst).insert(aliasvs);
@@ -316,7 +316,7 @@ implementation
            { needs high parameter ? }
            { needs high parameter ? }
            if paramanager.push_high_param(varspez,vardef,pd.proccalloption) then
            if paramanager.push_high_param(varspez,vardef,pd.proccalloption) then
              begin
              begin
-               hvs:=tparavarsym.create('$high'+name,paranr+1,vs_const,sinttype,[vo_is_high_para,vo_is_hidden_para]);
+               hvs:=cparavarsym.create('$high'+name,paranr+1,vs_const,sinttype,[vo_is_high_para,vo_is_hidden_para]);
                hvs.symoptions:=[];
                hvs.symoptions:=[];
                owner.insert(hvs);
                owner.insert(hvs);
                { don't place to register if it will be accessed from implicit finally block }
                { don't place to register if it will be accessed from implicit finally block }
@@ -344,7 +344,7 @@ implementation
                end;
                end;
               if (vardef.typ=formaldef) and (Tformaldef(vardef).typed) then
               if (vardef.typ=formaldef) and (Tformaldef(vardef).typed) then
                 begin
                 begin
-                  hvs:=tparavarsym.create('$typinfo'+name,paranr+1,vs_const,voidpointertype,
+                  hvs:=cparavarsym.create('$typinfo'+name,paranr+1,vs_const,voidpointertype,
                                           [vo_is_typinfo_para,vo_is_hidden_para]);
                                           [vo_is_typinfo_para,vo_is_hidden_para]);
                   owner.insert(hvs);
                   owner.insert(hvs);
                 end;
                 end;

+ 3 - 3
compiler/pstatmnt.pas

@@ -671,7 +671,7 @@ implementation
                 if hasimplicitderef then
                 if hasimplicitderef then
                   hdef:=p.resultdef
                   hdef:=p.resultdef
                 else
                 else
-                  hdef:=tpointerdef.create(p.resultdef);
+                  hdef:=cpointerdef.create(p.resultdef);
                 { load address of the value in a temp }
                 { load address of the value in a temp }
                 tempnode:=ctempcreatenode.create_withnode(hdef,sizeof(pint),tt_persistent,true,p);
                 tempnode:=ctempcreatenode.create_withnode(hdef,sizeof(pint),tt_persistent,true,p);
                 typecheckpass(tnode(tempnode));
                 typecheckpass(tnode(tempnode));
@@ -940,7 +940,7 @@ implementation
                             begin
                             begin
                               single_type(ot,[]);
                               single_type(ot,[]);
                               check_type_valid(ot);
                               check_type_valid(ot);
-                              sym:=tlocalvarsym.create(objrealname,vs_value,ot,[]);
+                              sym:=clocalvarsym.create(objrealname,vs_value,ot,[]);
                             end
                             end
                           else
                           else
                             begin
                             begin
@@ -973,7 +973,7 @@ implementation
                                  { create dummy symbol so we don't need a special
                                  { create dummy symbol so we don't need a special
                                  case in ncgflw, and so that we always know the
                                  case in ncgflw, and so that we always know the
                                  type }
                                  type }
-                               sym:=tlocalvarsym.create('$exceptsym',vs_value,ot,[]);
+                               sym:=clocalvarsym.create('$exceptsym',vs_value,ot,[]);
                             end;
                             end;
                           excepTSymtable:=tstt_excepTSymtable.create;
                           excepTSymtable:=tstt_excepTSymtable.create;
                           excepTSymtable.insert(sym);
                           excepTSymtable.insert(sym);

+ 1 - 1
compiler/psub.pas

@@ -464,7 +464,7 @@ implementation
                                     load_self_pointer_node,
                                     load_self_pointer_node,
                                     voidpointertype),
                                     voidpointertype),
                                 ccallnode.create(nil,tprocsym(srsym),srsym.owner,
                                 ccallnode.create(nil,tprocsym(srsym),srsym.owner,
-                                  ctypeconvnode.create_internal(load_self_pointer_node,tclassrefdef.create(current_structdef)),
+                                  ctypeconvnode.create_internal(load_self_pointer_node,cclassrefdef.create(current_structdef)),
                                   [])),
                                   [])),
                             nil));
                             nil));
                       end
                       end

+ 139 - 139
compiler/psystem.pas

@@ -54,58 +54,58 @@ implementation
         all intern procedures for the system unit
         all intern procedures for the system unit
       }
       }
       begin
       begin
-        systemunit.insert(tsyssym.create('Concat',in_concat_x));
-        systemunit.insert(tsyssym.create('Write',in_write_x));
-        systemunit.insert(tsyssym.create('WriteLn',in_writeln_x));
-        systemunit.insert(tsyssym.create('WriteStr',in_writestr_x));
-        systemunit.insert(tsyssym.create('Assigned',in_assigned_x));
-        systemunit.insert(tsyssym.create('Read',in_read_x));
-        systemunit.insert(tsyssym.create('ReadLn',in_readln_x));
-        systemunit.insert(tsyssym.create('ReadStr',in_readstr_x));
-        systemunit.insert(tsyssym.create('Ofs',in_ofs_x));
-        systemunit.insert(tsyssym.create('SizeOf',in_sizeof_x));
-        systemunit.insert(tsyssym.create('BitSizeOf',in_bitsizeof_x));
-        systemunit.insert(tsyssym.create('TypeOf',in_typeof_x));
-        systemunit.insert(tsyssym.create('Low',in_low_x));
-        systemunit.insert(tsyssym.create('High',in_high_x));
-        systemunit.insert(tsyssym.create('Slice',in_slice_x));
-        systemunit.insert(tsyssym.create('Seg',in_seg_x));
-        systemunit.insert(tsyssym.create('Ord',in_ord_x));
-        systemunit.insert(tsyssym.create('Pred',in_pred_x));
-        systemunit.insert(tsyssym.create('Succ',in_succ_x));
-        systemunit.insert(tsyssym.create('Exclude',in_exclude_x_y));
-        systemunit.insert(tsyssym.create('Include',in_include_x_y));
-        systemunit.insert(tsyssym.create('Pack',in_pack_x_y_z));
-        systemunit.insert(tsyssym.create('Unpack',in_unpack_x_y_z));
-        systemunit.insert(tsyssym.create('Break',in_break));
-        systemunit.insert(tsyssym.create('Exit',in_exit));
-        systemunit.insert(tsyssym.create('Continue',in_continue));
-        systemunit.insert(tsyssym.create('Leave',in_leave)); {macpas only}
-        systemunit.insert(tsyssym.create('Cycle',in_cycle)); {macpas only}
-        systemunit.insert(tsyssym.create('Dec',in_dec_x));
-        systemunit.insert(tsyssym.create('Inc',in_inc_x));
-        systemunit.insert(tsyssym.create('Str',in_str_x_string));
-        systemunit.insert(tsyssym.create('Assert',in_assert_x_y));
-        systemunit.insert(tsyssym.create('Val',in_val_x));
-        systemunit.insert(tsyssym.create('Addr',in_addr_x));
-        systemunit.insert(tsyssym.create('TypeInfo',in_typeinfo_x));
-        systemunit.insert(tsyssym.create('SetLength',in_setlength_x));
-        systemunit.insert(tsyssym.create('Copy',in_copy_x));
-        systemunit.insert(tsyssym.create('Initialize',in_initialize_x));
-        systemunit.insert(tsyssym.create('Finalize',in_finalize_x));
-        systemunit.insert(tsyssym.create('Length',in_length_x));
-        systemunit.insert(tsyssym.create('New',in_new_x));
-        systemunit.insert(tsyssym.create('Dispose',in_dispose_x));
+        systemunit.insert(csyssym.create('Concat',in_concat_x));
+        systemunit.insert(csyssym.create('Write',in_write_x));
+        systemunit.insert(csyssym.create('WriteLn',in_writeln_x));
+        systemunit.insert(csyssym.create('WriteStr',in_writestr_x));
+        systemunit.insert(csyssym.create('Assigned',in_assigned_x));
+        systemunit.insert(csyssym.create('Read',in_read_x));
+        systemunit.insert(csyssym.create('ReadLn',in_readln_x));
+        systemunit.insert(csyssym.create('ReadStr',in_readstr_x));
+        systemunit.insert(csyssym.create('Ofs',in_ofs_x));
+        systemunit.insert(csyssym.create('SizeOf',in_sizeof_x));
+        systemunit.insert(csyssym.create('BitSizeOf',in_bitsizeof_x));
+        systemunit.insert(csyssym.create('TypeOf',in_typeof_x));
+        systemunit.insert(csyssym.create('Low',in_low_x));
+        systemunit.insert(csyssym.create('High',in_high_x));
+        systemunit.insert(csyssym.create('Slice',in_slice_x));
+        systemunit.insert(csyssym.create('Seg',in_seg_x));
+        systemunit.insert(csyssym.create('Ord',in_ord_x));
+        systemunit.insert(csyssym.create('Pred',in_pred_x));
+        systemunit.insert(csyssym.create('Succ',in_succ_x));
+        systemunit.insert(csyssym.create('Exclude',in_exclude_x_y));
+        systemunit.insert(csyssym.create('Include',in_include_x_y));
+        systemunit.insert(csyssym.create('Pack',in_pack_x_y_z));
+        systemunit.insert(csyssym.create('Unpack',in_unpack_x_y_z));
+        systemunit.insert(csyssym.create('Break',in_break));
+        systemunit.insert(csyssym.create('Exit',in_exit));
+        systemunit.insert(csyssym.create('Continue',in_continue));
+        systemunit.insert(csyssym.create('Leave',in_leave)); {macpas only}
+        systemunit.insert(csyssym.create('Cycle',in_cycle)); {macpas only}
+        systemunit.insert(csyssym.create('Dec',in_dec_x));
+        systemunit.insert(csyssym.create('Inc',in_inc_x));
+        systemunit.insert(csyssym.create('Str',in_str_x_string));
+        systemunit.insert(csyssym.create('Assert',in_assert_x_y));
+        systemunit.insert(csyssym.create('Val',in_val_x));
+        systemunit.insert(csyssym.create('Addr',in_addr_x));
+        systemunit.insert(csyssym.create('TypeInfo',in_typeinfo_x));
+        systemunit.insert(csyssym.create('SetLength',in_setlength_x));
+        systemunit.insert(csyssym.create('Copy',in_copy_x));
+        systemunit.insert(csyssym.create('Initialize',in_initialize_x));
+        systemunit.insert(csyssym.create('Finalize',in_finalize_x));
+        systemunit.insert(csyssym.create('Length',in_length_x));
+        systemunit.insert(csyssym.create('New',in_new_x));
+        systemunit.insert(csyssym.create('Dispose',in_dispose_x));
 {$ifdef SUPPORT_GET_FRAME}
 {$ifdef SUPPORT_GET_FRAME}
-        systemunit.insert(tsyssym.create('Get_Frame',in_get_frame));
+        systemunit.insert(csyssym.create('Get_Frame',in_get_frame));
 {$endif SUPPORT_GET_FRAME}
 {$endif SUPPORT_GET_FRAME}
-        systemunit.insert(tsyssym.create('Unaligned',in_unaligned_x));
-        systemunit.insert(tsyssym.create('Aligned',in_aligned_x));
-        systemunit.insert(tsyssym.create('ObjCSelector',in_objc_selector_x)); { objc only }
-        systemunit.insert(tsyssym.create('ObjCEncode',in_objc_encode_x)); { objc only }
-        systemunit.insert(tsyssym.create('Default',in_default_x));
-        systemunit.insert(tconstsym.create_ord('False',constord,0,pasbool8type));
-        systemunit.insert(tconstsym.create_ord('True',constord,1,pasbool8type));
+        systemunit.insert(csyssym.create('Unaligned',in_unaligned_x));
+        systemunit.insert(csyssym.create('Aligned',in_aligned_x));
+        systemunit.insert(csyssym.create('ObjCSelector',in_objc_selector_x)); { objc only }
+        systemunit.insert(csyssym.create('ObjCEncode',in_objc_encode_x)); { objc only }
+        systemunit.insert(csyssym.create('Default',in_default_x));
+        systemunit.insert(cconstsym.create_ord('False',constord,0,pasbool8type));
+        systemunit.insert(cconstsym.create_ord('True',constord,1,pasbool8type));
       end;
       end;
 
 
 
 
@@ -166,7 +166,7 @@ implementation
 
 
         function addtype(const s:string;def:tdef):ttypesym;
         function addtype(const s:string;def:tdef):ttypesym;
         begin
         begin
-          result:=ttypesym.create(s,def);
+          result:=ctypesym.create(s,def);
           systemunit.insert(result);
           systemunit.insert(result);
         end;
         end;
 
 
@@ -180,10 +180,10 @@ implementation
         begin
         begin
           if init_settings.fputype<>fpu_none then
           if init_settings.fputype<>fpu_none then
             begin
             begin
-              s32floattype:=tfloatdef.create(s32real);
-              s64floattype:=tfloatdef.create(s64real);
-              s80floattype:=tfloatdef.create(s80real);
-              sc80floattype:=tfloatdef.create(sc80real);
+              s32floattype:=cfloatdef.create(s32real);
+              s64floattype:=cfloatdef.create(s64real);
+              s80floattype:=cfloatdef.create(s80real);
+              sc80floattype:=cfloatdef.create(sc80real);
             end else begin
             end else begin
               s32floattype:=nil;
               s32floattype:=nil;
               s64floattype:=nil;
               s64floattype:=nil;
@@ -196,120 +196,120 @@ implementation
         hrecst : trecordsymtable;
         hrecst : trecordsymtable;
       begin
       begin
         symtablestack.push(systemunit);
         symtablestack.push(systemunit);
-        cundefinedtype:=tundefineddef.create;
-        cformaltype:=tformaldef.create(false);
-        ctypedformaltype:=tformaldef.create(true);
-        voidtype:=torddef.create(uvoid,0,0);
-        voidpointertype:=tpointerdef.create(voidtype);
-        u8inttype:=torddef.create(u8bit,0,255);
-        s8inttype:=torddef.create(s8bit,int64(-128),127);
-        u16inttype:=torddef.create(u16bit,0,65535);
-        s16inttype:=torddef.create(s16bit,int64(-32768),32767);
-        u32inttype:=torddef.create(u32bit,0,high(longword));
-        s32inttype:=torddef.create(s32bit,int64(low(longint)),int64(high(longint)));
-        u64inttype:=torddef.create(u64bit,low(qword),high(qword));
-        s64inttype:=torddef.create(s64bit,low(int64),high(int64));
-        pasbool8type:=torddef.create(pasbool8,0,1);
-        pasbool16type:=torddef.create(pasbool16,0,1);
-        pasbool32type:=torddef.create(pasbool32,0,1);
-        pasbool64type:=torddef.create(pasbool64,0,1);
-        bool8type:=torddef.create(bool8bit,low(int64),high(int64));
-        bool16type:=torddef.create(bool16bit,low(int64),high(int64));
-        bool32type:=torddef.create(bool32bit,low(int64),high(int64));
-        bool64type:=torddef.create(bool64bit,low(int64),high(int64));
-        cansichartype:=torddef.create(uchar,0,255);
-        cwidechartype:=torddef.create(uwidechar,0,65535);
-        cshortstringtype:=tstringdef.createshort(255);
+        cundefinedtype:=cundefineddef.create;
+        cformaltype:=cformaldef.create(false);
+        ctypedformaltype:=cformaldef.create(true);
+        voidtype:=corddef.create(uvoid,0,0);
+        voidpointertype:=cpointerdef.create(voidtype);
+        u8inttype:=corddef.create(u8bit,0,255);
+        s8inttype:=corddef.create(s8bit,int64(-128),127);
+        u16inttype:=corddef.create(u16bit,0,65535);
+        s16inttype:=corddef.create(s16bit,int64(-32768),32767);
+        u32inttype:=corddef.create(u32bit,0,high(longword));
+        s32inttype:=corddef.create(s32bit,int64(low(longint)),int64(high(longint)));
+        u64inttype:=corddef.create(u64bit,low(qword),high(qword));
+        s64inttype:=corddef.create(s64bit,low(int64),high(int64));
+        pasbool8type:=corddef.create(pasbool8,0,1);
+        pasbool16type:=corddef.create(pasbool16,0,1);
+        pasbool32type:=corddef.create(pasbool32,0,1);
+        pasbool64type:=corddef.create(pasbool64,0,1);
+        bool8type:=corddef.create(bool8bit,low(int64),high(int64));
+        bool16type:=corddef.create(bool16bit,low(int64),high(int64));
+        bool32type:=corddef.create(bool32bit,low(int64),high(int64));
+        bool64type:=corddef.create(bool64bit,low(int64),high(int64));
+        cansichartype:=corddef.create(uchar,0,255);
+        cwidechartype:=corddef.create(uwidechar,0,65535);
+        cshortstringtype:=cstringdef.createshort(255);
         { should we give a length to the default long and ansi string definition ?? }
         { should we give a length to the default long and ansi string definition ?? }
-        clongstringtype:=tstringdef.createlong(-1);
-        cansistringtype:=tstringdef.createansi(0);
+        clongstringtype:=cstringdef.createlong(-1);
+        cansistringtype:=cstringdef.createansi(0);
         if target_info.system in systems_windows then
         if target_info.system in systems_windows then
-          cwidestringtype:=tstringdef.createwide
+          cwidestringtype:=cstringdef.createwide
         else
         else
-          cwidestringtype:=tstringdef.createunicode;
-        cunicodestringtype:=tstringdef.createunicode;
+          cwidestringtype:=cstringdef.createunicode;
+        cunicodestringtype:=cstringdef.createunicode;
         { length=0 for shortstring is open string (needed for readln(string) }
         { length=0 for shortstring is open string (needed for readln(string) }
-        openshortstringtype:=tstringdef.createshort(0);
-        openchararraytype:=tarraydef.create(0,-1,s32inttype);
+        openshortstringtype:=cstringdef.createshort(0);
+        openchararraytype:=carraydef.create(0,-1,s32inttype);
         tarraydef(openchararraytype).elementdef:=cansichartype;
         tarraydef(openchararraytype).elementdef:=cansichartype;
 {$ifdef x86}
 {$ifdef x86}
         create_fpu_types;
         create_fpu_types;
 {$ifndef FPC_SUPPORT_X87_TYPES_ON_WIN64}
 {$ifndef FPC_SUPPORT_X87_TYPES_ON_WIN64}
         if target_info.system=system_x86_64_win64 then
         if target_info.system=system_x86_64_win64 then
           begin
           begin
-            s64currencytype:=torddef.create(scurrency,low(int64),high(int64));
+            s64currencytype:=corddef.create(scurrency,low(int64),high(int64));
             pbestrealtype:=@s64floattype;
             pbestrealtype:=@s64floattype;
           end
           end
         else
         else
 {$endif FPC_SUPPORT_X87_TYPES_ON_WIN64}
 {$endif FPC_SUPPORT_X87_TYPES_ON_WIN64}
-          s64currencytype:=tfloatdef.create(s64currency);
+          s64currencytype:=cfloatdef.create(s64currency);
 {$endif x86}
 {$endif x86}
 {$ifdef powerpc}
 {$ifdef powerpc}
         create_fpu_types;
         create_fpu_types;
-        s64currencytype:=torddef.create(scurrency,low(int64),high(int64));
+        s64currencytype:=corddef.create(scurrency,low(int64),high(int64));
 {$endif powerpc}
 {$endif powerpc}
 {$ifdef POWERPC64}
 {$ifdef POWERPC64}
         create_fpu_types;
         create_fpu_types;
-        s64currencytype:=torddef.create(scurrency,low(int64),high(int64));
+        s64currencytype:=corddef.create(scurrency,low(int64),high(int64));
 {$endif POWERPC64}
 {$endif POWERPC64}
 {$ifdef sparc}
 {$ifdef sparc}
         create_fpu_types;
         create_fpu_types;
-        s64currencytype:=torddef.create(scurrency,low(int64),high(int64));
+        s64currencytype:=corddef.create(scurrency,low(int64),high(int64));
 {$endif sparc}
 {$endif sparc}
 {$ifdef m68k}
 {$ifdef m68k}
         create_fpu_types;
         create_fpu_types;
-        s64currencytype:=torddef.create(scurrency,low(int64),high(int64));
+        s64currencytype:=corddef.create(scurrency,low(int64),high(int64));
 {$endif}
 {$endif}
 {$ifdef arm}
 {$ifdef arm}
         create_fpu_types;
         create_fpu_types;
-        s64currencytype:=torddef.create(scurrency,low(int64),high(int64));
+        s64currencytype:=corddef.create(scurrency,low(int64),high(int64));
 {$endif arm}
 {$endif arm}
 {$ifdef avr}
 {$ifdef avr}
-        s32floattype:=tfloatdef.create(s32real);
-        s64floattype:=tfloatdef.create(s64real);
-        s80floattype:=tfloatdef.create(s80real);
-        sc80floattype:=tfloatdef.create(sc80real);
-        s64currencytype:=torddef.create(scurrency,low(int64),high(int64));
+        s32floattype:=cfloatdef.create(s32real);
+        s64floattype:=cfloatdef.create(s64real);
+        s80floattype:=cfloatdef.create(s80real);
+        sc80floattype:=cfloatdef.create(sc80real);
+        s64currencytype:=corddef.create(scurrency,low(int64),high(int64));
 {$endif avr}
 {$endif avr}
 {$ifdef mips}
 {$ifdef mips}
         create_fpu_types;
         create_fpu_types;
-        s64currencytype:=torddef.create(scurrency,low(int64),high(int64));
+        s64currencytype:=corddef.create(scurrency,low(int64),high(int64));
 {$endif mips}
 {$endif mips}
 {$ifdef jvm}
 {$ifdef jvm}
         create_fpu_types;
         create_fpu_types;
-        s64currencytype:=torddef.create(scurrency,low(int64),high(int64));
+        s64currencytype:=corddef.create(scurrency,low(int64),high(int64));
 {$endif jvm}
 {$endif jvm}
         set_default_int_types;
         set_default_int_types;
         { some other definitions }
         { some other definitions }
-        charpointertype:=tpointerdef.create(cansichartype);
-        widecharpointertype:=tpointerdef.create(cwidechartype);
+        charpointertype:=cpointerdef.create(cansichartype);
+        widecharpointertype:=cpointerdef.create(cwidechartype);
 {$ifdef i8086}
 {$ifdef i8086}
-        parentfpvoidpointertype:=tpointerdef.createx86(voidtype,x86pt_near);
+        parentfpvoidpointertype:=cpointerdef.createx86(voidtype,x86pt_near);
 {$else i8086}
 {$else i8086}
-        parentfpvoidpointertype:=tpointerdef.create(voidtype);
+        parentfpvoidpointertype:=cpointerdef.create(voidtype);
 {$endif i8086}
 {$endif i8086}
 {$ifdef x86}
 {$ifdef x86}
-        voidnearpointertype:=tpointerdef.createx86(voidtype,x86pt_near);
-        voidnearcspointertype:=tpointerdef.createx86(voidtype,x86pt_near_cs);
-        voidneardspointertype:=tpointerdef.createx86(voidtype,x86pt_near_ds);
-        voidnearsspointertype:=tpointerdef.createx86(voidtype,x86pt_near_ss);
-        voidnearespointertype:=tpointerdef.createx86(voidtype,x86pt_near_es);
-        voidnearfspointertype:=tpointerdef.createx86(voidtype,x86pt_near_fs);
-        voidneargspointertype:=tpointerdef.createx86(voidtype,x86pt_near_gs);
+        voidnearpointertype:=cpointerdef.createx86(voidtype,x86pt_near);
+        voidnearcspointertype:=cpointerdef.createx86(voidtype,x86pt_near_cs);
+        voidneardspointertype:=cpointerdef.createx86(voidtype,x86pt_near_ds);
+        voidnearsspointertype:=cpointerdef.createx86(voidtype,x86pt_near_ss);
+        voidnearespointertype:=cpointerdef.createx86(voidtype,x86pt_near_es);
+        voidnearfspointertype:=cpointerdef.createx86(voidtype,x86pt_near_fs);
+        voidneargspointertype:=cpointerdef.createx86(voidtype,x86pt_near_gs);
   {$ifdef i8086}
   {$ifdef i8086}
-        voidfarpointertype:=tpointerdef.createx86(voidtype,x86pt_far);
-        voidhugepointertype:=tpointerdef.createx86(voidtype,x86pt_huge);
-        charnearpointertype:=tpointerdef.createx86(cansichartype,x86pt_near);
-        charfarpointertype:=tpointerdef.createx86(cansichartype,x86pt_far);
-        bytefarpointertype:=tpointerdef.createx86(u8inttype,x86pt_far);
-        wordfarpointertype:=tpointerdef.createx86(u16inttype,x86pt_far);
-        longintfarpointertype:=tpointerdef.createx86(s32inttype,x86pt_far);
+        voidfarpointertype:=cpointerdef.createx86(voidtype,x86pt_far);
+        voidhugepointertype:=cpointerdef.createx86(voidtype,x86pt_huge);
+        charnearpointertype:=cpointerdef.createx86(cansichartype,x86pt_near);
+        charfarpointertype:=cpointerdef.createx86(cansichartype,x86pt_far);
+        bytefarpointertype:=cpointerdef.createx86(u8inttype,x86pt_far);
+        wordfarpointertype:=cpointerdef.createx86(u16inttype,x86pt_far);
+        longintfarpointertype:=cpointerdef.createx86(s32inttype,x86pt_far);
   {$endif i8086}
   {$endif i8086}
 {$endif x86}
 {$endif x86}
         set_default_ptr_types;
         set_default_ptr_types;
-        cfiletype:=tfiledef.createuntyped;
-        cvarianttype:=tvariantdef.create(vt_normalvariant);
-        colevarianttype:=tvariantdef.create(vt_olevariant);
+        cfiletype:=cfiledef.createuntyped;
+        cvarianttype:=cvariantdef.create(vt_normalvariant);
+        colevarianttype:=cvariantdef.create(vt_olevariant);
 
 
 {$ifdef cpufpemu}
 {$ifdef cpufpemu}
         { Normal types }
         { Normal types }
@@ -348,7 +348,7 @@ implementation
 {$ifndef FPC_SUPPORT_X87_TYPES_ON_WIN64}
 {$ifndef FPC_SUPPORT_X87_TYPES_ON_WIN64}
         if target_info.system<>system_x86_64_win64 then
         if target_info.system<>system_x86_64_win64 then
 {$endif FPC_SUPPORT_X87_TYPES_ON_WIN64}
 {$endif FPC_SUPPORT_X87_TYPES_ON_WIN64}
-          addtype('Comp',tfloatdef.create(s64comp));
+          addtype('Comp',cfloatdef.create(s64comp));
 {$endif x86}
 {$endif x86}
         addtype('Currency',s64currencytype);
         addtype('Currency',s64currencytype);
         addtype('Pointer',voidpointertype);
         addtype('Pointer',voidpointertype);
@@ -392,8 +392,8 @@ implementation
         addtype('Int64',s64inttype);
         addtype('Int64',s64inttype);
         addtype('Char',cansichartype);
         addtype('Char',cansichartype);
         addtype('WideChar',cwidechartype);
         addtype('WideChar',cwidechartype);
-        addtype('Text',tfiledef.createtext);
-        addtype('TypedFile',tfiledef.createtyped(voidtype));
+        addtype('Text',cfiledef.createtext);
+        addtype('TypedFile',cfiledef.createtyped(voidtype));
         addtype('Variant',cvarianttype);
         addtype('Variant',cvarianttype);
         addtype('OleVariant',colevarianttype);
         addtype('OleVariant',colevarianttype);
         { Internal types }
         { Internal types }
@@ -463,40 +463,40 @@ implementation
           begin
           begin
             { Add a type for virtual method tables }
             { Add a type for virtual method tables }
             hrecst:=trecordsymtable.create('',current_settings.packrecords);
             hrecst:=trecordsymtable.create('',current_settings.packrecords);
-            vmttype:=trecorddef.create('',hrecst);
-            pvmttype:=tpointerdef.create(vmttype);
+            vmttype:=crecorddef.create('',hrecst);
+            pvmttype:=cpointerdef.create(vmttype);
             { can't use addtype for pvmt because the rtti of the pointed
             { can't use addtype for pvmt because the rtti of the pointed
               type is not available. The rtti for pvmt will be written implicitly
               type is not available. The rtti for pvmt will be written implicitly
               by thev tblarray below }
               by thev tblarray below }
-            systemunit.insert(ttypesym.create('$pvmt',pvmttype));
-            addfield(hrecst,tfieldvarsym.create('$length',vs_value,ptrsinttype,[]));
-            addfield(hrecst,tfieldvarsym.create('$mlength',vs_value,ptrsinttype,[]));
-            addfield(hrecst,tfieldvarsym.create('$parent',vs_value,pvmttype,[]));
+            systemunit.insert(ctypesym.create('$pvmt',pvmttype));
+            addfield(hrecst,cfieldvarsym.create('$length',vs_value,ptrsinttype,[]));
+            addfield(hrecst,cfieldvarsym.create('$mlength',vs_value,ptrsinttype,[]));
+            addfield(hrecst,cfieldvarsym.create('$parent',vs_value,pvmttype,[]));
             { it seems vmttype is used both for TP objects and Delphi classes,
             { it seems vmttype is used both for TP objects and Delphi classes,
               so the next entry could either be the first virtual method (vm1)
               so the next entry could either be the first virtual method (vm1)
               (object) or the class name (class). We can't easily create separate
               (object) or the class name (class). We can't easily create separate
               vtable formats for both, as gdb is hard coded to search for
               vtable formats for both, as gdb is hard coded to search for
               __vtbl_ptr_type in all cases (JM) }
               __vtbl_ptr_type in all cases (JM) }
-            addfield(hrecst,tfieldvarsym.create('$vm1_or_classname',vs_value,tpointerdef.create(cshortstringtype),[]));
-            vmtarraytype:=tarraydef.create(0,0,s32inttype);
+            addfield(hrecst,cfieldvarsym.create('$vm1_or_classname',vs_value,cpointerdef.create(cshortstringtype),[]));
+            vmtarraytype:=carraydef.create(0,0,s32inttype);
             tarraydef(vmtarraytype).elementdef:=voidpointertype;
             tarraydef(vmtarraytype).elementdef:=voidpointertype;
-            addfield(hrecst,tfieldvarsym.create('$__pfn',vs_value,vmtarraytype,[]));
+            addfield(hrecst,cfieldvarsym.create('$__pfn',vs_value,vmtarraytype,[]));
             addtype('$__vtbl_ptr_type',vmttype);
             addtype('$__vtbl_ptr_type',vmttype);
-            vmtarraytype:=tarraydef.create(0,1,s32inttype);
+            vmtarraytype:=carraydef.create(0,1,s32inttype);
             tarraydef(vmtarraytype).elementdef:=pvmttype;
             tarraydef(vmtarraytype).elementdef:=pvmttype;
             addtype('$vtblarray',vmtarraytype);
             addtype('$vtblarray',vmtarraytype);
             { Add a type for methodpointers }
             { Add a type for methodpointers }
             hrecst:=trecordsymtable.create('',1);
             hrecst:=trecordsymtable.create('',1);
 {$ifdef i8086}
 {$ifdef i8086}
             if current_settings.x86memorymodel in x86_far_code_models then
             if current_settings.x86memorymodel in x86_far_code_models then
-              addfield(hrecst,tfieldvarsym.create('$proc',vs_value,voidfarpointertype,[]))
+              addfield(hrecst,cfieldvarsym.create('$proc',vs_value,voidfarpointertype,[]))
             else
             else
-              addfield(hrecst,tfieldvarsym.create('$proc',vs_value,voidnearpointertype,[]));
+              addfield(hrecst,cfieldvarsym.create('$proc',vs_value,voidnearpointertype,[]));
 {$else i8086}
 {$else i8086}
-            addfield(hrecst,tfieldvarsym.create('$proc',vs_value,voidpointertype,[]));
+            addfield(hrecst,cfieldvarsym.create('$proc',vs_value,voidpointertype,[]));
 {$endif i8086}
 {$endif i8086}
-            addfield(hrecst,tfieldvarsym.create('$self',vs_value,voidpointertype,[]));
-            methodpointertype:=trecorddef.create('',hrecst);
+            addfield(hrecst,cfieldvarsym.create('$self',vs_value,voidpointertype,[]));
+            methodpointertype:=crecorddef.create('',hrecst);
             addtype('$methodpointer',methodpointertype);
             addtype('$methodpointer',methodpointertype);
           end;
           end;
         symtablestack.pop(systemunit);
         symtablestack.pop(systemunit);

+ 24 - 24
compiler/ptype.pas

@@ -339,7 +339,7 @@ implementation
          if isforwarddef and
          if isforwarddef and
             not(is_unit_specific) then
             not(is_unit_specific) then
            begin
            begin
-             def:=tforwarddef.create(sorg,pos);
+             def:=cforwarddef.create(sorg,pos);
              exit;
              exit;
            end;
            end;
          { unknown sym ? }
          { unknown sym ? }
@@ -408,7 +408,7 @@ implementation
                          single_type(t2,[stoAllowTypeDef]);
                          single_type(t2,[stoAllowTypeDef]);
                          if is_managed_type(t2) then
                          if is_managed_type(t2) then
                            Message(parser_e_no_refcounted_typed_file);
                            Message(parser_e_no_refcounted_typed_file);
-                         def:=tfiledef.createtyped(t2);
+                         def:=cfiledef.createtyped(t2);
                       end
                       end
                     else
                     else
                       def:=cfiletype;
                       def:=cfiletype;
@@ -820,14 +820,14 @@ implementation
              recst:=trecordsymtable.create(n,current_settings.packrecords);
              recst:=trecordsymtable.create(n,current_settings.packrecords);
              { can't use recst.realname^ instead of n, because recst.realname is
              { can't use recst.realname^ instead of n, because recst.realname is
                nil in case of an empty name }
                nil in case of an empty name }
-             current_structdef:=trecorddef.create(n,recst);
+             current_structdef:=crecorddef.create(n,recst);
            end
            end
          else
          else
            begin
            begin
              { for the JVM target records always need a name, because they are
              { for the JVM target records always need a name, because they are
                represented by a class }
                represented by a class }
              recst:=trecordsymtable.create(current_module.realmodulename^+'__fpc_intern_recname_'+tostr(current_module.deflist.count),current_settings.packrecords);
              recst:=trecordsymtable.create(current_module.realmodulename^+'__fpc_intern_recname_'+tostr(current_module.deflist.count),current_settings.packrecords);
-             current_structdef:=trecorddef.create(recst.name^,recst);
+             current_structdef:=crecorddef.create(recst.name^,recst);
            end;
            end;
          result:=current_structdef;
          result:=current_structdef;
          { insert in symtablestack }
          { insert in symtablestack }
@@ -956,18 +956,18 @@ implementation
                        { All checks passed, create the new def }
                        { All checks passed, create the new def }
                        case pt1.resultdef.typ of
                        case pt1.resultdef.typ of
                          enumdef :
                          enumdef :
-                           def:=tenumdef.create_subrange(tenumdef(pt1.resultdef),lv.svalue,hv.svalue);
+                           def:=cenumdef.create_subrange(tenumdef(pt1.resultdef),lv.svalue,hv.svalue);
                          orddef :
                          orddef :
                            begin
                            begin
                              if is_char(pt1.resultdef) then
                              if is_char(pt1.resultdef) then
-                               def:=torddef.create(uchar,lv,hv)
+                               def:=corddef.create(uchar,lv,hv)
                              else
                              else
                                if is_boolean(pt1.resultdef) then
                                if is_boolean(pt1.resultdef) then
-                                 def:=torddef.create(pasbool8,lv,hv)
+                                 def:=corddef.create(pasbool8,lv,hv)
                                else if is_signed(pt1.resultdef) then
                                else if is_signed(pt1.resultdef) then
-                                 def:=torddef.create(range_to_basetype(lv,hv),lv,hv)
+                                 def:=corddef.create(range_to_basetype(lv,hv),lv,hv)
                                else
                                else
-                                 def:=torddef.create(range_to_basetype(lv,hv),lv,hv);
+                                 def:=corddef.create(range_to_basetype(lv,hv),lv,hv);
                            end;
                            end;
                        end;
                        end;
                      end;
                      end;
@@ -1109,8 +1109,8 @@ implementation
                enumdef :
                enumdef :
                  if (tenumdef(tt2).min>=0) and
                  if (tenumdef(tt2).min>=0) and
                     (tenumdef(tt2).max<=255) then
                     (tenumdef(tt2).max<=255) then
-                  // !! def:=tsetdef.create(tt2,tenumdef(tt2.def).min,tenumdef(tt2.def).max))
-                  def:=tsetdef.create(tt2,tenumdef(tt2).min,tenumdef(tt2).max)
+                  // !! def:=csetdef.create(tt2,tenumdef(tt2.def).min,tenumdef(tt2.def).max))
+                  def:=csetdef.create(tt2,tenumdef(tt2).min,tenumdef(tt2).max)
                  else
                  else
                   Message(sym_e_ill_type_decl_set);
                   Message(sym_e_ill_type_decl_set);
                orddef :
                orddef :
@@ -1118,11 +1118,11 @@ implementation
                    if (torddef(tt2).ordtype<>uvoid) and
                    if (torddef(tt2).ordtype<>uvoid) and
                       (torddef(tt2).ordtype<>uwidechar) and
                       (torddef(tt2).ordtype<>uwidechar) and
                       (torddef(tt2).low>=0) then
                       (torddef(tt2).low>=0) then
-                     // !! def:=tsetdef.create(tt2,torddef(tt2.def).low,torddef(tt2.def).high))
+                     // !! def:=csetdef.create(tt2,torddef(tt2.def).low,torddef(tt2.def).high))
                      if Torddef(tt2).high>int64(high(byte)) then
                      if Torddef(tt2).high>int64(high(byte)) then
                        message(sym_e_ill_type_decl_set)
                        message(sym_e_ill_type_decl_set)
                      else
                      else
-                       def:=tsetdef.create(tt2,torddef(tt2).low.svalue,torddef(tt2).high.svalue)
+                       def:=csetdef.create(tt2,torddef(tt2).low.svalue,torddef(tt2).high.svalue)
                    else
                    else
                      Message(sym_e_ill_type_decl_set);
                      Message(sym_e_ill_type_decl_set);
                  end;
                  end;
@@ -1195,7 +1195,7 @@ implementation
            current_genericdef:=nil;
            current_genericdef:=nil;
            current_specializedef:=nil;
            current_specializedef:=nil;
            first:=true;
            first:=true;
-           arrdef:=tarraydef.create(0,0,s32inttype);
+           arrdef:=carraydef.create(0,0,s32inttype);
            consume(_ARRAY);
            consume(_ARRAY);
 
 
            { usage of specialized type inside its generic template }
            { usage of specialized type inside its generic template }
@@ -1287,7 +1287,7 @@ implementation
                     as element of the existing array, otherwise modify the existing array }
                     as element of the existing array, otherwise modify the existing array }
                   if not(first) then
                   if not(first) then
                     begin
                     begin
-                      arrdef.elementdef:=tarraydef.create(lowval.svalue,highval.svalue,indexdef);
+                      arrdef.elementdef:=carraydef.create(lowval.svalue,highval.svalue,indexdef);
                       { push new symtable }
                       { push new symtable }
                       symtablestack.pop(arrdef.symtable);
                       symtablestack.pop(arrdef.symtable);
                       arrdef:=tarraydef(arrdef.elementdef);
                       arrdef:=tarraydef(arrdef.elementdef);
@@ -1357,7 +1357,7 @@ implementation
 
 
             is_func:=(token=_FUNCTION);
             is_func:=(token=_FUNCTION);
             consume(token);
             consume(token);
-            pd:=tprocvardef.create(normal_function_level);
+            pd:=cprocvardef.create(normal_function_level);
 
 
             { usage of specialized type inside its generic template }
             { usage of specialized type inside its generic template }
             if assigned(genericdef) then
             if assigned(genericdef) then
@@ -1406,7 +1406,7 @@ implementation
               begin
               begin
                 if check_proc_directive(true) then
                 if check_proc_directive(true) then
                   begin
                   begin
-                    newtype:=ttypesym.create('unnamed',result);
+                    newtype:=ctypesym.create('unnamed',result);
                     parse_var_proc_directives(tsym(newtype));
                     parse_var_proc_directives(tsym(newtype));
                     newtype.typedef:=nil;
                     newtype.typedef:=nil;
                     result.typesym:=nil;
                     result.typesym:=nil;
@@ -1470,7 +1470,7 @@ implementation
                       break;
                       break;
                   end;
                   end;
                 if not is_specialize then
                 if not is_specialize then
-                  aktenumdef:=tenumdef.create
+                  aktenumdef:=cenumdef.create
                 else
                 else
                   aktenumdef:=nil;
                   aktenumdef:=nil;
                 repeat
                 repeat
@@ -1532,9 +1532,9 @@ implementation
                     begin
                     begin
                       storepos:=current_tokenpos;
                       storepos:=current_tokenpos;
                       current_tokenpos:=defpos;
                       current_tokenpos:=defpos;
-                      tenumsymtable(aktenumdef.symtable).insert(tenumsym.create(s,aktenumdef,longint(l.svalue)));
+                      tenumsymtable(aktenumdef.symtable).insert(cenumsym.create(s,aktenumdef,longint(l.svalue)));
                       if not (cs_scopedenums in current_settings.localswitches) then
                       if not (cs_scopedenums in current_settings.localswitches) then
-                        tstoredsymtable(aktenumdef.owner).insert(tenumsym.create(s,aktenumdef,longint(l.svalue)));
+                        tstoredsymtable(aktenumdef.owner).insert(cenumsym.create(s,aktenumdef,longint(l.svalue)));
                       current_tokenpos:=storepos;
                       current_tokenpos:=storepos;
                     end;
                     end;
                 until not try_to_consume(_COMMA);
                 until not try_to_consume(_COMMA);
@@ -1576,7 +1576,7 @@ implementation
                   end;
                   end;
                 { don't use getpointerdef() here, since this is a type
                 { don't use getpointerdef() here, since this is a type
                   declaration (-> must create new typedef) }
                   declaration (-> must create new typedef) }
-                def:=tpointerdef.create(tt2);
+                def:=cpointerdef.create(tt2);
                 if tt2.typ=forwarddef then
                 if tt2.typ=forwarddef then
                   current_module.checkforwarddefs.add(def);
                   current_module.checkforwarddefs.add(def);
               end;
               end;
@@ -1655,11 +1655,11 @@ implementation
                     if is_class(hdef) or
                     if is_class(hdef) or
                        is_objcclass(hdef) or
                        is_objcclass(hdef) or
                        is_javaclass(hdef) then
                        is_javaclass(hdef) then
-                      def:=tclassrefdef.create(hdef)
+                      def:=cclassrefdef.create(hdef)
                     else
                     else
                       if hdef.typ=forwarddef then
                       if hdef.typ=forwarddef then
                         begin
                         begin
-                          def:=tclassrefdef.create(hdef);
+                          def:=cclassrefdef.create(hdef);
                           current_module.checkforwarddefs.add(def);
                           current_module.checkforwarddefs.add(def);
                         end
                         end
                     else
                     else
@@ -1739,7 +1739,7 @@ implementation
                 begin
                 begin
                   consume(_KLAMMERAFFE);
                   consume(_KLAMMERAFFE);
                   single_type(tt2,SingleTypeOptionsInTypeBlock[block_type=bt_type]);
                   single_type(tt2,SingleTypeOptionsInTypeBlock[block_type=bt_type]);
-                  def:=tpointerdef.create(tt2);
+                  def:=cpointerdef.create(tt2);
                   if tt2.typ=forwarddef then
                   if tt2.typ=forwarddef then
                     current_module.checkforwarddefs.add(def);
                     current_module.checkforwarddefs.add(def);
                 end
                 end

+ 4 - 0
compiler/scanner.pas

@@ -849,6 +849,10 @@ type
 
 
   class constructor texprvalue.createdefs;
   class constructor texprvalue.createdefs;
     begin
     begin
+      { do not use corddef etc here: this code is executed before those
+        variables are initialised. Since these types are only used for
+        compile-time evaluation of conditional expressions, it doesn't matter
+        that we use the base types instead of the cpu-specific ones. }
       sintdef:=torddef.create(s64bit,low(int64),high(int64));
       sintdef:=torddef.create(s64bit,low(int64),high(int64));
       uintdef:=torddef.create(u64bit,low(qword),high(qword));
       uintdef:=torddef.create(u64bit,low(qword),high(qword));
       booldef:=torddef.create(pasbool8,0,1);
       booldef:=torddef.create(pasbool8,0,1);

+ 3 - 1
compiler/sparc/cpunode.pas

@@ -33,6 +33,8 @@ implementation
     ncgbas,ncgflw,ncgcnv,ncgld,ncgmem,ncgcon,ncgset,
     ncgbas,ncgflw,ncgcnv,ncgld,ncgmem,ncgcon,ncgset,
     ncpuadd,ncpucall,ncpumat,ncpuinln,ncpucnv,ncpuset,
     ncpuadd,ncpucall,ncpumat,ncpuinln,ncpucnv,ncpuset,
     { this not really a node }
     { this not really a node }
-    rgcpu;
+    rgcpu,
+    { symtable }
+    symcpu;
 
 
 end.
 end.

+ 174 - 0
compiler/sparc/symcpu.pas

@@ -0,0 +1,174 @@
+{
+    Copyright (c) 2014 by Florian Klaempfl
+
+    Symbol table overrides for SPARC
+
+    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 symcpu;
+
+{$i fpcdefs.inc}
+
+interface
+
+uses
+  symdef,symsym;
+
+type
+  { defs }
+  tcpufiledef = class(tfiledef)
+  end;
+
+  tcpuvariantdef = class(tvariantdef)
+  end;
+
+  tcpuformaldef = class(tformaldef)
+  end;
+
+  tcpuforwarddef = class(tforwarddef)
+  end;
+
+  tcpuundefineddef = class(tundefineddef)
+  end;
+
+  tcpuerrordef = class(terrordef)
+  end;
+
+  tcpupointerdef = class(tpointerdef)
+  end;
+
+  tcpurecorddef = class(trecorddef)
+  end;
+
+  tcpuimplementedinterface = class(timplementedinterface)
+  end;
+
+  tcpuobjectdef = class(tobjectdef)
+  end;
+
+  tcpuclassrefdef = class(tclassrefdef)
+  end;
+
+  tcpuarraydef = class(tarraydef)
+  end;
+
+  tcpuorddef = class(torddef)
+  end;
+
+  tcpufloatdef = class(tfloatdef)
+  end;
+
+  tcpuprocvardef = class(tprocvardef)
+  end;
+
+  tcpuprocdef = class(tprocdef)
+  end;
+
+  tcpustringdef = class(tstringdef)
+  end;
+
+  tcpuenumdef = class(tenumdef)
+  end;
+
+  tcpusetdef = class(tsetdef)
+  end;
+
+  { syms }
+  tcpulabelsym = class(tlabelsym)
+  end;
+
+  tcpuunitsym = class(tunitsym)
+  end;
+
+  tcpunamespacesym = class(tnamespacesym)
+  end;
+
+  tcpuprocsym = class(tprocsym)
+  end;
+
+  tcpuypesym = class(ttypesym)
+  end;
+
+  tcpufieldvarsym = class(tfieldvarsym)
+  end;
+
+  tcpulocalvarsym = class(tlocalvarsym)
+  end;
+
+  tcpuparavarsym = class(tparavarsym)
+  end;
+
+  tcpustaticvarsym = class(tstaticvarsym)
+  end;
+
+  tcpuabsolutevarsym = class(tabsolutevarsym)
+  end;
+
+  tcpupropertysym = class(tpropertysym)
+  end;
+
+  tcpuconstsym = class(tconstsym)
+  end;
+
+  tcpuenumsym = class(tenumsym)
+  end;
+
+  tcpusyssym = class(tsyssym)
+  end;
+
+
+implementation
+
+begin
+  { used tdef classes }
+  cfiledef:=tcpufiledef;
+  cvariantdef:=tcpuvariantdef;
+  cformaldef:=tcpuformaldef;
+  cforwarddef:=tcpuforwarddef;
+  cundefineddef:=tcpuundefineddef;
+  cerrordef:=tcpuerrordef;
+  cpointerdef:=tcpupointerdef;
+  crecorddef:=tcpurecorddef;
+  cimplementedinterface:=tcpuimplementedinterface;
+  cobjectdef:=tcpuobjectdef;
+  cclassrefdef:=tcpuclassrefdef;
+  carraydef:=tcpuarraydef;
+  corddef:=tcpuorddef;
+  cfloatdef:=tcpufloatdef;
+  cprocvardef:=tcpuprocvardef;
+  cprocdef:=tcpuprocdef;
+  cstringdef:=tcpustringdef;
+  cenumdef:=tcpuenumdef;
+  csetdef:=tcpusetdef;
+
+  { used tsym classes }
+  clabelsym:=tcpulabelsym;
+  cunitsym:=tcpuunitsym;
+  cnamespacesym:=tcpunamespacesym;
+  cprocsym:=tcpuprocsym;
+  ctypesym:=tcpuypesym;
+  cfieldvarsym:=tcpufieldvarsym;
+  clocalvarsym:=tcpulocalvarsym;
+  cparavarsym:=tcpuparavarsym;
+  cstaticvarsym:=tcpustaticvarsym;
+  cabsolutevarsym:=tcpuabsolutevarsym;
+  cpropertysym:=tcpupropertysym;
+  cconstsym:=tcpuconstsym;
+  cenumsym:=tcpuenumsym;
+  csyssym:=tcpusyssym;
+end.
+

+ 9 - 9
compiler/symcreat.pas

@@ -1053,7 +1053,7 @@ implementation
         end
         end
       else
       else
         begin
         begin
-          ps:=tprocsym.create(realname);
+          ps:=cprocsym.create(realname);
           newparentst.insert(ps);
           newparentst.insert(ps);
         end;
         end;
       pd.procsym:=ps;
       pd.procsym:=ps;
@@ -1071,7 +1071,7 @@ implementation
                   if vo_is_self in parasym.varoptions then
                   if vo_is_self in parasym.varoptions then
                     begin
                     begin
                       if parasym.vardef.typ=classrefdef then
                       if parasym.vardef.typ=classrefdef then
-                        parasym.vardef:=tclassrefdef.create(newstruct)
+                        parasym.vardef:=cclassrefdef.create(newstruct)
                       else
                       else
                         parasym.vardef:=newstruct;
                         parasym.vardef:=newstruct;
                     end
                     end
@@ -1105,7 +1105,7 @@ implementation
         accessed from within nested routines (start with extra dollar to prevent
         accessed from within nested routines (start with extra dollar to prevent
         the JVM from thinking this is a nested class in the unit) }
         the JVM from thinking this is a nested class in the unit) }
       nestedvarsst:=trecordsymtable.create('$'+current_module.realmodulename^+'$$_fpc_nestedvars$'+tostr(pd.defid),current_settings.alignment.localalignmax);
       nestedvarsst:=trecordsymtable.create('$'+current_module.realmodulename^+'$$_fpc_nestedvars$'+tostr(pd.defid),current_settings.alignment.localalignmax);
-      nestedvarsdef:=trecorddef.create(nestedvarsst.name^,nestedvarsst);
+      nestedvarsdef:=crecorddef.create(nestedvarsst.name^,nestedvarsst);
 {$ifdef jvm}
 {$ifdef jvm}
       maybe_guarantee_record_typesym(nestedvarsdef,nestedvarsdef.owner);
       maybe_guarantee_record_typesym(nestedvarsdef,nestedvarsdef.owner);
       { don't add clone/FpcDeepCopy, because the field names are not all
       { don't add clone/FpcDeepCopy, because the field names are not all
@@ -1118,7 +1118,7 @@ implementation
       symtablestack.free;
       symtablestack.free;
       symtablestack:=old_symtablestack.getcopyuntil(pd.localst);
       symtablestack:=old_symtablestack.getcopyuntil(pd.localst);
       pnestedvarsdef:=getpointerdef(nestedvarsdef);
       pnestedvarsdef:=getpointerdef(nestedvarsdef);
-      nestedvars:=tlocalvarsym.create('$nestedvars',vs_var,nestedvarsdef,[]);
+      nestedvars:=clocalvarsym.create('$nestedvars',vs_var,nestedvarsdef,[]);
       pd.localst.insert(nestedvars);
       pd.localst.insert(nestedvars);
       pd.parentfpstruct:=nestedvars;
       pd.parentfpstruct:=nestedvars;
       pd.parentfpstructptrtype:=pnestedvarsdef;
       pd.parentfpstructptrtype:=pnestedvarsdef;
@@ -1151,7 +1151,7 @@ implementation
             fieldvardef:=getpointerdef(vardef)
             fieldvardef:=getpointerdef(vardef)
           else
           else
             fieldvardef:=vardef;
             fieldvardef:=vardef;
-          result:=tfieldvarsym.create(sym.realname,vs_value,fieldvardef,[]);
+          result:=cfieldvarsym.create(sym.realname,vs_value,fieldvardef,[]);
           if nestedvarsst.symlist.count=0 then
           if nestedvarsst.symlist.count=0 then
             include(tfieldvarsym(result).varoptions,vo_is_first_field);
             include(tfieldvarsym(result).varoptions,vo_is_first_field);
           nestedvarsst.insert(result);
           nestedvarsst.insert(result);
@@ -1209,7 +1209,7 @@ implementation
           sl:=tpropaccesslist.create;
           sl:=tpropaccesslist.create;
           sl.addsym(sl_load,pd.parentfpstruct);
           sl.addsym(sl_load,pd.parentfpstruct);
           sl.addsym(sl_subscript,tfieldvarsym(fsym));
           sl.addsym(sl_subscript,tfieldvarsym(fsym));
-          aliassym:=tabsolutevarsym.create_ref(lsym.name,tfieldvarsym(fsym).vardef,sl);
+          aliassym:=cabsolutevarsym.create_ref(lsym.name,tfieldvarsym(fsym).vardef,sl);
           { hide the original variable (can't delete, because there
           { hide the original variable (can't delete, because there
             may be other loadnodes that reference it)
             may be other loadnodes that reference it)
             -- only for locals; hiding parameters changes the
             -- only for locals; hiding parameters changes the
@@ -1250,7 +1250,7 @@ implementation
          (def.typ=recorddef) and
          (def.typ=recorddef) and
          not assigned(def.typesym) then
          not assigned(def.typesym) then
         begin
         begin
-          ts:=ttypesym.create(trecorddef(def).symtable.realname^,def);
+          ts:=ctypesym.create(trecorddef(def).symtable.realname^,def);
           st.insert(ts);
           st.insert(ts);
           ts.visibility:=vis_strictprivate;
           ts.visibility:=vis_strictprivate;
           { this typesym can't be used by any Pascal code, so make sure we don't
           { this typesym can't be used by any Pascal code, so make sure we don't
@@ -1270,7 +1270,7 @@ implementation
       include(fieldvs.symoptions,sp_static);
       include(fieldvs.symoptions,sp_static);
       { generate the symbol which reserves the space }
       { generate the symbol which reserves the space }
       static_name:=lower(generate_nested_name(recst,'_'))+'_'+fieldvs.name;
       static_name:=lower(generate_nested_name(recst,'_'))+'_'+fieldvs.name;
-      hstaticvs:=tstaticvarsym.create(internal_static_field_name(static_name),vs_value,fieldvs.vardef,[]);
+      hstaticvs:=cstaticvarsym.create(internal_static_field_name(static_name),vs_value,fieldvs.vardef,[]);
 {$ifdef jvm}
 {$ifdef jvm}
       { for the JVM, static field accesses are name-based and
       { for the JVM, static field accesses are name-based and
         hence we have to keep the original name of the field.
         hence we have to keep the original name of the field.
@@ -1304,7 +1304,7 @@ implementation
         load node (handle_staticfield_access -> searchsym_in_class ->
         load node (handle_staticfield_access -> searchsym_in_class ->
         is_visible_for_object), which means that the load will fail if this
         is_visible_for_object), which means that the load will fail if this
         symbol is e.g. "strict private" while the property is public }
         symbol is e.g. "strict private" while the property is public }
-      tmp:=tabsolutevarsym.create_ref('$'+static_name,fieldvs.vardef,sl);
+      tmp:=cabsolutevarsym.create_ref('$'+static_name,fieldvs.vardef,sl);
       recst.insert(tmp);
       recst.insert(tmp);
       result:=hstaticvs;
       result:=hstaticvs;
     end;
     end;

+ 118 - 78
compiler/symdef.pas

@@ -128,10 +128,10 @@ interface
           filetyp : tfiletyp;
           filetyp : tfiletyp;
           typedfiledef : tdef;
           typedfiledef : tdef;
           typedfiledefderef : tderef;
           typedfiledefderef : tderef;
-          constructor createtext;
-          constructor createuntyped;
-          constructor createtyped(def : tdef);
-          constructor ppuload(ppufile:tcompilerppufile);
+          constructor createtext;virtual;
+          constructor createuntyped;virtual;
+          constructor createtyped(def : tdef);virtual;
+          constructor ppuload(ppufile:tcompilerppufile);virtual;
           function getcopy : tstoreddef;override;
           function getcopy : tstoreddef;override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure buildderef;override;
           procedure buildderef;override;
@@ -141,11 +141,12 @@ interface
           function  size:asizeint;override;
           function  size:asizeint;override;
           procedure setsize;
           procedure setsize;
        end;
        end;
+       tfiledefclass = class of tfiledef;
 
 
        tvariantdef = class(tstoreddef)
        tvariantdef = class(tstoreddef)
           varianttype : tvarianttype;
           varianttype : tvarianttype;
-          constructor create(v : tvarianttype);
-          constructor ppuload(ppufile:tcompilerppufile);
+          constructor create(v : tvarianttype);virtual;
+          constructor ppuload(ppufile:tcompilerppufile);virtual;
           function getcopy : tstoreddef;override;
           function getcopy : tstoreddef;override;
           function GetTypeName:string;override;
           function GetTypeName:string;override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
@@ -154,37 +155,42 @@ interface
           function is_publishable : boolean;override;
           function is_publishable : boolean;override;
           function needs_inittable : boolean;override;
           function needs_inittable : boolean;override;
        end;
        end;
+       tvariantdefclass = class of tvariantdef;
 
 
        tformaldef = class(tstoreddef)
        tformaldef = class(tstoreddef)
           typed:boolean;
           typed:boolean;
-          constructor create(Atyped:boolean);
-          constructor ppuload(ppufile:tcompilerppufile);
+          constructor create(Atyped:boolean);virtual;
+          constructor ppuload(ppufile:tcompilerppufile);virtual;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           function  GetTypeName:string;override;
           function  GetTypeName:string;override;
        end;
        end;
+       tformaldefclass = class of tformaldef;
 
 
        tforwarddef = class(tstoreddef)
        tforwarddef = class(tstoreddef)
           tosymname : pshortstring;
           tosymname : pshortstring;
           forwardpos : tfileposinfo;
           forwardpos : tfileposinfo;
-          constructor create(const s:string;const pos:tfileposinfo);
+          constructor create(const s:string;const pos:tfileposinfo);virtual;
           destructor destroy;override;
           destructor destroy;override;
           function getcopy:tstoreddef;override;
           function getcopy:tstoreddef;override;
           function GetTypeName:string;override;
           function GetTypeName:string;override;
        end;
        end;
+       tforwarddefclass = class of tforwarddef;
 
 
        tundefineddef = class(tstoreddef)
        tundefineddef = class(tstoreddef)
-          constructor create;
-          constructor ppuload(ppufile:tcompilerppufile);
+          constructor create;virtual;
+          constructor ppuload(ppufile:tcompilerppufile);virtual;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           function  GetTypeName:string;override;
           function  GetTypeName:string;override;
        end;
        end;
+       tundefineddefclass = class of tundefineddef;
 
 
        terrordef = class(tstoreddef)
        terrordef = class(tstoreddef)
-          constructor create;
+          constructor create;virtual;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           function  GetTypeName:string;override;
           function  GetTypeName:string;override;
           function  getmangledparaname : TSymStr;override;
           function  getmangledparaname : TSymStr;override;
        end;
        end;
+       terrordefclass = class of terrordef;
 
 
        tabstractpointerdef = class(tstoreddef)
        tabstractpointerdef = class(tstoreddef)
           pointeddef : tdef;
           pointeddef : tdef;
@@ -206,16 +212,17 @@ interface
           x86pointertyp : tx86pointertyp;
           x86pointertyp : tx86pointertyp;
 {$endif x86}
 {$endif x86}
           has_pointer_math : boolean;
           has_pointer_math : boolean;
-          constructor create(def:tdef);
+          constructor create(def:tdef);virtual;
 {$ifdef x86}
 {$ifdef x86}
-          constructor createx86(def:tdef;x86typ:tx86pointertyp);
+          constructor createx86(def:tdef;x86typ:tx86pointertyp);virtual;
 {$endif x86}
 {$endif x86}
           function size:asizeint;override;
           function size:asizeint;override;
           function getcopy:tstoreddef;override;
           function getcopy:tstoreddef;override;
-          constructor ppuload(ppufile:tcompilerppufile);
+          constructor ppuload(ppufile:tcompilerppufile);virtual;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           function  GetTypeName:string;override;
           function  GetTypeName:string;override;
        end;
        end;
+       tpointerdefclass = class of tpointerdef;
 
 
        tprocdef = class;
        tprocdef = class;
 
 
@@ -272,8 +279,8 @@ interface
        public
        public
           variantrecdesc : pvariantrecdesc;
           variantrecdesc : pvariantrecdesc;
           isunion       : boolean;
           isunion       : boolean;
-          constructor create(const n:string; p:TSymtable);
-          constructor ppuload(ppufile:tcompilerppufile);
+          constructor create(const n:string; p:TSymtable);virtual;
+          constructor ppuload(ppufile:tcompilerppufile);virtual;
           destructor destroy;override;
           destructor destroy;override;
           function getcopy : tstoreddef;override;
           function getcopy : tstoreddef;override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
@@ -288,6 +295,7 @@ interface
           function  needs_inittable : boolean;override;
           function  needs_inittable : boolean;override;
           function  needs_separate_initrtti:boolean;override;
           function  needs_separate_initrtti:boolean;override;
        end;
        end;
+       trecorddefclass = class of trecorddef;
 
 
        tobjectdef = class;
        tobjectdef = class;
 
 
@@ -307,8 +315,8 @@ interface
          ImplementsGetter :  tsym;
          ImplementsGetter :  tsym;
          ImplementsGetterDeref : tderef;
          ImplementsGetterDeref : tderef;
          ImplementsField : tsym;
          ImplementsField : tsym;
-         constructor create(aintf: tobjectdef);
-         constructor create_deref(intfd,getterd:tderef);
+         constructor create(aintf: tobjectdef);virtual;
+         constructor create_deref(intfd,getterd:tderef);virtual;
          destructor  destroy; override;
          destructor  destroy; override;
          function  getcopy:TImplementedInterface;
          function  getcopy:TImplementedInterface;
          procedure buildderef;
          procedure buildderef;
@@ -319,6 +327,7 @@ interface
          function  IsImplMergePossible(MergingIntf:TImplementedInterface;out weight: longint): boolean;
          function  IsImplMergePossible(MergingIntf:TImplementedInterface;out weight: longint): boolean;
          property  IOffset: longint read GetIOffset write fIOffset;
          property  IOffset: longint read GetIOffset write fIOffset;
        end;
        end;
+       timplementedinterfaceclass = class of timplementedinterface;
 
 
        { tvmtentry }
        { tvmtentry }
        tvmtentry = record
        tvmtentry = record
@@ -373,8 +382,8 @@ interface
           }
           }
           classref_created_in_current_module : boolean;
           classref_created_in_current_module : boolean;
           objecttype     : tobjecttyp;
           objecttype     : tobjecttyp;
-          constructor create(ot:tobjecttyp;const n:string;c:tobjectdef);
-          constructor ppuload(ppufile:tcompilerppufile);
+          constructor create(ot:tobjecttyp;const n:string;c:tobjectdef);virtual;
+          constructor ppuload(ppufile:tcompilerppufile);virtual;
           destructor  destroy;override;
           destructor  destroy;override;
           function getcopy : tstoreddef;override;
           function getcopy : tstoreddef;override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
@@ -419,10 +428,11 @@ interface
           { C++ }
           { C++ }
           procedure finish_cpp_data;
           procedure finish_cpp_data;
        end;
        end;
+       tobjectdefclass = class of tobjectdef;
 
 
        tclassrefdef = class(tabstractpointerdef)
        tclassrefdef = class(tabstractpointerdef)
-          constructor create(def:tdef);
-          constructor ppuload(ppufile:tcompilerppufile);
+          constructor create(def:tdef);virtual;
+          constructor ppuload(ppufile:tcompilerppufile);virtual;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           function getcopy:tstoreddef;override;
           function getcopy:tstoreddef;override;
           function GetTypeName:string;override;
           function GetTypeName:string;override;
@@ -430,6 +440,7 @@ interface
           function rtti_mangledname(rt:trttitype):string;override;
           function rtti_mangledname(rt:trttitype):string;override;
           procedure register_created_object_type;override;
           procedure register_created_object_type;override;
        end;
        end;
+       tclassrefdefclass = class of tclassrefdef;
 
 
        tarraydef = class(tstoreddef)
        tarraydef = class(tstoreddef)
           lowrange,
           lowrange,
@@ -446,9 +457,9 @@ interface
           function elesize : asizeint;
           function elesize : asizeint;
           function elepackedbitsize : asizeint;
           function elepackedbitsize : asizeint;
           function elecount : asizeuint;
           function elecount : asizeuint;
-          constructor create_from_pointer(def:tdef);
-          constructor create(l,h:asizeint;def:tdef);
-          constructor ppuload(ppufile:tcompilerppufile);
+          constructor create_from_pointer(def:tdef);virtual;
+          constructor create(l,h:asizeint;def:tdef);virtual;
+          constructor ppuload(ppufile:tcompilerppufile);virtual;
           destructor destroy; override;
           destructor destroy; override;
           function getcopy : tstoreddef;override;
           function getcopy : tstoreddef;override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
@@ -464,12 +475,13 @@ interface
           property elementdef : tdef read _elementdef write setelementdef;
           property elementdef : tdef read _elementdef write setelementdef;
           function is_publishable : boolean;override;
           function is_publishable : boolean;override;
        end;
        end;
+       tarraydefclass = class of tarraydef;
 
 
        torddef = class(tstoreddef)
        torddef = class(tstoreddef)
           low,high : TConstExprInt;
           low,high : TConstExprInt;
           ordtype  : tordtype;
           ordtype  : tordtype;
-          constructor create(t : tordtype;v,b : TConstExprInt);
-          constructor ppuload(ppufile:tcompilerppufile);
+          constructor create(t : tordtype;v,b : TConstExprInt);virtual;
+          constructor ppuload(ppufile:tcompilerppufile);virtual;
           function getcopy : tstoreddef;override;
           function getcopy : tstoreddef;override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           function  is_publishable : boolean;override;
           function  is_publishable : boolean;override;
@@ -479,11 +491,12 @@ interface
           function  packedbitsize: asizeint; override;
           function  packedbitsize: asizeint; override;
           function getvardef : longint;override;
           function getvardef : longint;override;
        end;
        end;
+       torddefclass = class of torddef;
 
 
        tfloatdef = class(tstoreddef)
        tfloatdef = class(tstoreddef)
           floattype : tfloattype;
           floattype : tfloattype;
-          constructor create(t : tfloattype);
-          constructor ppuload(ppufile:tcompilerppufile);
+          constructor create(t : tfloattype);virtual;
+          constructor ppuload(ppufile:tcompilerppufile);virtual;
           function getcopy : tstoreddef;override;
           function getcopy : tstoreddef;override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           function  GetTypeName:string;override;
           function  GetTypeName:string;override;
@@ -493,6 +506,7 @@ interface
           procedure setsize;
           procedure setsize;
           function  getvardef:longint;override;
           function  getvardef:longint;override;
        end;
        end;
+       tfloatdefclass = class of tfloatdef;
 
 
        { tabstractprocdef }
        { tabstractprocdef }
 
 
@@ -553,8 +567,8 @@ interface
           classdef  : tobjectdef;
           classdef  : tobjectdef;
           classdefderef : tderef;
           classdefderef : tderef;
 {$endif}
 {$endif}
-          constructor create(level:byte);
-          constructor ppuload(ppufile:tcompilerppufile);
+          constructor create(level:byte);virtual;
+          constructor ppuload(ppufile:tcompilerppufile);virtual;
           function getcopy : tstoreddef;override;
           function getcopy : tstoreddef;override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
 {$ifdef jvm}
 {$ifdef jvm}
@@ -569,6 +583,7 @@ interface
           function  is_addressonly:boolean;override;
           function  is_addressonly:boolean;override;
           function  getmangledparaname:TSymStr;override;
           function  getmangledparaname:TSymStr;override;
        end;
        end;
+       tprocvardefclass = class of tprocvardef;
 
 
        tmessageinf = record
        tmessageinf = record
          case integer of
          case integer of
@@ -710,8 +725,8 @@ interface
           { set to a value different from tsk_none in case this procdef is for
           { set to a value different from tsk_none in case this procdef is for
             a routine that has to be internally generated by the compiler }
             a routine that has to be internally generated by the compiler }
           synthetickind : tsynthetickind;
           synthetickind : tsynthetickind;
-          constructor create(level:byte);
-          constructor ppuload(ppufile:tcompilerppufile);
+          constructor create(level:byte);virtual;
+          constructor ppuload(ppufile:tcompilerppufile);virtual;
           destructor  destroy;override;
           destructor  destroy;override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure buildderef;override;
           procedure buildderef;override;
@@ -778,6 +793,7 @@ interface
           { true if all information required to inline this routine is available }
           { true if all information required to inline this routine is available }
           property has_inlininginfo: boolean read GetHasInliningInfo write SetHasInliningInfo;
           property has_inlininginfo: boolean read GetHasInliningInfo write SetHasInliningInfo;
        end;
        end;
+       tprocdefclass = class of tprocdef;
 
 
        { single linked list of overloaded procs }
        { single linked list of overloaded procs }
        pprocdeflist = ^tprocdeflist;
        pprocdeflist = ^tprocdeflist;
@@ -791,16 +807,16 @@ interface
           encoding   : tstringencoding;
           encoding   : tstringencoding;
           stringtype : tstringtype;
           stringtype : tstringtype;
           len        : asizeint;
           len        : asizeint;
-          constructor createshort(l : byte);
-          constructor loadshort(ppufile:tcompilerppufile);
-          constructor createlong(l : asizeint);
-          constructor loadlong(ppufile:tcompilerppufile);
-          constructor createansi(aencoding:tstringencoding);
-          constructor loadansi(ppufile:tcompilerppufile);
-          constructor createwide;
-          constructor loadwide(ppufile:tcompilerppufile);
-          constructor createunicode;
-          constructor loadunicode(ppufile:tcompilerppufile);
+          constructor createshort(l : byte);virtual;
+          constructor loadshort(ppufile:tcompilerppufile);virtual;
+          constructor createlong(l : asizeint);virtual;
+          constructor loadlong(ppufile:tcompilerppufile);virtual;
+          constructor createansi(aencoding:tstringencoding);virtual;
+          constructor loadansi(ppufile:tcompilerppufile);virtual;
+          constructor createwide;virtual;
+          constructor loadwide(ppufile:tcompilerppufile);virtual;
+          constructor createunicode;virtual;
+          constructor loadunicode(ppufile:tcompilerppufile);virtual;
           function getcopy : tstoreddef;override;
           function getcopy : tstoreddef;override;
           function  stringtypname:string;
           function  stringtypname:string;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
@@ -812,6 +828,7 @@ interface
           function  needs_inittable : boolean;override;
           function  needs_inittable : boolean;override;
           function  getvardef:longint;override;
           function  getvardef:longint;override;
        end;
        end;
+       tstringdefclass = class of tstringdef;
 
 
        { tenumdef }
        { tenumdef }
 
 
@@ -827,9 +844,9 @@ interface
           classdefderef : tderef;
           classdefderef : tderef;
 {$endif}
 {$endif}
           has_jumps : boolean;
           has_jumps : boolean;
-          constructor create;
-          constructor create_subrange(_basedef:tenumdef;_min,_max:asizeint);
-          constructor ppuload(ppufile:tcompilerppufile);
+          constructor create;virtual;
+          constructor create_subrange(_basedef:tenumdef;_min,_max:asizeint);virtual;
+          constructor ppuload(ppufile:tcompilerppufile);virtual;
           destructor destroy;override;
           destructor destroy;override;
           function getcopy : tstoreddef;override;
           function getcopy : tstoreddef;override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
@@ -848,14 +865,15 @@ interface
           { returns basedef if assigned, otherwise self }
           { returns basedef if assigned, otherwise self }
           function getbasedef: tenumdef;
           function getbasedef: tenumdef;
        end;
        end;
+       tenumdefclass = class of tenumdef;
 
 
        tsetdef = class(tstoreddef)
        tsetdef = class(tstoreddef)
           elementdef : tdef;
           elementdef : tdef;
           elementdefderef : tderef;
           elementdefderef : tderef;
           setbase,
           setbase,
           setmax   : aword;
           setmax   : aword;
-          constructor create(def:tdef;low, high : asizeint);
-          constructor ppuload(ppufile:tcompilerppufile);
+          constructor create(def:tdef;low, high : asizeint);virtual;
+          constructor ppuload(ppufile:tcompilerppufile);virtual;
           function getcopy : tstoreddef;override;
           function getcopy : tstoreddef;override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure buildderef;override;
           procedure buildderef;override;
@@ -863,6 +881,7 @@ interface
           function  GetTypeName:string;override;
           function  GetTypeName:string;override;
           function  is_publishable : boolean;override;
           function  is_publishable : boolean;override;
        end;
        end;
+       tsetdefclass = class of tsetdef;
 
 
 
 
        tgenericdummyentry = class
        tgenericdummyentry = class
@@ -890,6 +909,27 @@ interface
        current_genericdef: tstoreddef;        { used to reject declaration of generic class inside generic class }
        current_genericdef: tstoreddef;        { used to reject declaration of generic class inside generic class }
        current_specializedef: tstoreddef;     { used to implement usage of generic class in itself }
        current_specializedef: tstoreddef;     { used to implement usage of generic class in itself }
 
 
+       cfiledef: tfiledefclass;
+       cvariantdef: tvariantdefclass;
+       cformaldef: tformaldefclass;
+       cforwarddef: tforwarddefclass;
+       cundefineddef: tundefineddefclass;
+       cerrordef: terrordefclass;
+       cpointerdef: tpointerdefclass;
+       crecorddef: trecorddefclass;
+       cimplementedinterface: timplementedinterfaceclass;
+       cobjectdef: tobjectdefclass;
+       cclassrefdef: tclassrefdefclass;
+       carraydef: tarraydefclass;
+       corddef: torddefclass;
+       cfloatdef: tfloatdefclass;
+       cprocvardef: tprocvardefclass;
+       cprocdef: tprocdefclass;
+       cstringdef: tstringdefclass;
+       cenumdef: tenumdefclass;
+       csetdef: tsetdefclass;
+
+
     { default types }
     { default types }
        generrordef,               { error in definition }
        generrordef,               { error in definition }
        voidpointertype,           { pointer for Void-pointeddef }
        voidpointertype,           { pointer for Void-pointeddef }
@@ -1181,7 +1221,7 @@ implementation
                 else
                 else
                   symtable:=current_module.localsymtable;
                   symtable:=current_module.localsymtable;
                 symtablestack.push(symtable);
                 symtablestack.push(symtable);
-                current_module.ansistrdef:=tstringdef.createansi(current_settings.sourcecodepage);
+                current_module.ansistrdef:=cstringdef.createansi(current_settings.sourcecodepage);
                 symtablestack.pop(symtable);
                 symtablestack.pop(symtable);
               end;
               end;
             result:=tstringdef(current_module.ansistrdef);
             result:=tstringdef(current_module.ansistrdef);
@@ -1833,7 +1873,7 @@ implementation
     function tstoreddef.getcopy : tstoreddef;
     function tstoreddef.getcopy : tstoreddef;
       begin
       begin
         Message(sym_e_cant_create_unique_type);
         Message(sym_e_cant_create_unique_type);
-        getcopy:=terrordef.create;
+        getcopy:=cerrordef.create;
       end;
       end;
 
 
 
 
@@ -2133,7 +2173,7 @@ implementation
 
 
     function tstringdef.getcopy : tstoreddef;
     function tstringdef.getcopy : tstoreddef;
       begin
       begin
-        result:=tstringdef.create(typ);
+        result:=cstringdef.create(typ);
         result.typ:=stringdef;
         result.typ:=stringdef;
         tstringdef(result).stringtype:=stringtype;
         tstringdef(result).stringtype:=stringtype;
         tstringdef(result).encoding:=encoding;
         tstringdef(result).encoding:=encoding;
@@ -2313,10 +2353,10 @@ implementation
     function tenumdef.getcopy : tstoreddef;
     function tenumdef.getcopy : tstoreddef;
       begin
       begin
         if assigned(basedef) then
         if assigned(basedef) then
-          result:=tenumdef.create_subrange(basedef,minval,maxval)
+          result:=cenumdef.create_subrange(basedef,minval,maxval)
         else
         else
           begin
           begin
-            result:=tenumdef.create;
+            result:=cenumdef.create;
             tenumdef(result).minval:=minval;
             tenumdef(result).minval:=minval;
             tenumdef(result).maxval:=maxval;
             tenumdef(result).maxval:=maxval;
             tenumdef(result).symtable.free;
             tenumdef(result).symtable.free;
@@ -2528,7 +2568,7 @@ implementation
 
 
     function torddef.getcopy : tstoreddef;
     function torddef.getcopy : tstoreddef;
       begin
       begin
-         result:=torddef.create(ordtype,low,high);
+         result:=corddef.create(ordtype,low,high);
          result.typ:=orddef;
          result.typ:=orddef;
          torddef(result).low:=low;
          torddef(result).low:=low;
          torddef(result).high:=high;
          torddef(result).high:=high;
@@ -2664,7 +2704,7 @@ implementation
 
 
     function tfloatdef.getcopy : tstoreddef;
     function tfloatdef.getcopy : tstoreddef;
       begin
       begin
-         result:=tfloatdef.create(floattype);
+         result:=cfloatdef.create(floattype);
          result.typ:=floatdef;
          result.typ:=floatdef;
          tfloatdef(result).savesize:=savesize;
          tfloatdef(result).savesize:=savesize;
       end;
       end;
@@ -2804,11 +2844,11 @@ implementation
       begin
       begin
         case filetyp of
         case filetyp of
           ft_typed:
           ft_typed:
-            result:=tfiledef.createtyped(typedfiledef);
+            result:=cfiledef.createtyped(typedfiledef);
           ft_untyped:
           ft_untyped:
-            result:=tfiledef.createuntyped;
+            result:=cfiledef.createuntyped;
           ft_text:
           ft_text:
-            result:=tfiledef.createtext;
+            result:=cfiledef.createtext;
           else
           else
             internalerror(2004121201);
             internalerror(2004121201);
         end;
         end;
@@ -2921,7 +2961,7 @@ implementation
 
 
     function tvariantdef.getcopy : tstoreddef;
     function tvariantdef.getcopy : tstoreddef;
       begin
       begin
-        result:=tvariantdef.create(varianttype);
+        result:=cvariantdef.create(varianttype);
       end;
       end;
 
 
 
 
@@ -3076,9 +3116,9 @@ implementation
           one of them will be destroyed on forward type resolve and the second will
           one of them will be destroyed on forward type resolve and the second will
           point to garbage }
           point to garbage }
         if pointeddef.typ=forwarddef then
         if pointeddef.typ=forwarddef then
-          result:=tpointerdef.create(tforwarddef(pointeddef).getcopy)
+          result:=cpointerdef.create(tforwarddef(pointeddef).getcopy)
         else
         else
-          result:=tpointerdef.create(pointeddef);
+          result:=cpointerdef.create(pointeddef);
 {$ifdef x86}
 {$ifdef x86}
         tpointerdef(result).x86pointertyp:=x86pointertyp;
         tpointerdef(result).x86pointertyp:=x86pointertyp;
 {$endif x86}
 {$endif x86}
@@ -3166,9 +3206,9 @@ implementation
     function tclassrefdef.getcopy:tstoreddef;
     function tclassrefdef.getcopy:tstoreddef;
       begin
       begin
         if pointeddef.typ=forwarddef then
         if pointeddef.typ=forwarddef then
-          result:=tclassrefdef.create(tforwarddef(pointeddef).getcopy)
+          result:=cclassrefdef.create(tforwarddef(pointeddef).getcopy)
         else
         else
-          result:=tclassrefdef.create(pointeddef);
+          result:=cclassrefdef.create(pointeddef);
       end;
       end;
 
 
 
 
@@ -3252,7 +3292,7 @@ implementation
 
 
     function tsetdef.getcopy : tstoreddef;
     function tsetdef.getcopy : tstoreddef;
       begin
       begin
-        result:=tsetdef.create(elementdef,setbase,setmax);
+        result:=csetdef.create(elementdef,setbase,setmax);
         { the copy might have been created with a different setalloc setting }
         { the copy might have been created with a different setalloc setting }
         tsetdef(result).savesize:=savesize;
         tsetdef(result).savesize:=savesize;
       end;
       end;
@@ -3382,7 +3422,7 @@ implementation
 
 
     function tarraydef.getcopy : tstoreddef;
     function tarraydef.getcopy : tstoreddef;
       begin
       begin
-        result:=tarraydef.create(lowrange,highrange,rangedef);
+        result:=carraydef.create(lowrange,highrange,rangedef);
         tarraydef(result).arrayoptions:=arrayoptions;
         tarraydef(result).arrayoptions:=arrayoptions;
         tarraydef(result)._elementdef:=_elementdef;
         tarraydef(result)._elementdef:=_elementdef;
       end;
       end;
@@ -3930,7 +3970,7 @@ implementation
 
 
     function trecorddef.getcopy : tstoreddef;
     function trecorddef.getcopy : tstoreddef;
       begin
       begin
-        result:=trecorddef.create(objrealname^,symtable.getcopy);
+        result:=crecorddef.create(objrealname^,symtable.getcopy);
         trecorddef(result).isunion:=isunion;
         trecorddef(result).isunion:=isunion;
         include(trecorddef(result).defoptions,df_copied_def);
         include(trecorddef(result).defoptions,df_copied_def);
         if assigned(tcinitcode) then
         if assigned(tcinitcode) then
@@ -4398,14 +4438,14 @@ implementation
         if newtyp=procdef then
         if newtyp=procdef then
           begin
           begin
             if (copytyp<>pc_bareproc) then
             if (copytyp<>pc_bareproc) then
-              result:=tprocdef.create(nestinglevel)
+              result:=cprocdef.create(nestinglevel)
             else
             else
-              result:=tprocdef.create(normal_function_level);
+              result:=cprocdef.create(normal_function_level);
             tprocdef(result).visibility:=vis_public;
             tprocdef(result).visibility:=vis_public;
           end
           end
         else
         else
           begin
           begin
-            result:=tprocvardef.create(nestinglevel);
+            result:=cprocvardef.create(nestinglevel);
           end;
           end;
         tabstractprocdef(result).returndef:=returndef;
         tabstractprocdef(result).returndef:=returndef;
         tabstractprocdef(result).returndefderef:=returndefderef;
         tabstractprocdef(result).returndefderef:=returndefderef;
@@ -4422,7 +4462,7 @@ implementation
                   if (copytyp=pc_bareproc) and
                   if (copytyp=pc_bareproc) and
                      (([vo_is_self,vo_is_vmt,vo_is_parentfp,vo_is_result]*pvs.varoptions)<>[]) then
                      (([vo_is_self,vo_is_vmt,vo_is_parentfp,vo_is_result]*pvs.varoptions)<>[]) then
                     continue;
                     continue;
-                  npvs:=tparavarsym.create(pvs.realname,pvs.paranr,pvs.varspez,
+                  npvs:=cparavarsym.create(pvs.realname,pvs.paranr,pvs.varspez,
                     pvs.vardef,pvs.varoptions);
                     pvs.vardef,pvs.varoptions);
                   npvs.defaultconstsym:=pvs.defaultconstsym;
                   npvs.defaultconstsym:=pvs.defaultconstsym;
                   tabstractprocdef(result).parast.insert(npvs);
                   tabstractprocdef(result).parast.insert(npvs);
@@ -5730,7 +5770,7 @@ implementation
         i : tcallercallee;
         i : tcallercallee;
         j : longint;
         j : longint;
       begin
       begin
-        result:=tprocvardef.create(parast.symtablelevel);
+        result:=cprocvardef.create(parast.symtablelevel);
         tprocvardef(result).returndef:=returndef;
         tprocvardef(result).returndef:=returndef;
         tprocvardef(result).returndefderef:=returndefderef;
         tprocvardef(result).returndefderef:=returndefderef;
         tprocvardef(result).parast:=parast.getcopy;
         tprocvardef(result).parast:=parast.getcopy;
@@ -6068,7 +6108,7 @@ implementation
       var
       var
         i : longint;
         i : longint;
       begin
       begin
-        result:=tobjectdef.create(objecttype,objrealname^,childof);
+        result:=cobjectdef.create(objecttype,objrealname^,childof);
         { the constructor allocates a symtable which we release to avoid memory leaks }
         { the constructor allocates a symtable which we release to avoid memory leaks }
         tobjectdef(result).symtable.free;
         tobjectdef(result).symtable.free;
         tobjectdef(result).symtable:=symtable.getcopy;
         tobjectdef(result).symtable:=symtable.getcopy;
@@ -6264,7 +6304,7 @@ implementation
         psym:=tsym(st.find(nname));
         psym:=tsym(st.find(nname));
         if not assigned(psym) then
         if not assigned(psym) then
           begin
           begin
-            psym:=tprocsym.create(nname);
+            psym:=cprocsym.create(nname);
             { avoid warning about this symbol being unused }
             { avoid warning about this symbol being unused }
             psym.IncRefCount;
             psym.IncRefCount;
             { don't check for duplicates:
             { don't check for duplicates:
@@ -6418,7 +6458,7 @@ implementation
                  tObjectSymtable(symtable).datasize:=align(tObjectSymtable(symtable).datasize,sizeof(pint));
                  tObjectSymtable(symtable).datasize:=align(tObjectSymtable(symtable).datasize,sizeof(pint));
                  tObjectSymtable(symtable).alignrecord(tObjectSymtable(symtable).datasize,sizeof(pint));
                  tObjectSymtable(symtable).alignrecord(tObjectSymtable(symtable).datasize,sizeof(pint));
                end;
                end;
-             vs:=tfieldvarsym.create('_vptr$'+objname^,vs_value,voidpointertype,[]);
+             vs:=cfieldvarsym.create('_vptr$'+objname^,vs_value,voidpointertype,[]);
              hidesym(vs);
              hidesym(vs);
              tObjectSymtable(symtable).insert(vs);
              tObjectSymtable(symtable).insert(vs);
              tObjectSymtable(symtable).addfield(vs,vis_hidden);
              tObjectSymtable(symtable).addfield(vs,vis_hidden);
@@ -7084,7 +7124,7 @@ implementation
 
 
     function tforwarddef.getcopy:tstoreddef;
     function tforwarddef.getcopy:tstoreddef;
       begin
       begin
-        result:=tforwarddef.create(tosymname^, forwardpos);
+        result:=cforwarddef.create(tosymname^, forwardpos);
       end;
       end;
 
 
 {****************************************************************************
 {****************************************************************************
@@ -7485,7 +7525,7 @@ implementation
             { do not simply push/pop current_module.localsymtable, because
             { do not simply push/pop current_module.localsymtable, because
               that can have side-effects (e.g., it removes helpers) }
               that can have side-effects (e.g., it removes helpers) }
             symtablestack:=nil;
             symtablestack:=nil;
-            res^.Data:=tpointerdef.create(def);
+            res^.Data:=cpointerdef.create(def);
             if assigned(current_module.localsymtable) then
             if assigned(current_module.localsymtable) then
               current_module.localsymtable.insertdef(tdef(res^.Data))
               current_module.localsymtable.insertdef(tdef(res^.Data))
             else
             else
@@ -7522,7 +7562,7 @@ implementation
               unit, add them to the global/staticsymtable }
               unit, add them to the global/staticsymtable }
             oldsymtablestack:=symtablestack;
             oldsymtablestack:=symtablestack;
             symtablestack:=nil;
             symtablestack:=nil;
-            res^.Data:=tarraydef.create(0,elecount-1,ptrsinttype);
+            res^.Data:=carraydef.create(0,elecount-1,ptrsinttype);
             tarraydef(res^.Data).elementdef:=def;
             tarraydef(res^.Data).elementdef:=def;
             if assigned(current_module.localsymtable) then
             if assigned(current_module.localsymtable) then
               current_module.localsymtable.insertdef(tdef(res^.Data))
               current_module.localsymtable.insertdef(tdef(res^.Data))

+ 68 - 39
compiler/symsym.pas

@@ -64,29 +64,32 @@ interface
           { when the label is defined in an asm block, this points to the
           { when the label is defined in an asm block, this points to the
             generated asmlabel }
             generated asmlabel }
           asmblocklabel : tasmlabel;
           asmblocklabel : tasmlabel;
-          constructor create(const n : string);
-          constructor ppuload(ppufile:tcompilerppufile);
+          constructor create(const n : string);virtual;
+          constructor ppuload(ppufile:tcompilerppufile);virtual;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           function mangledname:TSymStr;override;
           function mangledname:TSymStr;override;
        end;
        end;
+       tlabelsymclass = class of tlabelsym;
 
 
        tunitsym = class(Tstoredsym)
        tunitsym = class(Tstoredsym)
           module : tobject; { tmodule }
           module : tobject; { tmodule }
-          constructor create(const n : string;amodule : tobject);
-          constructor ppuload(ppufile:tcompilerppufile);
+          constructor create(const n : string;amodule : tobject);virtual;
+          constructor ppuload(ppufile:tcompilerppufile);virtual;
           destructor destroy;override;
           destructor destroy;override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
        end;
        end;
+       tunitsymclass = class of tunitsym;
 
 
        tnamespacesym = class(Tstoredsym)
        tnamespacesym = class(Tstoredsym)
           unitsym:tsym;
           unitsym:tsym;
           unitsymderef:tderef;
           unitsymderef:tderef;
-          constructor create(const n : string);
-          constructor ppuload(ppufile:tcompilerppufile);
+          constructor create(const n : string);virtual;
+          constructor ppuload(ppufile:tcompilerppufile);virtual;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure buildderef;override;
           procedure buildderef;override;
           procedure deref;override;
           procedure deref;override;
        end;
        end;
+       tnamespacesymclass = class of tnamespacesym;
 
 
        terrorsym = class(Tsym)
        terrorsym = class(Tsym)
           constructor create;
           constructor create;
@@ -99,8 +102,8 @@ interface
           FProcdefList   : TFPObjectList;
           FProcdefList   : TFPObjectList;
           FProcdefDerefList : TFPList;
           FProcdefDerefList : TFPList;
        public
        public
-          constructor create(const n : string);
-          constructor ppuload(ppufile:tcompilerppufile);
+          constructor create(const n : string);virtual;
+          constructor ppuload(ppufile:tcompilerppufile);virtual;
           destructor destroy;override;
           destructor destroy;override;
           { writes all declarations except the specified one }
           { writes all declarations except the specified one }
           procedure write_parameter_lists(skipdef:tprocdef);
           procedure write_parameter_lists(skipdef:tprocdef);
@@ -120,20 +123,22 @@ interface
           function find_procdef_enumerator_operator(fromdef,todef:tdef;var besteq:tequaltype):Tprocdef;
           function find_procdef_enumerator_operator(fromdef,todef:tdef;var besteq:tequaltype):Tprocdef;
           property ProcdefList:TFPObjectList read FProcdefList;
           property ProcdefList:TFPObjectList read FProcdefList;
        end;
        end;
+       tprocsymclass = class of tprocsym;
 
 
        ttypesym = class(Tstoredsym)
        ttypesym = class(Tstoredsym)
        public
        public
           typedef      : tdef;
           typedef      : tdef;
           typedefderef : tderef;
           typedefderef : tderef;
           fprettyname : ansistring;
           fprettyname : ansistring;
-          constructor create(const n : string;def:tdef);
+          constructor create(const n : string;def:tdef);virtual;
           destructor destroy;override;
           destructor destroy;override;
-          constructor ppuload(ppufile:tcompilerppufile);
+          constructor ppuload(ppufile:tcompilerppufile);virtual;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure buildderef;override;
           procedure buildderef;override;
           procedure deref;override;
           procedure deref;override;
           function prettyname : string;override;
           function prettyname : string;override;
        end;
        end;
+       ttypesymclass = class of ttypesym;
 
 
        tabstractvarsym = class(tstoredsym)
        tabstractvarsym = class(tstoredsym)
           varoptions    : tvaroptions;
           varoptions    : tvaroptions;
@@ -178,13 +183,14 @@ interface
 {$else symansistr}
 {$else symansistr}
           cachedmangledname: pshortstring; { mangled name for ObjC or Java }
           cachedmangledname: pshortstring; { mangled name for ObjC or Java }
 {$endif symansistr}
 {$endif symansistr}
-          constructor create(const n : string;vsp:tvarspez;def:tdef;vopts:tvaroptions);
-          constructor ppuload(ppufile:tcompilerppufile);
+          constructor create(const n : string;vsp:tvarspez;def:tdef;vopts:tvaroptions);virtual;
+          constructor ppuload(ppufile:tcompilerppufile);virtual;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure set_externalname(const s:string);
           procedure set_externalname(const s:string);
           function mangledname:TSymStr;override;
           function mangledname:TSymStr;override;
           destructor destroy;override;
           destructor destroy;override;
       end;
       end;
+      tfieldvarsymclass = class of tfieldvarsym;
 
 
       tabstractnormalvarsym = class(tabstractvarsym)
       tabstractnormalvarsym = class(tabstractvarsym)
           defaultconstsym : tsym;
           defaultconstsym : tsym;
@@ -206,10 +212,11 @@ interface
       end;
       end;
 
 
       tlocalvarsym = class(tabstractnormalvarsym)
       tlocalvarsym = class(tabstractnormalvarsym)
-          constructor create(const n : string;vsp:tvarspez;def:tdef;vopts:tvaroptions);
-          constructor ppuload(ppufile:tcompilerppufile);
+          constructor create(const n : string;vsp:tvarspez;def:tdef;vopts:tvaroptions);virtual;
+          constructor ppuload(ppufile:tcompilerppufile);virtual;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
       end;
       end;
+      tlocalvarsymclass = class of tlocalvarsym;
 
 
       tparavarsym = class(tabstractnormalvarsym)
       tparavarsym = class(tabstractnormalvarsym)
           paraloc       : array[tcallercallee] of TCGPara;
           paraloc       : array[tcallercallee] of TCGPara;
@@ -221,12 +228,13 @@ interface
 {$ifdef EXTDEBUG}
 {$ifdef EXTDEBUG}
           eqval         : tequaltype;
           eqval         : tequaltype;
 {$endif EXTDEBUG}
 {$endif EXTDEBUG}
-          constructor create(const n : string;nr:word;vsp:tvarspez;def:tdef;vopts:tvaroptions);
-          constructor ppuload(ppufile:tcompilerppufile);
+          constructor create(const n : string;nr:word;vsp:tvarspez;def:tdef;vopts:tvaroptions);virtual;
+          constructor ppuload(ppufile:tcompilerppufile);virtual;
           destructor destroy;override;
           destructor destroy;override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           function needs_finalization: boolean;
           function needs_finalization: boolean;
       end;
       end;
+      tparavarsymclass = class of tparavarsym;
 
 
       tstaticvarsym = class(tabstractnormalvarsym)
       tstaticvarsym = class(tabstractnormalvarsym)
       private
       private
@@ -243,10 +251,10 @@ interface
             parameters as it is done by iso pascal with the program symbols,
             parameters as it is done by iso pascal with the program symbols,
             isoindex contains the parameter number }
             isoindex contains the parameter number }
           isoindex : dword;
           isoindex : dword;
-          constructor create(const n : string;vsp:tvarspez;def:tdef;vopts:tvaroptions);
-          constructor create_dll(const n : string;vsp:tvarspez;def:tdef);
-          constructor create_C(const n: string; const mangled : TSymStr;vsp:tvarspez;def:tdef);
-          constructor ppuload(ppufile:tcompilerppufile);
+          constructor create(const n : string;vsp:tvarspez;def:tdef;vopts:tvaroptions);virtual;
+          constructor create_dll(const n : string;vsp:tvarspez;def:tdef);virtual;
+          constructor create_C(const n: string; const mangled : TSymStr;vsp:tvarspez;def:tdef);virtual;
+          constructor ppuload(ppufile:tcompilerppufile);virtual;
           destructor destroy;override;
           destructor destroy;override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           function mangledname:TSymStr;override;
           function mangledname:TSymStr;override;
@@ -255,6 +263,7 @@ interface
           procedure set_mangledname(const s:TSymStr);
           procedure set_mangledname(const s:TSymStr);
           procedure set_raw_mangledname(const s:TSymStr);
           procedure set_raw_mangledname(const s:TSymStr);
       end;
       end;
+      tstaticvarsymclass = class of tstaticvarsym;
 
 
       tabsolutevarsym = class(tabstractvarsym)
       tabsolutevarsym = class(tabstractvarsym)
       public
       public
@@ -268,15 +277,16 @@ interface
          addrsegment : aword;
          addrsegment : aword;
 {$endif defined(i8086)}
 {$endif defined(i8086)}
          ref     : tpropaccesslist;
          ref     : tpropaccesslist;
-         constructor create(const n : string;def:tdef);
-         constructor create_ref(const n : string;def:tdef;_ref:tpropaccesslist);
+         constructor create(const n : string;def:tdef);virtual;
+         constructor create_ref(const n : string;def:tdef;_ref:tpropaccesslist);virtual;
          destructor  destroy;override;
          destructor  destroy;override;
-         constructor ppuload(ppufile:tcompilerppufile);
+         constructor ppuload(ppufile:tcompilerppufile);virtual;
          procedure buildderef;override;
          procedure buildderef;override;
          procedure deref;override;
          procedure deref;override;
          function  mangledname : TSymStr;override;
          function  mangledname : TSymStr;override;
          procedure ppuwrite(ppufile:tcompilerppufile);override;
          procedure ppuwrite(ppufile:tcompilerppufile);override;
       end;
       end;
+      tabsolutevarsymclass = class of tabsolutevarsym;
 
 
        tpropaccesslisttypes=(palt_none,palt_read,palt_write,palt_stored);
        tpropaccesslisttypes=(palt_none,palt_read,palt_write,palt_stored);
 
 
@@ -293,9 +303,9 @@ interface
           dispid        : longint;
           dispid        : longint;
           propaccesslist: array[tpropaccesslisttypes] of tpropaccesslist;
           propaccesslist: array[tpropaccesslisttypes] of tpropaccesslist;
           parast : tsymtable;
           parast : tsymtable;
-          constructor create(const n : string);
+          constructor create(const n : string);virtual;
           destructor  destroy;override;
           destructor  destroy;override;
-          constructor ppuload(ppufile:tcompilerppufile);
+          constructor ppuload(ppufile:tcompilerppufile);virtual;
           function  getsize : asizeint;
           function  getsize : asizeint;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure buildderef;override;
           procedure buildderef;override;
@@ -307,6 +317,7 @@ interface
           procedure add_accessor_parameters(readprocdef, writeprocdef: tprocdef);
           procedure add_accessor_parameters(readprocdef, writeprocdef: tprocdef);
           procedure add_index_parameter(var paranr: word; readprocdef, writeprocdef: tprocdef);
           procedure add_index_parameter(var paranr: word; readprocdef, writeprocdef: tprocdef);
        end;
        end;
+       tpropertysymclass = class of tpropertysym;
 
 
        tconstvalue = record
        tconstvalue = record
          case integer of
          case integer of
@@ -320,36 +331,39 @@ interface
           constdefderef : tderef;
           constdefderef : tderef;
           consttyp    : tconsttyp;
           consttyp    : tconsttyp;
           value       : tconstvalue;
           value       : tconstvalue;
-          constructor create_ord(const n : string;t : tconsttyp;v : tconstexprint;def:tdef);
-          constructor create_ordptr(const n : string;t : tconsttyp;v : tconstptruint;def:tdef);
-          constructor create_ptr(const n : string;t : tconsttyp;v : pointer;def:tdef);
-          constructor create_string(const n : string;t : tconsttyp;str:pchar;l:longint;def:tdef);
-          constructor create_wstring(const n : string;t : tconsttyp;pw:pcompilerwidestring);
-          constructor ppuload(ppufile:tcompilerppufile);
+          constructor create_ord(const n : string;t : tconsttyp;v : tconstexprint;def:tdef);virtual;
+          constructor create_ordptr(const n : string;t : tconsttyp;v : tconstptruint;def:tdef);virtual;
+          constructor create_ptr(const n : string;t : tconsttyp;v : pointer;def:tdef);virtual;
+          constructor create_string(const n : string;t : tconsttyp;str:pchar;l:longint;def:tdef);virtual;
+          constructor create_wstring(const n : string;t : tconsttyp;pw:pcompilerwidestring);virtual;
+          constructor ppuload(ppufile:tcompilerppufile);virtual;
           destructor  destroy;override;
           destructor  destroy;override;
           procedure buildderef;override;
           procedure buildderef;override;
           procedure deref;override;
           procedure deref;override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
        end;
        end;
+       tconstsymclass = class of tconstsym;
 
 
        tenumsym = class(Tstoredsym)
        tenumsym = class(Tstoredsym)
           value      : longint;
           value      : longint;
           definition : tenumdef;
           definition : tenumdef;
           definitionderef : tderef;
           definitionderef : tderef;
-          constructor create(const n : string;def : tenumdef;v : longint);
-          constructor ppuload(ppufile:tcompilerppufile);
+          constructor create(const n : string;def : tenumdef;v : longint);virtual;
+          constructor ppuload(ppufile:tcompilerppufile);virtual;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure buildderef;override;
           procedure buildderef;override;
           procedure deref;override;
           procedure deref;override;
        end;
        end;
+       tenumsymclass = class of tenumsym;
 
 
        tsyssym = class(Tstoredsym)
        tsyssym = class(Tstoredsym)
           number : longint;
           number : longint;
-          constructor create(const n : string;l : longint);
-          constructor ppuload(ppufile:tcompilerppufile);
+          constructor create(const n : string;l : longint);virtual;
+          constructor ppuload(ppufile:tcompilerppufile);virtual;
           destructor  destroy;override;
           destructor  destroy;override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
        end;
        end;
+       tsyssymclass = class of tsyssym;
 
 
     const
     const
        maxmacrolen=16*1024;
        maxmacrolen=16*1024;
@@ -380,6 +394,21 @@ interface
     var
     var
        generrorsym : tsym;
        generrorsym : tsym;
 
 
+       clabelsym: tlabelsymclass;
+       cunitsym: tunitsymclass;
+       cnamespacesym: tnamespacesymclass;
+       cprocsym: tprocsymclass;
+       ctypesym: ttypesymclass;
+       cfieldvarsym: tfieldvarsymclass;
+       clocalvarsym: tlocalvarsymclass;
+       cparavarsym: tparavarsymclass;
+       cstaticvarsym: tstaticvarsymclass;
+       cabsolutevarsym: tabsolutevarsymclass;
+       cpropertysym: tpropertysymclass;
+       cconstsym: tconstsymclass;
+       cenumsym: tenumsymclass;
+       csyssym: tsyssymclass;
+
     { generate internal static field name based on regular field name }
     { generate internal static field name based on regular field name }
     function internal_static_field_name(const fieldname: TSymStr): TSymStr;
     function internal_static_field_name(const fieldname: TSymStr): TSymStr;
     function get_high_value_sym(vs: tparavarsym):tsym; { marking it as inline causes IE 200311075 during loading from ppu file }
     function get_high_value_sym(vs: tparavarsym):tsym; { marking it as inline causes IE 200311075 during loading from ppu file }
@@ -1262,12 +1291,12 @@ implementation
             orig:=tparavarsym(parast.SymList[i]);
             orig:=tparavarsym(parast.SymList[i]);
             if assigned(readprocdef) then
             if assigned(readprocdef) then
               begin
               begin
-                hparavs:=tparavarsym.create(orig.RealName,orig.paranr,orig.varspez,orig.vardef,[]);
+                hparavs:=cparavarsym.create(orig.RealName,orig.paranr,orig.varspez,orig.vardef,[]);
                 readprocdef.parast.insert(hparavs);
                 readprocdef.parast.insert(hparavs);
               end;
               end;
             if assigned(writeprocdef) then
             if assigned(writeprocdef) then
               begin
               begin
-                hparavs:=tparavarsym.create(orig.RealName,orig.paranr,orig.varspez,orig.vardef,[]);
+                hparavs:=cparavarsym.create(orig.RealName,orig.paranr,orig.varspez,orig.vardef,[]);
                 writeprocdef.parast.insert(hparavs);
                 writeprocdef.parast.insert(hparavs);
               end;
               end;
           end;
           end;
@@ -1281,12 +1310,12 @@ implementation
         inc(paranr);
         inc(paranr);
         if assigned(readprocdef) then
         if assigned(readprocdef) then
           begin
           begin
-            hparavs:=tparavarsym.create('$index',10*paranr,vs_value,indexdef,[]);
+            hparavs:=cparavarsym.create('$index',10*paranr,vs_value,indexdef,[]);
             readprocdef.parast.insert(hparavs);
             readprocdef.parast.insert(hparavs);
           end;
           end;
         if assigned(writeprocdef) then
         if assigned(writeprocdef) then
           begin
           begin
-            hparavs:=tparavarsym.create('$index',10*paranr,vs_value,indexdef,[]);
+            hparavs:=cparavarsym.create('$index',10*paranr,vs_value,indexdef,[]);
             writeprocdef.parast.insert(hparavs);
             writeprocdef.parast.insert(hparavs);
           end;
           end;
       end;
       end;

+ 3 - 3
compiler/symtable.pas

@@ -485,7 +485,7 @@ implementation
             iblocalvarsym : sym:=tlocalvarsym.ppuload(ppufile);
             iblocalvarsym : sym:=tlocalvarsym.ppuload(ppufile);
              ibparavarsym : sym:=tparavarsym.ppuload(ppufile);
              ibparavarsym : sym:=tparavarsym.ppuload(ppufile);
             ibfieldvarsym : sym:=tfieldvarsym.ppuload(ppufile);
             ibfieldvarsym : sym:=tfieldvarsym.ppuload(ppufile);
-         ibabsolutevarsym : sym:=tabsolutevarsym.ppuload(ppufile);
+         ibabsolutevarsym : sym:=cabsolutevarsym.ppuload(ppufile);
                 ibenumsym : sym:=tenumsym.ppuload(ppufile);
                 ibenumsym : sym:=tenumsym.ppuload(ppufile);
             ibpropertysym : sym:=tpropertysym.ppuload(ppufile);
             ibpropertysym : sym:=tpropertysym.ppuload(ppufile);
                 ibunitsym : sym:=tunitsym.ppuload(ppufile);
                 ibunitsym : sym:=tunitsym.ppuload(ppufile);
@@ -1738,7 +1738,7 @@ implementation
             system.delete(n,1,p);
             system.delete(n,1,p);
             oldsym:=findnamespace(upper(ns));
             oldsym:=findnamespace(upper(ns));
             if not assigned(oldsym) then
             if not assigned(oldsym) then
-              insert(tnamespacesym.create(ns));
+              insert(cnamespacesym.create(ns));
             p:=pos('.',n);
             p:=pos('.',n);
           end;
           end;
       end;
       end;
@@ -3647,7 +3647,7 @@ implementation
        systemunit:=nil;
        systemunit:=nil;
        { create error syms and def }
        { create error syms and def }
        generrorsym:=terrorsym.create;
        generrorsym:=terrorsym.create;
-       generrordef:=terrordef.create;
+       generrordef:=cerrordef.create;
        { macros }
        { macros }
        initialmacrosymtable:=tmacrosymtable.create(false);
        initialmacrosymtable:=tmacrosymtable.create(false);
        macrosymtablestack:=TSymtablestack.create;
        macrosymtablestack:=TSymtablestack.create;

+ 3 - 1
compiler/vis/cpunode.pas

@@ -41,7 +41,9 @@ unit cpunode;
 //       nvismem,
 //       nvismem,
 //       nvisinl,
 //       nvisinl,
 //       nvismat,
 //       nvismat,
-//       nviscnv
+//       nviscnv,
+       { symtable }
+       symcpu
        ;
        ;
 
 
 end.
 end.

+ 3 - 1
compiler/x86_64/cpunode.pas

@@ -56,7 +56,9 @@ unit cpunode;
        nx64flw,
        nx64flw,
 {$endif DISABLE_WIN64_SEH}
 {$endif DISABLE_WIN64_SEH}
        nx64inl,
        nx64inl,
-       nx64set
+       nx64set,
+       { symtable }
+       symcpu
        ;
        ;
 
 
 end.
 end.

+ 174 - 0
compiler/x86_64/symcpu.pas

@@ -0,0 +1,174 @@
+{
+    Copyright (c) 2014 by Florian Klaempfl
+
+    Symbol table overrides for x86_64
+
+    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 symcpu;
+
+{$i fpcdefs.inc}
+
+interface
+
+uses
+  symdef,symsym;
+
+type
+  { defs }
+  tcpufiledef = class(tfiledef)
+  end;
+
+  tcpuvariantdef = class(tvariantdef)
+  end;
+
+  tcpuformaldef = class(tformaldef)
+  end;
+
+  tcpuforwarddef = class(tforwarddef)
+  end;
+
+  tcpuundefineddef = class(tundefineddef)
+  end;
+
+  tcpuerrordef = class(terrordef)
+  end;
+
+  tcpupointerdef = class(tpointerdef)
+  end;
+
+  tcpurecorddef = class(trecorddef)
+  end;
+
+  tcpuimplementedinterface = class(timplementedinterface)
+  end;
+
+  tcpuobjectdef = class(tobjectdef)
+  end;
+
+  tcpuclassrefdef = class(tclassrefdef)
+  end;
+
+  tcpuarraydef = class(tarraydef)
+  end;
+
+  tcpuorddef = class(torddef)
+  end;
+
+  tcpufloatdef = class(tfloatdef)
+  end;
+
+  tcpuprocvardef = class(tprocvardef)
+  end;
+
+  tcpuprocdef = class(tprocdef)
+  end;
+
+  tcpustringdef = class(tstringdef)
+  end;
+
+  tcpuenumdef = class(tenumdef)
+  end;
+
+  tcpusetdef = class(tsetdef)
+  end;
+
+  { syms }
+  tcpulabelsym = class(tlabelsym)
+  end;
+
+  tcpuunitsym = class(tunitsym)
+  end;
+
+  tcpunamespacesym = class(tnamespacesym)
+  end;
+
+  tcpuprocsym = class(tprocsym)
+  end;
+
+  tcpuypesym = class(ttypesym)
+  end;
+
+  tcpufieldvarsym = class(tfieldvarsym)
+  end;
+
+  tcpulocalvarsym = class(tlocalvarsym)
+  end;
+
+  tcpuparavarsym = class(tparavarsym)
+  end;
+
+  tcpustaticvarsym = class(tstaticvarsym)
+  end;
+
+  tcpuabsolutevarsym = class(tabsolutevarsym)
+  end;
+
+  tcpupropertysym = class(tpropertysym)
+  end;
+
+  tcpuconstsym = class(tconstsym)
+  end;
+
+  tcpuenumsym = class(tenumsym)
+  end;
+
+  tcpusyssym = class(tsyssym)
+  end;
+
+
+implementation
+
+begin
+  { used tdef classes }
+  cfiledef:=tcpufiledef;
+  cvariantdef:=tcpuvariantdef;
+  cformaldef:=tcpuformaldef;
+  cforwarddef:=tcpuforwarddef;
+  cundefineddef:=tcpuundefineddef;
+  cerrordef:=tcpuerrordef;
+  cpointerdef:=tcpupointerdef;
+  crecorddef:=tcpurecorddef;
+  cimplementedinterface:=tcpuimplementedinterface;
+  cobjectdef:=tcpuobjectdef;
+  cclassrefdef:=tcpuclassrefdef;
+  carraydef:=tcpuarraydef;
+  corddef:=tcpuorddef;
+  cfloatdef:=tcpufloatdef;
+  cprocvardef:=tcpuprocvardef;
+  cprocdef:=tcpuprocdef;
+  cstringdef:=tcpustringdef;
+  cenumdef:=tcpuenumdef;
+  csetdef:=tcpusetdef;
+
+  { used tsym classes }
+  clabelsym:=tcpulabelsym;
+  cunitsym:=tcpuunitsym;
+  cnamespacesym:=tcpunamespacesym;
+  cprocsym:=tcpuprocsym;
+  ctypesym:=tcpuypesym;
+  cfieldvarsym:=tcpufieldvarsym;
+  clocalvarsym:=tcpulocalvarsym;
+  cparavarsym:=tcpuparavarsym;
+  cstaticvarsym:=tcpustaticvarsym;
+  cabsolutevarsym:=tcpuabsolutevarsym;
+  cpropertysym:=tcpupropertysym;
+  cconstsym:=tcpuconstsym;
+  cenumsym:=tcpuenumsym;
+  csyssym:=tcpusyssym;
+end.
+