소스 검색

* remove tdictionary and tindexarray
* symtables based on TFPHashObjectList and TFPObjectList
* rename torddef.typ to torddef.ordtype
* rename tfloatdef.typ to tfloatdef.floattype
* rename tdef.deftype to tdef.typ
* remove obsolete browser code, browcol is kept so the ide
can still be compiled

git-svn-id: trunk@5192 -

peter 19 년 전
부모
커밋
658c46b903
100개의 변경된 파일1884개의 추가작업 그리고 3521개의 파일을 삭제
  1. 0 1
      .gitattributes
  2. 2 2
      compiler/alpha/cpupara.pas
  3. 0 313
      compiler/alpha/radirect.pas
  4. 4 24
      compiler/aoptbase.pas
  5. 2 22
      compiler/aoptda.pas
  6. 0 4
      compiler/aoptobj.pas
  7. 6 6
      compiler/arm/cgcpu.pas
  8. 9 9
      compiler/arm/cpupara.pas
  9. 1 1
      compiler/arm/narmcnv.pas
  10. 1 1
      compiler/arm/narmcon.pas
  11. 1 1
      compiler/assemble.pas
  12. 20 20
      compiler/browcol.pas
  13. 0 510
      compiler/browlog.pas
  14. 179 969
      compiler/cclasses.pas
  15. 25 7
      compiler/cfileutils.pas
  16. 1 1
      compiler/cg64f32.pas
  17. 10 10
      compiler/cgobj.pas
  18. 1 16
      compiler/compiler.pas
  19. 4 4
      compiler/cresstr.pas
  20. 0 41
      compiler/cutils.pas
  21. 5 5
      compiler/dbgbase.pas
  22. 35 40
      compiler/dbgdwarf.pas
  23. 49 47
      compiler/dbgstabs.pas
  24. 62 62
      compiler/defcmp.pas
  25. 112 116
      compiler/defutil.pas
  26. 1 1
      compiler/finput.pas
  27. 2 2
      compiler/fmodule.pas
  28. 6 57
      compiler/fppu.pas
  29. 184 16
      compiler/globals.pas
  30. 2 4
      compiler/globtype.pas
  31. 66 64
      compiler/htypechk.pas
  32. 1 1
      compiler/i386/cgcpu.pas
  33. 6 6
      compiler/i386/cpupara.pas
  34. 3 3
      compiler/i386/daopt386.pas
  35. 8 8
      compiler/i386/n386add.pas
  36. 2 2
      compiler/i386/n386mat.pas
  37. 1 1
      compiler/m68k/cgcpu.pas
  38. 6 6
      compiler/m68k/cpupara.pas
  39. 4 4
      compiler/m68k/n68kadd.pas
  40. 2 2
      compiler/m68k/ra68kmot.pas
  41. 85 85
      compiler/nadd.pas
  42. 2 2
      compiler/nbas.pas
  43. 60 65
      compiler/ncal.pas
  44. 3 3
      compiler/ncgadd.pas
  45. 1 1
      compiler/ncgbas.pas
  46. 6 6
      compiler/ncgcal.pas
  47. 6 6
      compiler/ncgcnv.pas
  48. 1 1
      compiler/ncgcon.pas
  49. 15 10
      compiler/ncgflw.pas
  50. 5 5
      compiler/ncginl.pas
  51. 14 14
      compiler/ncgld.pas
  52. 1 1
      compiler/ncgmat.pas
  53. 12 12
      compiler/ncgmem.pas
  54. 2 2
      compiler/ncgset.pas
  55. 45 45
      compiler/ncgutil.pas
  56. 52 52
      compiler/ncnv.pas
  57. 4 4
      compiler/ncon.pas
  58. 8 8
      compiler/nflw.pas
  59. 45 45
      compiler/ninl.pas
  60. 13 13
      compiler/nld.pas
  61. 34 34
      compiler/nmat.pas
  62. 13 13
      compiler/nmem.pas
  63. 34 34
      compiler/nobj.pas
  64. 1 1
      compiler/node.pas
  65. 1 1
      compiler/nopt.pas
  66. 5 5
      compiler/nset.pas
  67. 6 6
      compiler/nutils.pas
  68. 1 1
      compiler/oglx.pas
  69. 1 32
      compiler/options.pas
  70. 7 7
      compiler/paramgr.pas
  71. 3 31
      compiler/parser.pas
  72. 6 6
      compiler/pbase.pas
  73. 19 19
      compiler/pdecl.pas
  74. 17 19
      compiler/pdecobj.pas
  75. 225 221
      compiler/pdecsub.pas
  76. 30 30
      compiler/pdecvar.pas
  77. 1 1
      compiler/pexports.pas
  78. 40 40
      compiler/pexpr.pas
  79. 12 12
      compiler/pinline.pas
  80. 18 19
      compiler/pmodules.pas
  81. 5 5
      compiler/powerpc/cgcpu.pas
  82. 13 13
      compiler/powerpc/cpupara.pas
  83. 1 1
      compiler/powerpc/cpupi.pas
  84. 6 6
      compiler/powerpc/nppcadd.pas
  85. 3 3
      compiler/powerpc/nppccnv.pas
  86. 2 2
      compiler/powerpc/nppcmat.pas
  87. 11 11
      compiler/powerpc64/cgcpu.pas
  88. 11 11
      compiler/powerpc64/cpupara.pas
  89. 1 1
      compiler/powerpc64/cpupi.pas
  90. 1 1
      compiler/powerpc64/nppcadd.pas
  91. 1 1
      compiler/powerpc64/nppccnv.pas
  92. 2 2
      compiler/powerpc64/nppcmat.pas
  93. 9 9
      compiler/ppcgen/ngppcadd.pas
  94. 7 7
      compiler/ppu.pas
  95. 33 28
      compiler/pstatmnt.pas
  96. 34 38
      compiler/psub.pas
  97. 18 12
      compiler/ptconst.pas
  98. 20 20
      compiler/ptype.pas
  99. 3 3
      compiler/raatt.pas
  100. 26 26
      compiler/rautils.pas

+ 0 - 1
.gitattributes

@@ -73,7 +73,6 @@ 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/assemble.pas svneol=native#text/plain
 compiler/assemble.pas svneol=native#text/plain
 compiler/browcol.pas svneol=native#text/plain
 compiler/browcol.pas svneol=native#text/plain
-compiler/browlog.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
 compiler/cclasses.pas svneol=native#text/plain
 compiler/cclasses.pas svneol=native#text/plain

+ 2 - 2
compiler/alpha/cpupara.pas

@@ -70,7 +70,7 @@ unit cpupara;
          { Later, the LOC_REFERENCE is in most cases changed into LOC_REGISTER
          { Later, the LOC_REFERENCE is in most cases changed into LOC_REGISTER
            if push_addr_param for the def is true
            if push_addr_param for the def is true
          }
          }
-         case p.deftype of
+         case p.typ of
             orddef:
             orddef:
               getparaloc:=LOC_REGISTER;
               getparaloc:=LOC_REGISTER;
             floatdef:
             floatdef:
@@ -248,7 +248,7 @@ unit cpupara;
 
 
     function talphaparamanager.getfuncretparaloc(p : tabstractprocdef) : tparalocation;
     function talphaparamanager.getfuncretparaloc(p : tabstractprocdef) : tparalocation;
       begin
       begin
-         case p.returndef.deftype of
+         case p.returndef.typ of
             orddef,
             orddef,
             enumdef:
             enumdef:
               begin
               begin

+ 0 - 313
compiler/alpha/radirect.pas

@@ -1,313 +0,0 @@
-{
-    Copyright (c) 1998-2002 by Florian Klaempfl
-
-    Reads inline Alpha assembler and writes the lines direct to the output
-
-    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.
-
- ****************************************************************************
-}
-{
-  This unit reads Alpha inline assembler and writes the lines direct to the output file.
-}
-unit radirect;
-
-{$i fpcdefs.inc}
-
-interface
-
-    uses
-      node;
-
-     function assemble : tnode;
-
-  implementation
-
-    uses
-       { common }
-       cutils,
-       { global }
-       globals,verbose,
-       systems,
-       { aasm }
-       aasmbase,aasmtai,aasmdata,aasmcpu,
-       { symtable }
-       symconst,symbase,symtype,symsym,symtable,defbase,
-       { pass 1 }
-       nbas,
-       { parser }
-       scanner,
-       { codegen }
-       cgbase,
-       { constants }
-       agaxpgas,
-       cpubase
-       ;
-
-    function assemble : tnode;
-
-      var
-         retstr,s,hs : string;
-         c : char;
-         ende : boolean;
-         srsym,sym : tsym;
-         srsymtable : tsymtable;
-         code : TAsmList;
-         i,l : longint;
-
-       procedure writeasmline;
-         var
-           i : longint;
-         begin
-           i:=length(s);
-           while (i>0) and (s[i] in [' ',#9]) do
-            dec(i);
-           s[0]:=chr(i);
-           if s<>'' then
-            code.concat(Tai_direct.Create(strpnew(s)));
-            { consider it set function set if the offset was loaded }
-           if assigned(aktprocdef.funcretsym) and
-              (pos(retstr,upper(s))>0) then
-             tfuncretsym(aktprocdef.funcretsym).funcretstate:=vs_initialised;
-           s:='';
-         end;
-
-     begin
-       ende:=false;
-       s:='';
-       if assigned(aktprocdef.funcretsym) and
-          is_fpu(aktprocdef.returndef) then
-         tfuncretsym(aktprocdef.funcretsym).funcretstate:=vs_initialised;
-       { !!!!!
-       if (not is_void(aktprocdef.returndef)) then
-         retstr:=upper(tostr(procinfo^.return_offset)+'('+gas_reg2str[procinfo^.framepointer]+')')
-       else
-       }
-         retstr:='';
-
-       c:=current_scanner.asmgetchar;
-       code:=TAsmList.Create;
-       while not(ende) do
-         begin
-            { wrong placement
-            current_scanner.gettokenpos; }
-            case c of
-              'A'..'Z','a'..'z','_':
-                begin
-                   current_scanner.gettokenpos;
-                   i:=0;
-                   hs:='';
-                   while ((ord(c)>=ord('A')) and (ord(c)<=ord('Z')))
-                      or ((ord(c)>=ord('a')) and (ord(c)<=ord('z')))
-                      or ((ord(c)>=ord('0')) and (ord(c)<=ord('9')))
-                      or (c='_') do
-                     begin
-                        inc(i);
-                        hs[i]:=c;
-                        c:=current_scanner.asmgetchar;
-                     end;
-                   hs[0]:=chr(i);
-                   if upper(hs)='END' then
-                      ende:=true
-                   else
-                      begin
-                         if c=':' then
-                           begin
-                             searchsym(upper(hs),srsym,srsymtable);
-                             if srsym<>nil then
-                               if (srsym.typ = labelsym) then
-                                 Begin
-                                    hs:=tlabelsym(srsym).lab.name;
-                                    tlabelsym(srsym).lab.is_set:=true;
-                                 end
-                               else
-                                 Message(asmr_w_using_defined_as_local);
-                           end
-                         else
-                           { access to local variables }
-                           if assigned(aktprocdef) then
-                             begin
-                                { I don't know yet, what the ppc port requires }
-                                { we'll see how things settle down             }
-
-                                { is the last written character an special }
-                                { char ?                                   }
-                                { !!!
-                                if (s[length(s)]='%') and
-                                   ret_in_acc(aktprocdef.returndef) and
-                                   ((pos('AX',upper(hs))>0) or
-                                   (pos('AL',upper(hs))>0)) then
-                                  tfuncretsym(aktprocdef.funcretsym).funcretstate:=vs_initialised;
-                                }
-                                if ((s[length(s)]<>'0') or (hs[1]<>'x')) then
-                                  begin
-                                     if assigned(aktprocdef.localst) and
-                                        (lexlevel >= normal_function_level) then
-                                       sym:=tsym(aktprocdef.localst.search(upper(hs)))
-                                     else
-                                       sym:=nil;
-                                     if assigned(sym) then
-                                       begin
-                                          if (sym.typ=labelsym) then
-                                            Begin
-                                               hs:=tlabelsym(sym).lab.name;
-                                            end
-                                          else if sym.typ=varsym then
-                                            begin
-                                               if (vo_is_external in tvarsym(sym).varoptions) then
-                                                 hs:=tvarsym(sym).mangledname
-                                               else
-                                                 begin
-                                                    if (tvarsym(sym).reg<>R_NO) then
-                                                      hs:=gas_reg2str[procinfo.framepointer]
-                                                    else
-                                                      hs:=tostr(tvarsym(sym).address)+
-                                                        '('+gas_reg2str[procinfo.framepointer]+')';
-                                                 end;
-                                            end
-                                          else
-                                          { call to local function }
-                                          if (sym.typ=procsym) and (pos('BL',upper(s))>0) then
-                                            hs:=tprocsym(sym).first_procdef.mangledname;
-                                       end
-                                     else
-                                       begin
-                                          if assigned(aktprocdef.parast) then
-                                            sym:=tsym(aktprocdef.parast.search(upper(hs)))
-                                          else
-                                            sym:=nil;
-                                          if assigned(sym) then
-                                            begin
-                                               if sym.typ=varsym then
-                                                 begin
-                                                    l:=tvarsym(sym).address;
-                                                    { set offset }
-                                                    inc(l,aktprocdef.parast.address_fixup);
-                                                    hs:=tostr(l)+'('+gas_reg2str[procinfo.framepointer]+')';
-                                                    if pos(',',s) > 0 then
-                                                      tvarsym(sym).varstate:=vs_readwritten;
-                                                 end;
-                                            end
-                                          { I added that but it creates a problem in line.ppi
-                                          because there is a local label wbuffer and
-                                          a static variable WBUFFER ...
-                                          what would you decide, florian ?}
-                                          else
-                                            begin
-                                               searchsym(upper(hs),sym,srsymtable);
-                                               if assigned(sym) and (sym.owner.symtabletype in [globalsymtable,staticsymtable]) then
-                                                 begin
-                                                   case sym.typ of
-                                                     varsym :
-                                                       begin
-                                                         Message2(asmr_h_direct_global_to_mangled,hs,tvarsym(sym).mangledname);
-                                                         hs:=tvarsym(sym).mangledname;
-                                                         inc(tvarsym(sym).refs);
-                                                       end;
-                                                     typedconstsym :
-                                                       begin
-                                                         Message2(asmr_h_direct_global_to_mangled,hs,ttypedconstsym(sym).mangledname);
-                                                         hs:=ttypedconstsym(sym).mangledname;
-                                                       end;
-                                                     procsym :
-                                                       begin
-                                                         { procs can be called or the address can be loaded }
-                                                         if (pos('BL',upper(s))>0) {or (pos('LEA',upper(s))>0))}  then
-                                                          begin
-                                                            if Tprocsym(sym).procdef_count>1 then
-                                                              Message1(asmr_w_direct_global_is_overloaded_func,hs);
-                                                            Message2(asmr_h_direct_global_to_mangled,hs,tprocsym(sym).first_procdef.mangledname);
-                                                            hs:=tprocsym(sym).first_procdef.mangledname;
-                                                          end;
-                                                       end;
-                                                     else
-                                                       Message(asmr_e_wrong_sym_type);
-                                                   end;
-                                                 end
-{$ifdef dummy}
-                                               else if upper(hs)='__SELF' then
-                                                 begin
-                                                    if assigned(procinfo^._class) then
-                                                      hs:=tostr(procinfo^.selfpointer_offset)+
-                                                          '('+gas_reg2str[procinfo^.framepointer]+')'
-                                                    else
-                                                     Message(asmr_e_cannot_use_SELF_outside_a_method);
-                                                 end
-                                               else if upper(hs)='__RESULT' then
-                                                 begin
-                                                    if (not is_void(aktprocdef.returndef)) then
-                                                      hs:=retstr
-                                                    else
-                                                      Message(asmr_e_void_function);
-                                                 end
-                                               { implement old stack/frame pointer access for nested procedures }
-                                               {!!!!
-                                               else if upper(hs)='__OLDSP' then
-                                                 begin
-                                                    { complicate to check there }
-                                                    { we do it: }
-                                                    if lexlevel>normal_function_level then
-                                                      hs:=tostr(procinfo^.framepointer_offset)+
-                                                        '('+gas_reg2str[procinfo^.framepointer]+')'
-                                                    else
-                                                      Message(asmr_e_cannot_use_OLDEBP_outside_nested_procedure);
-                                                 end;
-                                               }
-                                               end;
-{$endif dummy}
-                                            end;
-                                       end;
-                                  end;
-                             end;
-                         s:=s+hs;
-                      end;
-                end;
-              '{',';',#10,#13:
-                begin
-                   if pos(retstr,s) > 0 then
-                     tfuncretsym(aktprocdef.funcretsym).funcretstate:=vs_initialised;
-                   writeasmline;
-                   c:=current_scanner.asmgetchar;
-                end;
-              #26:
-                Message(scan_f_end_of_file);
-              else
-                begin
-                  current_scanner.gettokenpos;
-                  inc(byte(s[0]));
-                  s[length(s)]:=c;
-                  c:=current_scanner.asmgetchar;
-                end;
-            end;
-         end;
-       writeasmline;
-       assemble:=casmnode.create(code);
-     end;
-
-{*****************************************************************************
-                                     Initialize
-*****************************************************************************}
-
-const
-  asmmode_ppc_direct_info : tasmmodeinfo =
-          (
-            id    : asmmode_direct;
-            idtxt : 'DIRECT'
-          );
-
-initialization
-  RegisterAsmMode(asmmode_ppc_direct_info);
-
-end.

+ 4 - 24
compiler/aoptbase.pas

@@ -76,16 +76,16 @@ unit aoptbase;
         Function RegsSameSize(Reg1, Reg2: TRegister): Boolean; Virtual;
         Function RegsSameSize(Reg1, Reg2: TRegister): Boolean; Virtual;
         { returns whether P is a load instruction (load contents from a }
         { returns whether P is a load instruction (load contents from a }
         { memory location or (register) variable into a register)       }
         { memory location or (register) variable into a register)       }
-        Function IsLoadMemReg(p: tai): Boolean; Virtual;
+        Function IsLoadMemReg(p: tai): Boolean; Virtual; Abstract;
         { returns whether P is a load constant instruction (load a constant }
         { returns whether P is a load constant instruction (load a constant }
         { into a register)                                                  }
         { into a register)                                                  }
-        Function IsLoadConstReg(p: tai): Boolean; Virtual;
+        Function IsLoadConstReg(p: tai): Boolean; Virtual; Abstract;
         { returns whether P is a store instruction (store contents from a }
         { returns whether P is a store instruction (store contents from a }
         { register to a memory location or to a (register) variable)      }
         { register to a memory location or to a (register) variable)      }
-        Function IsStoreRegMem(p: tai): Boolean; Virtual;
+        Function IsStoreRegMem(p: tai): Boolean; Virtual; Abstract;
 
 
         { create a paicpu Object that loads the contents of reg1 into reg2 }
         { create a paicpu Object that loads the contents of reg1 into reg2 }
-        Function a_load_reg_reg(reg1, reg2: TRegister): taicpu; Virtual;
+        Function a_load_reg_reg(reg1, reg2: TRegister): taicpu; Virtual; Abstract;
 
 
     end;
     end;
 
 
@@ -234,24 +234,4 @@ unit aoptbase;
     RegsSameSize := True
     RegsSameSize := True
   End;
   End;
 
 
-  Function TAOptBase.IsLoadMemReg(p: tai): Boolean;
-  Begin
-    Abstract
-  End;
-
-  Function TAOptBase.IsLoadConstReg(p: tai): Boolean;
-  Begin
-    Abstract
-  End;
-
-  Function TAOptBase.IsStoreRegMem(p: tai): Boolean;
-  Begin
-    Abstract
-  End;
-
-  Function TAoptBase.a_load_reg_reg(reg1, reg2: TRegister): taicpu;
-  Begin
-    Abstract
-  End;
-
 end.
 end.

+ 2 - 22
compiler/aoptda.pas

@@ -41,7 +41,7 @@ Unit aoptda;
         Procedure DoDFA;
         Procedure DoDFA;
 
 
         { handles the processor dependent dataflow analizing               }
         { handles the processor dependent dataflow analizing               }
-        Procedure CpuDFA(p: PInstr); Virtual;
+        Procedure CpuDFA(p: PInstr); Virtual; Abstract;
 
 
         { How many instructions are between the current instruction and the }
         { How many instructions are between the current instruction and the }
         { last one that modified the register                               }
         { last one that modified the register                               }
@@ -50,7 +50,7 @@ Unit aoptda;
         { convert a TInsChange value into the corresponding register }
         { convert a TInsChange value into the corresponding register }
         //!!!!!!!!!! Function TCh2Reg(Ch: TInsChange): TRegister; Virtual;
         //!!!!!!!!!! Function TCh2Reg(Ch: TInsChange): TRegister; Virtual;
         { returns whether the instruction P reads from register Reg }
         { returns whether the instruction P reads from register Reg }
-        Function RegReadByInstr(Reg: TRegister; p: tai): Boolean; Virtual;
+        Function RegReadByInstr(Reg: TRegister; p: tai): Boolean; Virtual; Abstract;
       End;
       End;
 
 
   Implementation
   Implementation
@@ -160,24 +160,4 @@ Unit aoptda;
     }
     }
     End;
     End;
 
 
-    Procedure TAoptDFA.CpuDFA(p: PInstr);
-    Begin
-      Abstract;
-    End;
-
-  {!!!!!!!
-    Function TAOptDFA.TCh2Reg(Ch: TInsChange): TRegister;
-    Begin
-      TCh2Reg:=R_NO;
-      Abstract;
-    End;
-  }
-
-    Function TAOptDFA.RegReadByInstr(Reg: TRegister; p: tai): Boolean;
-    Begin
-      RegReadByInstr:=false;
-      Abstract;
-    End;
-
-
 End.
 End.

+ 0 - 4
compiler/aoptobj.pas

@@ -210,11 +210,7 @@ Unit AoptObj;
         PaiObj: Tai;
         PaiObj: Tai;
       End;
       End;
 
 
-    {$ifndef TP}
       TLabelTable = Array[0..2500000] Of TLabelTableItem;
       TLabelTable = Array[0..2500000] Of TLabelTableItem;
-    {$else TP}
-      TLabelTable = Array[0..(65520 div sizeof(TLabelTableItem))] Of TLabelTableItem;
-    {$endif TP}
       PLabelTable = ^TLabelTable;
       PLabelTable = ^TLabelTable;
       PLabelInfo = ^TLabelInfo;
       PLabelInfo = ^TLabelInfo;
       TLabelInfo = Record
       TLabelInfo = Record

+ 6 - 6
compiler/arm/cgcpu.pas

@@ -139,9 +139,9 @@ unit cgcpu;
 
 
     function get_fpu_postfix(def : tdef) : toppostfix;
     function get_fpu_postfix(def : tdef) : toppostfix;
       begin
       begin
-        if def.deftype=floatdef then
+        if def.typ=floatdef then
           begin
           begin
-            case tfloatdef(def).typ of
+            case tfloatdef(def).floattype of
               s32real:
               s32real:
                 result:=PF_S;
                 result:=PF_S;
               s64real:
               s64real:
@@ -1724,9 +1724,9 @@ unit cgcpu;
               ai:=taicpu.op_sym(A_B,hl);
               ai:=taicpu.op_sym(A_B,hl);
               ai.is_jmp:=true;
               ai.is_jmp:=true;
 
 
-              if not((def.deftype=pointerdef) or
-                    ((def.deftype=orddef) and
-                     (torddef(def).typ in [u64bit,u16bit,u32bit,u8bit,uchar,bool8bit,bool16bit,bool32bit]))) then
+              if not((def.typ=pointerdef) or
+                    ((def.typ=orddef) and
+                     (torddef(def).ordtype in [u64bit,u16bit,u32bit,u8bit,uchar,bool8bit,bool16bit,bool32bit]))) then
                  ai.SetCondition(C_VC)
                  ai.SetCondition(C_VC)
               else
               else
                 if TAiCpu(List.Last).opcode in [A_RSB,A_RSC,A_SBC,A_SUB] then
                 if TAiCpu(List.Last).opcode in [A_RSB,A_RSC,A_SBC,A_SUB] then
@@ -1808,7 +1808,7 @@ unit cgcpu;
            (procdef.procoptions*[po_classmethod, po_staticmethod,
            (procdef.procoptions*[po_classmethod, po_staticmethod,
              po_methodpointer, po_interrupt, po_iocheck]<>[]) then
              po_methodpointer, po_interrupt, po_iocheck]<>[]) then
           Internalerror(200006138);
           Internalerror(200006138);
-        if procdef.owner.symtabletype<>objectsymtable then
+        if procdef.owner.symtabletype<>ObjectSymtable then
           Internalerror(200109191);
           Internalerror(200109191);
 
 
         make_global:=false;
         make_global:=false;

+ 9 - 9
compiler/arm/cpupara.pas

@@ -104,7 +104,7 @@ unit cpupara;
          { Later, the LOC_REFERENCE is in most cases changed into LOC_REGISTER
          { Later, the LOC_REFERENCE is in most cases changed into LOC_REGISTER
            if push_addr_param for the def is true
            if push_addr_param for the def is true
          }
          }
-         case p.deftype of
+         case p.typ of
             orddef:
             orddef:
               getparaloc:=LOC_REGISTER;
               getparaloc:=LOC_REGISTER;
             floatdef:
             floatdef:
@@ -159,7 +159,7 @@ unit cpupara;
             result:=true;
             result:=true;
             exit;
             exit;
           end;
           end;
-        case def.deftype of
+        case def.typ of
           objectdef,
           objectdef,
           variantdef,
           variantdef,
           formaldef,
           formaldef,
@@ -173,20 +173,20 @@ unit cpupara;
           setdef :
           setdef :
             result:=(tsetdef(def).settype<>smallset);
             result:=(tsetdef(def).settype<>smallset);
           stringdef :
           stringdef :
-            result:=tstringdef(def).string_typ in [st_shortstring,st_longstring];
+            result:=tstringdef(def).stringtype in [st_shortstring,st_longstring];
         end;
         end;
       end;
       end;
 
 
 
 
     function tarmparamanager.ret_in_param(def : tdef;calloption : tproccalloption) : boolean;
     function tarmparamanager.ret_in_param(def : tdef;calloption : tproccalloption) : boolean;
       begin
       begin
-        case def.deftype of
+        case def.typ of
           recorddef:
           recorddef:
             { this is how gcc 4.0.4 on linux seems to do it, it doesn't look like being
             { this is how gcc 4.0.4 on linux seems to do it, it doesn't look like being
               ARM ABI standard compliant
               ARM ABI standard compliant
             }
             }
-            result:=not((trecorddef(def).symtable.symindex.count=1) and
-              not(ret_in_param(tabstractvarsym(trecorddef(def).symtable.symindex.search(1)).vardef,calloption)));
+            result:=not((trecorddef(def).symtable.SymList.count=1) and
+              not(ret_in_param(tabstractvarsym(trecorddef(def).symtable.SymList[0]).vardef,calloption)));
           {
           {
           objectdef
           objectdef
           arraydef:
           arraydef:
@@ -283,7 +283,7 @@ unit cpupara;
                 else
                 else
                   paralen := tcgsize2size[def_cgsize(paradef)];
                   paralen := tcgsize2size[def_cgsize(paradef)];
                 loc := getparaloc(p.proccalloption,paradef);
                 loc := getparaloc(p.proccalloption,paradef);
-                if (paradef.deftype in [objectdef,arraydef,recorddef]) and
+                if (paradef.typ in [objectdef,arraydef,recorddef]) and
                   not is_special_array(paradef) and
                   not is_special_array(paradef) and
                   (hp.varspez in [vs_value,vs_const]) then
                   (hp.varspez in [vs_value,vs_const]) then
                   paracgsize := int_cgsize(paralen)
                   paracgsize := int_cgsize(paralen)
@@ -434,7 +434,7 @@ unit cpupara;
           retcgsize:=OS_ADDR
           retcgsize:=OS_ADDR
         else
         else
           retcgsize:=def_cgsize(p.returndef);
           retcgsize:=def_cgsize(p.returndef);
-          
+
         location_reset(p.funcretloc[side],LOC_INVALID,OS_NO);
         location_reset(p.funcretloc[side],LOC_INVALID,OS_NO);
         p.funcretloc[side].size:=retcgsize;
         p.funcretloc[side].size:=retcgsize;
 
 
@@ -446,7 +446,7 @@ unit cpupara;
           end;
           end;
 
 
         { Return in FPU register? }
         { Return in FPU register? }
-        if p.returndef.deftype=floatdef then
+        if p.returndef.typ=floatdef then
           begin
           begin
             if (p.proccalloption in [pocall_softfloat]) or (cs_fp_emulation in current_settings.moduleswitches) then
             if (p.proccalloption in [pocall_softfloat]) or (cs_fp_emulation in current_settings.moduleswitches) then
               begin
               begin

+ 1 - 1
compiler/arm/narmcnv.pas

@@ -134,7 +134,7 @@ implementation
                       fname:='int32_to_';
                       fname:='int32_to_';
                     firstpass(left);
                     firstpass(left);
                   end;
                   end;
-                if tfloatdef(resultdef).typ=s64real then
+                if tfloatdef(resultdef).floattype=s64real then
                   fname:=fname+'float64'
                   fname:=fname+'float64'
                 else
                 else
                   fname:=fname+'float32';
                   fname:=fname+'float32';

+ 1 - 1
compiler/arm/narmcon.pas

@@ -65,7 +65,7 @@ interface
       begin
       begin
         location_reset(location,LOC_CREFERENCE,def_cgsize(resultdef));
         location_reset(location,LOC_CREFERENCE,def_cgsize(resultdef));
         lastlabel:=nil;
         lastlabel:=nil;
-        realait:=floattype2ait[tfloatdef(resultdef).typ];
+        realait:=floattype2ait[tfloatdef(resultdef).floattype];
         hiloswapped:=current_settings.fputype in [fpu_fpa,fpu_fpa10,fpu_fpa11];
         hiloswapped:=current_settings.fputype in [fpu_fpa,fpu_fpa10,fpu_fpa11];
         { const already used ? }
         { const already used ? }
         if not assigned(lab_real) then
         if not assigned(lab_real) then

+ 1 - 1
compiler/assemble.pas

@@ -848,7 +848,7 @@ Implementation
                 if (nidx=N_SourceFile) or (nidx=N_IncludeFile) then
                 if (nidx=N_SourceFile) or (nidx=N_IncludeFile) then
                   begin
                   begin
                     hs:=strpas(pstr);
                     hs:=strpas(pstr);
-                    StabstrEntry:=StabStrDict.Search(hs);
+                    StabstrEntry:=StabStrDict.Find(hs);
                     if not assigned(StabstrEntry) then
                     if not assigned(StabstrEntry) then
                       begin
                       begin
                         StabstrEntry:=TStabStrEntry.Create(hs);
                         StabstrEntry:=TStabStrEntry.Create(hs);

+ 20 - 20
compiler/browcol.pas

@@ -1156,7 +1156,6 @@ end;
 
 
   procedure ProcessSymTable(OwnerSym: PSymbol; var Owner: PSymbolCollection; Table: TSymTable);
   procedure ProcessSymTable(OwnerSym: PSymbol; var Owner: PSymbolCollection; Table: TSymTable);
   var J: longint;
   var J: longint;
-      Ref: TRef;
       Sym: TSym;
       Sym: TSym;
       Symbol: PSymbol;
       Symbol: PSymbol;
       Reference: PReference;
       Reference: PReference;
@@ -1211,7 +1210,7 @@ end;
   var Name: string;
   var Name: string;
   begin
   begin
     Name:='';
     Name:='';
-    case def.string_typ of
+    case def.stringtype of
       st_shortstring :
       st_shortstring :
         if def.len=255 then
         if def.len=255 then
           Name:='shortstring'
           Name:='shortstring'
@@ -1327,7 +1326,7 @@ end;
       if assigned(def.typesym) then
       if assigned(def.typesym) then
         Name:=def.typesym.name;
         Name:=def.typesym.name;
       if Name='' then
       if Name='' then
-      case def.deftype of
+      case def.typ of
         arraydef :
         arraydef :
           Name:=GetArrayDefStr(tarraydef(def));
           Name:=GetArrayDefStr(tarraydef(def));
         stringdef :
         stringdef :
@@ -1373,7 +1372,7 @@ end;
     case sym.consttyp of
     case sym.consttyp of
       constord :
       constord :
         begin
         begin
-          if sym.constdef.deftype=enumdef then
+          if sym.constdef.typ=enumdef then
             Name:=sym.constdef.typesym.name+'('+IntToStr(sym.value.valueord)+')'
             Name:=sym.constdef.typesym.name+'('+IntToStr(sym.value.valueord)+')'
           else
           else
             if is_boolean(sym.constdef) then
             if is_boolean(sym.constdef) then
@@ -1402,7 +1401,7 @@ end;
       only usefull for unamed types PM }
       only usefull for unamed types PM }
     if assigned(definition) and not assigned(definition.typesym) then
     if assigned(definition) and not assigned(definition.typesym) then
     begin
     begin
-      case definition.deftype of
+      case definition.typ of
         recorddef :
         recorddef :
           if trecorddef(definition).symtable<>Table then
           if trecorddef(definition).symtable<>Table then
             ProcessSymTable(Symbol,Symbol^.Items,trecorddef(definition).symtable);
             ProcessSymTable(Symbol,Symbol^.Items,trecorddef(definition).symtable);
@@ -1420,14 +1419,15 @@ end;
   end;
   end;
   var MemInfo: TSymbolMemInfo;
   var MemInfo: TSymbolMemInfo;
       ObjDef: tobjectdef;
       ObjDef: tobjectdef;
+      symidx : longint;
   begin
   begin
     if not Assigned(Table) then
     if not Assigned(Table) then
      Exit;
      Exit;
     if Owner=nil then
     if Owner=nil then
      Owner:=New(PSortedSymbolCollection, Init(10,50));
      Owner:=New(PSortedSymbolCollection, Init(10,50));
-    sym:=tsym(Table.symindex.first);
-    while assigned(sym) do
+    for symidx:=0 to Table.SymList.Count-1 do
       begin
       begin
+        sym:=tsym(Table.SymList[symidx]);
         New(Symbol, Init(Sym.Name,Sym.Typ,'',nil));
         New(Symbol, Init(Sym.Name,Sym.Typ,'',nil));
         case Sym.Typ of
         case Sym.Typ of
           globalvarsym,
           globalvarsym,
@@ -1442,7 +1442,7 @@ end;
                    SetVType(Symbol,GetDefinitionStr(vardef));
                    SetVType(Symbol,GetDefinitionStr(vardef));
                ProcessDefIfStruct(vardef);
                ProcessDefIfStruct(vardef);
                if assigned(vardef) then
                if assigned(vardef) then
-                 if (vardef.deftype=pointerdef) and
+                 if (vardef.typ=pointerdef) and
                     assigned(tpointerdef(vardef).pointeddef) then
                     assigned(tpointerdef(vardef).pointeddef) then
                  begin
                  begin
                    Symbol^.Flags:=(Symbol^.Flags or sfPointer);
                    Symbol^.Flags:=(Symbol^.Flags or sfPointer);
@@ -1457,7 +1457,7 @@ end;
                    else
                    else
                      MemInfo.Addr:=0;
                      MemInfo.Addr:=0;
                  end;
                  end;
-               if assigned(vardef) and (vardef.deftype=arraydef) then
+               if assigned(vardef) and (vardef.typ=arraydef) then
                  begin
                  begin
                    if tarraydef(vardef).highrange<tarraydef(vardef).lowrange then
                    if tarraydef(vardef).highrange<tarraydef(vardef).lowrange then
                      MemInfo.Size:=-1
                      MemInfo.Size:=-1
@@ -1473,7 +1473,7 @@ end;
           fieldvarsym :
           fieldvarsym :
              with tfieldvarsym(sym) do
              with tfieldvarsym(sym) do
              begin
              begin
-               if assigned(vardef) and (vardef.deftype=arraydef) then
+               if assigned(vardef) and (vardef.typ=arraydef) then
                  begin
                  begin
                    if tarraydef(vardef).highrange<tarraydef(vardef).lowrange then
                    if tarraydef(vardef).highrange<tarraydef(vardef).lowrange then
                      MemInfo.Size:=-1
                      MemInfo.Size:=-1
@@ -1504,8 +1504,7 @@ end;
               with tprocsym(sym) do
               with tprocsym(sym) do
               if assigned(first_procdef) then
               if assigned(first_procdef) then
               begin
               begin
-                if cs_local_browser in current_settings.moduleswitches then
-                  ProcessSymTable(Symbol,Symbol^.Items,first_procdef.parast);
+                ProcessSymTable(Symbol,Symbol^.Items,first_procdef.parast);
                 if assigned(first_procdef.parast) then
                 if assigned(first_procdef.parast) then
                   begin
                   begin
                     Symbol^.Params:=TypeNames^.Add(GetAbsProcParmDefStr(first_procdef));
                     Symbol^.Params:=TypeNames^.Add(GetAbsProcParmDefStr(first_procdef));
@@ -1516,7 +1515,7 @@ end;
                   begin
                   begin
                     Symbol^.Params:=TypeNames^.Add('...');
                     Symbol^.Params:=TypeNames^.Add('...');
                   end;
                   end;
-                if cs_local_browser in current_settings.moduleswitches then
+//                if cs_local_browser in current_settings.moduleswitches then
                  begin
                  begin
                    if assigned(first_procdef.localst) and
                    if assigned(first_procdef.localst) and
                      (first_procdef.localst.symtabletype<>staticsymtable) then
                      (first_procdef.localst.symtabletype<>staticsymtable) then
@@ -1530,7 +1529,7 @@ end;
               if assigned(typedef) then
               if assigned(typedef) then
                begin
                begin
                 Symbol^.TypeID:=Ptrint(typedef);
                 Symbol^.TypeID:=Ptrint(typedef);
-                case typedef.deftype of
+                case typedef.typ of
                   arraydef :
                   arraydef :
                     SetDType(Symbol,GetArrayDefStr(tarraydef(typedef)));
                     SetDType(Symbol,GetArrayDefStr(tarraydef(typedef)));
                   enumdef :
                   enumdef :
@@ -1570,6 +1569,7 @@ end;
                end;
                end;
             end;
             end;
         end;
         end;
+{$ifdef use_refs}
         Ref:=tstoredsym(sym).defref;
         Ref:=tstoredsym(sym).defref;
         while Assigned(Symbol) and assigned(Ref) do
         while Assigned(Symbol) and assigned(Ref) do
           begin
           begin
@@ -1582,6 +1582,7 @@ end;
               end;
               end;
             Ref:=Ref.nextref;
             Ref:=Ref.nextref;
           end;
           end;
+{$endif use_refs}
         if Assigned(Symbol) then
         if Assigned(Symbol) then
           begin
           begin
             if not Owner^.Search(Symbol,J) then
             if not Owner^.Search(Symbol,J) then
@@ -1592,7 +1593,6 @@ end;
                 Symbol:=nil;
                 Symbol:=nil;
               end;
               end;
           end;
           end;
-        sym:=tsym(sym.indexnext);
       end;
       end;
   end;
   end;
 
 
@@ -1619,10 +1619,10 @@ var
   pif: tinputfile;
   pif: tinputfile;
 begin
 begin
   DisposeBrowserCol;
   DisposeBrowserCol;
-  if (cs_browser in current_settings.moduleswitches) then
+//  if (cs_browser in current_settings.moduleswitches) then
     NewBrowserCol;
     NewBrowserCol;
   hp:=tmodule(loaded_units.first);
   hp:=tmodule(loaded_units.first);
-  if (cs_browser in current_settings.moduleswitches) then
+//  if (cs_browser in current_settings.moduleswitches) then
    while assigned(hp) do
    while assigned(hp) do
     begin
     begin
        t:=tsymtable(hp.globalsymtable);
        t:=tsymtable(hp.globalsymtable);
@@ -1646,7 +1646,7 @@ begin
 
 
            Modules^.Insert(UnitS);
            Modules^.Insert(UnitS);
            ProcessSymTable(UnitS,UnitS^.Items,T);
            ProcessSymTable(UnitS,UnitS^.Items,T);
-           if cs_local_browser in current_settings.moduleswitches then
+//           if cs_local_browser in current_settings.moduleswitches then
              begin
              begin
                 t:=tsymtable(hp.localsymtable);
                 t:=tsymtable(hp.localsymtable);
                 if assigned(t) then
                 if assigned(t) then
@@ -1657,7 +1657,7 @@ begin
     end;
     end;
 
 
   hp:=tmodule(loaded_units.first);
   hp:=tmodule(loaded_units.first);
-  if (cs_browser in current_settings.moduleswitches) then
+//  if (cs_browser in current_settings.moduleswitches) then
    while assigned(hp) do
    while assigned(hp) do
     begin
     begin
        t:=tsymtable(hp.globalsymtable);
        t:=tsymtable(hp.globalsymtable);
@@ -1684,7 +1684,7 @@ begin
        hp:=tmodule(hp.next);
        hp:=tmodule(hp.next);
     end;
     end;
 
 
-  if (cs_browser in current_settings.moduleswitches) then
+  //if (cs_browser in current_settings.moduleswitches) then
     BuildObjectInfo;
     BuildObjectInfo;
   { can allways be done
   { can allways be done
     needed to know when recompilation of sources is necessary }
     needed to know when recompilation of sources is necessary }

+ 0 - 510
compiler/browlog.pas

@@ -1,510 +0,0 @@
-{
-    Copyright (c) 1998-2002 by Florian Klaempfl and Pierre Muller
-
-    Support routines for creating the browser log
-
-    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 browlog;
-
-{$i fpcdefs.inc}
-
-interface
-uses
-  cclasses,
-  globtype,
-  fmodule,finput,
-  symbase,symconst,symtype,symsym,symdef,symtable;
-
-const
-  logbufsize   = 16384;
-
-type
-  pbrowserlog=^tbrowserlog;
-  tbrowserlog=object
-    fname    : string;
-    logopen  : boolean;
-    stderrlog : boolean;
-    f        : file;
-    elements_to_list : tstringlist;
-    buf      : pchar;
-    bufidx   : longint;
-    identidx : longint;
-    constructor init;
-    destructor done;
-    procedure setfilename(const fn:string);
-    procedure createlog;
-    procedure flushlog;
-    procedure addlog(const s:string);
-    procedure addlogrefs(p:tref);
-    procedure closelog;
-    procedure ident;
-    procedure unident;
-    procedure browse_symbol(const sr : string);
-    procedure list_elements;
-    procedure list_debug_infos;
-  end;
-
-var
-  browserlog : tbrowserlog;
-
-  procedure WriteBrowserLog;
-
-  procedure InitBrowserLog;
-  procedure DoneBrowserLog;
-
-
-implementation
-
-  uses
-    cutils,cfileutils,comphook,
-    globals,systems,
-    ppu;
-
-    function get_file_line(ref:tref): string;
-      var
-         inputfile : tinputfile;
-      begin
-        get_file_line:='';
-        with ref do
-         begin
-           inputfile:=get_source_file(moduleindex,posinfo.fileindex);
-           if assigned(inputfile) then
-             if status.use_gccoutput then
-             { for use with rhide
-               add warning so that it does not interpret
-               this as an error !! }
-               get_file_line:=lower(inputfile.name^)
-                 +':'+tostr(posinfo.line)+': warning: '+tostr(posinfo.column)+':'
-             else
-               get_file_line:=inputfile.name^
-                 +'('+tostr(posinfo.line)+','+tostr(posinfo.column)+')'
-           else
-             if status.use_gccoutput then
-               get_file_line:='file_unknown:'
-                 +tostr(posinfo.line)+': warning: '+tostr(posinfo.column)+':'
-             else
-               get_file_line:='file_unknown('
-                 +tostr(posinfo.line)+','+tostr(posinfo.column)+')'
-         end;
-      end;
-
-{****************************************************************************
-                              TBrowser
-****************************************************************************}
-
-    constructor tbrowserlog.init;
-      begin
-        fname:=FixFileName('browser.log');
-        logopen:=false;
-        elements_to_list:=TStringList.Create;
-      end;
-
-
-    destructor tbrowserlog.done;
-      begin
-        if logopen then
-         closelog;
-        elements_to_list.free;
-      end;
-
-
-    procedure tbrowserlog.setfilename(const fn:string);
-      begin
-        fname:=FixFileName(fn);
-      end;
-
-
-    procedure tbrowserlog.createlog;
-      begin
-        if logopen then
-         closelog;
-        assign(f,fname);
-        {$I-}
-         rewrite(f,1);
-        {$I+}
-        if ioresult<>0 then
-         exit;
-        logopen:=true;
-        getmem(buf,logbufsize);
-        bufidx:=0;
-        identidx:=0;
-      end;
-
-
-    procedure tbrowserlog.flushlog;
-      begin
-        if logopen then
-         if not stderrlog then
-           blockwrite(f,buf^,bufidx)
-         else
-           begin
-             buf[bufidx]:=#0;
-             write(stderr,buf);
-           end;
-        bufidx:=0;
-      end;
-
-
-    procedure tbrowserlog.closelog;
-      begin
-        if logopen then
-         begin
-           flushlog;
-           close(f);
-           freemem(buf,logbufsize);
-           logopen:=false;
-         end;
-      end;
-
-    procedure tbrowserlog.list_elements;
-
-      begin
-
-         stderrlog:=true;
-         getmem(buf,logbufsize);
-         logopen:=true;
-         while not elements_to_list.empty do
-           browse_symbol(elements_to_list.getfirst);
-         flushlog;
-         logopen:=false;
-         freemem(buf,logbufsize);
-         stderrlog:=false;
-      end;
-
-    procedure tbrowserlog.list_debug_infos;
-{$ifndef debug}
-      begin
-      end;
-{$else debug}
-      var
-         hp : tmodule;
-         ff : tinputfile;
-      begin
-         hp:=tmodule(loaded_units.first);
-         while assigned(hp) do
-           begin
-              addlog('Unit '+hp.modulename^+' has index '+tostr(hp.unit_index));
-              ff:=hp.sourcefiles.files;
-              while assigned(ff) do
-                begin
-                   addlog('File '+ff.name^+' index '+tostr(ff.ref_index));
-                   ff:=ff.ref_next;
-                end;
-              hp:=tmodule(hp.next);
-           end;
-      end;
-{$endif debug}
-
-    procedure tbrowserlog.addlog(const s:string);
-      begin
-        if not logopen then
-         exit;
-      { add ident }
-        if (identidx>0) and not stderrlog then
-         begin
-           if bufidx+identidx>logbufsize then
-            flushlog;
-           fillchar(buf[bufidx],identidx,' ');
-           inc(bufidx,identidx);
-         end;
-      { add text }
-        if bufidx+length(s)>logbufsize-2 then
-         flushlog;
-        move(s[1],buf[bufidx],length(s));
-        inc(bufidx,length(s));
-      { add crlf }
-        buf[bufidx]:=target_info.newline[1];
-        inc(bufidx);
-        if length(target_info.newline)=2 then
-         begin
-           buf[bufidx]:=target_info.newline[2];
-           inc(bufidx);
-         end;
-      end;
-
-
-    procedure tbrowserlog.addlogrefs(p:tref);
-      var
-        ref : tref;
-      begin
-        ref:=p;
-        Ident;
-        while assigned(ref) do
-         begin
-           Browserlog.AddLog(get_file_line(ref));
-           ref:=ref.nextref;
-         end;
-        Unident;
-      end;
-
-
-    procedure tbrowserlog.browse_symbol(const sr : string);
-      var
-         sym  : tsym;
-         symb : tstoredsym;
-         symt : tsymtable;
-         hp : tmodule;
-         s,ss : string;
-         p : byte;
-
-         procedure next_substring;
-           begin
-              p:=pos('.',s);
-              if p>0 then
-                begin
-                   ss:=copy(s,1,p-1);
-                   s:=copy(s,p+1,255);
-                end
-              else
-                begin
-                  ss:=s;
-                  s:='';
-                end;
-              addlog('substring : '+ss);
-          end;
-      begin
-         { don't create a new reference when
-          looking for the symbol !! }
-         make_ref:=false;
-         s:=sr;
-         symt:=symtablestack.top;
-         next_substring;
-         if assigned(symt) then
-           begin
-              sym:=tstoredsym(symt.search(ss));
-              if sym=nil then
-                sym:=tstoredsym(symt.search(upper(ss)));
-           end
-         else
-           sym:=nil;
-         if assigned(sym) and (sym.typ=unitsym) and (s<>'') then
-           begin
-              addlog('Unitsym found !');
-              symt:=tmodule(tunitsym(sym).module).globalsymtable;
-              if assigned(symt) then
-                begin
-                   next_substring;
-                   sym:=tstoredsym(symt.search(ss));
-                end
-              else
-                sym:=nil;
-           end;
-         if not assigned(sym) then
-           begin
-              symt:=nil;
-              { try all loaded_units }
-              hp:=tmodule(loaded_units.first);
-              while assigned(hp) do
-                begin
-                   if hp.modulename^=upper(ss) then
-                     begin
-                        symt:=hp.globalsymtable;
-                        break;
-                     end;
-                   hp:=tmodule(hp.next);
-                end;
-              if not assigned(symt) then
-                begin
-                   addlog('!!!Symbol '+ss+' not found !!!');
-                   make_ref:=true;
-                   exit;
-                end
-              else
-                begin
-                   next_substring;
-                   sym:=tstoredsym(symt.search(ss));
-                   if sym=nil then
-                     sym:=tstoredsym(symt.search(upper(ss)));
-                end;
-           end;
-
-         while assigned(sym) and (s<>'') do
-           begin
-              next_substring;
-              case sym.typ of
-                typesym :
-                  begin
-                     if ttypesym(sym).typedef.deftype in [recorddef,objectdef] then
-                       begin
-                          if ttypesym(sym).typedef.deftype=recorddef then
-                            symt:=trecorddef(ttypesym(sym).typedef).symtable
-                          else
-                            symt:=tobjectdef(ttypesym(sym).typedef).symtable;
-                          sym:=tstoredsym(symt.search(ss));
-                          if sym=nil then
-                            sym:=tstoredsym(symt.search(upper(ss)));
-                       end;
-                  end;
-                globalvarsym,
-                localvarsym,
-                paravarsym,
-                fieldvarsym :
-                  begin
-                     if tabstractvarsym(sym).vardef.deftype in [recorddef,objectdef] then
-                       begin
-                          symt:=tabstractvarsym(sym).vardef.getsymtable(gs_record);
-                          sym:=tstoredsym(symt.search(ss));
-                          if sym=nil then
-                            sym:=tstoredsym(symt.search(upper(ss)));
-                       end;
-                  end;
-                procsym :
-                  begin
-                     symt:=tprocsym(sym).first_procdef.parast;
-                     symb:=tstoredsym(symt.search(ss));
-                     if symb=nil then
-                       symb:=tstoredsym(symt.search(upper(ss)));
-                     if not assigned(symb) then
-                       begin
-                          symt:=tprocsym(sym).first_procdef.localst;
-                          sym:=tstoredsym(symt.search(ss));
-                          if symb=nil then
-                            symb:=tstoredsym(symt.search(upper(ss)));
-                       end
-                     else
-                       sym:=symb;
-                  end;
-                end;
-           end;
-           if assigned(sym) then
-            begin
-              if assigned(sym.defref) then
-               begin
-                 browserlog.AddLog('***'+sym.name+'***');
-                 browserlog.AddLogRefs(sym.defref);
-               end;
-            end
-           else
-             addlog('!!!Symbol '+ss+' not found !!!');
-           make_ref:=true;
-      end;
-
-    procedure tbrowserlog.ident;
-      begin
-        inc(identidx,2);
-      end;
-
-
-    procedure tbrowserlog.unident;
-      begin
-        dec(identidx,2);
-      end;
-
-    procedure writesymtable(p:Tsymtable);forward;
-
-    procedure writelocalsymtables(p:Tprocdef;arg:pointer);
-
-    begin
-        if assigned(p.defref) then
-            begin
-                browserlog.AddLog('***'+p.mangledname);
-                browserlog.AddLogRefs(p.defref);
-                if (current_module.flags and uf_local_browser)<>0 then
-                    begin
-                        if assigned(p.parast) then
-                            writesymtable(p.parast);
-                        if assigned(p.localst) then
-                            writesymtable(p.localst);
-                    end;
-             end;
-    end;
-
-
-    procedure writesymtable(p:tsymtable);
-      var
-        hp : tsym;
-      begin
-        if cs_browser in current_settings.moduleswitches then
-         begin
-           if assigned(p.name) then
-             Browserlog.AddLog('---Symtable '+p.name^)
-           else
-             begin
-                if (p.symtabletype=recordsymtable) and
-                   assigned(tdef(p.defowner).typesym) then
-                  Browserlog.AddLog('---Symtable '+tdef(p.defowner).typesym.name)
-                else
-                  Browserlog.AddLog('---Symtable with no name');
-             end;
-           Browserlog.Ident;
-           hp:=tstoredsym(p.symindex.first);
-           while assigned(hp) do
-            begin
-              if assigned(hp.defref) then
-               begin
-                 browserlog.AddLog('***'+hp.name+'***');
-                 browserlog.AddLogRefs(hp.defref);
-               end;
-              case hp.typ of
-                typesym :
-                  begin
-                    if (ttypesym(hp).typedef.deftype=recorddef) then
-                      writesymtable(trecorddef(ttypesym(hp).typedef).symtable);
-                    if (ttypesym(hp).typedef.deftype=objectdef) then
-                      writesymtable(tobjectdef(ttypesym(hp).typedef).symtable);
-                  end;
-                procsym :
-                    Tprocsym(hp).foreach_procdef_static(@writelocalsymtables,nil);
-              end;
-              hp:=tstoredsym(hp.indexnext);
-            end;
-           browserlog.Unident;
-         end;
-      end;
-
-
-{****************************************************************************
-                             Helpers
-****************************************************************************}
-
-   procedure WriteBrowserLog;
-     var
-       p : tstoredsymtable;
-       hp : tmodule;
-     begin
-       browserlog.CreateLog;
-       browserlog.list_debug_infos;
-       hp:=tmodule(loaded_units.first);
-       while assigned(hp) do
-         begin
-            p:=tstoredsymtable(hp.globalsymtable);
-            if assigned(p) then
-              writesymtable(p);
-            if cs_local_browser in current_settings.moduleswitches then
-              begin
-                 p:=tstoredsymtable(hp.localsymtable);
-                 if assigned(p) then
-                   writesymtable(p);
-              end;
-            hp:=tmodule(hp.next);
-         end;
-       browserlog.CloseLog;
-     end;
-
-
-  procedure InitBrowserLog;
-    begin
-       browserlog.init;
-    end;
-
-  procedure DoneBrowserLog;
-    begin
-       browserlog.done;
-    end;
-
-end.

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 179 - 969
compiler/cclasses.pas


+ 25 - 7
compiler/cfileutils.pas

@@ -88,6 +88,7 @@ interface
         function  FindFile(const f : string;allowcache:boolean;var foundfile:string):boolean;
         function  FindFile(const f : string;allowcache:boolean;var foundfile:string):boolean;
       end;
       end;
 
 
+    function  bstoslash(const s : string) : string;
     {Gives the absolute path to the current directory}
     {Gives the absolute path to the current directory}
     function  GetCurrentDir:string;
     function  GetCurrentDir:string;
     {Gives the relative path to the current directory,
     {Gives the relative path to the current directory,
@@ -288,10 +289,19 @@ implementation
                                    Utils
                                    Utils
 ****************************************************************************}
 ****************************************************************************}
 
 
-    procedure WarnNonExistingPath(const path : string);
+    function bstoslash(const s : string) : string;
+    {
+      return string s with all \ changed into /
+    }
+      var
+         i : longint;
       begin
       begin
-        if assigned(do_comment) then
-          do_comment(V_Tried,'Path "'+path+'" not found');
+        for i:=1to length(s) do
+         if s[i]='\' then
+          bstoslash[i]:='/'
+         else
+          bstoslash[i]:=s[i];
+         bstoslash[0]:=s[0];
       end;
       end;
 
 
 
 
@@ -731,10 +741,12 @@ implementation
         end;
         end;
      end;
      end;
 
 
-  procedure TSearchPathList.AddPath(s:string;addfirst:boolean);
-    begin
-      AddPath('',s,AddFirst);
-    end;
+
+    procedure TSearchPathList.AddPath(s:string;addfirst:boolean);
+      begin
+        AddPath('',s,AddFirst);
+      end;
+
 
 
    procedure TSearchPathList.AddPath(SrcPath,s:string;addfirst:boolean);
    procedure TSearchPathList.AddPath(SrcPath,s:string;addfirst:boolean);
      var
      var
@@ -752,6 +764,12 @@ implementation
 {$endif usedircache}
 {$endif usedircache}
        hp       : TStringListItem;
        hp       : TStringListItem;
 
 
+       procedure WarnNonExistingPath(const path : string);
+       begin
+         if assigned(do_comment) then
+           do_comment(V_Tried,'Path "'+path+'" not found');
+       end;
+
        procedure AddCurrPath;
        procedure AddCurrPath;
        begin
        begin
          if addfirst then
          if addfirst then

+ 1 - 1
compiler/cg64f32.pas

@@ -801,7 +801,7 @@ unit cg64f32;
               { also not if the fromdef is unsigned and < 64bit, since that will }
               { also not if the fromdef is unsigned and < 64bit, since that will }
               { always fit in a 64bit int (todef is 64bit)                       }
               { always fit in a 64bit int (todef is 64bit)                       }
               (from_signed or
               (from_signed or
-               (torddef(fromdef).typ = u64bit)) then
+               (torddef(fromdef).ordtype = u64bit)) then
              begin
              begin
                { in all cases, there is only a problem if the higest bit is set }
                { in all cases, there is only a problem if the higest bit is set }
                if l.loc in [LOC_REGISTER,LOC_CREGISTER] then
                if l.loc in [LOC_REGISTER,LOC_CREGISTER] then

+ 10 - 10
compiler/cgobj.pas

@@ -2626,7 +2626,7 @@ implementation
       begin
       begin
         { range checking on and range checkable value? }
         { range checking on and range checkable value? }
         if not(cs_check_range in current_settings.localswitches) or
         if not(cs_check_range in current_settings.localswitches) or
-           not(fromdef.deftype in [orddef,enumdef]) then
+           not(fromdef.typ in [orddef,enumdef]) then
           exit;
           exit;
 {$ifndef cpu64bit}
 {$ifndef cpu64bit}
         { handle 64bit rangechecks separate for 32bit processors }
         { handle 64bit rangechecks separate for 32bit processors }
@@ -2644,7 +2644,7 @@ implementation
         to_signed := is_signed(todef);
         to_signed := is_signed(todef);
         { check the rangedef of the array, not the array itself }
         { check the rangedef of the array, not the array itself }
         { (only change now, since getrange needs the arraydef)   }
         { (only change now, since getrange needs the arraydef)   }
-        if (todef.deftype = arraydef) then
+        if (todef.typ = arraydef) then
           todef := tarraydef(todef).rangedef;
           todef := tarraydef(todef).rangedef;
         { no range check if from and to are equal and are both longint/dword }
         { no range check if from and to are equal and are both longint/dword }
         { no range check if from and to are equal and are both longint/dword }
         { no range check if from and to are equal and are both longint/dword }
@@ -2654,24 +2654,24 @@ implementation
         { have to be changed once we introduce 64bit subrange types          }
         { have to be changed once we introduce 64bit subrange types          }
 {$ifdef cpu64bit}
 {$ifdef cpu64bit}
         if (fromdef = todef) and
         if (fromdef = todef) and
-           (fromdef.deftype=orddef) and
-           (((((torddef(fromdef).typ = s64bit) and
+           (fromdef.typ=orddef) and
+           (((((torddef(fromdef).ordtype = s64bit) and
                (lfrom = low(int64)) and
                (lfrom = low(int64)) and
                (hfrom = high(int64))) or
                (hfrom = high(int64))) or
-              ((torddef(fromdef).typ = u64bit) and
+              ((torddef(fromdef).ordtype = u64bit) and
                (lfrom = low(qword)) and
                (lfrom = low(qword)) and
                (hfrom = high(qword))) or
                (hfrom = high(qword))) or
-              ((torddef(fromdef).typ = scurrency) and
+              ((torddef(fromdef).ordtype = scurrency) and
                (lfrom = low(int64)) and
                (lfrom = low(int64)) and
                (hfrom = high(int64)))))) then
                (hfrom = high(int64)))))) then
           exit;
           exit;
 {$else cpu64bit}
 {$else cpu64bit}
         if (fromdef = todef) and
         if (fromdef = todef) and
-           (fromdef.deftype=orddef) and
-           (((((torddef(fromdef).typ = s32bit) and
+           (fromdef.typ=orddef) and
+           (((((torddef(fromdef).ordtype = s32bit) and
                (lfrom = low(longint)) and
                (lfrom = low(longint)) and
                (hfrom = high(longint))) or
                (hfrom = high(longint))) or
-              ((torddef(fromdef).typ = u32bit) and
+              ((torddef(fromdef).ordtype = u32bit) and
                (lfrom = low(cardinal)) and
                (lfrom = low(cardinal)) and
                (hfrom = high(cardinal)))))) then
                (hfrom = high(cardinal)))))) then
           exit;
           exit;
@@ -3041,7 +3041,7 @@ implementation
             procdef.requiredargarea:=paramanager.create_paraloc_info(procdef,callerside);
             procdef.requiredargarea:=paramanager.create_paraloc_info(procdef,callerside);
             procdef.has_paraloc_info:=true;
             procdef.has_paraloc_info:=true;
           end;
           end;
-        hsym:=tsym(procdef.parast.search('self'));
+        hsym:=tsym(procdef.parast.Find('self'));
         if not(assigned(hsym) and
         if not(assigned(hsym) and
                (hsym.typ=paravarsym)) then
                (hsym.typ=paravarsym)) then
           internalerror(200305251);
           internalerror(200305251);

+ 1 - 16
compiler/compiler.pas

@@ -33,9 +33,6 @@ uses
 {$ifdef WATCOM}
 {$ifdef WATCOM}
     emu387,
     emu387,
 {$endif WATCOM}
 {$endif WATCOM}
-{$ifdef BrowserLog}
-  browlog,
-{$endif BrowserLog}
 {$IFNDEF USE_FAKE_SYSUTILS}
 {$IFNDEF USE_FAKE_SYSUTILS}
   sysutils,
   sysutils,
 {$ELSE}
 {$ELSE}
@@ -138,12 +135,6 @@ begin
   if not CompilerInited then
   if not CompilerInited then
    exit;
    exit;
 { Free compiler if args are read }
 { Free compiler if args are read }
-{$ifdef BrowserLog}
-  DoneBrowserLog;
-{$endif BrowserLog}
-{$ifdef BrowserCol}
-  do_doneSymbolInfo;
-{$endif BrowserCol}
   if CompilerInitedAfterArgs then
   if CompilerInitedAfterArgs then
    begin
    begin
      CompilerInitedAfterArgs:=false;
      CompilerInitedAfterArgs:=false;
@@ -176,14 +167,8 @@ begin
   InitGlobals;
   InitGlobals;
   { verbose depends on exe_path and must be after globals }
   { verbose depends on exe_path and must be after globals }
   InitVerbose;
   InitVerbose;
-{$ifdef BrowserLog}
-  InitBrowserLog;
-{$endif BrowserLog}
-{$ifdef BrowserCol}
-  do_initSymbolInfo;
-{$endif BrowserCol}
   inittokens;
   inittokens;
-  InitSymtable; {Must come before read_arguments, to enable macrosymstack}
+  IniTSymtable; {Must come before read_arguments, to enable macrosymstack}
   CompilerInited:=true;
   CompilerInited:=true;
 { this is needed here for the IDE
 { this is needed here for the IDE
   in case of compilation failure
   in case of compilation failure

+ 4 - 4
compiler/cresstr.pas

@@ -55,7 +55,7 @@ uses
       Tresourcestrings=class
       Tresourcestrings=class
       private
       private
         List : TLinkedList;
         List : TLinkedList;
-        procedure ConstSym_Register(p:tnamedindexitem;arg:pointer);
+        procedure ConstSym_Register(p:TObject;arg:pointer);
       public
       public
         constructor Create;
         constructor Create;
         destructor  Destroy;override;
         destructor  Destroy;override;
@@ -295,7 +295,7 @@ uses
       end;
       end;
 
 
 
 
-    procedure Tresourcestrings.ConstSym_Register(p:tnamedindexitem;arg:pointer);
+    procedure Tresourcestrings.ConstSym_Register(p:TObject;arg:pointer);
       begin
       begin
         if (tsym(p).typ=constsym) and
         if (tsym(p).typ=constsym) and
            (tconstsym(p).consttyp=constresourcestring) then
            (tconstsym(p).consttyp=constresourcestring) then
@@ -306,8 +306,8 @@ uses
     procedure Tresourcestrings.RegisterResourceStrings;
     procedure Tresourcestrings.RegisterResourceStrings;
       begin
       begin
         if assigned(current_module.globalsymtable) then
         if assigned(current_module.globalsymtable) then
-          current_module.globalsymtable.foreach(@ConstSym_Register,nil);
-        current_module.localsymtable.foreach(@ConstSym_Register,nil);
+          current_module.globalsymtable.SymList.ForEachCall(@ConstSym_Register,nil);
+        current_module.localsymtable.SymList.ForEachCall(@ConstSym_Register,nil);
       end;
       end;
 
 
 
 

+ 0 - 41
compiler/cutils.pas

@@ -124,9 +124,6 @@ interface
     { ambivalent to pchar2pshortstring }
     { ambivalent to pchar2pshortstring }
     function pshortstring2pchar(p : pshortstring) : pchar;
     function pshortstring2pchar(p : pshortstring) : pchar;
 
 
-    { Speed/Hash value }
-    Function GetSpeedValue(Const s:String):cardinal;
-
     { Ansistring (pchar+length) support }
     { Ansistring (pchar+length) support }
     procedure ansistringdispose(var p : pchar;length : longint);
     procedure ansistringdispose(var p : pchar;length : longint);
     function compareansistrings(p1,p2 : pchar;length1,length2 : longint) : longint;
     function compareansistrings(p1,p2 : pchar;length1,length2 : longint) : longint;
@@ -959,43 +956,6 @@ implementation
       end;
       end;
 
 
 
 
-{*****************************************************************************
-                               GetSpeedValue
-*****************************************************************************}
-
-    var
-      Crc32Tbl : array[0..255] of cardinal;
-
-    procedure MakeCRC32Tbl;
-      var
-        crc : cardinal;
-        i,n : integer;
-      begin
-        for i:=0 to 255 do
-         begin
-           crc:=i;
-           for n:=1 to 8 do
-            if odd(longint(crc)) then
-             crc:=cardinal(crc shr 1) xor cardinal($edb88320)
-            else
-             crc:=cardinal(crc shr 1);
-           Crc32Tbl[i]:=crc;
-         end;
-      end;
-
-
-    Function GetSpeedValue(Const s:String):cardinal;
-      var
-        i : integer;
-        InitCrc : cardinal;
-      begin
-        InitCrc:=cardinal($ffffffff);
-        for i:=1 to Length(s) do
-         InitCrc:=Crc32Tbl[byte(InitCrc) xor ord(s[i])] xor (InitCrc shr 8);
-        GetSpeedValue:=InitCrc;
-      end;
-
-
 {*****************************************************************************
 {*****************************************************************************
                                Ansistring (PChar+Length)
                                Ansistring (PChar+Length)
 *****************************************************************************}
 *****************************************************************************}
@@ -1193,6 +1153,5 @@ implementation
 
 
 initialization
 initialization
   internalerrorproc:=@defaulterror;
   internalerrorproc:=@defaulterror;
-  makecrc32tbl;
   initupperlower;
   initupperlower;
 end.
 end.

+ 5 - 5
compiler/dbgbase.pas

@@ -43,11 +43,11 @@ interface
         procedure insertlineinfo(list:TAsmList);virtual;
         procedure insertlineinfo(list:TAsmList);virtual;
         procedure referencesections(list:TAsmList);virtual;
         procedure referencesections(list:TAsmList);virtual;
         procedure insertdef(list:TAsmList;def:tdef);virtual;abstract;
         procedure insertdef(list:TAsmList;def:tdef);virtual;abstract;
-        procedure write_symtable_defs(list:TAsmList;st:tsymtable);virtual;abstract;
+        procedure write_symtable_defs(list:TAsmList;st:TSymtable);virtual;abstract;
 
 
         procedure write_used_unit_type_info(list:TAsmList;hp:tmodule);
         procedure write_used_unit_type_info(list:TAsmList;hp:tmodule);
-        procedure field_write_defs(p:Tnamedindexitem;arg:pointer);
-        procedure method_write_defs(p :tnamedindexitem;arg:pointer);
+        procedure field_write_defs(p:TObject;arg:pointer);
+        procedure method_write_defs(p:TObject;arg:pointer);
       end;
       end;
       TDebugInfoClass=class of TDebugInfo;
       TDebugInfoClass=class of TDebugInfo;
 
 
@@ -104,7 +104,7 @@ implementation
       end;
       end;
 
 
 
 
-    procedure TDebugInfo.field_write_defs(p:Tnamedindexitem;arg:pointer);
+    procedure TDebugInfo.field_write_defs(p:TObject;arg:pointer);
       begin
       begin
         if (Tsym(p).typ=fieldvarsym) and
         if (Tsym(p).typ=fieldvarsym) and
            not(sp_static in Tsym(p).symoptions) then
            not(sp_static in Tsym(p).symoptions) then
@@ -112,7 +112,7 @@ implementation
       end;
       end;
 
 
 
 
-    procedure TDebugInfo.method_write_defs(p :tnamedindexitem;arg:pointer);
+    procedure TDebugInfo.method_write_defs(p:TObject;arg:pointer);
       var
       var
         pd : tprocdef;
         pd : tprocdef;
       begin
       begin

+ 35 - 40
compiler/dbgdwarf.pas

@@ -51,7 +51,7 @@ interface
         DW_TAG_imported_declaration := $08,DW_TAG_label := $0a,
         DW_TAG_imported_declaration := $08,DW_TAG_label := $0a,
         DW_TAG_lexical_block := $0b,DW_TAG_member := $0d,
         DW_TAG_lexical_block := $0b,DW_TAG_member := $0d,
         DW_TAG_pointer_type := $0f,DW_TAG_reference_type := $10,
         DW_TAG_pointer_type := $0f,DW_TAG_reference_type := $10,
-        DW_TAG_compile_unit := $11,DW_TAG_string_type := $12,
+        DW_TAG_compile_unit := $11,DW_TAG_stringtypee := $12,
         DW_TAG_structure_type := $13,DW_TAG_subroutine_type := $15,
         DW_TAG_structure_type := $13,DW_TAG_subroutine_type := $15,
         DW_TAG_typedef := $16,DW_TAG_union_type := $17,
         DW_TAG_typedef := $16,DW_TAG_union_type := $17,
         DW_TAG_unspecified_parameters := $18,
         DW_TAG_unspecified_parameters := $18,
@@ -200,9 +200,6 @@ interface
         currabbrevnumber : longint;
         currabbrevnumber : longint;
 
 
         { collect all defs in one list so we can reset them easily }
         { collect all defs in one list so we can reset them easily }
-        { not used (MWE)
-        nextdefnumber    : longint;
-        }
         defnumberlist,
         defnumberlist,
         deftowritelist   : TFPObjectList;
         deftowritelist   : TFPObjectList;
 
 
@@ -221,7 +218,7 @@ interface
 
 
         function def_dwarf_lab(def:tdef) : tasmsymbol;
         function def_dwarf_lab(def:tdef) : tasmsymbol;
         function get_file_index(afile: tinputfile): Integer;
         function get_file_index(afile: tinputfile): Integer;
-        procedure write_symtable_syms(st:tsymtable);
+        procedure write_symtable_syms(st:TSymtable);
       protected
       protected
         isdwarf64: Boolean;
         isdwarf64: Boolean;
         vardatadef: trecorddef;
         vardatadef: trecorddef;
@@ -262,7 +259,7 @@ interface
 
 
         function symname(sym:tsym): String; virtual;
         function symname(sym:tsym): String; virtual;
 
 
-        procedure enum_membersyms_callback(p:Tnamedindexitem;arg:pointer);
+        procedure enum_membersyms_callback(p:TObject;arg:pointer);
 
 
         procedure finish_children;
         procedure finish_children;
         procedure finish_entry;
         procedure finish_entry;
@@ -277,7 +274,7 @@ interface
         procedure referencesections(list:TAsmList);override;
         procedure referencesections(list:TAsmList);override;
         procedure insertlineinfo(list:TAsmList);override;
         procedure insertlineinfo(list:TAsmList);override;
         function  dwarf_version: Word; virtual; abstract;
         function  dwarf_version: Word; virtual; abstract;
-        procedure write_symtable_defs(unused:TAsmList;st:tsymtable);override;
+        procedure write_symtable_defs(unused:TAsmList;st:TSymtable);override;
       end;
       end;
 
 
       { TDebugInfoDwarf2 }
       { TDebugInfoDwarf2 }
@@ -666,7 +663,7 @@ implementation
         inherited Destroy;
         inherited Destroy;
       end;
       end;
 
 
-    procedure TDebugInfoDwarf.enum_membersyms_callback(p: Tnamedindexitem; arg: pointer);
+    procedure TDebugInfoDwarf.enum_membersyms_callback(p:TObject; arg: pointer);
       begin
       begin
         case tsym(p).typ of
         case tsym(p).typ of
           fieldvarsym:
           fieldvarsym:
@@ -896,7 +893,7 @@ implementation
 
 
     procedure TDebugInfoDwarf.appenddef_ord(def:torddef);
     procedure TDebugInfoDwarf.appenddef_ord(def:torddef);
       begin
       begin
-        case def.typ of
+        case def.ordtype of
           s8bit,
           s8bit,
           s16bit,
           s16bit,
           s32bit :
           s32bit :
@@ -1034,7 +1031,7 @@ implementation
 
 
     procedure TDebugInfoDwarf.appenddef_float(def:tfloatdef);
     procedure TDebugInfoDwarf.appenddef_float(def:tfloatdef);
       begin
       begin
-        case def.typ of
+        case def.floattype of
           s32real,
           s32real,
           s64real,
           s64real,
           s80real:
           s80real:
@@ -1199,7 +1196,7 @@ implementation
             DW_AT_byte_size,DW_FORM_udata,def.size
             DW_AT_byte_size,DW_FORM_udata,def.size
             ]);
             ]);
         finish_entry;
         finish_entry;
-        def.symtable.foreach(@enum_membersyms_callback,nil);
+        def.symtable.symList.ForEachCall(@enum_membersyms_callback,nil);
         finish_children;
         finish_children;
       end;
       end;
 
 
@@ -1218,7 +1215,7 @@ implementation
         slen : aint;
         slen : aint;
         arr : tasmlabel;
         arr : tasmlabel;
       begin
       begin
-        case def.string_typ of
+        case def.stringtype of
           st_shortstring:
           st_shortstring:
             begin
             begin
               { fix length of openshortstring }
               { fix length of openshortstring }
@@ -1397,7 +1394,7 @@ implementation
         else
         else
           current_asmdata.asmlists[al_dwarf_info].concat(tai_symbol.create(labsym,0));
           current_asmdata.asmlists[al_dwarf_info].concat(tai_symbol.create(labsym,0));
 
 
-        case def.deftype of
+        case def.typ of
           stringdef :
           stringdef :
             appenddef_string(tstringdef(def));
             appenddef_string(tstringdef(def));
           enumdef :
           enumdef :
@@ -1441,19 +1438,19 @@ implementation
         appenddef(def);
         appenddef(def);
       end;
       end;
 
 
-    procedure TDebugInfoDwarf.write_symtable_defs(unused:TAsmList;st:tsymtable);
+    procedure TDebugInfoDwarf.write_symtable_defs(unused:TAsmList;st:TSymtable);
 
 
-       procedure dowritedwarf(st:tsymtable);
+       procedure dowritedwarf(st:TSymtable);
          var
          var
-           p : tdef;
+           def : tdef;
+           i   : longint;
          begin
          begin
-           p:=tdef(st.defindex.first);
-           while assigned(p) do
+           for i:=0 to st.DefList.Count-1 do
              begin
              begin
-               if (p.dbg_state=dbg_state_used) then
-                 appenddef(p);
-
-               p:=tdef(p.indexnext);
+               def:=tdef(st.DefList[i]);
+               if not(df_deleted in def.defoptions) and
+                  (def.dbg_state=dbg_state_used) then
+                 appenddef(def);
              end;
              end;
          end;
          end;
 
 
@@ -1722,7 +1719,7 @@ implementation
             constreal:
             constreal:
               begin
               begin
                 current_asmdata.asmlists[al_dwarf_abbrev].concat(tai_const.create_uleb128bit(ord(DW_FORM_block1)));
                 current_asmdata.asmlists[al_dwarf_abbrev].concat(tai_const.create_uleb128bit(ord(DW_FORM_block1)));
-                case tfloatdef(sym.constdef).typ of
+                case tfloatdef(sym.constdef).floattype of
                   s32real:
                   s32real:
                     begin
                     begin
                       current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(4));
                       current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(4));
@@ -1800,7 +1797,7 @@ implementation
 
 
           { Moved fom append sym, do we need this (MWE)
           { Moved fom append sym, do we need this (MWE)
           { For object types write also the symtable entries }
           { For object types write also the symtable entries }
-          if (sym.typ=typesym) and (ttypesym(sym).typedef.deftype=objectdef) then
+          if (sym.typ=typesym) and (ttypesym(sym).typedef.typ=objectdef) then
             write_symtable_syms(list,tobjectdef(ttypesym(sym).typedef).symtable);
             write_symtable_syms(list,tobjectdef(ttypesym(sym).typedef).symtable);
           }
           }
         end;
         end;
@@ -1918,19 +1915,20 @@ implementation
       end;
       end;
 
 
 
 
-    procedure TDebugInfoDwarf.write_symtable_syms(st:tsymtable);
+    procedure TDebugInfoDwarf.write_symtable_syms(st:TSymtable);
       var
       var
-        p : tsym;
+        i   : longint;
+        sym : tsym;
         old_writing_def_dwarf : boolean;
         old_writing_def_dwarf : boolean;
       begin
       begin
         old_writing_def_dwarf:=writing_def_dwarf;
         old_writing_def_dwarf:=writing_def_dwarf;
         writing_def_dwarf:=false;
         writing_def_dwarf:=false;
-        p:=tsym(st.symindex.first);
-        while assigned(p) do
+        for i:=0 to st.SymList.Count-1 do
           begin
           begin
-            if (not p.isdbgwritten) then
-              appendsym(p);
-            p:=tsym(p.indexnext);
+            sym:=tsym(st.SymList[i]);
+            if not(sp_hidden in sym.symoptions) and
+               (not sym.isdbgwritten) then
+              appendsym(sym);
           end;
           end;
         writing_def_dwarf:=old_writing_def_dwarf;
         writing_def_dwarf:=old_writing_def_dwarf;
       end;
       end;
@@ -2140,15 +2138,12 @@ implementation
         currabbrevnumber:=0;
         currabbrevnumber:=0;
         writing_def_dwarf:=false;
         writing_def_dwarf:=false;
 
 
-        { not used (MWE)
-        nextdefnumber:=0;
-        }
         defnumberlist:=TFPObjectList.create(false);
         defnumberlist:=TFPObjectList.create(false);
         deftowritelist:=TFPObjectList.create(false);
         deftowritelist:=TFPObjectList.create(false);
 
 
         { not exported (FK)
         { not exported (FK)
-        filerecdef:=getderefdef('FILEREC');
-        textrecdef:=getderefdef('TEXTREC');
+            FILEREC
+            TEXTREC
         }
         }
         vardatadef:=trecorddef(search_system_type('TVARDATA').typedef);
         vardatadef:=trecorddef(search_system_type('TVARDATA').typedef);
 
 
@@ -2464,7 +2459,7 @@ implementation
               finish_entry;
               finish_entry;
             end;
             end;
 
 
-          def.symtable.foreach(@enum_membersyms_callback,nil);
+          def.symtable.symList.ForEachCall(@enum_membersyms_callback,nil);
           finish_children;
           finish_children;
         end;
         end;
 
 
@@ -2658,7 +2653,7 @@ implementation
             end;
             end;
 
 
         { add members }
         { add members }
-        def.symtable.foreach(@enum_membersyms_callback,nil);
+        def.symtable.symList.ForEachCall(@enum_membersyms_callback,nil);
         finish_children;
         finish_children;
       end;
       end;
 
 
@@ -2744,7 +2739,7 @@ implementation
         finish_entry;
         finish_entry;
 
 
         { discriminant }
         { discriminant }
-        fs := tfieldvarsym(vardatadef.symtable.search('VTYPE'));
+        fs := tfieldvarsym(vardatadef.symtable.Find('VTYPE'));
         if (fs = nil) or (fs.typ <> fieldvarsym) then
         if (fs = nil) or (fs.typ <> fieldvarsym) then
           internalerror(200609271);
           internalerror(200609271);
         current_asmdata.asmlists[al_dwarf_info].concat(tai_symbol.create(lbl,0));
         current_asmdata.asmlists[al_dwarf_info].concat(tai_symbol.create(lbl,0));
@@ -2760,7 +2755,7 @@ implementation
 
 
             if VARIANTS[idx].name <> '' then
             if VARIANTS[idx].name <> '' then
               begin
               begin
-                fs := tfieldvarsym(vardatadef.symtable.search(VARIANTS[idx].name));
+                fs := tfieldvarsym(vardatadef.symtable.Find(VARIANTS[idx].name));
                 if (fs = nil) or (fs.typ <> fieldvarsym) then
                 if (fs = nil) or (fs.typ <> fieldvarsym) then
                   internalerror(20060927200+idx);
                   internalerror(20060927200+idx);
                 appendsym_fieldvar(fs);
                 appendsym_fieldvar(fs);

+ 49 - 47
compiler/dbgstabs.pas

@@ -40,14 +40,14 @@ interface
         { tsym writing }
         { tsym writing }
         function  sym_var_value(const s:string;arg:pointer):string;
         function  sym_var_value(const s:string;arg:pointer):string;
         function  sym_stabstr_evaluate(sym:tsym;const s:string;const vars:array of string):Pchar;
         function  sym_stabstr_evaluate(sym:tsym;const s:string;const vars:array of string):Pchar;
-        procedure write_symtable_syms(list:TAsmList;st:tsymtable);
+        procedure write_symtable_syms(list:TAsmList;st:TSymtable);
         { tdef writing }
         { tdef writing }
         function  def_stab_number(def:tdef):string;
         function  def_stab_number(def:tdef):string;
         function  def_stab_classnumber(def:tobjectdef):string;
         function  def_stab_classnumber(def:tobjectdef):string;
         function  def_var_value(const s:string;arg:pointer):string;
         function  def_var_value(const s:string;arg:pointer):string;
         function  def_stabstr_evaluate(def:tdef;const s:string;const vars:array of string):Pchar;
         function  def_stabstr_evaluate(def:tdef;const s:string;const vars:array of string):Pchar;
-        procedure field_add_stabstr(p:Tnamedindexitem;arg:pointer);
-        procedure method_add_stabstr(p:Tnamedindexitem;arg:pointer);
+        procedure field_add_stabstr(p:TObject;arg:pointer);
+        procedure method_add_stabstr(p:TObject;arg:pointer);
         function  def_stabstr(def:tdef):pchar;
         function  def_stabstr(def:tdef):pchar;
         procedure write_def_stabstr(list:TAsmList;def:tdef);
         procedure write_def_stabstr(list:TAsmList;def:tdef);
         procedure write_procdef(list:TAsmList;pd:tprocdef);
         procedure write_procdef(list:TAsmList;pd:tprocdef);
@@ -58,7 +58,7 @@ interface
         procedure insertlineinfo(list:TAsmList);override;
         procedure insertlineinfo(list:TAsmList);override;
         procedure referencesections(list:TAsmList);override;
         procedure referencesections(list:TAsmList);override;
         procedure insertdef(list:TAsmList;def:tdef);override;
         procedure insertdef(list:TAsmList;def:tdef);override;
-        procedure write_symtable_defs(list:TAsmList;st:tsymtable);override;
+        procedure write_symtable_defs(list:TAsmList;st:TSymtable);override;
       end;
       end;
 
 
 
 
@@ -245,7 +245,7 @@ implementation
       begin
       begin
         { procdefs only need a number, mark them as already written
         { procdefs only need a number, mark them as already written
           so they won't be written implicitly }
           so they won't be written implicitly }
-        if (def.deftype=procdef) then
+        if (def.typ=procdef) then
           def.dbg_state:=dbg_state_written;
           def.dbg_state:=dbg_state_written;
         { Stab must already be written, or we must be busy writing it }
         { Stab must already be written, or we must be busy writing it }
         if writing_def_stabs and
         if writing_def_stabs and
@@ -309,7 +309,7 @@ implementation
       end;
       end;
 
 
 
 
-    procedure TDebugInfoStabs.field_add_stabstr(p:Tnamedindexitem;arg:pointer);
+    procedure TDebugInfoStabs.field_add_stabstr(p:TObject;arg:pointer);
       var
       var
         newrec  : Pchar;
         newrec  : Pchar;
         spec    : string[3];
         spec    : string[3];
@@ -331,7 +331,7 @@ implementation
             { open arrays made overflows !! }
             { open arrays made overflows !! }
             if varsize>$fffffff then
             if varsize>$fffffff then
               varsize:=$fffffff;
               varsize:=$fffffff;
-            newrec:=def_stabstr_evaluate(nil,'$1:$2,$3,$4;',[p.name,
+            newrec:=def_stabstr_evaluate(nil,'$1:$2,$3,$4;',[tfieldvarsym(p).name,
                                      spec+def_stab_number(tfieldvarsym(p).vardef),
                                      spec+def_stab_number(tfieldvarsym(p).vardef),
                                      tostr(tfieldvarsym(p).fieldoffset*8),tostr(varsize*8)]);
                                      tostr(tfieldvarsym(p).fieldoffset*8),tostr(varsize*8)]);
             if state^.stabsize+strlen(newrec)>=state^.staballoc-256 then
             if state^.stabsize+strlen(newrec)>=state^.staballoc-256 then
@@ -348,7 +348,7 @@ implementation
       end;
       end;
 
 
 
 
-    procedure TDebugInfoStabs.method_add_stabstr(p:Tnamedindexitem;arg:pointer);
+    procedure TDebugInfoStabs.method_add_stabstr(p:TObject;arg:pointer);
       var virtualind,argnames : string;
       var virtualind,argnames : string;
           newrec : pchar;
           newrec : pchar;
           pd     : tprocdef;
           pd     : tprocdef;
@@ -387,7 +387,7 @@ implementation
             for i:=0 to pd.paras.count-1 do
             for i:=0 to pd.paras.count-1 do
               begin
               begin
                 parasym:=tparavarsym(pd.paras[i]);
                 parasym:=tparavarsym(pd.paras[i]);
-                if Parasym.vardef.deftype = formaldef then
+                if Parasym.vardef.typ = formaldef then
                   begin
                   begin
                     case Parasym.varspez of
                     case Parasym.varspez of
                       vs_var :
                       vs_var :
@@ -419,7 +419,7 @@ implementation
              sp:='1'
              sp:='1'
            else
            else
              sp:='2';
              sp:='2';
-           newrec:=def_stabstr_evaluate(nil,'$1::$2=##$3;:$4;$5A$6;',[p.name,def_stab_number(pd),
+           newrec:=def_stabstr_evaluate(nil,'$1::$2=##$3;:$4;$5A$6;',[tsym(p).name,def_stab_number(pd),
                                     def_stab_number(pd.returndef),argnames,sp,
                                     def_stab_number(pd.returndef),argnames,sp,
                                     virtualind]);
                                     virtualind]);
            { get spare place for a string at the end }
            { get spare place for a string at the end }
@@ -445,7 +445,7 @@ implementation
             slen : aint;
             slen : aint;
             bytest,charst,longst : string;
             bytest,charst,longst : string;
           begin
           begin
-            case def.string_typ of
+            case def.stringtype of
               st_shortstring:
               st_shortstring:
                 begin
                 begin
                   { fix length of openshortstring }
                   { fix length of openshortstring }
@@ -520,7 +520,7 @@ implementation
           begin
           begin
             if cs_gdb_valgrind in current_settings.globalswitches then
             if cs_gdb_valgrind in current_settings.globalswitches then
               begin
               begin
-                case def.typ of
+                case def.ordtype of
                   uvoid :
                   uvoid :
                     result:=strpnew(def_stab_number(def));
                     result:=strpnew(def_stab_number(def));
                   bool8bit,
                   bool8bit,
@@ -538,7 +538,7 @@ implementation
               end
               end
             else
             else
               begin
               begin
-                case def.typ of
+                case def.ordtype of
                   uvoid :
                   uvoid :
                     result:=strpnew(def_stab_number(def));
                     result:=strpnew(def_stab_number(def));
                   uchar :
                   uchar :
@@ -567,7 +567,7 @@ implementation
 
 
         function floatdef_stabstr(def:tfloatdef):Pchar;
         function floatdef_stabstr(def:tfloatdef):Pchar;
           begin
           begin
-            case def.typ of
+            case def.floattype of
               s32real,
               s32real,
               s64real,
               s64real,
               s80real:
               s80real:
@@ -613,7 +613,7 @@ implementation
               RType := 'f';
               RType := 'f';
             if assigned(def.owner) then
             if assigned(def.owner) then
              begin
              begin
-               if (def.owner.symtabletype = objectsymtable) then
+               if (def.owner.symtabletype = objecTSymtable) then
                  obj := def.owner.name^+'__'+def.procsym.name;
                  obj := def.owner.name^+'__'+def.procsym.name;
                if not(cs_gdb_valgrind in current_settings.globalswitches) and
                if not(cs_gdb_valgrind in current_settings.globalswitches) and
                   (def.owner.symtabletype=localsymtable) and
                   (def.owner.symtabletype=localsymtable) and
@@ -643,7 +643,7 @@ implementation
             strpcopy(state.stabstring,'s'+tostr(def.size));
             strpcopy(state.stabstring,'s'+tostr(def.size));
             state.recoffset:=0;
             state.recoffset:=0;
             state.stabsize:=strlen(state.stabstring);
             state.stabsize:=strlen(state.stabstring);
-            def.symtable.foreach(@field_add_stabstr,@state);
+            def.symtable.SymList.ForEachCall(@field_add_stabstr,@state);
             state.stabstring[state.stabsize]:=';';
             state.stabstring[state.stabsize]:=';';
             state.stabstring[state.stabsize+1]:=#0;
             state.stabstring[state.stabsize+1]:=#0;
             reallocmem(state.stabstring,state.stabsize+2);
             reallocmem(state.stabstring,state.stabsize+2);
@@ -666,7 +666,7 @@ implementation
 
 
             state.staballoc:=memsizeinc;
             state.staballoc:=memsizeinc;
             getmem(state.stabstring,state.staballoc);
             getmem(state.stabstring,state.staballoc);
-            strpcopy(state.stabstring,'s'+tostr(tobjectsymtable(def.symtable).datasize));
+            strpcopy(state.stabstring,'s'+tostr(tobjecTSymtable(def.symtable).datasize));
             if assigned(def.childof) then
             if assigned(def.childof) then
               begin
               begin
                 {only one ancestor not virtual, public, at base offset 0 }
                 {only one ancestor not virtual, public, at base offset 0 }
@@ -676,7 +676,7 @@ implementation
             {virtual table to implement yet}
             {virtual table to implement yet}
             state.recoffset:=0;
             state.recoffset:=0;
             state.stabsize:=strlen(state.stabstring);
             state.stabsize:=strlen(state.stabstring);
-            def.symtable.foreach(@field_add_stabstr,@state);
+            def.symtable.symList.ForEachCall(@field_add_stabstr,@state);
             if (oo_has_vmt in def.objectoptions) then
             if (oo_has_vmt in def.objectoptions) then
               if not assigned(def.childof) or not(oo_has_vmt in def.childof.objectoptions) then
               if not assigned(def.childof) or not(oo_has_vmt in def.childof.objectoptions) then
                  begin
                  begin
@@ -684,7 +684,7 @@ implementation
                     strpcopy(state.stabstring+state.stabsize,ts);
                     strpcopy(state.stabstring+state.stabsize,ts);
                     inc(state.stabsize,length(ts));
                     inc(state.stabsize,length(ts));
                  end;
                  end;
-            def.symtable.foreach(@method_add_stabstr,@state);
+            def.symtable.symList.ForEachCall(@method_add_stabstr,@state);
             if (oo_has_vmt in def.objectoptions) then
             if (oo_has_vmt in def.objectoptions) then
               begin
               begin
                  anc := def;
                  anc := def;
@@ -703,7 +703,7 @@ implementation
 
 
       begin
       begin
         result:=nil;
         result:=nil;
-        case def.deftype of
+        case def.typ of
           stringdef :
           stringdef :
             result:=stringdef_stabstr(tstringdef(def));
             result:=stringdef_stabstr(tstringdef(def));
           enumdef :
           enumdef :
@@ -758,7 +758,7 @@ implementation
         ss,st,su : pchar;
         ss,st,su : pchar;
       begin
       begin
         { procdefs require a different stabs style without type prefix }
         { procdefs require a different stabs style without type prefix }
-        if def.deftype=procdef then
+        if def.typ=procdef then
           begin
           begin
             st:=def_stabstr(def);
             st:=def_stabstr(def);
             { add to list }
             { add to list }
@@ -767,7 +767,7 @@ implementation
         else
         else
           begin
           begin
             { type prefix }
             { type prefix }
-            if def.deftype in tagtypes then
+            if def.typ in tagtypes then
               stabchar := 'Tt'
               stabchar := 'Tt'
             else
             else
               stabchar := 't';
               stabchar := 't';
@@ -808,10 +808,10 @@ implementation
         { to avoid infinite loops }
         { to avoid infinite loops }
         def.dbg_state := dbg_state_writing;
         def.dbg_state := dbg_state_writing;
         { write dependencies first }
         { write dependencies first }
-        case def.deftype of
+        case def.typ of
           stringdef :
           stringdef :
             begin
             begin
-              if tstringdef(def).string_typ=st_widestring then
+              if tstringdef(def).stringtype=st_widestring then
                 insertdef(list,cwidechartype)
                 insertdef(list,cwidechartype)
               else
               else
                 begin
                 begin
@@ -845,7 +845,7 @@ implementation
               insertdef(list,tarraydef(def).elementdef);
               insertdef(list,tarraydef(def).elementdef);
             end;
             end;
           recorddef :
           recorddef :
-            trecorddef(def).symtable.foreach(@field_write_defs,list);
+            trecorddef(def).symtable.symList.ForEachCall(@field_write_defs,list);
           enumdef :
           enumdef :
             if assigned(tenumdef(def).basedef) then
             if assigned(tenumdef(def).basedef) then
               insertdef(list,tenumdef(def).basedef);
               insertdef(list,tenumdef(def).basedef);
@@ -859,12 +859,12 @@ implementation
                   anc:=anc.childof;
                   anc:=anc.childof;
                   insertdef(list,anc);
                   insertdef(list,anc);
                 end;
                 end;
-              tobjectdef(def).symtable.foreach(@field_write_defs,list);
-              tobjectdef(def).symtable.foreach(@method_write_defs,list);
+              tobjectdef(def).symtable.symList.ForEachCall(@field_write_defs,list);
+              tobjectdef(def).symtable.symList.ForEachCall(@method_write_defs,list);
             end;
             end;
         end;
         end;
 
 
-        case def.deftype of
+        case def.typ of
           objectdef :
           objectdef :
             begin
             begin
               { classes require special code to write the record and the invisible pointer }
               { classes require special code to write the record and the invisible pointer }
@@ -886,7 +886,7 @@ implementation
               if (oo_has_vmt in tobjectdef(def).objectoptions) and
               if (oo_has_vmt in tobjectdef(def).objectoptions) and
                  assigned(def.owner) and
                  assigned(def.owner) and
                  assigned(def.owner.name) then
                  assigned(def.owner.name) then
-                list.concat(Tai_stab.create(stab_stabs,strpnew('"vmt_'+def.owner.name^+tobjectdef(def).name+':S'+
+                list.concat(Tai_stab.create(stab_stabs,strpnew('"vmt_'+def.owner.name^+tobjectdef(def).objname^+':S'+
                        def_stab_number(vmttype)+'",'+tostr(N_STSYM)+',0,0,'+tobjectdef(def).vmt_mangledname)));
                        def_stab_number(vmttype)+'",'+tostr(N_STSYM)+',0,0,'+tobjectdef(def).vmt_mangledname)));
             end;
             end;
           procdef :
           procdef :
@@ -901,18 +901,19 @@ implementation
       end;
       end;
 
 
 
 
-    procedure TDebugInfoStabs.write_symtable_defs(list:TAsmList;st:tsymtable);
+    procedure TDebugInfoStabs.write_symtable_defs(list:TAsmList;st:TSymtable);
 
 
-       procedure dowritestabs(list:TAsmList;st:tsymtable);
+       procedure dowritestabs(list:TAsmList;st:TSymtable);
          var
          var
-           p : tdef;
+           def : tdef;
+           i   : longint;
          begin
          begin
-           p:=tdef(st.defindex.first);
-           while assigned(p) do
+           for i:=0 to st.DefList.Count-1 do
              begin
              begin
-               if (p.dbg_state=dbg_state_used) then
-                 insertdef(list,p);
-               p:=tdef(p.indexnext);
+               def:=tdef(st.DefList[i]);
+               if not(df_deleted in def.defoptions) and
+                  (def.dbg_state=dbg_state_used) then
+                 insertdef(list,def);
              end;
              end;
          end;
          end;
 
 
@@ -1080,7 +1081,7 @@ implementation
         function fieldvarsym_stabstr(sym:tfieldvarsym):Pchar;
         function fieldvarsym_stabstr(sym:tfieldvarsym):Pchar;
           begin
           begin
             result:=nil;
             result:=nil;
-            if (sym.owner.symtabletype=objectsymtable) and
+            if (sym.owner.symtabletype=objecTSymtable) and
                (sp_static in sym.symoptions) then
                (sp_static in sym.symoptions) then
               result:=sym_stabstr_evaluate(sym,'"${ownername}__${name}:S$1",${N_LCSYM},0,${line},${mangledname}',
               result:=sym_stabstr_evaluate(sym,'"${ownername}__${name}:S$1",${N_LCSYM},0,${line},${mangledname}',
                   [def_stab_number(sym.vardef)]);
                   [def_stab_number(sym.vardef)]);
@@ -1283,7 +1284,7 @@ implementation
             result:=nil;
             result:=nil;
             if not assigned(sym.typedef) then
             if not assigned(sym.typedef) then
               internalerror(200509262);
               internalerror(200509262);
-            if sym.typedef.deftype in tagtypes then
+            if sym.typedef.typ in tagtypes then
               stabchar:='Tt'
               stabchar:='Tt'
             else
             else
               stabchar:='t';
               stabchar:='t';
@@ -1327,15 +1328,16 @@ implementation
         if stabstr<>nil then
         if stabstr<>nil then
           list.concat(Tai_stab.create(stab_stabs,stabstr));
           list.concat(Tai_stab.create(stab_stabs,stabstr));
         { For object types write also the symtable entries }
         { For object types write also the symtable entries }
-        if (sym.typ=typesym) and (ttypesym(sym).typedef.deftype=objectdef) then
+        if (sym.typ=typesym) and (ttypesym(sym).typedef.typ=objectdef) then
           write_symtable_syms(list,tobjectdef(ttypesym(sym).typedef).symtable);
           write_symtable_syms(list,tobjectdef(ttypesym(sym).typedef).symtable);
         sym.isdbgwritten:=true;
         sym.isdbgwritten:=true;
       end;
       end;
 
 
 
 
-    procedure TDebugInfoStabs.write_symtable_syms(list:TAsmList;st:tsymtable);
+    procedure TDebugInfoStabs.write_symtable_syms(list:TAsmList;st:TSymtable);
       var
       var
-        p : tsym;
+        sym : tsym;
+        i   : longint;
       begin
       begin
         case st.symtabletype of
         case st.symtabletype of
           staticsymtable :
           staticsymtable :
@@ -1343,12 +1345,12 @@ implementation
           globalsymtable :
           globalsymtable :
             list.concat(tai_comment.Create(strpnew('Syms - Begin unit '+st.name^+' has index '+tostr(st.moduleid))));
             list.concat(tai_comment.Create(strpnew('Syms - Begin unit '+st.name^+' has index '+tostr(st.moduleid))));
         end;
         end;
-        p:=tsym(st.symindex.first);
-        while assigned(p) do
+        for i:=0 to st.SymList.Count-1 do
           begin
           begin
-            if (not p.isdbgwritten) then
-              insertsym(list,p);
-            p:=tsym(p.indexnext);
+            sym:=tsym(st.SymList[i]);
+            if not(sp_hidden in sym.symoptions) and
+               (not sym.isdbgwritten) then
+              insertsym(list,sym);
           end;
           end;
         case st.symtabletype of
         case st.symtabletype of
           staticsymtable :
           staticsymtable :

+ 62 - 62
compiler/defcmp.pas

@@ -131,7 +131,7 @@ implementation
                               var operatorpd : tprocdef;
                               var operatorpd : tprocdef;
                               cdoptions:tcompare_defs_options):tequaltype;
                               cdoptions:tcompare_defs_options):tequaltype;
 
 
-      { Tbasetype:
+      { tordtype:
            uvoid,
            uvoid,
            u8bit,u16bit,u32bit,u64bit,
            u8bit,u16bit,u32bit,u64bit,
            s8bit,s16bit,s32bit,s64bit,
            s8bit,s16bit,s32bit,s64bit,
@@ -141,7 +141,7 @@ implementation
       type
       type
         tbasedef=(bvoid,bchar,bint,bbool);
         tbasedef=(bvoid,bchar,bint,bbool);
       const
       const
-        basedeftbl:array[tbasetype] of tbasedef =
+        basedeftbl:array[tordtype] of tbasedef =
           (bvoid,
           (bvoid,
            bint,bint,bint,bint,
            bint,bint,bint,bint,
            bint,bint,bint,bint,
            bint,bint,bint,bint,
@@ -187,8 +187,8 @@ implementation
           end;
           end;
 
 
          { undefined def? then mark it as equal }
          { undefined def? then mark it as equal }
-         if (def_from.deftype=undefineddef) or
-            (def_to.deftype=undefineddef) then
+         if (def_from.typ=undefineddef) or
+            (def_to.typ=undefineddef) then
           begin
           begin
             doconv:=tc_equal;
             doconv:=tc_equal;
             compare_defs_ext:=te_equal;
             compare_defs_ext:=te_equal;
@@ -196,8 +196,8 @@ implementation
           end;
           end;
 
 
          { undefined def? then mark it as equal }
          { undefined def? then mark it as equal }
-         if (def_from.deftype=undefineddef) or
-            (def_to.deftype=undefineddef) then
+         if (def_from.typ=undefineddef) or
+            (def_to.typ=undefineddef) then
           begin
           begin
             doconv:=tc_equal;
             doconv:=tc_equal;
             compare_defs_ext:=te_equal;
             compare_defs_ext:=te_equal;
@@ -206,15 +206,15 @@ implementation
 
 
          { we walk the wanted (def_to) types and check then the def_from
          { we walk the wanted (def_to) types and check then the def_from
            types if there is a conversion possible }
            types if there is a conversion possible }
-         case def_to.deftype of
+         case def_to.typ of
            orddef :
            orddef :
              begin
              begin
-               case def_from.deftype of
+               case def_from.typ of
                  orddef :
                  orddef :
                    begin
                    begin
-                     if (torddef(def_from).typ=torddef(def_to).typ) then
+                     if (torddef(def_from).ordtype=torddef(def_to).ordtype) then
                       begin
                       begin
-                        case torddef(def_from).typ of
+                        case torddef(def_from).ordtype of
                           uchar,uwidechar,
                           uchar,uwidechar,
                           u8bit,u16bit,u32bit,u64bit,
                           u8bit,u16bit,u32bit,u64bit,
                           s8bit,s16bit,s32bit,s64bit:
                           s8bit,s16bit,s32bit,s64bit:
@@ -238,9 +238,9 @@ implementation
                      else
                      else
                       begin
                       begin
                         if cdo_explicit in cdoptions then
                         if cdo_explicit in cdoptions then
-                         doconv:=basedefconvertsexplicit[basedeftbl[torddef(def_from).typ],basedeftbl[torddef(def_to).typ]]
+                         doconv:=basedefconvertsexplicit[basedeftbl[torddef(def_from).ordtype],basedeftbl[torddef(def_to).ordtype]]
                         else
                         else
-                         doconv:=basedefconvertsimplicit[basedeftbl[torddef(def_from).typ],basedeftbl[torddef(def_to).typ]];
+                         doconv:=basedefconvertsimplicit[basedeftbl[torddef(def_from).ordtype],basedeftbl[torddef(def_to).ordtype]];
                         if (doconv=tc_not_possible) then
                         if (doconv=tc_not_possible) then
                           eq:=te_incompatible
                           eq:=te_incompatible
                         else
                         else
@@ -299,22 +299,22 @@ implementation
 
 
            stringdef :
            stringdef :
              begin
              begin
-               case def_from.deftype of
+               case def_from.typ of
                  stringdef :
                  stringdef :
                    begin
                    begin
                      { Constant string }
                      { Constant string }
                      if (fromtreetype=stringconstn) then
                      if (fromtreetype=stringconstn) then
                       begin
                       begin
-                        if (tstringdef(def_from).string_typ=tstringdef(def_to).string_typ) then
+                        if (tstringdef(def_from).stringtype=tstringdef(def_to).stringtype) then
                           eq:=te_equal
                           eq:=te_equal
                         else
                         else
                          begin
                          begin
                            doconv:=tc_string_2_string;
                            doconv:=tc_string_2_string;
                            { Don't prefer conversions from widestring to a
                            { Don't prefer conversions from widestring to a
                              normal string as we can loose information }
                              normal string as we can loose information }
-                           if tstringdef(def_from).string_typ=st_widestring then
+                           if tstringdef(def_from).stringtype=st_widestring then
                              eq:=te_convert_l3
                              eq:=te_convert_l3
-                           else if tstringdef(def_to).string_typ=st_widestring then
+                           else if tstringdef(def_to).stringtype=st_widestring then
                              eq:=te_convert_l2
                              eq:=te_convert_l2
                            else
                            else
                              eq:=te_equal;
                              eq:=te_equal;
@@ -322,18 +322,18 @@ implementation
                       end
                       end
                      else
                      else
                      { Same string type, for shortstrings also the length must match }
                      { Same string type, for shortstrings also the length must match }
-                      if (tstringdef(def_from).string_typ=tstringdef(def_to).string_typ) and
-                         ((tstringdef(def_from).string_typ<>st_shortstring) or
+                      if (tstringdef(def_from).stringtype=tstringdef(def_to).stringtype) and
+                         ((tstringdef(def_from).stringtype<>st_shortstring) or
                           (tstringdef(def_from).len=tstringdef(def_to).len)) then
                           (tstringdef(def_from).len=tstringdef(def_to).len)) then
                         eq:=te_equal
                         eq:=te_equal
                      else
                      else
                        begin
                        begin
                          doconv:=tc_string_2_string;
                          doconv:=tc_string_2_string;
-                         case tstringdef(def_from).string_typ of
+                         case tstringdef(def_from).stringtype of
                            st_widestring :
                            st_widestring :
                              begin
                              begin
                                { Prefer conversions to ansistring }
                                { Prefer conversions to ansistring }
-                               if tstringdef(def_to).string_typ=st_ansistring then
+                               if tstringdef(def_to).stringtype=st_ansistring then
                                  eq:=te_convert_l2
                                  eq:=te_convert_l2
                                else
                                else
                                  eq:=te_convert_l3;
                                  eq:=te_convert_l3;
@@ -342,9 +342,9 @@ implementation
                              begin
                              begin
                                { Prefer shortstrings of different length or conversions
                                { Prefer shortstrings of different length or conversions
                                  from shortstring to ansistring }
                                  from shortstring to ansistring }
-                               if (tstringdef(def_to).string_typ=st_shortstring) then
+                               if (tstringdef(def_to).stringtype=st_shortstring) then
                                  eq:=te_convert_l1
                                  eq:=te_convert_l1
-                               else if tstringdef(def_to).string_typ=st_ansistring then
+                               else if tstringdef(def_to).stringtype=st_ansistring then
                                  eq:=te_convert_l2
                                  eq:=te_convert_l2
                                else
                                else
                                  eq:=te_convert_l3;
                                  eq:=te_convert_l3;
@@ -352,7 +352,7 @@ implementation
                            st_ansistring :
                            st_ansistring :
                              begin
                              begin
                                { Prefer conversion to widestrings }
                                { Prefer conversion to widestrings }
-                               if (tstringdef(def_to).string_typ=st_widestring) then
+                               if (tstringdef(def_to).stringtype=st_widestring) then
                                  eq:=te_convert_l2
                                  eq:=te_convert_l2
                                else
                                else
                                  eq:=te_convert_l3;
                                  eq:=te_convert_l3;
@@ -381,12 +381,12 @@ implementation
                             doconv:=tc_string_2_string;
                             doconv:=tc_string_2_string;
                             { prefered string type depends on the $H switch }
                             { prefered string type depends on the $H switch }
                             if not(cs_ansistrings in current_settings.localswitches) and
                             if not(cs_ansistrings in current_settings.localswitches) and
-                               (tstringdef(def_to).string_typ=st_shortstring) then
+                               (tstringdef(def_to).stringtype=st_shortstring) then
                               eq:=te_equal
                               eq:=te_equal
                             else if (cs_ansistrings in current_settings.localswitches) and
                             else if (cs_ansistrings in current_settings.localswitches) and
-                               (tstringdef(def_to).string_typ=st_ansistring) then
+                               (tstringdef(def_to).stringtype=st_ansistring) then
                               eq:=te_equal
                               eq:=te_equal
-                            else if tstringdef(def_to).string_typ=st_widestring then
+                            else if tstringdef(def_to).stringtype=st_widestring then
                               eq:=te_convert_l3
                               eq:=te_convert_l3
                             else
                             else
                               eq:=te_convert_l1;
                               eq:=te_convert_l1;
@@ -475,7 +475,7 @@ implementation
 
 
            floatdef :
            floatdef :
              begin
              begin
-               case def_from.deftype of
+               case def_from.typ of
                  orddef :
                  orddef :
                    begin { ordinal to real }
                    begin { ordinal to real }
                      { only for implicit and internal typecasts in tp/delphi }
                      { only for implicit and internal typecasts in tp/delphi }
@@ -483,13 +483,13 @@ implementation
                          ([m_tp7,m_delphi] * current_settings.modeswitches = [])) and
                          ([m_tp7,m_delphi] * current_settings.modeswitches = [])) and
                         (is_integer(def_from) or
                         (is_integer(def_from) or
                          (is_currency(def_from) and
                          (is_currency(def_from) and
-                          (s64currencytype.deftype = floatdef))) then
+                          (s64currencytype.typ = floatdef))) then
                        begin
                        begin
                          doconv:=tc_int_2_real;
                          doconv:=tc_int_2_real;
                          eq:=te_convert_l1;
                          eq:=te_convert_l1;
                        end
                        end
                      else if is_currency(def_from)
                      else if is_currency(def_from)
-                             { and (s64currencytype.deftype = orddef)) } then
+                             { and (s64currencytype.typ = orddef)) } then
                        begin
                        begin
                          { prefer conversion to orddef in this case, unless    }
                          { prefer conversion to orddef in this case, unless    }
                          { the orddef < currency (then it will get convert l3, }
                          { the orddef < currency (then it will get convert l3, }
@@ -500,7 +500,7 @@ implementation
                    end;
                    end;
                  floatdef :
                  floatdef :
                    begin
                    begin
-                     if tfloatdef(def_from).typ=tfloatdef(def_to).typ then
+                     if tfloatdef(def_from).floattype=tfloatdef(def_to).floattype then
                        eq:=te_equal
                        eq:=te_equal
                      else
                      else
                        begin
                        begin
@@ -522,7 +522,7 @@ implementation
 
 
            enumdef :
            enumdef :
              begin
              begin
-               case def_from.deftype of
+               case def_from.typ of
                  enumdef :
                  enumdef :
                    begin
                    begin
                      if cdo_explicit in cdoptions then
                      if cdo_explicit in cdoptions then
@@ -590,7 +590,7 @@ implementation
                  the extra check for deftyp is needed because equal defs can also return
                  the extra check for deftyp is needed because equal defs can also return
                  true if the def types are not the same, for example with dynarray to pointer. }
                  true if the def types are not the same, for example with dynarray to pointer. }
                if is_open_array(def_to) and
                if is_open_array(def_to) and
-                  (def_from.deftype=tarraydef(def_to).elementdef.deftype) and
+                  (def_from.typ=tarraydef(def_to).elementdef.typ) and
                   equal_defs(def_from,tarraydef(def_to).elementdef) then
                   equal_defs(def_from,tarraydef(def_to).elementdef) then
                 begin
                 begin
                   doconv:=tc_equal;
                   doconv:=tc_equal;
@@ -598,7 +598,7 @@ implementation
                 end
                 end
                else
                else
                 begin
                 begin
-                  case def_from.deftype of
+                  case def_from.typ of
                     arraydef :
                     arraydef :
                       begin
                       begin
                         { from/to packed array -- packed chararrays are      }
                         { from/to packed array -- packed chararrays are      }
@@ -797,7 +797,7 @@ implementation
              begin
              begin
                if (cdo_allow_variant in cdoptions) then
                if (cdo_allow_variant in cdoptions) then
                  begin
                  begin
-                   case def_from.deftype of
+                   case def_from.typ of
                      enumdef :
                      enumdef :
                        begin
                        begin
                          doconv:=tc_enum_2_variant;
                          doconv:=tc_enum_2_variant;
@@ -836,7 +836,7 @@ implementation
 
 
            pointerdef :
            pointerdef :
              begin
              begin
-               case def_from.deftype of
+               case def_from.typ of
                  stringdef :
                  stringdef :
                    begin
                    begin
                      { string constant (which can be part of array constructor)
                      { string constant (which can be part of array constructor)
@@ -944,7 +944,7 @@ implementation
                      else
                      else
                       { the types can be forward type, handle before normal type check !! }
                       { the types can be forward type, handle before normal type check !! }
                       if assigned(def_to.typesym) and
                       if assigned(def_to.typesym) and
-                         (tpointerdef(def_to).pointeddef.deftype=forwarddef) then
+                         (tpointerdef(def_to).pointeddef.typ=forwarddef) then
                        begin
                        begin
                          if (def_from.typesym=def_to.typesym) then
                          if (def_from.typesym=def_to.typesym) then
                           eq:=te_equal
                           eq:=te_equal
@@ -958,8 +958,8 @@ implementation
                      else
                      else
                       { child class pointer can be assigned to anchestor pointers }
                       { child class pointer can be assigned to anchestor pointers }
                       if (
                       if (
-                          (tpointerdef(def_from).pointeddef.deftype=objectdef) and
-                          (tpointerdef(def_to).pointeddef.deftype=objectdef) and
+                          (tpointerdef(def_from).pointeddef.typ=objectdef) and
+                          (tpointerdef(def_to).pointeddef.typ=objectdef) and
                           tobjectdef(tpointerdef(def_from).pointeddef).is_related(
                           tobjectdef(tpointerdef(def_from).pointeddef).is_related(
                             tobjectdef(tpointerdef(def_to).pointeddef))
                             tobjectdef(tpointerdef(def_to).pointeddef))
                          ) then
                          ) then
@@ -985,7 +985,7 @@ implementation
                       if is_void(tpointerdef(def_from).pointeddef) or
                       if is_void(tpointerdef(def_from).pointeddef) or
                       { all pointers can be assigned from void-pointer or formaldef pointer, check
                       { all pointers can be assigned from void-pointer or formaldef pointer, check
                         tw3777.pp if you change this }
                         tw3777.pp if you change this }
-                        (tpointerdef(def_from).pointeddef.deftype=formaldef) then
+                        (tpointerdef(def_from).pointeddef.typ=formaldef) then
                        begin
                        begin
                          doconv:=tc_equal;
                          doconv:=tc_equal;
                          { give pwidechar a penalty so it prefers
                          { give pwidechar a penalty so it prefers
@@ -1027,10 +1027,10 @@ implementation
                        preferred than assigning to a related objectdef }
                        preferred than assigning to a related objectdef }
                      if (
                      if (
                          is_class_or_interface(def_from) or
                          is_class_or_interface(def_from) or
-                         (def_from.deftype=classrefdef)
+                         (def_from.typ=classrefdef)
                         ) and
                         ) and
-                        (tpointerdef(def_to).pointeddef.deftype=orddef) and
-                        (torddef(tpointerdef(def_to).pointeddef).typ=uvoid) then
+                        (tpointerdef(def_to).pointeddef.typ=orddef) and
+                        (torddef(tpointerdef(def_to).pointeddef).ordtype=uvoid) then
                        begin
                        begin
                          doconv:=tc_equal;
                          doconv:=tc_equal;
                          eq:=te_convert_l2;
                          eq:=te_convert_l2;
@@ -1041,7 +1041,7 @@ implementation
 
 
            setdef :
            setdef :
              begin
              begin
-               case def_from.deftype of
+               case def_from.typ of
                  setdef :
                  setdef :
                    begin
                    begin
                      if assigned(tsetdef(def_from).elementdef) and
                      if assigned(tsetdef(def_from).elementdef) and
@@ -1069,7 +1069,7 @@ implementation
 
 
            procvardef :
            procvardef :
              begin
              begin
-               case def_from.deftype of
+               case def_from.typ of
                  procdef :
                  procdef :
                    begin
                    begin
                      { proc -> procvar }
                      { proc -> procvar }
@@ -1114,7 +1114,7 @@ implementation
            objectdef :
            objectdef :
              begin
              begin
                { object pascal objects }
                { object pascal objects }
-               if (def_from.deftype=objectdef) and
+               if (def_from.typ=objectdef) and
                   (tobjectdef(def_from).is_related(tobjectdef(def_to))) then
                   (tobjectdef(def_from).is_related(tobjectdef(def_to))) then
                 begin
                 begin
                   doconv:=tc_equal;
                   doconv:=tc_equal;
@@ -1167,14 +1167,14 @@ implementation
                        eq:=te_convert_l1;
                        eq:=te_convert_l1;
                        doconv:=tc_equal;
                        doconv:=tc_equal;
                      end
                      end
-                   else if (def_from.deftype=variantdef) and is_interface(def_to) then
+                   else if (def_from.typ=variantdef) and is_interface(def_to) then
                      begin
                      begin
                        doconv:=tc_variant_2_interface;
                        doconv:=tc_variant_2_interface;
                        eq:=te_convert_l2;
                        eq:=te_convert_l2;
                      end
                      end
                    { ugly, but delphi allows it }
                    { ugly, but delphi allows it }
                    else if (eq=te_incompatible) and
                    else if (eq=te_incompatible) and
-                     (def_from.deftype=orddef) and
+                     (def_from.typ=orddef) and
                      (m_delphi in current_settings.modeswitches) and
                      (m_delphi in current_settings.modeswitches) and
                      (cdo_explicit in cdoptions) then
                      (cdo_explicit in cdoptions) then
                      begin
                      begin
@@ -1188,14 +1188,14 @@ implementation
              begin
              begin
                { similar to pointerdef wrt forwards }
                { similar to pointerdef wrt forwards }
                if assigned(def_to.typesym) and
                if assigned(def_to.typesym) and
-                  (tclassrefdef(def_to).pointeddef.deftype=forwarddef) then
+                  (tclassrefdef(def_to).pointeddef.typ=forwarddef) then
                  begin
                  begin
                    if (def_from.typesym=def_to.typesym) then
                    if (def_from.typesym=def_to.typesym) then
                     eq:=te_equal;
                     eq:=te_equal;
                  end
                  end
                else
                else
                 { class reference types }
                 { class reference types }
-                if (def_from.deftype=classrefdef) then
+                if (def_from.typ=classrefdef) then
                  begin
                  begin
                    if equal_defs(tclassrefdef(def_from).pointeddef,tclassrefdef(def_to).pointeddef) then
                    if equal_defs(tclassrefdef(def_from).pointeddef,tclassrefdef(def_to).pointeddef) then
                     begin
                     begin
@@ -1228,7 +1228,7 @@ implementation
                when trying to find the good overloaded function !!
                when trying to find the good overloaded function !!
                so all file function are doubled in system.pp
                so all file function are doubled in system.pp
                this is not very beautiful !!}
                this is not very beautiful !!}
-               if (def_from.deftype=filedef) then
+               if (def_from.typ=filedef) then
                 begin
                 begin
                   if (tfiledef(def_from).filetyp=tfiledef(def_to).filetyp) then
                   if (tfiledef(def_from).filetyp=tfiledef(def_to).filetyp) then
                    begin
                    begin
@@ -1280,11 +1280,11 @@ implementation
            formaldef :
            formaldef :
              begin
              begin
                doconv:=tc_equal;
                doconv:=tc_equal;
-               if (def_from.deftype=formaldef) then
+               if (def_from.typ=formaldef) then
                  eq:=te_equal
                  eq:=te_equal
                else
                else
                 { Just about everything can be converted to a formaldef...}
                 { Just about everything can be converted to a formaldef...}
-                if not (def_from.deftype in [abstractdef,errordef]) then
+                if not (def_from.typ in [abstractdef,errordef]) then
                   eq:=te_convert_l2;
                   eq:=te_convert_l2;
              end;
              end;
         end;
         end;
@@ -1296,13 +1296,13 @@ implementation
             { Check for variants? }
             { Check for variants? }
             (
             (
              (cdo_allow_variant in cdoptions) and
              (cdo_allow_variant in cdoptions) and
-             ((def_from.deftype=variantdef) or (def_to.deftype=variantdef))
+             ((def_from.typ=variantdef) or (def_to.typ=variantdef))
             ) or
             ) or
             { Check for operators? }
             { Check for operators? }
             (
             (
              (cdo_check_operator in cdoptions) and
              (cdo_check_operator in cdoptions) and
-             ((def_from.deftype in [objectdef,recorddef,arraydef,stringdef,variantdef]) or
-              (def_to.deftype in [objectdef,recorddef,arraydef,stringdef,variantdef]))
+             ((def_from.typ in [objectdef,recorddef,arraydef,stringdef,variantdef]) or
+              (def_to.typ in [objectdef,recorddef,arraydef,stringdef,variantdef]))
             )
             )
            ) then
            ) then
           begin
           begin
@@ -1348,26 +1348,26 @@ implementation
         is_subequal := false;
         is_subequal := false;
         if assigned(def1) and assigned(def2) then
         if assigned(def1) and assigned(def2) then
          Begin
          Begin
-           if (def1.deftype = orddef) and (def2.deftype = orddef) then
+           if (def1.typ = orddef) and (def2.typ = orddef) then
             Begin
             Begin
               { see p.47 of Turbo Pascal 7.01 manual for the separation of types }
               { see p.47 of Turbo Pascal 7.01 manual for the separation of types }
               { range checking for case statements is done with testrange        }
               { range checking for case statements is done with testrange        }
-              case torddef(def1).typ of
+              case torddef(def1).ordtype of
                 u8bit,u16bit,u32bit,u64bit,
                 u8bit,u16bit,u32bit,u64bit,
                 s8bit,s16bit,s32bit,s64bit :
                 s8bit,s16bit,s32bit,s64bit :
-                  is_subequal:=(torddef(def2).typ in [s64bit,u64bit,s32bit,u32bit,u8bit,s8bit,s16bit,u16bit]);
+                  is_subequal:=(torddef(def2).ordtype in [s64bit,u64bit,s32bit,u32bit,u8bit,s8bit,s16bit,u16bit]);
                 bool8bit,bool16bit,bool32bit,bool64bit :
                 bool8bit,bool16bit,bool32bit,bool64bit :
-                  is_subequal:=(torddef(def2).typ in [bool8bit,bool16bit,bool32bit,bool64bit]);
+                  is_subequal:=(torddef(def2).ordtype in [bool8bit,bool16bit,bool32bit,bool64bit]);
                 uchar :
                 uchar :
-                  is_subequal:=(torddef(def2).typ=uchar);
+                  is_subequal:=(torddef(def2).ordtype=uchar);
                 uwidechar :
                 uwidechar :
-                  is_subequal:=(torddef(def2).typ=uwidechar);
+                  is_subequal:=(torddef(def2).ordtype=uwidechar);
               end;
               end;
             end
             end
            else
            else
             Begin
             Begin
               { Check if both basedefs are equal }
               { Check if both basedefs are equal }
-              if (def1.deftype=enumdef) and (def2.deftype=enumdef) then
+              if (def1.typ=enumdef) and (def2.typ=enumdef) then
                 Begin
                 Begin
                    { get both basedefs }
                    { get both basedefs }
                    basedef1:=tenumdef(def1);
                    basedef1:=tenumdef(def1);

+ 112 - 116
compiler/defutil.pas

@@ -50,7 +50,7 @@ interface
     function get_max_value(def : tdef) : TConstExprInt;
     function get_max_value(def : tdef) : TConstExprInt;
 
 
     {# Returns basetype of the specified integer range }
     {# Returns basetype of the specified integer range }
-    function range_to_basetype(l,h:TConstExprInt):tbasetype;
+    function range_to_basetype(l,h:TConstExprInt):tordtype;
 
 
     procedure range_to_type(l,h:TConstExprInt;var def:tdef);
     procedure range_to_type(l,h:TConstExprInt;var def:tdef);
 
 
@@ -238,20 +238,20 @@ implementation
     { returns true, if def uses FPU }
     { returns true, if def uses FPU }
     function is_fpu(def : tdef) : boolean;
     function is_fpu(def : tdef) : boolean;
       begin
       begin
-         is_fpu:=(def.deftype=floatdef);
+         is_fpu:=(def.typ=floatdef);
       end;
       end;
 
 
 
 
     { returns true, if def is a currency type }
     { returns true, if def is a currency type }
     function is_currency(def : tdef) : boolean;
     function is_currency(def : tdef) : boolean;
       begin
       begin
-         case s64currencytype.deftype of
+         case s64currencytype.typ of
            orddef :
            orddef :
-             result:=(def.deftype=orddef) and
-                     (torddef(s64currencytype).typ=torddef(def).typ);
+             result:=(def.typ=orddef) and
+                     (torddef(s64currencytype).ordtype=torddef(def).ordtype);
            floatdef :
            floatdef :
-             result:=(def.deftype=floatdef) and
-                     (tfloatdef(s64currencytype).typ=tfloatdef(def).typ);
+             result:=(def.typ=floatdef) and
+                     (tfloatdef(s64currencytype).floattype=tfloatdef(def).floattype);
            else
            else
              internalerror(200304222);
              internalerror(200304222);
          end;
          end;
@@ -261,35 +261,35 @@ implementation
     { returns true, if def is a single type }
     { returns true, if def is a single type }
     function is_single(def : tdef) : boolean;
     function is_single(def : tdef) : boolean;
       begin
       begin
-        result:=(def.deftype=floatdef) and
-          (tfloatdef(def).typ=s32real);
+        result:=(def.typ=floatdef) and
+          (tfloatdef(def).floattype=s32real);
       end;
       end;
 
 
 
 
     { returns true, if def is a double type }
     { returns true, if def is a double type }
     function is_double(def : tdef) : boolean;
     function is_double(def : tdef) : boolean;
       begin
       begin
-        result:=(def.deftype=floatdef) and
-          (tfloatdef(def).typ=s64real);
+        result:=(def.typ=floatdef) and
+          (tfloatdef(def).floattype=s64real);
       end;
       end;
 
 
 
 
     function is_extended(def : tdef) : boolean;
     function is_extended(def : tdef) : boolean;
       begin
       begin
-        result:=(def.deftype=floatdef) and
-          (tfloatdef(def).typ=s80real);
+        result:=(def.typ=floatdef) and
+          (tfloatdef(def).floattype=s80real);
       end;
       end;
 
 
 
 
     { returns true, if definition is a "real" real (i.e. single/double/extended) }
     { returns true, if definition is a "real" real (i.e. single/double/extended) }
     function is_real(def : tdef) : boolean;
     function is_real(def : tdef) : boolean;
       begin
       begin
-        result:=(def.deftype=floatdef) and
-          (tfloatdef(def).typ in [s32real,s64real,s80real]);
+        result:=(def.typ=floatdef) and
+          (tfloatdef(def).floattype in [s32real,s64real,s80real]);
       end;
       end;
 
 
 
 
-    function range_to_basetype(l,h:TConstExprInt):tbasetype;
+    function range_to_basetype(l,h:TConstExprInt):tordtype;
       begin
       begin
         { prefer signed over unsigned }
         { prefer signed over unsigned }
         if (l>=-128) and (h<=127) then
         if (l>=-128) and (h<=127) then
@@ -338,12 +338,12 @@ implementation
     { true if p is an ordinal }
     { true if p is an ordinal }
     function is_ordinal(def : tdef) : boolean;
     function is_ordinal(def : tdef) : boolean;
       var
       var
-         dt : tbasetype;
+         dt : tordtype;
       begin
       begin
-         case def.deftype of
+         case def.typ of
            orddef :
            orddef :
              begin
              begin
-               dt:=torddef(def).typ;
+               dt:=torddef(def).ordtype;
                is_ordinal:=dt in [uchar,uwidechar,
                is_ordinal:=dt in [uchar,uwidechar,
                                   u8bit,u16bit,u32bit,u64bit,
                                   u8bit,u16bit,u32bit,u64bit,
                                   s8bit,s16bit,s32bit,s64bit,
                                   s8bit,s16bit,s32bit,s64bit,
@@ -360,13 +360,13 @@ implementation
     { returns the min. value of the type }
     { returns the min. value of the type }
     function get_min_value(def : tdef) : TConstExprInt;
     function get_min_value(def : tdef) : TConstExprInt;
       begin
       begin
-         case def.deftype of
+         case def.typ of
            orddef:
            orddef:
-             get_min_value:=torddef(def).low;
+             result:=torddef(def).low;
            enumdef:
            enumdef:
-             get_min_value:=tenumdef(def).min;
+             result:=tenumdef(def).min;
            else
            else
-             get_min_value:=0;
+             result:=0;
          end;
          end;
       end;
       end;
 
 
@@ -374,13 +374,13 @@ implementation
     { returns the max. value of the type }
     { returns the max. value of the type }
     function get_max_value(def : tdef) : TConstExprInt;
     function get_max_value(def : tdef) : TConstExprInt;
       begin
       begin
-         case def.deftype of
+         case def.typ of
            orddef:
            orddef:
-             get_max_value:=torddef(def).high;
+             result:=torddef(def).high;
            enumdef:
            enumdef:
-             get_max_value:=tenumdef(def).max;
+             result:=tenumdef(def).max;
            else
            else
-             get_max_value:=0;
+             result:=0;
          end;
          end;
       end;
       end;
 
 
@@ -388,8 +388,8 @@ implementation
     { true if p is an integer }
     { true if p is an integer }
     function is_integer(def : tdef) : boolean;
     function is_integer(def : tdef) : boolean;
       begin
       begin
-        is_integer:=(def.deftype=orddef) and
-                    (torddef(def).typ in [u8bit,u16bit,u32bit,u64bit,
+        result:=(def.typ=orddef) and
+                    (torddef(def).ordtype in [u8bit,u16bit,u32bit,u64bit,
                                           s8bit,s16bit,s32bit,s64bit]);
                                           s8bit,s16bit,s32bit,s64bit]);
       end;
       end;
 
 
@@ -397,52 +397,47 @@ implementation
     { true if p is a boolean }
     { true if p is a boolean }
     function is_boolean(def : tdef) : boolean;
     function is_boolean(def : tdef) : boolean;
       begin
       begin
-        is_boolean:=(def.deftype=orddef) and
-                    (torddef(def).typ in [bool8bit,bool16bit,bool32bit,bool64bit]);
+        result:=(def.typ=orddef) and
+                    (torddef(def).ordtype in [bool8bit,bool16bit,bool32bit,bool64bit]);
       end;
       end;
 
 
 
 
     { true if p is a void }
     { true if p is a void }
     function is_void(def : tdef) : boolean;
     function is_void(def : tdef) : boolean;
       begin
       begin
-        is_void:=(def.deftype=orddef) and
-                 (torddef(def).typ=uvoid);
+        result:=(def.typ=orddef) and
+                 (torddef(def).ordtype=uvoid);
       end;
       end;
 
 
 
 
     { true if p is a char }
     { true if p is a char }
     function is_char(def : tdef) : boolean;
     function is_char(def : tdef) : boolean;
       begin
       begin
-        is_char:=(def.deftype=orddef) and
-                 (torddef(def).typ=uchar);
+        result:=(def.typ=orddef) and
+                 (torddef(def).ordtype=uchar);
       end;
       end;
 
 
 
 
     { true if p is a wchar }
     { true if p is a wchar }
     function is_widechar(def : tdef) : boolean;
     function is_widechar(def : tdef) : boolean;
       begin
       begin
-        is_widechar:=(def.deftype=orddef) and
-                 (torddef(def).typ=uwidechar);
+        result:=(def.typ=orddef) and
+                 (torddef(def).ordtype=uwidechar);
       end;
       end;
 
 
 
 
     { true if p is signed (integer) }
     { true if p is signed (integer) }
     function is_signed(def : tdef) : boolean;
     function is_signed(def : tdef) : boolean;
-      var
-         dt : tbasetype;
       begin
       begin
-         case def.deftype of
+         case def.typ of
            orddef :
            orddef :
-             begin
-               dt:=torddef(def).typ;
-               is_signed:=(dt in [s8bit,s16bit,s32bit,s64bit,scurrency]);
-             end;
+             result:=(torddef(def).ordtype in [s8bit,s16bit,s32bit,s64bit,scurrency]);
            enumdef :
            enumdef :
-             is_signed:=tenumdef(def).min < 0;
+             result:=tenumdef(def).min < 0;
            arraydef :
            arraydef :
-             is_signed:=is_signed(tarraydef(def).rangedef);
+             result:=is_signed(tarraydef(def).rangedef);
            else
            else
-             is_signed:=false;
+             result:=false;
          end;
          end;
       end;
       end;
 
 
@@ -453,14 +448,14 @@ implementation
         fromqword, toqword: boolean;
         fromqword, toqword: boolean;
 
 
       begin
       begin
-         if (def_from.deftype <> orddef) or
-            (def_to.deftype <> orddef) then
+         if (def_from.typ <> orddef) or
+            (def_to.typ <> orddef) then
            begin
            begin
              is_in_limit := false;
              is_in_limit := false;
              exit;
              exit;
            end;
            end;
-         fromqword := torddef(def_from).typ = u64bit;
-         toqword := torddef(def_to).typ = u64bit;
+         fromqword := torddef(def_from).ordtype = u64bit;
+         toqword := torddef(def_to).ordtype = u64bit;
          is_in_limit:=(toqword and is_signed(def_from)) or
          is_in_limit:=(toqword and is_signed(def_from)) or
                       ((not fromqword) and
                       ((not fromqword) and
                        (torddef(def_from).low>=torddef(def_to).low) and
                        (torddef(def_from).low>=torddef(def_to).low) and
@@ -471,10 +466,10 @@ implementation
     function is_in_limit_value(val_from:TConstExprInt;def_from,def_to : tdef) : boolean;
     function is_in_limit_value(val_from:TConstExprInt;def_from,def_to : tdef) : boolean;
 
 
       begin
       begin
-         if (def_from.deftype <> orddef) and
-            (def_to.deftype <> orddef) then
+         if (def_from.typ <> orddef) and
+            (def_to.typ <> orddef) then
            internalerror(200210062);
            internalerror(200210062);
-         if (torddef(def_to).typ = u64bit) then
+         if (torddef(def_to).ordtype = u64bit) then
           begin
           begin
             is_in_limit_value:=((TConstExprUInt(val_from)>=TConstExprUInt(torddef(def_to).low)) and
             is_in_limit_value:=((TConstExprUInt(val_from)>=TConstExprUInt(torddef(def_to).low)) and
                                 (TConstExprUInt(val_from)<=TConstExprUInt(torddef(def_to).high)));
                                 (TConstExprUInt(val_from)<=TConstExprUInt(torddef(def_to).high)));
@@ -490,8 +485,8 @@ implementation
     { true, if p points to an open array def }
     { true, if p points to an open array def }
     function is_open_string(p : tdef) : boolean;
     function is_open_string(p : tdef) : boolean;
       begin
       begin
-         is_open_string:=(p.deftype=stringdef) and
-                         (tstringdef(p).string_typ=st_shortstring) and
+         is_open_string:=(p.typ=stringdef) and
+                         (tstringdef(p).stringtype=st_shortstring) and
                          (tstringdef(p).len=0);
                          (tstringdef(p).len=0);
       end;
       end;
 
 
@@ -499,7 +494,7 @@ implementation
     { true, if p points to a zero based array def }
     { true, if p points to a zero based array def }
     function is_zero_based_array(p : tdef) : boolean;
     function is_zero_based_array(p : tdef) : boolean;
       begin
       begin
-         result:=(p.deftype=arraydef) and
+         result:=(p.typ=arraydef) and
                  (tarraydef(p).lowrange=0) and
                  (tarraydef(p).lowrange=0) and
                  not(is_special_array(p));
                  not(is_special_array(p));
       end;
       end;
@@ -507,7 +502,7 @@ implementation
     { true if p points to a dynamic array def }
     { true if p points to a dynamic array def }
     function is_dynamic_array(p : tdef) : boolean;
     function is_dynamic_array(p : tdef) : boolean;
       begin
       begin
-         result:=(p.deftype=arraydef) and
+         result:=(p.typ=arraydef) and
                  (ado_IsDynamicArray in tarraydef(p).arrayoptions);
                  (ado_IsDynamicArray in tarraydef(p).arrayoptions);
       end;
       end;
 
 
@@ -517,7 +512,7 @@ implementation
       begin
       begin
          { check for s32inttype is needed, because for u32bit the high
          { check for s32inttype is needed, because for u32bit the high
            range is also -1 ! (PFV) }
            range is also -1 ! (PFV) }
-         result:=(p.deftype=arraydef) and
+         result:=(p.typ=arraydef) and
                  (tarraydef(p).rangedef=s32inttype) and
                  (tarraydef(p).rangedef=s32inttype) and
                  (tarraydef(p).lowrange=0) and
                  (tarraydef(p).lowrange=0) and
                  (tarraydef(p).highrange=-1) and
                  (tarraydef(p).highrange=-1) and
@@ -527,28 +522,28 @@ implementation
     { true, if p points to an array of const def }
     { true, if p points to an array of const def }
     function is_array_constructor(p : tdef) : boolean;
     function is_array_constructor(p : tdef) : boolean;
       begin
       begin
-         result:=(p.deftype=arraydef) and
+         result:=(p.typ=arraydef) and
                  (ado_IsConstructor in tarraydef(p).arrayoptions);
                  (ado_IsConstructor in tarraydef(p).arrayoptions);
       end;
       end;
 
 
     { true, if p points to a variant array }
     { true, if p points to a variant array }
     function is_variant_array(p : tdef) : boolean;
     function is_variant_array(p : tdef) : boolean;
       begin
       begin
-         result:=(p.deftype=arraydef) and
+         result:=(p.typ=arraydef) and
                  (ado_IsVariant in tarraydef(p).arrayoptions);
                  (ado_IsVariant in tarraydef(p).arrayoptions);
       end;
       end;
 
 
     { true, if p points to an array of const }
     { true, if p points to an array of const }
     function is_array_of_const(p : tdef) : boolean;
     function is_array_of_const(p : tdef) : boolean;
       begin
       begin
-         result:=(p.deftype=arraydef) and
+         result:=(p.typ=arraydef) and
                  (ado_IsArrayOfConst in tarraydef(p).arrayoptions);
                  (ado_IsArrayOfConst in tarraydef(p).arrayoptions);
       end;
       end;
 
 
     { true, if p points to a special array, bitpacked arrays aren't special in this regard though }
     { true, if p points to a special array, bitpacked arrays aren't special in this regard though }
     function is_special_array(p : tdef) : boolean;
     function is_special_array(p : tdef) : boolean;
       begin
       begin
-         result:=(p.deftype=arraydef) and
+         result:=(p.typ=arraydef) and
                  (
                  (
                   ((tarraydef(p).arrayoptions * [ado_IsVariant,ado_IsArrayOfConst,ado_IsConstructor,ado_IsDynamicArray])<>[]) or
                   ((tarraydef(p).arrayoptions * [ado_IsVariant,ado_IsArrayOfConst,ado_IsConstructor,ado_IsDynamicArray])<>[]) or
                   is_open_array(p)
                   is_open_array(p)
@@ -558,31 +553,31 @@ implementation
     { true if p is an ansi string def }
     { true if p is an ansi string def }
     function is_ansistring(p : tdef) : boolean;
     function is_ansistring(p : tdef) : boolean;
       begin
       begin
-         is_ansistring:=(p.deftype=stringdef) and
-                        (tstringdef(p).string_typ=st_ansistring);
+         is_ansistring:=(p.typ=stringdef) and
+                        (tstringdef(p).stringtype=st_ansistring);
       end;
       end;
 
 
     { true if p is an long string def }
     { true if p is an long string def }
     function is_longstring(p : tdef) : boolean;
     function is_longstring(p : tdef) : boolean;
       begin
       begin
-         is_longstring:=(p.deftype=stringdef) and
-                        (tstringdef(p).string_typ=st_longstring);
+         is_longstring:=(p.typ=stringdef) and
+                        (tstringdef(p).stringtype=st_longstring);
       end;
       end;
 
 
 
 
     { true if p is an wide string def }
     { true if p is an wide string def }
     function is_widestring(p : tdef) : boolean;
     function is_widestring(p : tdef) : boolean;
       begin
       begin
-         is_widestring:=(p.deftype=stringdef) and
-                        (tstringdef(p).string_typ=st_widestring);
+         is_widestring:=(p.typ=stringdef) and
+                        (tstringdef(p).stringtype=st_widestring);
       end;
       end;
 
 
 
 
     { true if p is an short string def }
     { true if p is an short string def }
     function is_shortstring(p : tdef) : boolean;
     function is_shortstring(p : tdef) : boolean;
       begin
       begin
-         is_shortstring:=(p.deftype=stringdef) and
-                         (tstringdef(p).string_typ=st_shortstring);
+         is_shortstring:=(p.typ=stringdef) and
+                         (tstringdef(p).stringtype=st_shortstring);
       end;
       end;
 
 
 
 
@@ -590,7 +585,7 @@ implementation
     function is_packed_array(p: tdef) : boolean;
     function is_packed_array(p: tdef) : boolean;
       begin
       begin
         is_packed_array :=
         is_packed_array :=
-           (p.deftype = arraydef) and
+           (p.typ = arraydef) and
            (ado_IsBitPacked in tarraydef(p).arrayoptions);
            (ado_IsBitPacked in tarraydef(p).arrayoptions);
       end;
       end;
 
 
@@ -599,7 +594,7 @@ implementation
     function is_packed_record_or_object(p: tdef) : boolean;
     function is_packed_record_or_object(p: tdef) : boolean;
       begin
       begin
         is_packed_record_or_object :=
         is_packed_record_or_object :=
-           (p.deftype in [recorddef,objectdef]) and
+           (p.typ in [recorddef,objectdef]) and
            (tabstractrecorddef(p).is_packed);
            (tabstractrecorddef(p).is_packed);
       end;
       end;
 
 
@@ -607,7 +602,7 @@ implementation
     { true if p is a char array def }
     { true if p is a char array def }
     function is_chararray(p : tdef) : boolean;
     function is_chararray(p : tdef) : boolean;
       begin
       begin
-        is_chararray:=(p.deftype=arraydef) and
+        is_chararray:=(p.typ=arraydef) and
                       is_char(tarraydef(p).elementdef) and
                       is_char(tarraydef(p).elementdef) and
                       not(is_special_array(p));
                       not(is_special_array(p));
       end;
       end;
@@ -615,7 +610,7 @@ implementation
     { true if p is a widechar array def }
     { true if p is a widechar array def }
     function is_widechararray(p : tdef) : boolean;
     function is_widechararray(p : tdef) : boolean;
       begin
       begin
-        is_widechararray:=(p.deftype=arraydef) and
+        is_widechararray:=(p.typ=arraydef) and
                           is_widechar(tarraydef(p).elementdef) and
                           is_widechar(tarraydef(p).elementdef) and
                           not(is_special_array(p));
                           not(is_special_array(p));
       end;
       end;
@@ -638,7 +633,7 @@ implementation
     { true if p is a pchar def }
     { true if p is a pchar def }
     function is_pchar(p : tdef) : boolean;
     function is_pchar(p : tdef) : boolean;
       begin
       begin
-        is_pchar:=(p.deftype=pointerdef) and
+        is_pchar:=(p.typ=pointerdef) and
                   (is_char(tpointerdef(p).pointeddef) or
                   (is_char(tpointerdef(p).pointeddef) or
                    (is_zero_based_array(tpointerdef(p).pointeddef) and
                    (is_zero_based_array(tpointerdef(p).pointeddef) and
                     is_chararray(tpointerdef(p).pointeddef)));
                     is_chararray(tpointerdef(p).pointeddef)));
@@ -647,7 +642,7 @@ implementation
     { true if p is a pchar def }
     { true if p is a pchar def }
     function is_pwidechar(p : tdef) : boolean;
     function is_pwidechar(p : tdef) : boolean;
       begin
       begin
-        is_pwidechar:=(p.deftype=pointerdef) and
+        is_pwidechar:=(p.typ=pointerdef) and
                       (is_widechar(tpointerdef(p).pointeddef) or
                       (is_widechar(tpointerdef(p).pointeddef) or
                        (is_zero_based_array(tpointerdef(p).pointeddef) and
                        (is_zero_based_array(tpointerdef(p).pointeddef) and
                         is_widechararray(tpointerdef(p).pointeddef)));
                         is_widechararray(tpointerdef(p).pointeddef)));
@@ -657,16 +652,16 @@ implementation
     { true if p is a voidpointer def }
     { true if p is a voidpointer def }
     function is_voidpointer(p : tdef) : boolean;
     function is_voidpointer(p : tdef) : boolean;
       begin
       begin
-        is_voidpointer:=(p.deftype=pointerdef) and
-                        (tpointerdef(p).pointeddef.deftype=orddef) and
-                        (torddef(tpointerdef(p).pointeddef).typ=uvoid);
+        is_voidpointer:=(p.typ=pointerdef) and
+                        (tpointerdef(p).pointeddef.typ=orddef) and
+                        (torddef(tpointerdef(p).pointeddef).ordtype=uvoid);
       end;
       end;
 
 
 
 
     { true if p is a smallset def }
     { true if p is a smallset def }
     function is_smallset(p : tdef) : boolean;
     function is_smallset(p : tdef) : boolean;
       begin
       begin
-        is_smallset:=(p.deftype=setdef) and
+        is_smallset:=(p.typ=setdef) and
                      (tsetdef(p).settype=smallset);
                      (tsetdef(p).settype=smallset);
       end;
       end;
 
 
@@ -674,21 +669,21 @@ implementation
     { true, if def is a 32 bit int type }
     { true, if def is a 32 bit int type }
     function is_32bitint(def : tdef) : boolean;
     function is_32bitint(def : tdef) : boolean;
       begin
       begin
-         result:=(def.deftype=orddef) and (torddef(def).typ in [u32bit,s32bit])
+         result:=(def.typ=orddef) and (torddef(def).ordtype in [u32bit,s32bit])
       end;
       end;
 
 
 
 
     { true, if def is a 64 bit int type }
     { true, if def is a 64 bit int type }
     function is_64bitint(def : tdef) : boolean;
     function is_64bitint(def : tdef) : boolean;
       begin
       begin
-         is_64bitint:=(def.deftype=orddef) and (torddef(def).typ in [u64bit,s64bit])
+         is_64bitint:=(def.typ=orddef) and (torddef(def).ordtype in [u64bit,s64bit])
       end;
       end;
 
 
 
 
     { true, if def is a 64 bit type }
     { true, if def is a 64 bit type }
     function is_64bit(def : tdef) : boolean;
     function is_64bit(def : tdef) : boolean;
       begin
       begin
-         is_64bit:=(def.deftype=orddef) and (torddef(def).typ in [u64bit,s64bit,scurrency])
+         is_64bit:=(def.typ=orddef) and (torddef(def).ordtype in [u64bit,s64bit,scurrency])
       end;
       end;
 
 
 
 
@@ -704,7 +699,7 @@ implementation
          { zero, if def is a qword node                              }
          { zero, if def is a qword node                              }
          if is_64bitint(def) then
          if is_64bitint(def) then
            begin
            begin
-              if (l<0) and (torddef(def).typ=u64bit) then
+              if (l<0) and (torddef(def).ordtype=u64bit) then
                 begin
                 begin
                    { don't zero the result, because it may come from hex notation
                    { don't zero the result, because it may come from hex notation
                      like $ffffffffffffffff! (JM)
                      like $ffffffffffffffff! (JM)
@@ -726,7 +721,7 @@ implementation
                 begin
                 begin
                    if not explicit then
                    if not explicit then
                     begin
                     begin
-                      if ((def.deftype=enumdef) and
+                      if ((def.typ=enumdef) and
                           { delphi allows range check errors in
                           { delphi allows range check errors in
                            enumeration type casts FK }
                            enumeration type casts FK }
                           not(m_delphi in current_settings.modeswitches)) or
                           not(m_delphi in current_settings.modeswitches)) or
@@ -763,7 +758,7 @@ implementation
     { return the range from def in l and h }
     { return the range from def in l and h }
     procedure getrange(def : tdef;var l : TConstExprInt;var h : TConstExprInt);
     procedure getrange(def : tdef;var l : TConstExprInt;var h : TConstExprInt);
       begin
       begin
-        case def.deftype of
+        case def.typ of
           orddef :
           orddef :
             begin
             begin
               l:=torddef(def).low;
               l:=torddef(def).low;
@@ -790,13 +785,13 @@ implementation
          mmx_type:=mmxno;
          mmx_type:=mmxno;
          if is_mmx_able_array(p) then
          if is_mmx_able_array(p) then
            begin
            begin
-              if tarraydef(p).elementdef.deftype=floatdef then
-                case tfloatdef(tarraydef(p).elementdef).typ of
+              if tarraydef(p).elementdef.typ=floatdef then
+                case tfloatdef(tarraydef(p).elementdef).floattype of
                   s32real:
                   s32real:
                     mmx_type:=mmxsingle;
                     mmx_type:=mmxsingle;
                 end
                 end
               else
               else
-                case torddef(tarraydef(p).elementdef).typ of
+                case torddef(tarraydef(p).elementdef).ordtype of
                    u8bit:
                    u8bit:
                      mmx_type:=mmxu8bit;
                      mmx_type:=mmxu8bit;
                    s8bit:
                    s8bit:
@@ -816,9 +811,10 @@ implementation
 
 
     function is_vector(p : tdef) : boolean;
     function is_vector(p : tdef) : boolean;
       begin
       begin
-        result:=(p.deftype=arraydef) and
+        result:=(p.typ=arraydef) and
                 not(is_special_array(p)) and
                 not(is_special_array(p)) and
-                (tarraydef(p).elementdef.deftype=floatdef) and (tfloatdef(tarraydef(p).elementdef).typ in [s32real,s64real]);
+                (tarraydef(p).elementdef.typ=floatdef) and
+                (tfloatdef(tarraydef(p).elementdef).floattype in [s32real,s64real]);
       end;
       end;
 
 
 
 
@@ -828,20 +824,20 @@ implementation
 {$ifdef x86}
 {$ifdef x86}
         result:= is_vector(p) and
         result:= is_vector(p) and
                  (
                  (
-                  (tarraydef(p).elementdef.deftype=floatdef) and
+                  (tarraydef(p).elementdef.typ=floatdef) and
                   (
                   (
                    (tarraydef(p).lowrange=0) and
                    (tarraydef(p).lowrange=0) and
                    (tarraydef(p).highrange=3) and
                    (tarraydef(p).highrange=3) and
-                   (tfloatdef(tarraydef(p).elementdef).typ=s32real)
+                   (tfloatdef(tarraydef(p).elementdef).floattype=s32real)
                   )
                   )
                  ) or
                  ) or
 
 
                  (
                  (
-                  (tarraydef(p).elementdef.deftype=floatdef) and
+                  (tarraydef(p).elementdef.typ=floatdef) and
                   (
                   (
                    (tarraydef(p).lowrange=0) and
                    (tarraydef(p).lowrange=0) and
                    (tarraydef(p).highrange=1) and
                    (tarraydef(p).highrange=1) and
-                   (tfloatdef(tarraydef(p).elementdef).typ=s64real)
+                   (tfloatdef(tarraydef(p).elementdef).floattype=s64real)
                   )
                   )
                  );
                  );
 {$else x86}
 {$else x86}
@@ -855,33 +851,33 @@ implementation
 {$ifdef SUPPORT_MMX}
 {$ifdef SUPPORT_MMX}
          if (cs_mmx_saturation in current_settings.localswitches) then
          if (cs_mmx_saturation in current_settings.localswitches) then
            begin
            begin
-              is_mmx_able_array:=(p.deftype=arraydef) and
+              is_mmx_able_array:=(p.typ=arraydef) and
                 not(is_special_array(p)) and
                 not(is_special_array(p)) and
                 (
                 (
                  (
                  (
-                  (tarraydef(p).elementdef.deftype=orddef) and
+                  (tarraydef(p).elementdef.typ=orddef) and
                   (
                   (
                    (
                    (
                     (tarraydef(p).lowrange=0) and
                     (tarraydef(p).lowrange=0) and
                     (tarraydef(p).highrange=1) and
                     (tarraydef(p).highrange=1) and
-                    (torddef(tarraydef(p).elementdef).typ in [u32bit,s32bit])
+                    (torddef(tarraydef(p).elementdef).ordtype in [u32bit,s32bit])
                    )
                    )
                    or
                    or
                    (
                    (
                     (tarraydef(p).lowrange=0) and
                     (tarraydef(p).lowrange=0) and
                     (tarraydef(p).highrange=3) and
                     (tarraydef(p).highrange=3) and
-                    (torddef(tarraydef(p).elementdef).typ in [u16bit,s16bit])
+                    (torddef(tarraydef(p).elementdef).ordtype in [u16bit,s16bit])
                    )
                    )
                   )
                   )
                  )
                  )
                  or
                  or
                 (
                 (
                  (
                  (
-                  (tarraydef(p).elementdef.deftype=floatdef) and
+                  (tarraydef(p).elementdef.typ=floatdef) and
                   (
                   (
                    (tarraydef(p).lowrange=0) and
                    (tarraydef(p).lowrange=0) and
                    (tarraydef(p).highrange=1) and
                    (tarraydef(p).highrange=1) and
-                   (tfloatdef(tarraydef(p).elementdef).typ=s32real)
+                   (tfloatdef(tarraydef(p).elementdef).floattype=s32real)
                   )
                   )
                  )
                  )
                 )
                 )
@@ -889,37 +885,37 @@ implementation
            end
            end
          else
          else
            begin
            begin
-              is_mmx_able_array:=(p.deftype=arraydef) and
+              is_mmx_able_array:=(p.typ=arraydef) and
                 (
                 (
                  (
                  (
-                  (tarraydef(p).elementdef.deftype=orddef) and
+                  (tarraydef(p).elementdef.typ=orddef) and
                   (
                   (
                    (
                    (
                     (tarraydef(p).lowrange=0) and
                     (tarraydef(p).lowrange=0) and
                     (tarraydef(p).highrange=1) and
                     (tarraydef(p).highrange=1) and
-                    (torddef(tarraydef(p).elementdef).typ in [u32bit,s32bit])
+                    (torddef(tarraydef(p).elementdef).ordtype in [u32bit,s32bit])
                    )
                    )
                    or
                    or
                    (
                    (
                     (tarraydef(p).lowrange=0) and
                     (tarraydef(p).lowrange=0) and
                     (tarraydef(p).highrange=3) and
                     (tarraydef(p).highrange=3) and
-                    (torddef(tarraydef(p).elementdef).typ in [u16bit,s16bit])
+                    (torddef(tarraydef(p).elementdef).ordtype in [u16bit,s16bit])
                    )
                    )
                    or
                    or
                    (
                    (
                     (tarraydef(p).lowrange=0) and
                     (tarraydef(p).lowrange=0) and
                     (tarraydef(p).highrange=7) and
                     (tarraydef(p).highrange=7) and
-                    (torddef(tarraydef(p).elementdef).typ in [u8bit,s8bit])
+                    (torddef(tarraydef(p).elementdef).ordtype in [u8bit,s8bit])
                    )
                    )
                   )
                   )
                  )
                  )
                  or
                  or
                  (
                  (
-                  (tarraydef(p).elementdef.deftype=floatdef) and
+                  (tarraydef(p).elementdef.typ=floatdef) and
                   (
                   (
                    (tarraydef(p).lowrange=0) and
                    (tarraydef(p).lowrange=0) and
                    (tarraydef(p).highrange=1) and
                    (tarraydef(p).highrange=1) and
-                   (tfloatdef(tarraydef(p).elementdef).typ=s32real)
+                   (tfloatdef(tarraydef(p).elementdef).floattype=s32real)
                   )
                   )
                  )
                  )
                 );
                 );
@@ -932,7 +928,7 @@ implementation
 
 
     function def_cgsize(def: tdef): tcgsize;
     function def_cgsize(def: tdef): tcgsize;
       begin
       begin
-        case def.deftype of
+        case def.typ of
           orddef,
           orddef,
           enumdef,
           enumdef,
           setdef:
           setdef:
@@ -970,7 +966,7 @@ implementation
             if cs_fp_emulation in current_settings.moduleswitches then
             if cs_fp_emulation in current_settings.moduleswitches then
               result:=int_cgsize(def.size)
               result:=int_cgsize(def.size)
             else
             else
-              result:=tfloat2tcgsize[tfloatdef(def).typ];
+              result:=tfloat2tcgsize[tfloatdef(def).floattype];
           recorddef :
           recorddef :
             result:=int_cgsize(def.size);
             result:=int_cgsize(def.size);
           arraydef :
           arraydef :
@@ -997,13 +993,13 @@ implementation
     function is_automatable(p : tdef) : boolean;
     function is_automatable(p : tdef) : boolean;
       begin
       begin
         result:=false;
         result:=false;
-        case p.deftype of
+        case p.typ of
           orddef:
           orddef:
-            result:=torddef(p).typ in [u8bit,s32bit,s16bit,bool16bit];
+            result:=torddef(p).ordtype in [u8bit,s32bit,s16bit,bool16bit];
           floatdef:
           floatdef:
-            result:=tfloatdef(p).typ in [s64currency,s64real,s32real];
+            result:=tfloatdef(p).floattype in [s64currency,s64real,s32real];
           stringdef:
           stringdef:
-            result:=tstringdef(p).string_typ in [st_ansistring,st_widestring];
+            result:=tstringdef(p).stringtype in [st_ansistring,st_widestring];
           variantdef:
           variantdef:
             result:=true;
             result:=true;
         end;
         end;
@@ -1013,7 +1009,7 @@ implementation
     {# returns true, if the type passed is a varset }
     {# returns true, if the type passed is a varset }
     function is_varset(p : tdef) : boolean;
     function is_varset(p : tdef) : boolean;
       begin
       begin
-        result:=(p.deftype=setdef) and not(p.size=4) and not(p.size=32);
+        result:=(p.typ=setdef) and not(p.size=4) and not(p.size=32);
       end;
       end;
 
 
 
 

+ 1 - 1
compiler/finput.pas

@@ -56,7 +56,7 @@ interface
          linebuf    : plongintarr;  { line buffer to retrieve lines }
          linebuf    : plongintarr;  { line buffer to retrieve lines }
          maxlinebuf : longint;
          maxlinebuf : longint;
 
 
-         ref_index  : longint;      { to handle the browser refs }
+         ref_index  : longint;
          ref_next   : tinputfile;
          ref_next   : tinputfile;
 
 
          constructor create(const fn:string);
          constructor create(const fn:string);

+ 2 - 2
compiler/fmodule.pas

@@ -126,9 +126,9 @@ interface
         deflist,
         deflist,
         symlist       : TFPObjectList;
         symlist       : TFPObjectList;
         globalsymtable,           { pointer to the global symtable of this unit }
         globalsymtable,           { pointer to the global symtable of this unit }
-        localsymtable : tsymtable;{ pointer to the local symtable of this unit }
+        localsymtable : TSymtable;{ pointer to the local symtable of this unit }
         globalmacrosymtable,           { pointer to the global macro symtable of this unit }
         globalmacrosymtable,           { pointer to the global macro symtable of this unit }
-        localmacrosymtable : tsymtable;{ pointer to the local macro symtable of this unit }
+        localmacrosymtable : TSymtable;{ pointer to the local macro symtable of this unit }
         scanner       : TObject;  { scanner object used }
         scanner       : TObject;  { scanner object used }
         procinfo      : TObject;  { current procedure being compiled }
         procinfo      : TObject;  { current procedure being compiled }
         asmdata       : TObject;  { Assembler data }
         asmdata       : TObject;  { Assembler data }

+ 6 - 57
compiler/fppu.pas

@@ -62,7 +62,6 @@ interface
           function  search_unit(onlysource,shortname:boolean):boolean;
           function  search_unit(onlysource,shortname:boolean):boolean;
           procedure load_interface;
           procedure load_interface;
           procedure load_implementation;
           procedure load_implementation;
-          procedure load_symtable_refs;
           procedure load_usedunits;
           procedure load_usedunits;
           procedure printcomments;
           procedure printcomments;
           procedure queuecomment(s:string;v,w:longint);
           procedure queuecomment(s:string;v,w:longint);
@@ -86,7 +85,7 @@ interface
        end;
        end;
 
 
     procedure reload_flagged_units;
     procedure reload_flagged_units;
-    function registerunit(callermodule:tmodule;const s : stringid;const fn:string) : tppumodule;
+    function registerunit(callermodule:tmodule;const s : TIDString;const fn:string) : tppumodule;
 
 
 
 
 implementation
 implementation
@@ -659,7 +658,7 @@ uses
            hs:=ppufile.getstring;
            hs:=ppufile.getstring;
            was_initial:=boolean(ppufile.getbyte);
            was_initial:=boolean(ppufile.getbyte);
            was_used:=boolean(ppufile.getbyte);
            was_used:=boolean(ppufile.getbyte);
-           mac:=tmacro(initialmacrosymtable.search(hs));
+           mac:=tmacro(initialmacrosymtable.Find(hs));
            if assigned(mac) then
            if assigned(mac) then
              begin
              begin
 {$ifndef EXTDEBUG}
 {$ifndef EXTDEBUG}
@@ -958,25 +957,6 @@ uses
       end;
       end;
 
 
 
 
-    procedure tppumodule.load_symtable_refs;
-      var
-         b : byte;
-         i : longint;
-      begin
-        if (flags and uf_has_browser)<>0 then
-          begin
-            tstoredsymtable(globalsymtable).load_references(ppufile,true);
-            for i:=0 to unitmapsize-1 do
-              tstoredsymtable(globalsymtable).load_references(ppufile,false);
-            b:=ppufile.readentry;
-            if b<>ibendbrowser then
-             Message1(unit_f_ppu_invalid_entry,tostr(b));
-          end;
-        if ((flags and uf_local_browser)<>0) then
-          tstaticsymtable(localsymtable).load_references(ppufile,true);
-      end;
-
-
     procedure tppumodule.writeppu;
     procedure tppumodule.writeppu;
       var
       var
         pu : tused_unit;
         pu : tused_unit;
@@ -984,10 +964,6 @@ uses
          Message1(unit_u_ppu_write,realmodulename^);
          Message1(unit_u_ppu_write,realmodulename^);
 
 
          { create unit flags }
          { create unit flags }
-         if cs_browser in current_settings.moduleswitches then
-          flags:=flags or uf_has_browser;
-         if cs_local_browser in current_settings.moduleswitches then
-          flags:=flags or uf_local_browser;
          if do_release then
          if do_release then
           flags:=flags or uf_release;
           flags:=flags or uf_release;
          if assigned(localsymtable) then
          if assigned(localsymtable) then
@@ -1053,7 +1029,7 @@ uses
          { write the symtable entries }
          { write the symtable entries }
          tstoredsymtable(globalsymtable).ppuwrite(ppufile);
          tstoredsymtable(globalsymtable).ppuwrite(ppufile);
 
 
-         if assigned(globalmacrosymtable) and (globalmacrosymtable.symindex.count > 0) then
+         if assigned(globalmacrosymtable) and (globalmacrosymtable.SymList.count > 0) then
            begin
            begin
              ppufile.putbyte(byte(true));
              ppufile.putbyte(byte(true));
              ppufile.writeentry(ibexportedmacros);
              ppufile.writeentry(ibexportedmacros);
@@ -1079,25 +1055,6 @@ uses
          if (flags and uf_local_symtable)<>0 then
          if (flags and uf_local_symtable)<>0 then
            tstoredsymtable(localsymtable).ppuwrite(ppufile);
            tstoredsymtable(localsymtable).ppuwrite(ppufile);
 
 
-         { write all browser section }
-         if (flags and uf_has_browser)<>0 then
-          begin
-            tstoredsymtable(globalsymtable).write_references(ppufile,true);
-            pu:=tused_unit(used_units.first);
-            while assigned(pu) do
-             begin
-               tstoredsymtable(pu.u.globalsymtable).write_references(ppufile,false);
-               pu:=tused_unit(pu.next);
-             end;
-            ppufile.writeentry(ibendbrowser);
-          end;
-         if ((flags and uf_local_browser)<>0) then
-           begin
-             if not assigned(localsymtable) then
-               internalerror(200408271);
-             tstaticsymtable(localsymtable).write_references(ppufile,true);
-           end;
-
          { the last entry ibend is written automaticly }
          { the last entry ibend is written automaticly }
 
 
          { flush to be sure }
          { flush to be sure }
@@ -1160,7 +1117,7 @@ uses
          { write the symtable entries }
          { write the symtable entries }
          tstoredsymtable(globalsymtable).ppuwrite(ppufile);
          tstoredsymtable(globalsymtable).ppuwrite(ppufile);
 
 
-         if assigned(globalmacrosymtable) and (globalmacrosymtable.symindex.count > 0) then
+         if assigned(globalmacrosymtable) and (globalmacrosymtable.SymList.count > 0) then
            begin
            begin
              ppufile.putbyte(byte(true));
              ppufile.putbyte(byte(true));
              ppufile.writeentry(ibexportedmacros);
              ppufile.writeentry(ibexportedmacros);
@@ -1308,14 +1265,6 @@ uses
         tstoredsymtable(globalsymtable).derefimpl;
         tstoredsymtable(globalsymtable).derefimpl;
         if assigned(localsymtable) then
         if assigned(localsymtable) then
           tstoredsymtable(localsymtable).derefimpl;
           tstoredsymtable(localsymtable).derefimpl;
-
-        { load browser info if stored }
-        if ((flags and uf_has_browser)<>0) and load_refs then
-         begin
-           if current_module<>self then
-            internalerror(200208188);
-           load_symtable_refs;
-         end;
       end;
       end;
 
 
 
 
@@ -1544,9 +1493,9 @@ uses
 *****************************************************************************}
 *****************************************************************************}
 
 
 
 
-    function registerunit(callermodule:tmodule;const s : stringid;const fn:string) : tppumodule;
+    function registerunit(callermodule:tmodule;const s : TIDString;const fn:string) : tppumodule;
       var
       var
-        ups   : stringid;
+        ups   : TIDString;
         hp    : tppumodule;
         hp    : tppumodule;
         hp2   : tmodule;
         hp2   : tmodule;
       begin
       begin

+ 184 - 16
compiler/globals.pas

@@ -137,6 +137,37 @@ interface
          maxfpuregisters : shortint;
          maxfpuregisters : shortint;
        end;
        end;
 
 
+    const
+      LinkMapWeightDefault = 1000;
+
+    type
+      TLinkRec = record
+        Key   : AnsiString;
+        Value : AnsiString; // key expands to valuelist "value"
+        Weight: longint;
+      end;
+
+      TLinkStrMap  = class
+      private
+        itemcnt : longint;
+        fmap : Array Of TLinkRec;
+        function  Lookup(key:Ansistring):longint;
+        function getlinkrec(i:longint):TLinkRec;
+      public
+        procedure Add(key:ansistring;value:AnsiString='';weight:longint=LinkMapWeightDefault);
+        procedure addseries(keys:AnsiString;weight:longint=LinkMapWeightDefault);
+        function  AddDep(keyvalue:String):boolean;
+        function  AddWeight(keyvalue:String):boolean;
+        procedure SetValue(key:AnsiString;Weight:Integer);
+        procedure SortonWeight;
+        function Find(key:AnsiString):AnsiString;
+        procedure Expand(src:TStringList;dest: TLinkStrMap);
+        procedure UpdateWeights(Weightmap:TLinkStrMap);
+        constructor Create;
+        property count : longint read itemcnt;
+        property items[I:longint]:TLinkRec read getlinkrec; default;
+      end;
+
     var
     var
        { specified inputfile }
        { specified inputfile }
        inputfilepath     : string;
        inputfilepath     : string;
@@ -285,9 +316,6 @@ interface
        { actual values are defined in ncgutil.pas }
        { actual values are defined in ncgutil.pas }
        nroftrashvalues = 4;
        nroftrashvalues = 4;
 
 
-    procedure abstract;
-
-    function bstoslash(const s : string) : string;
 
 
     function getdatestr:string;
     function getdatestr:string;
     function gettimestr:string;
     function gettimestr:string;
@@ -331,25 +359,165 @@ implementation
 {$endif}
 {$endif}
       comphook;
       comphook;
 
 
-    procedure abstract;
+{****************************************************************************
+                                 TLinkStrMap
+****************************************************************************}
+
+    Constructor TLinkStrMap.create;
       begin
       begin
-        do_internalerror(255);
+        inherited;
+        itemcnt:=0;
       end;
       end;
 
 
 
 
-    function bstoslash(const s : string) : string;
-    {
-      return string s with all \ changed into /
-    }
+    procedure TLinkStrMap.Add(key:ansistring;value:AnsiString='';weight:longint=LinkMapWeightDefault);
+      begin
+        if lookup(key)<>-1 Then
+          exit;
+        if itemcnt<=length(fmap) Then
+          setlength(fmap,itemcnt+10);
+        fmap[itemcnt].key:=key;
+        fmap[itemcnt].value:=value;
+        fmap[itemcnt].weight:=weight;
+        inc(itemcnt);
+      end;
+
+
+    function  TLinkStrMap.AddDep(keyvalue:String):boolean;
       var
       var
-         i : longint;
+        i : Longint;
       begin
       begin
-        for i:=1to length(s) do
-         if s[i]='\' then
-          bstoslash[i]:='/'
-         else
-          bstoslash[i]:=s[i];
-         bstoslash[0]:=s[0];
+        AddDep:=false;
+        i:=pos('=',keyvalue);
+        if i=0 then
+          exit;
+        Add(Copy(KeyValue,1,i-1),Copy(KeyValue,i+1,length(KeyValue)-i));
+        AddDep:=True;
+      end;
+
+
+    function  TLinkStrMap.AddWeight(keyvalue:String):boolean;
+      var
+        i,j    : Longint;
+        Code : Word;
+        s    : AnsiString;
+      begin
+        AddWeight:=false;
+        i:=pos('=',keyvalue);
+        if i=0 then
+          exit;
+        s:=Copy(KeyValue,i+1,length(KeyValue)-i);
+        val(s,j,code);
+        if code=0 Then
+          begin
+            Add(Copy(KeyValue,1,i-1),'',j);
+            AddWeight:=True;
+          end;
+      end;
+
+
+    procedure TLinkStrMap.addseries(keys:AnsiString;weight:longint);
+      var
+        i,j,k : longint;
+      begin
+       k:=length(keys);
+       i:=1;
+       while i<=k do
+         begin
+           j:=i;
+           while (i<=k) and (keys[i]<>',') do
+             inc(i);
+           add(copy(keys,j,i-j),'',weight);
+           inc(i);
+         end;
+      end;
+
+    procedure TLinkStrMap.SetValue(Key:Ansistring;weight:Integer);
+      var
+        j : longint;
+      begin
+         j:=lookup(key);
+         if j<>-1 then
+          fmap[j].weight:=weight;
+      end;
+
+
+    function TLinkStrMap.find(key:Ansistring):Ansistring;
+      var
+        j : longint;
+      begin
+         find:='';
+         j:=lookup(key);
+         if j<>-1 then
+          find:=fmap[j].value;
+      end;
+
+
+    function TLinkStrMap.lookup(key:Ansistring):longint;
+      var
+        i : longint;
+      begin
+         lookup:=-1;
+         i:=0;
+         while (i<itemcnt) and (fmap[i].key<>key) do
+           inc(i);
+         if i<>itemcnt then
+            lookup:=i;
+      end;
+
+
+    procedure TLinkStrMap.SortOnWeight;
+      var
+        i, j : longint;
+        m    : TLinkRec;
+      begin
+        if itemcnt <2 then exit;
+        for i:=0 to itemcnt-1 do
+          for j:=i+1 to itemcnt-1 do
+            begin
+            if fmap[i].weight>fmap[j].weight Then
+              begin
+                m:=fmap[i];
+                fmap[i]:=fmap[j];
+                fmap[j]:=m;
+              end;
+           end;
+      end;
+
+
+    function TLinkStrMap.getlinkrec(i:longint):TLinkRec;
+      begin
+        result:=fmap[i];
+      end;
+
+
+    procedure TLinkStrMap.Expand(Src:TStringList;Dest:TLinkStrMap);
+      // expands every thing in Src to Dest for linkorder purposes.
+      var
+        l,r  : longint;
+        LibN    : String;
+      begin
+        while not src.empty do
+          begin
+            LibN:=src.getfirst;
+            r:=lookup (LibN);
+            if r=-1 then
+              dest.add(LibN)
+            else
+              dest.addseries(fmap[r].value);
+          end;
+      end;
+
+    procedure TLinkStrMap.UpdateWeights(Weightmap:TLinkStrMap);
+      var
+        l,r : longint;
+      begin
+        for l := 0 to itemcnt-1 do
+          begin
+            r:=weightmap.lookup (fmap[l].key);
+            if r<>-1 then
+              fmap[l].weight:=weightmap[r].weight;
+          end;
       end;
       end;
 
 
 
 

+ 2 - 4
compiler/globtype.pas

@@ -104,7 +104,7 @@ interface
          cs_support_goto,cs_support_macro,
          cs_support_goto,cs_support_macro,
          cs_support_c_operators,cs_static_keyword,
          cs_support_c_operators,cs_static_keyword,
          { generation }
          { generation }
-         cs_profile,cs_debuginfo,cs_browser,cs_local_browser,cs_compilesystem,
+         cs_profile,cs_debuginfo,cs_compilesystem,
          cs_lineinfo,cs_implicit_exceptions,
          cs_lineinfo,cs_implicit_exceptions,
          { linking }
          { linking }
          cs_create_smart,cs_create_dynamic,cs_create_pic
          cs_create_smart,cs_create_dynamic,cs_create_pic
@@ -121,8 +121,6 @@ interface
          cs_load_gpc_unit,
          cs_load_gpc_unit,
          cs_load_fpcylix_unit,
          cs_load_fpcylix_unit,
          cs_support_vectors,
          cs_support_vectors,
-         { browser }
-         cs_browser_log,
          { debuginfo }
          { debuginfo }
          cs_use_heaptrc,cs_use_lineinfo,
          cs_use_heaptrc,cs_use_lineinfo,
          cs_gdb_valgrind,cs_no_regalloc,
          cs_gdb_valgrind,cs_no_regalloc,
@@ -307,7 +305,7 @@ interface
        tprocinfoflags=set of tprocinfoflag;
        tprocinfoflags=set of tprocinfoflag;
 
 
     type
     type
-       stringid = string[maxidlen];
+       TIDString = string[maxidlen];
 
 
        tnormalset = set of byte; { 256 elements set }
        tnormalset = set of byte; { 256 elements set }
        pnormalset = ^tnormalset;
        pnormalset = ^tnormalset;

+ 66 - 64
compiler/htypechk.pas

@@ -65,7 +65,7 @@ interface
         FAllowVariant : boolean;
         FAllowVariant : boolean;
         function proc_add(pd:tprocdef):pcandidate;
         function proc_add(pd:tprocdef):pcandidate;
       public
       public
-        constructor create(sym:tprocsym;st:tsymtable;ppn:tnode;isprop,ignorevis : boolean);
+        constructor create(sym:tprocsym;st:TSymtable;ppn:tnode;isprop,ignorevis : boolean);
         constructor create_operator(op:ttoken;ppn:tnode);
         constructor create_operator(op:ttoken;ppn:tnode);
         destructor destroy;override;
         destructor destroy;override;
         procedure list(all:boolean);
         procedure list(all:boolean);
@@ -158,7 +158,7 @@ implementation
 
 
     uses
     uses
        globtype,systems,
        globtype,systems,
-       cutils,verbose,
+       cutils,cclasses,verbose,
        symtable,
        symtable,
        defutil,defcmp,
        defutil,defcmp,
        nbas,ncnv,nld,nmem,ncal,nmat,ninl,nutils,
        nbas,ncnv,nld,nmem,ncal,nmat,ninl,nutils,
@@ -189,7 +189,7 @@ implementation
         function internal_check(treetyp:tnodetype;ld:tdef;lt:tnodetype;rd:tdef;rt:tnodetype;var allowed:boolean):boolean;
         function internal_check(treetyp:tnodetype;ld:tdef;lt:tnodetype;rd:tdef;rt:tnodetype;var allowed:boolean):boolean;
         begin
         begin
           internal_check:=true;
           internal_check:=true;
-          case ld.deftype of
+          case ld.typ of
             formaldef,
             formaldef,
             recorddef,
             recorddef,
             variantdef :
             variantdef :
@@ -198,7 +198,7 @@ implementation
               end;
               end;
             procvardef :
             procvardef :
               begin
               begin
-                if (rd.deftype in [pointerdef,procdef,procvardef]) then
+                if (rd.typ in [pointerdef,procdef,procvardef]) then
                  begin
                  begin
                    allowed:=false;
                    allowed:=false;
                    exit;
                    exit;
@@ -207,7 +207,7 @@ implementation
               end;
               end;
             pointerdef :
             pointerdef :
               begin
               begin
-                if ((rd.deftype in [orddef,enumdef,pointerdef,classrefdef,procvardef]) or
+                if ((rd.typ in [orddef,enumdef,pointerdef,classrefdef,procvardef]) or
                     is_class_or_interface(rd)) then
                     is_class_or_interface(rd)) then
                  begin
                  begin
                    allowed:=false;
                    allowed:=false;
@@ -216,7 +216,7 @@ implementation
 
 
                 { don't allow pchar+string }
                 { don't allow pchar+string }
                 if (is_pchar(ld) or is_pwidechar(ld)) and
                 if (is_pchar(ld) or is_pwidechar(ld)) and
-                   ((rd.deftype=stringdef) or
+                   ((rd.typ=stringdef) or
                     is_pchar(rd) or
                     is_pchar(rd) or
                     is_pwidechar(rd) or
                     is_pwidechar(rd) or
                     is_chararray(rd) or
                     is_chararray(rd) or
@@ -242,7 +242,7 @@ implementation
                 if (is_chararray(ld) or is_widechararray(ld) or
                 if (is_chararray(ld) or is_widechararray(ld) or
                     is_open_chararray(ld) or is_open_widechararray(ld))
                     is_open_chararray(ld) or is_open_widechararray(ld))
                    and
                    and
-                   ((rd.deftype in [stringdef,orddef,enumdef]) or
+                   ((rd.typ in [stringdef,orddef,enumdef]) or
                     is_pchar(rd) or
                     is_pchar(rd) or
                     is_pwidechar(rd) or
                     is_pwidechar(rd) or
                     is_chararray(rd) or
                     is_chararray(rd) or
@@ -279,7 +279,7 @@ implementation
               end;
               end;
             stringdef :
             stringdef :
               begin
               begin
-                if (rd.deftype in [orddef,enumdef,stringdef]) or
+                if (rd.typ in [orddef,enumdef,stringdef]) or
                    is_pchar(rd) or
                    is_pchar(rd) or
                    is_pwidechar(rd) or
                    is_pwidechar(rd) or
                    is_chararray(rd) or
                    is_chararray(rd) or
@@ -322,7 +322,7 @@ implementation
           subn,
           subn,
           unaryminusn :
           unaryminusn :
             begin
             begin
-              if (ld.deftype in [orddef,enumdef,floatdef]) then
+              if (ld.typ in [orddef,enumdef,floatdef]) then
                 exit;
                 exit;
 
 
 {$ifdef SUPPORT_MMX}
 {$ifdef SUPPORT_MMX}
@@ -336,7 +336,7 @@ implementation
 
 
           notn :
           notn :
             begin
             begin
-              if (ld.deftype in [orddef,enumdef,floatdef]) then
+              if (ld.typ in [orddef,enumdef,floatdef]) then
                 exit;
                 exit;
 
 
 {$ifdef SUPPORT_MMX}
 {$ifdef SUPPORT_MMX}
@@ -360,9 +360,9 @@ implementation
         pd : tprocdef;
         pd : tprocdef;
       begin
       begin
         result:=false;
         result:=false;
-        case pf.parast.symindex.count of
+        case pf.parast.SymList.count of
           1 : begin
           1 : begin
-                ld:=tparavarsym(pf.parast.symindex.first).vardef;
+                ld:=tparavarsym(pf.parast.SymList[0]).vardef;
                 { assignment is a special case }
                 { assignment is a special case }
                 if optoken=_ASSIGNMENT then
                 if optoken=_ASSIGNMENT then
                   begin
                   begin
@@ -385,8 +385,8 @@ implementation
                 for i:=1 to tok2nodes do
                 for i:=1 to tok2nodes do
                   if tok2node[i].tok=optoken then
                   if tok2node[i].tok=optoken then
                     begin
                     begin
-                      ld:=tparavarsym(pf.parast.symindex.first).vardef;
-                      rd:=tparavarsym(pf.parast.symindex.first.indexnext).vardef;
+                      ld:=tparavarsym(pf.parast.SymList[0]).vardef;
+                      rd:=tparavarsym(pf.parast.SymList[1]).vardef;
                       result:=
                       result:=
                         tok2node[i].op_overloading_supported and
                         tok2node[i].op_overloading_supported and
                         isbinaryoperatoroverloadable(tok2node[i].nod,ld,nothingn,rd,nothingn);
                         isbinaryoperatoroverloadable(tok2node[i].nod,ld,nothingn,rd,nothingn);
@@ -650,7 +650,7 @@ implementation
              subscriptn:
              subscriptn:
                make_not_regable_intern(tsubscriptnode(p).left,how,true);
                make_not_regable_intern(tsubscriptnode(p).left,how,true);
             typeconvn :
             typeconvn :
-               if (ttypeconvnode(p).resultdef.deftype = recorddef) then
+               if (ttypeconvnode(p).resultdef.typ = recorddef) then
                  make_not_regable_intern(ttypeconvnode(p).left,how,false)
                  make_not_regable_intern(ttypeconvnode(p).left,how,false)
                else
                else
                  make_not_regable_intern(ttypeconvnode(p).left,how,records_only);
                  make_not_regable_intern(ttypeconvnode(p).left,how,records_only);
@@ -658,7 +658,7 @@ implementation
               if (tloadnode(p).symtableentry.typ in [globalvarsym,localvarsym,paravarsym]) and
               if (tloadnode(p).symtableentry.typ in [globalvarsym,localvarsym,paravarsym]) and
                  (tabstractvarsym(tloadnode(p).symtableentry).varregable <> vr_none) and
                  (tabstractvarsym(tloadnode(p).symtableentry).varregable <> vr_none) and
                  ((not records_only) or
                  ((not records_only) or
-                  (tabstractvarsym(tloadnode(p).symtableentry).vardef.deftype = recorddef)) then
+                  (tabstractvarsym(tloadnode(p).symtableentry).vardef.typ = recorddef)) then
                 if (tloadnode(p).symtableentry.typ = paravarsym) then
                 if (tloadnode(p).symtableentry.typ = paravarsym) then
                   tabstractvarsym(tloadnode(p).symtableentry).varregable:=how
                   tabstractvarsym(tloadnode(p).symtableentry).varregable:=how
                 else
                 else
@@ -666,7 +666,7 @@ implementation
             temprefn :
             temprefn :
               if (ttemprefnode(p).tempinfo^.may_be_in_reg) and
               if (ttemprefnode(p).tempinfo^.may_be_in_reg) and
                  ((not records_only) or
                  ((not records_only) or
-                  (ttemprefnode(p).tempinfo^.typedef.deftype = recorddef)) then
+                  (ttemprefnode(p).tempinfo^.typedef.typ = recorddef)) then
                 ttemprefnode(p).tempinfo^.may_be_in_reg:=false;
                 ttemprefnode(p).tempinfo^.may_be_in_reg:=false;
          end;
          end;
       end;
       end;
@@ -756,7 +756,7 @@ implementation
     procedure test_local_to_procvar(from_def:tprocvardef;to_def:tdef);
     procedure test_local_to_procvar(from_def:tprocvardef;to_def:tdef);
       begin
       begin
          if (from_def.parast.symtablelevel>normal_function_level) and
          if (from_def.parast.symtablelevel>normal_function_level) and
-            (to_def.deftype=procvardef) then
+            (to_def.typ=procvardef) then
            CGMessage(type_e_cannot_local_proc_to_procvar);
            CGMessage(type_e_cannot_local_proc_to_procvar);
       end;
       end;
 
 
@@ -807,7 +807,7 @@ implementation
                begin
                begin
                  set_varstate(tbinarynode(p).right,vs_read,[vsf_must_be_valid]);
                  set_varstate(tbinarynode(p).right,vs_read,[vsf_must_be_valid]);
                  if (newstate in [vs_read,vs_readwritten]) or
                  if (newstate in [vs_read,vs_readwritten]) or
-                    not(tunarynode(p).left.resultdef.deftype in [stringdef,arraydef]) then
+                    not(tunarynode(p).left.resultdef.typ in [stringdef,arraydef]) then
                    include(varstateflags,vsf_must_be_valid)
                    include(varstateflags,vsf_must_be_valid)
                  else if (newstate = vs_written) then
                  else if (newstate = vs_written) then
                    exclude(varstateflags,vsf_must_be_valid);
                    exclude(varstateflags,vsf_must_be_valid);
@@ -937,7 +937,7 @@ implementation
               if (hp.nodetype=calln) then
               if (hp.nodetype=calln) then
                 begin
                 begin
                   { check return type }
                   { check return type }
-                  case hp.resultdef.deftype of
+                  case hp.resultdef.typ of
                     pointerdef :
                     pointerdef :
                       gotpointer:=true;
                       gotpointer:=true;
                     objectdef :
                     objectdef :
@@ -1019,12 +1019,12 @@ implementation
                  fromdef:=ttypeconvnode(hp).left.resultdef;
                  fromdef:=ttypeconvnode(hp).left.resultdef;
                  todef:=hp.resultdef;
                  todef:=hp.resultdef;
                  if not((nf_absolute in ttypeconvnode(hp).flags) or
                  if not((nf_absolute in ttypeconvnode(hp).flags) or
-                        (fromdef.deftype=formaldef) or
+                        (fromdef.typ=formaldef) or
                         is_void(fromdef) or
                         is_void(fromdef) or
                         is_open_array(fromdef) or
                         is_open_array(fromdef) or
                         is_open_array(todef) or
                         is_open_array(todef) or
-                        ((fromdef.deftype=pointerdef) and (todef.deftype=arraydef)) or
-                        ((fromdef.deftype = objectdef) and (todef.deftype = objectdef) and
+                        ((fromdef.typ=pointerdef) and (todef.typ=arraydef)) or
+                        ((fromdef.typ = objectdef) and (todef.typ = objectdef) and
                          (tobjectdef(fromdef).is_related(tobjectdef(todef))))) and
                          (tobjectdef(fromdef).is_related(tobjectdef(todef))))) and
                     (fromdef.size<>todef.size) then
                     (fromdef.size<>todef.size) then
                   begin
                   begin
@@ -1045,7 +1045,7 @@ implementation
                        CGMessagePos(hp.fileinfo,errmsg);
                        CGMessagePos(hp.fileinfo,errmsg);
                      exit;
                      exit;
                    end;
                    end;
-                 case hp.resultdef.deftype of
+                 case hp.resultdef.typ of
                    pointerdef :
                    pointerdef :
                      gotpointer:=true;
                      gotpointer:=true;
                    objectdef :
                    objectdef :
@@ -1056,7 +1056,7 @@ implementation
                      begin
                      begin
                        { pointer -> array conversion is done then we need to see it
                        { pointer -> array conversion is done then we need to see it
                          as a deref, because a ^ is then not required anymore }
                          as a deref, because a ^ is then not required anymore }
-                       if (ttypeconvnode(hp).left.resultdef.deftype=pointerdef) then
+                       if (ttypeconvnode(hp).left.resultdef.typ=pointerdef) then
                         gotderef:=true;
                         gotderef:=true;
                      end;
                      end;
                  end;
                  end;
@@ -1067,7 +1067,7 @@ implementation
                  if { only check for first (= outermost) vec node }
                  if { only check for first (= outermost) vec node }
                     not gotvec and
                     not gotvec and
                     not(valid_packed in opts) and
                     not(valid_packed in opts) and
-                    (tvecnode(hp).left.resultdef.deftype = arraydef) and
+                    (tvecnode(hp).left.resultdef.typ = arraydef) and
                     (ado_IsBitPacked in tarraydef(tvecnode(hp).left.resultdef).arrayoptions) and
                     (ado_IsBitPacked in tarraydef(tvecnode(hp).left.resultdef).arrayoptions) and
                     (tarraydef(tvecnode(hp).left.resultdef).elepackedbitsize mod 8 <> 0) then
                     (tarraydef(tvecnode(hp).left.resultdef).elepackedbitsize mod 8 <> 0) then
                    begin
                    begin
@@ -1137,7 +1137,7 @@ implementation
                begin
                begin
                  { Allow operators on a pointer, or an integer
                  { Allow operators on a pointer, or an integer
                    and a pointer typecast and deref has been found }
                    and a pointer typecast and deref has been found }
-                 if ((hp.resultdef.deftype=pointerdef) or
+                 if ((hp.resultdef.typ=pointerdef) or
                      (is_integer(hp.resultdef) and gotpointer)) and
                      (is_integer(hp.resultdef) and gotpointer)) and
                     gotderef then
                     gotderef then
                   result:=true
                   result:=true
@@ -1147,7 +1147,7 @@ implementation
                    if (m_delphi in current_settings.modeswitches) and
                    if (m_delphi in current_settings.modeswitches) and
                       ((valid_addr in opts) or
                       ((valid_addr in opts) or
                        (valid_const in opts)) and
                        (valid_const in opts)) and
-                      (hp.resultdef.deftype=stringdef) then
+                      (hp.resultdef.typ=stringdef) then
                      result:=true
                      result:=true
                  else
                  else
                   if report_errors then
                   if report_errors then
@@ -1177,7 +1177,7 @@ implementation
              calln :
              calln :
                begin
                begin
                  { check return type }
                  { check return type }
-                 case hp.resultdef.deftype of
+                 case hp.resultdef.typ of
                    arraydef :
                    arraydef :
                      begin
                      begin
                        { dynamic arrays are allowed when there is also a
                        { dynamic arrays are allowed when there is also a
@@ -1211,7 +1211,7 @@ implementation
                    delphi only }
                    delphi only }
                    if (m_delphi in current_settings.modeswitches) and
                    if (m_delphi in current_settings.modeswitches) and
                       (valid_addr in opts) and
                       (valid_addr in opts) and
-                      (hp.resultdef.deftype=stringdef) then
+                      (hp.resultdef.typ=stringdef) then
                      result:=true
                      result:=true
                  else
                  else
                    if ([valid_const,valid_addr] * opts = [valid_const]) then
                    if ([valid_const,valid_addr] * opts = [valid_const]) then
@@ -1338,7 +1338,7 @@ implementation
 
 
     function  valid_for_formal_const(p : tnode; report_errors: boolean) : boolean;
     function  valid_for_formal_const(p : tnode; report_errors: boolean) : boolean;
       begin
       begin
-        valid_for_formal_const:=(p.resultdef.deftype=formaldef) or
+        valid_for_formal_const:=(p.resultdef.typ=formaldef) or
           valid_for_assign(p,[valid_void,valid_const],report_errors);
           valid_for_assign(p,[valid_void,valid_const],report_errors);
       end;
       end;
 
 
@@ -1364,7 +1364,7 @@ implementation
     procedure var_para_allowed(var eq:tequaltype;def_from,def_to:Tdef);
     procedure var_para_allowed(var eq:tequaltype;def_from,def_to:Tdef);
       begin
       begin
         { Note: eq must be already valid, it will only be updated! }
         { Note: eq must be already valid, it will only be updated! }
-        case def_to.deftype of
+        case def_to.typ of
           formaldef :
           formaldef :
             begin
             begin
               { all types can be passed to a formaldef,
               { all types can be passed to a formaldef,
@@ -1376,7 +1376,7 @@ implementation
               { allows conversion from word to integer and
               { allows conversion from word to integer and
                 byte to shortint, but only for TP7 compatibility }
                 byte to shortint, but only for TP7 compatibility }
               if (m_tp7 in current_settings.modeswitches) and
               if (m_tp7 in current_settings.modeswitches) and
-                 (def_from.deftype=orddef) and
+                 (def_from.typ=orddef) and
                  (def_from.size=def_to.size) then
                  (def_from.size=def_to.size) then
                 eq:=te_convert_l1;
                 eq:=te_convert_l1;
             end;
             end;
@@ -1395,7 +1395,7 @@ implementation
           pointerdef :
           pointerdef :
             begin
             begin
               { an implicit pointer conversion is allowed }
               { an implicit pointer conversion is allowed }
-              if (def_from.deftype=pointerdef) then
+              if (def_from.typ=pointerdef) then
                 eq:=te_convert_l1;
                 eq:=te_convert_l1;
             end;
             end;
           stringdef :
           stringdef :
@@ -1411,7 +1411,7 @@ implementation
               { in non-delphi mode, otherwise    }
               { in non-delphi mode, otherwise    }
               { they must match exactly, except  }
               { they must match exactly, except  }
               { if they are objects              }
               { if they are objects              }
-              if (def_from.deftype=objectdef) and
+              if (def_from.typ=objectdef) and
                  (
                  (
                   not(m_delphi in current_settings.modeswitches) or
                   not(m_delphi in current_settings.modeswitches) or
                   (
                   (
@@ -1426,7 +1426,7 @@ implementation
             begin
             begin
               { an implicit file conversion is also allowed }
               { an implicit file conversion is also allowed }
               { from a typed file to an untyped one           }
               { from a typed file to an untyped one           }
-              if (def_from.deftype=filedef) and
+              if (def_from.typ=filedef) and
                  (tfiledef(def_from).filetyp = ft_typed) and
                  (tfiledef(def_from).filetyp = ft_typed) and
                  (tfiledef(def_to).filetyp = ft_untyped) then
                  (tfiledef(def_to).filetyp = ft_untyped) then
                 eq:=te_convert_l1;
                 eq:=te_convert_l1;
@@ -1438,7 +1438,7 @@ implementation
     procedure para_allowed(var eq:tequaltype;p:tcallparanode;def_to:tdef);
     procedure para_allowed(var eq:tequaltype;p:tcallparanode;def_to:tdef);
       begin
       begin
         { Note: eq must be already valid, it will only be updated! }
         { Note: eq must be already valid, it will only be updated! }
-        case def_to.deftype of
+        case def_to.typ of
           formaldef :
           formaldef :
             begin
             begin
               { all types can be passed to a formaldef }
               { all types can be passed to a formaldef }
@@ -1449,8 +1449,8 @@ implementation
               { to support ansi/long/wide strings in a proper way }
               { to support ansi/long/wide strings in a proper way }
               { string and string[10] are assumed as equal }
               { string and string[10] are assumed as equal }
               { when searching the correct overloaded procedure   }
               { when searching the correct overloaded procedure   }
-              if (p.resultdef.deftype=stringdef) and
-                 (tstringdef(def_to).string_typ=tstringdef(p.resultdef).string_typ) then
+              if (p.resultdef.typ=stringdef) and
+                 (tstringdef(def_to).stringtype=tstringdef(p.resultdef).stringtype) then
                 eq:=te_equal
                 eq:=te_equal
               else
               else
               { Passing a constant char to ansistring or shortstring or
               { Passing a constant char to ansistring or shortstring or
@@ -1469,7 +1469,7 @@ implementation
           setdef :
           setdef :
             begin
             begin
               { set can also be a not yet converted array constructor }
               { set can also be a not yet converted array constructor }
-              if (p.resultdef.deftype=arraydef) and
+              if (p.resultdef.typ=arraydef) and
                  is_array_constructor(p.resultdef) and
                  is_array_constructor(p.resultdef) and
                  not is_variant_array(p.resultdef) then
                  not is_variant_array(p.resultdef) then
                 eq:=te_equal;
                 eq:=te_equal;
@@ -1503,7 +1503,7 @@ implementation
                            TCallCandidates
                            TCallCandidates
 ****************************************************************************}
 ****************************************************************************}
 
 
-    constructor tcallcandidates.create(sym:tprocsym;st:tsymtable;ppn:tnode;isprop,ignorevis : boolean);
+    constructor tcallcandidates.create(sym:tprocsym;st:TSymtable;ppn:tnode;isprop,ignorevis : boolean);
       var
       var
         j          : integer;
         j          : integer;
         pd         : tprocdef;
         pd         : tprocdef;
@@ -1511,10 +1511,11 @@ implementation
         found,
         found,
         has_overload_directive : boolean;
         has_overload_directive : boolean;
         topclassh  : tobjectdef;
         topclassh  : tobjectdef;
-        srsymtable : tsymtable;
+        srsymtable : TSymtable;
         srprocsym  : tprocsym;
         srprocsym  : tprocsym;
         pt         : tcallparanode;
         pt         : tcallparanode;
         checkstack : psymtablestackitem;
         checkstack : psymtablestackitem;
+        hashedid   : THashedIDString;
       begin
       begin
         if not assigned(sym) then
         if not assigned(sym) then
           internalerror(200411015);
           internalerror(200411015);
@@ -1539,7 +1540,7 @@ implementation
           overloaded definitions in the class, this only needs to be done once
           overloaded definitions in the class, this only needs to be done once
           for class entries as the tree keeps always the same }
           for class entries as the tree keeps always the same }
         if (not sym.overloadchecked) and
         if (not sym.overloadchecked) and
-           (sym.owner.symtabletype=objectsymtable) and
+           (sym.owner.symtabletype=ObjectSymtable) and
            (po_overload in sym.first_procdef.procoptions) then
            (po_overload in sym.first_procdef.procoptions) then
          search_class_overloads(sym);
          search_class_overloads(sym);
 
 
@@ -1549,9 +1550,9 @@ implementation
           units. At least kylix supports it this way (PFV) }
           units. At least kylix supports it this way (PFV) }
         if assigned(st) and
         if assigned(st) and
            (
            (
-            (st.symtabletype=objectsymtable) or
+            (st.symtabletype=ObjectSymtable) or
             ((st.symtabletype=withsymtable) and
             ((st.symtabletype=withsymtable) and
-             (st.defowner.deftype=objectdef))
+             (st.defowner.typ=objectdef))
            ) and
            ) and
            (st.defowner.owner.symtabletype in [globalsymtable,staticsymtable]) and
            (st.defowner.owner.symtabletype in [globalsymtable,staticsymtable]) and
            st.defowner.owner.iscurrentunit then
            st.defowner.owner.iscurrentunit then
@@ -1576,7 +1577,7 @@ implementation
               inherited overrides invisible anonymous inherited (FK) }
               inherited overrides invisible anonymous inherited (FK) }
 
 
             if isprop or ignorevis or
             if isprop or ignorevis or
-               (pd.owner.symtabletype<>objectsymtable) or
+               (pd.owner.symtabletype<>ObjectSymtable) or
                pd.is_visible_for_object(topclassh,nil) then
                pd.is_visible_for_object(topclassh,nil) then
              begin
              begin
                { we have at least one procedure that is visible }
                { we have at least one procedure that is visible }
@@ -1599,7 +1600,7 @@ implementation
           entries are only added to the procs list and not the procsym, because
           entries are only added to the procs list and not the procsym, because
           the list can change in every situation }
           the list can change in every situation }
         if has_overload_directive and
         if has_overload_directive and
-           (sym.owner.symtabletype<>objectsymtable) then
+           (sym.owner.symtabletype<>ObjectSymtable) then
           begin
           begin
             srsymtable:=sym.owner;
             srsymtable:=sym.owner;
             checkstack:=symtablestack.stack;
             checkstack:=symtablestack.stack;
@@ -1610,12 +1611,13 @@ implementation
               the next symtable in the stack }
               the next symtable in the stack }
             if assigned(checkstack) then
             if assigned(checkstack) then
               checkstack:=checkstack^.next;
               checkstack:=checkstack^.next;
+            hashedid.id:=sym.name;
             while assigned(checkstack) do
             while assigned(checkstack) do
              begin
              begin
                srsymtable:=checkstack^.symtable;
                srsymtable:=checkstack^.symtable;
                if srsymtable.symtabletype in [localsymtable,staticsymtable,globalsymtable] then
                if srsymtable.symtabletype in [localsymtable,staticsymtable,globalsymtable] then
                 begin
                 begin
-                  srprocsym:=tprocsym(srsymtable.speedsearch(sym.name,sym.speedvalue));
+                  srprocsym:=tprocsym(srsymtable.FindWithHash(hashedid));
                   if assigned(srprocsym) and
                   if assigned(srprocsym) and
                      (srprocsym.typ=procsym) then
                      (srprocsym.typ=procsym) then
                    begin
                    begin
@@ -1668,11 +1670,11 @@ implementation
         pd         : tprocdef;
         pd         : tprocdef;
         hp         : pcandidate;
         hp         : pcandidate;
         found      : boolean;
         found      : boolean;
-        srsymtable : tsymtable;
+        srsymtable : TSymtable;
         srprocsym  : tprocsym;
         srprocsym  : tprocsym;
         pt         : tcallparanode;
         pt         : tcallparanode;
-        sv         : cardinal;
         checkstack : psymtablestackitem;
         checkstack : psymtablestackitem;
+        hashedid   : THashedIDString;
       begin
       begin
         FProcSym:=nil;
         FProcSym:=nil;
         FProcs:=nil;
         FProcs:=nil;
@@ -1686,7 +1688,7 @@ implementation
         FParalength:=0;
         FParalength:=0;
         while assigned(pt) do
         while assigned(pt) do
          begin
          begin
-           if pt.resultdef.deftype=variantdef then
+           if pt.resultdef.typ=variantdef then
              FAllowVariant:=true;
              FAllowVariant:=true;
            inc(FParalength);
            inc(FParalength);
            pt:=tcallparanode(pt.right);
            pt:=tcallparanode(pt.right);
@@ -1695,14 +1697,14 @@ implementation
         { we search all overloaded operator definitions in the symtablestack. The found
         { we search all overloaded operator definitions in the symtablestack. The found
           entries are only added to the procs list and not the procsym, because
           entries are only added to the procs list and not the procsym, because
           the list can change in every situation }
           the list can change in every situation }
-        sv:=getspeedvalue(overloaded_names[op]);
+        hashedid.id:=overloaded_names[op];
         checkstack:=symtablestack.stack;
         checkstack:=symtablestack.stack;
         while assigned(checkstack) do
         while assigned(checkstack) do
           begin
           begin
             srsymtable:=checkstack^.symtable;
             srsymtable:=checkstack^.symtable;
             if srsymtable.symtabletype in [localsymtable,staticsymtable,globalsymtable] then
             if srsymtable.symtabletype in [localsymtable,staticsymtable,globalsymtable] then
               begin
               begin
-                srprocsym:=tprocsym(srsymtable.speedsearch(overloaded_names[op],sv));
+                srprocsym:=tprocsym(srsymtable.FindWithHash(hashedid));
                 if assigned(srprocsym) and
                 if assigned(srprocsym) and
                    (srprocsym.typ=procsym) then
                    (srprocsym.typ=procsym) then
                   begin
                   begin
@@ -1909,8 +1911,8 @@ implementation
                internalerror(200212092);
                internalerror(200212092);
 
 
               { Convert tp procvars when not expecting a procvar }
               { Convert tp procvars when not expecting a procvar }
-              if (def_to.deftype<>procvardef) and
-                 (currpt.left.resultdef.deftype=procvardef) then
+              if (def_to.typ<>procvardef) and
+                 (currpt.left.resultdef.typ=procvardef) then
                 begin
                 begin
                   releasecurrpt:=true;
                   releasecurrpt:=true;
                   currpt:=tcallparanode(pt.getcopy);
                   currpt:=tcallparanode(pt.getcopy);
@@ -1925,11 +1927,11 @@ implementation
                returns a procdef we need to find the correct overloaded
                returns a procdef we need to find the correct overloaded
                procdef that matches the expected procvar. The loadnode
                procdef that matches the expected procvar. The loadnode
                temporary returned the first procdef (PFV) }
                temporary returned the first procdef (PFV) }
-             if (def_to.deftype=procvardef) and
+             if (def_to.typ=procvardef) and
                 (currpt.left.nodetype=loadn) and
                 (currpt.left.nodetype=loadn) and
-                (currpt.left.resultdef.deftype=procdef) then
+                (currpt.left.resultdef.typ=procdef) then
                begin
                begin
-                 pdtemp:=tprocsym(Tloadnode(currpt.left).symtableentry).search_procdef_byprocvardef(Tprocvardef(def_to));
+                 pdtemp:=tprocsym(Tloadnode(currpt.left).symtableentry).Find_procdef_byprocvardef(Tprocvardef(def_to));
                  if assigned(pdtemp) then
                  if assigned(pdtemp) then
                    begin
                    begin
                      tloadnode(currpt.left).setprocdef(pdtemp);
                      tloadnode(currpt.left).setprocdef(pdtemp);
@@ -1963,11 +1965,11 @@ implementation
                    eq:=te_equal;
                    eq:=te_equal;
                    hp^.ordinal_distance:=hp^.ordinal_distance+
                    hp^.ordinal_distance:=hp^.ordinal_distance+
                      abs(bestreal(torddef(def_from).low)-bestreal(torddef(def_to).low));
                      abs(bestreal(torddef(def_from).low)-bestreal(torddef(def_to).low));
-                   if (torddef(def_to).typ=u64bit) then
+                   if (torddef(def_to).ordtype=u64bit) then
                      rth:=bestreal(qword(torddef(def_to).high))
                      rth:=bestreal(qword(torddef(def_to).high))
                    else
                    else
                      rth:=bestreal(torddef(def_to).high);
                      rth:=bestreal(torddef(def_to).high);
-                   if (torddef(def_from).typ=u64bit) then
+                   if (torddef(def_from).ordtype=u64bit) then
                      rfh:=bestreal(qword(torddef(def_from).high))
                      rfh:=bestreal(qword(torddef(def_from).high))
                    else
                    else
                      rfh:=bestreal(torddef(def_from).high);
                      rfh:=bestreal(torddef(def_from).high);
@@ -2010,8 +2012,8 @@ implementation
               { related object parameters also need to determine the distance between the current
               { related object parameters also need to determine the distance between the current
                 object and the object we are comparing with. var and out parameters must match exactly }
                 object and the object we are comparing with. var and out parameters must match exactly }
                if not(currpara.varspez in [vs_var,vs_out]) and
                if not(currpara.varspez in [vs_var,vs_out]) and
-                  (def_from.deftype=objectdef) and
-                  (def_to.deftype=objectdef) and
+                  (def_from.typ=objectdef) and
+                  (def_to.typ=objectdef) and
                   (tobjectdef(def_from).objecttype=tobjectdef(def_to).objecttype) and
                   (tobjectdef(def_from).objecttype=tobjectdef(def_to).objecttype) and
                   tobjectdef(def_from).is_related(tobjectdef(def_to)) then
                   tobjectdef(def_from).is_related(tobjectdef(def_to)) then
                  begin
                  begin
@@ -2310,10 +2312,10 @@ implementation
         { if its not explicit, and only if the values are       }
         { if its not explicit, and only if the values are       }
         { ordinals, enumdef and floatdef                        }
         { ordinals, enumdef and floatdef                        }
         if assigned(destdef) and
         if assigned(destdef) and
-          (destdef.deftype in [enumdef,orddef,floatdef]) and
+          (destdef.typ in [enumdef,orddef,floatdef]) and
           not is_boolean(destdef) and
           not is_boolean(destdef) and
           assigned(source.resultdef) and
           assigned(source.resultdef) and
-          (source.resultdef.deftype in [enumdef,orddef,floatdef]) and
+          (source.resultdef.typ in [enumdef,orddef,floatdef]) and
           not is_boolean(source.resultdef) and
           not is_boolean(source.resultdef) and
           not is_constrealnode(source) then
           not is_constrealnode(source) then
          begin
          begin

+ 1 - 1
compiler/i386/cgcpu.pas

@@ -576,7 +576,7 @@ unit cgcpu;
            (procdef.procoptions*[po_classmethod, po_staticmethod,
            (procdef.procoptions*[po_classmethod, po_staticmethod,
              po_methodpointer, po_interrupt, po_iocheck]<>[]) then
              po_methodpointer, po_interrupt, po_iocheck]<>[]) then
           Internalerror(200006138);
           Internalerror(200006138);
-        if procdef.owner.symtabletype<>objectsymtable then
+        if procdef.owner.symtabletype<>ObjectSymtable then
           Internalerror(200109191);
           Internalerror(200109191);
 
 
         make_global:=false;
         make_global:=false;

+ 6 - 6
compiler/i386/cpupara.pas

@@ -105,7 +105,7 @@ unit cpupara;
                   exit;
                   exit;
                 end
                 end
               else
               else
-                case def.deftype of
+                case def.typ of
                   recorddef :
                   recorddef :
                     begin
                     begin
                       { Win32 GCC returns small records in the FUNCTION_RETURN_REG.
                       { Win32 GCC returns small records in the FUNCTION_RETURN_REG.
@@ -122,7 +122,7 @@ unit cpupara;
             end;
             end;
           system_i386_darwin :
           system_i386_darwin :
             begin
             begin
-              case def.deftype of
+              case def.typ of
                 recorddef :
                 recorddef :
                   begin
                   begin
                     size := def.size;
                     size := def.size;
@@ -152,7 +152,7 @@ unit cpupara;
             exit;
             exit;
           end;
           end;
         { Only vs_const, vs_value here }
         { Only vs_const, vs_value here }
-        case def.deftype of
+        case def.typ of
           variantdef :
           variantdef :
             begin
             begin
               { variants are small enough to be passed by value except if
               { variants are small enough to be passed by value except if
@@ -216,7 +216,7 @@ unit cpupara;
           objectdef :
           objectdef :
             result:=is_object(def);
             result:=is_object(def);
           stringdef :
           stringdef :
-            result:= (tstringdef(def).string_typ in [st_shortstring,st_longstring]);
+            result:= (tstringdef(def).stringtype in [st_shortstring,st_longstring]);
           procvardef :
           procvardef :
             result:=not(calloption in [pocall_cdecl,pocall_cppdecl]) and (po_methodpointer in tprocvardef(def).procoptions);
             result:=not(calloption in [pocall_cdecl,pocall_cppdecl]) and (po_methodpointer in tprocvardef(def).procoptions);
           setdef :
           setdef :
@@ -329,7 +329,7 @@ unit cpupara;
             exit;
             exit;
           end;
           end;
         { Return in FPU register? }
         { Return in FPU register? }
-        if p.returndef.deftype=floatdef then
+        if p.returndef.typ=floatdef then
           begin
           begin
             p.funcretloc[side].loc:=LOC_FPUREGISTER;
             p.funcretloc[side].loc:=LOC_FPUREGISTER;
             p.funcretloc[side].register:=NR_FPU_RESULT_REG;
             p.funcretloc[side].register:=NR_FPU_RESULT_REG;
@@ -537,7 +537,7 @@ unit cpupara;
             if (parareg<=high(parasupregs)) and
             if (parareg<=high(parasupregs)) and
                (paralen<=sizeof(aint)) and
                (paralen<=sizeof(aint)) and
                (
                (
-                not(hp.vardef.deftype in [floatdef,recorddef,arraydef]) or
+                not(hp.vardef.typ in [floatdef,recorddef,arraydef]) or
                 pushaddr
                 pushaddr
                ) then
                ) then
               begin
               begin

+ 3 - 3
compiler/i386/daopt386.pas

@@ -300,7 +300,7 @@ var
               (TSearchDoubleIntItem(p).int2 = int2);
               (TSearchDoubleIntItem(p).int2 = int2);
   end;
   end;
 
 
-  function TSearchLinkedList.searchByValue(p: PSearchLinkedListItem): boolean;
+  function TSearchLinkedList.FindByValue(p: PSearchLinkedListItem): boolean;
   var temp: PSearchLinkedListItem;
   var temp: PSearchLinkedListItem;
   begin
   begin
     temp := first;
     temp := first;
@@ -403,7 +403,7 @@ procedure RemoveLastDeallocForFuncRes(asml: TAsmList; p: tai);
   end;
   end;
 
 
 begin
 begin
-    case current_procinfo.procdef.returndef.deftype of
+    case current_procinfo.procdef.returndef.typ of
       arraydef,recorddef,pointerdef,
       arraydef,recorddef,pointerdef,
          stringdef,enumdef,procdef,objectdef,errordef,
          stringdef,enumdef,procdef,objectdef,errordef,
          filedef,setdef,procvardef,
          filedef,setdef,procvardef,
@@ -425,7 +425,7 @@ var
   regCounter: TSuperRegister;
   regCounter: TSuperRegister;
 begin
 begin
   regs := [];
   regs := [];
-  case current_procinfo.procdef.returndef.deftype of
+  case current_procinfo.procdef.returndef.typ of
     arraydef,recorddef,pointerdef,
     arraydef,recorddef,pointerdef,
        stringdef,enumdef,procdef,objectdef,errordef,
        stringdef,enumdef,procdef,objectdef,errordef,
        filedef,setdef,procvardef,
        filedef,setdef,procvardef,

+ 8 - 8
compiler/i386/n386add.pas

@@ -69,10 +69,10 @@ interface
         op2:=A_NONE;
         op2:=A_NONE;
         mboverflow:=false;
         mboverflow:=false;
         opsize:=S_L;
         opsize:=S_L;
-        unsigned:=((left.resultdef.deftype=orddef) and
-                   (torddef(left.resultdef).typ=u64bit)) or
-                  ((right.resultdef.deftype=orddef) and
-                   (torddef(right.resultdef).typ=u64bit));
+        unsigned:=((left.resultdef.typ=orddef) and
+                   (torddef(left.resultdef).ordtype=u64bit)) or
+                  ((right.resultdef.typ=orddef) and
+                   (torddef(right.resultdef).ordtype=u64bit));
         case nodetype of
         case nodetype of
           addn :
           addn :
             begin
             begin
@@ -261,10 +261,10 @@ interface
 
 
         pass_left_right;
         pass_left_right;
 
 
-        unsigned:=((left.resultdef.deftype=orddef) and
-                   (torddef(left.resultdef).typ=u64bit)) or
-                  ((right.resultdef.deftype=orddef) and
-                   (torddef(right.resultdef).typ=u64bit));
+        unsigned:=((left.resultdef.typ=orddef) and
+                   (torddef(left.resultdef).ordtype=u64bit)) or
+                  ((right.resultdef.typ=orddef) and
+                   (torddef(right.resultdef).ordtype=u64bit));
 
 
         { left and right no register?  }
         { left and right no register?  }
         { then one must be demanded    }
         { then one must be demanded    }

+ 2 - 2
compiler/i386/n386mat.pas

@@ -318,13 +318,13 @@ implementation
             emit_reg_reg(A_MOV,S_L,hreg1,NR_EAX);
             emit_reg_reg(A_MOV,S_L,hreg1,NR_EAX);
             cg.getcpuregister(current_asmdata.CurrAsmList,NR_EDX);
             cg.getcpuregister(current_asmdata.CurrAsmList,NR_EDX);
             {Sign extension depends on the left type.}
             {Sign extension depends on the left type.}
-            if torddef(left.resultdef).typ=u32bit then
+            if torddef(left.resultdef).ordtype=u32bit then
               emit_reg_reg(A_XOR,S_L,NR_EDX,NR_EDX)
               emit_reg_reg(A_XOR,S_L,NR_EDX,NR_EDX)
             else
             else
               emit_none(A_CDQ,S_NO);
               emit_none(A_CDQ,S_NO);
 
 
             {Division depends on the right type.}
             {Division depends on the right type.}
-            if Torddef(right.resultdef).typ=u32bit then
+            if Torddef(right.resultdef).ordtype=u32bit then
               op:=A_DIV
               op:=A_DIV
             else
             else
               op:=A_IDIV;
               op:=A_IDIV;

+ 1 - 1
compiler/m68k/cgcpu.pas

@@ -1236,7 +1236,7 @@ unit cgcpu;
            (procdef.procoptions*[po_classmethod, po_staticmethod,
            (procdef.procoptions*[po_classmethod, po_staticmethod,
              po_methodpointer, po_interrupt, po_iocheck]<>[]) then
              po_methodpointer, po_interrupt, po_iocheck]<>[]) then
           Internalerror(200006138);
           Internalerror(200006138);
-        if procdef.owner.symtabletype<>objectsymtable then
+        if procdef.owner.symtabletype<>ObjectSymtable then
           Internalerror(200109191);
           Internalerror(200109191);
 
 
         make_global:=false;
         make_global:=false;

+ 6 - 6
compiler/m68k/cpupara.pas

@@ -88,7 +88,7 @@ unit cpupara;
          { Later, the LOC_REFERENCE is in most cases changed into LOC_REGISTER
          { Later, the LOC_REFERENCE is in most cases changed into LOC_REGISTER
            if push_addr_param for the def is true
            if push_addr_param for the def is true
          }
          }
-         case p.deftype of
+         case p.typ of
             orddef:
             orddef:
               result:=LOC_REGISTER;
               result:=LOC_REGISTER;
             floatdef:
             floatdef:
@@ -151,7 +151,7 @@ unit cpupara;
             result:=true;
             result:=true;
             exit;
             exit;
           end;
           end;
-        case def.deftype of
+        case def.typ of
           variantdef,
           variantdef,
           formaldef :
           formaldef :
             result:=true;
             result:=true;
@@ -167,7 +167,7 @@ unit cpupara;
           setdef :
           setdef :
             result:=(tsetdef(def).settype<>smallset);
             result:=(tsetdef(def).settype<>smallset);
           stringdef :
           stringdef :
-            result:=tstringdef(def).string_typ in [st_shortstring,st_longstring];
+            result:=tstringdef(def).stringtype in [st_shortstring,st_longstring];
           procvardef :
           procvardef :
             result:=po_methodpointer in tprocvardef(def).procoptions;
             result:=po_methodpointer in tprocvardef(def).procoptions;
         end;
         end;
@@ -208,7 +208,7 @@ unit cpupara;
             exit;
             exit;
           end;
           end;
         { Return in FPU register? }
         { Return in FPU register? }
-        if p.returndef.deftype=floatdef then
+        if p.returndef.typ=floatdef then
           begin
           begin
             p.funcretloc[side].loc:=LOC_FPUREGISTER;
             p.funcretloc[side].loc:=LOC_FPUREGISTER;
             p.funcretloc[side].register:=NR_FPU_RESULT_REG;
             p.funcretloc[side].register:=NR_FPU_RESULT_REG;
@@ -342,7 +342,7 @@ unit cpupara;
             hp.paraloc[side].intsize:=paralen;
             hp.paraloc[side].intsize:=paralen;
 
 
             if (paralen = 0) then
             if (paralen = 0) then
-              if (paradef.deftype = recorddef) then
+              if (paradef.typ = recorddef) then
                 begin
                 begin
                   paraloc:=hp.paraloc[side].add_location;
                   paraloc:=hp.paraloc[side].add_location;
                   paraloc^.loc := LOC_VOID;
                   paraloc^.loc := LOC_VOID;
@@ -361,7 +361,7 @@ unit cpupara;
 		    //writeln('loc register');
 		    //writeln('loc register');
                     paraloc^.loc := loc;
                     paraloc^.loc := loc;
                     { make sure we don't lose whether or not the type is signed }
                     { make sure we don't lose whether or not the type is signed }
-                    if (paradef.deftype <> orddef) then
+                    if (paradef.typ <> orddef) then
                       paracgsize := int_cgsize(paralen);
                       paracgsize := int_cgsize(paralen);
                     if (paracgsize in [OS_NO,OS_64,OS_S64]) then
                     if (paracgsize in [OS_NO,OS_64,OS_S64]) then
                       paraloc^.size := OS_INT
                       paraloc^.size := OS_INT

+ 4 - 4
compiler/m68k/n68kadd.pas

@@ -358,12 +358,12 @@ implementation
         otl,ofl : tasmlabel;
         otl,ofl : tasmlabel;
       begin
       begin
 //        writeln('second_cmpboolean');
 //        writeln('second_cmpboolean');
-        if (torddef(left.resultdef).typ=bool8bit) or
-           (torddef(right.resultdef).typ=bool8bit) then
+        if (torddef(left.resultdef).ordtype=bool8bit) or
+           (torddef(right.resultdef).ordtype=bool8bit) then
          cgsize:=OS_8
          cgsize:=OS_8
         else
         else
-          if (torddef(left.resultdef).typ=bool16bit) or
-             (torddef(right.resultdef).typ=bool16bit) then
+          if (torddef(left.resultdef).ordtype=bool16bit) or
+             (torddef(right.resultdef).ordtype=bool16bit) then
            cgsize:=OS_16
            cgsize:=OS_16
         else
         else
            cgsize:=OS_32;
            cgsize:=OS_32;

+ 2 - 2
compiler/m68k/ra68kmot.pas

@@ -587,7 +587,7 @@ const
   var expr: string;
   var expr: string;
       hs, tempstr: string;
       hs, tempstr: string;
       sym : tsym;
       sym : tsym;
-      srsymtable : tsymtable;
+      srsymtable : TSymtable;
       hl : tasmlabel;
       hl : tasmlabel;
       l : longint;
       l : longint;
       errorflag: boolean;
       errorflag: boolean;
@@ -703,7 +703,7 @@ const
                                end;
                                end;
                              typesym :
                              typesym :
                                begin
                                begin
-                                 if not(ttypesym(sym).typedef.deftype in [recorddef,objectdef]) then
+                                 if not(ttypesym(sym).typedef.typ in [recorddef,objectdef]) then
                                       Message(asmr_e_wrong_sym_type);
                                       Message(asmr_e_wrong_sym_type);
                                end;
                                end;
                              else
                              else

+ 85 - 85
compiler/nadd.pas

@@ -108,22 +108,22 @@ implementation
         floatweight : array[tfloattype] of byte =
         floatweight : array[tfloattype] of byte =
           (2,3,4,0,1,5);
           (2,3,4,0,1,5);
       begin
       begin
-        if t1.deftype=floatdef then
+        if t1.typ=floatdef then
           begin
           begin
             result:=t1;
             result:=t1;
-            if t2.deftype=floatdef then
+            if t2.typ=floatdef then
               begin
               begin
                 { when a comp or currency is used, use always the
                 { when a comp or currency is used, use always the
                   best float type to calculate the result }
                   best float type to calculate the result }
-                if (tfloatdef(t2).typ in [s64comp,s64currency]) or
-                  (tfloatdef(t2).typ in [s64comp,s64currency]) then
+                if (tfloatdef(t2).floattype in [s64comp,s64currency]) or
+                  (tfloatdef(t2).floattype in [s64comp,s64currency]) then
                   result:=pbestrealtype^
                   result:=pbestrealtype^
                 else
                 else
-                  if floatweight[tfloatdef(t2).typ]>floatweight[tfloatdef(t1).typ] then
+                  if floatweight[tfloatdef(t2).floattype]>floatweight[tfloatdef(t1).floattype] then
                     result:=t2;
                     result:=t2;
               end;
               end;
           end
           end
-        else if t2.deftype=floatdef then
+        else if t2.typ=floatdef then
           result:=t2
           result:=t2
         else internalerror(200508061);
         else internalerror(200508061);
       end;
       end;
@@ -155,20 +155,20 @@ implementation
           need to be done before the constant folding so constant
           need to be done before the constant folding so constant
           operation on a float and int are also handled }
           operation on a float and int are also handled }
         resultrealdef:=pbestrealtype^;
         resultrealdef:=pbestrealtype^;
-        if (right.resultdef.deftype=floatdef) or (left.resultdef.deftype=floatdef) then
+        if (right.resultdef.typ=floatdef) or (left.resultdef.typ=floatdef) then
          begin
          begin
            { when both floattypes are already equal then use that
            { when both floattypes are already equal then use that
              floattype for results }
              floattype for results }
-           if (right.resultdef.deftype=floatdef) and
-              (left.resultdef.deftype=floatdef) and
-              (tfloatdef(left.resultdef).typ=tfloatdef(right.resultdef).typ) then
+           if (right.resultdef.typ=floatdef) and
+              (left.resultdef.typ=floatdef) and
+              (tfloatdef(left.resultdef).floattype=tfloatdef(right.resultdef).floattype) then
              resultrealdef:=left.resultdef
              resultrealdef:=left.resultdef
            { when there is a currency type then use currency, but
            { when there is a currency type then use currency, but
              only when currency is defined as float }
              only when currency is defined as float }
            else
            else
             if (is_currency(right.resultdef) or
             if (is_currency(right.resultdef) or
                 is_currency(left.resultdef)) and
                 is_currency(left.resultdef)) and
-               ((s64currencytype.deftype = floatdef) or
+               ((s64currencytype.typ = floatdef) or
                 (nodetype <> slashn)) then
                 (nodetype <> slashn)) then
              begin
              begin
                resultrealdef:=s64currencytype;
                resultrealdef:=s64currencytype;
@@ -263,7 +263,7 @@ implementation
                   else if not(equal_defs(ld,rd)) then
                   else if not(equal_defs(ld,rd)) then
                     IncompatibleTypes(ld,rd);
                     IncompatibleTypes(ld,rd);
                end
                end
-             else if (ld.deftype=enumdef) and (rd.deftype=enumdef) then
+             else if (ld.typ=enumdef) and (rd.typ=enumdef) then
               begin
               begin
                 if not(equal_defs(ld,rd)) then
                 if not(equal_defs(ld,rd)) then
                   inserttypeconv(right,left.resultdef);
                   inserttypeconv(right,left.resultdef);
@@ -310,7 +310,7 @@ implementation
                        if is_integer(ld) then
                        if is_integer(ld) then
                          t := genintconstnode(lv+rv)
                          t := genintconstnode(lv+rv)
                      else
                      else
-                       t := cordconstnode.create(lv+rv,left.resultdef,(ld.deftype<>enumdef));
+                       t := cordconstnode.create(lv+rv,left.resultdef,(ld.typ<>enumdef));
                    except
                    except
                      on E:EIntOverflow do
                      on E:EIntOverflow do
                        begin
                        begin
@@ -344,7 +344,7 @@ implementation
                          if is_integer(ld) then
                          if is_integer(ld) then
                            t:=genintconstnode(lv-rv)
                            t:=genintconstnode(lv-rv)
                          else
                          else
-                           t:=cordconstnode.create(lv-rv,left.resultdef,(ld.deftype<>enumdef));
+                           t:=cordconstnode.create(lv-rv,left.resultdef,(ld.typ<>enumdef));
                        end;
                        end;
                    except
                    except
                      on E:EIntOverflow do
                      on E:EIntOverflow do
@@ -366,8 +366,8 @@ implementation
                      {$Q+}
                      {$Q+}
                    {$endif}
                    {$endif}
                    try
                    try
-                     if (torddef(ld).typ <> u64bit) or
-                        (torddef(rd).typ <> u64bit) then
+                     if (torddef(ld).ordtype <> u64bit) or
+                        (torddef(rd).ordtype <> u64bit) then
                        t:=genintconstnode(lv*rv)
                        t:=genintconstnode(lv*rv)
                      else
                      else
                        t:=genintconstnode(int64(qword(lv)*qword(rv)));
                        t:=genintconstnode(int64(qword(lv)*qword(rv)));
@@ -732,16 +732,16 @@ implementation
          if (m_delphi in current_settings.modeswitches) and
          if (m_delphi in current_settings.modeswitches) and
             (blocktype=bt_type) then
             (blocktype=bt_type) then
           begin
           begin
-            if (left.resultdef.deftype=enumdef) and
-               (right.resultdef.deftype=orddef) then
+            if (left.resultdef.typ=enumdef) and
+               (right.resultdef.typ=orddef) then
              begin
              begin
                { insert explicit typecast to default signed int }
                { insert explicit typecast to default signed int }
                left:=ctypeconvnode.create_internal(left,sinttype);
                left:=ctypeconvnode.create_internal(left,sinttype);
                typecheckpass(left);
                typecheckpass(left);
              end
              end
             else
             else
-             if (left.resultdef.deftype=orddef) and
-                (right.resultdef.deftype=enumdef) then
+             if (left.resultdef.typ=orddef) and
+                (right.resultdef.typ=enumdef) then
               begin
               begin
                 { insert explicit typecast to default signed int }
                 { insert explicit typecast to default signed int }
                 right:=ctypeconvnode.create_internal(right,sinttype);
                 right:=ctypeconvnode.create_internal(right,sinttype);
@@ -768,7 +768,7 @@ implementation
               { However, since this is already a division, both divisions by     }
               { However, since this is already a division, both divisions by     }
               { 10000 are eliminated when we divide the results -> we can skip   }
               { 10000 are eliminated when we divide the results -> we can skip   }
               { them.                                                            }
               { them.                                                            }
-              if s64currencytype.deftype = floatdef then
+              if s64currencytype.typ = floatdef then
                 begin
                 begin
                   { there's no s64comptype or so, how do we avoid the type conversion?
                   { there's no s64comptype or so, how do we avoid the type conversion?
                   left.resultdef := s64comptype;
                   left.resultdef := s64comptype;
@@ -779,15 +779,15 @@ implementation
                   left.resultdef := s64inttype;
                   left.resultdef := s64inttype;
                   right.resultdef := s64inttype;
                   right.resultdef := s64inttype;
                 end
                 end
-            else if (left.resultdef.deftype <> floatdef) and
-               (right.resultdef.deftype <> floatdef) then
+            else if (left.resultdef.typ <> floatdef) and
+               (right.resultdef.typ <> floatdef) then
               CGMessage(type_h_use_div_for_int);
               CGMessage(type_h_use_div_for_int);
             inserttypeconv(right,resultrealdef);
             inserttypeconv(right,resultrealdef);
             inserttypeconv(left,resultrealdef);
             inserttypeconv(left,resultrealdef);
           end
           end
 
 
          { if both are orddefs then check sub types }
          { if both are orddefs then check sub types }
-         else if (ld.deftype=orddef) and (rd.deftype=orddef) then
+         else if (ld.typ=orddef) and (rd.typ=orddef) then
            begin
            begin
              { optimize multiplacation by a power of 2 }
              { optimize multiplacation by a power of 2 }
              if not(cs_check_overflow in current_settings.localswitches) and
              if not(cs_check_overflow in current_settings.localswitches) and
@@ -927,24 +927,24 @@ implementation
                  if nodetype=addn then
                  if nodetype=addn then
                    begin
                    begin
                      inserttypeconv(left,cwidestringtype);
                      inserttypeconv(left,cwidestringtype);
-                     if (torddef(rd).typ<>uwidechar) then
+                     if (torddef(rd).ordtype<>uwidechar) then
                        inserttypeconv(right,cwidechartype);
                        inserttypeconv(right,cwidechartype);
                      resultdef:=cwidestringtype;
                      resultdef:=cwidestringtype;
                    end
                    end
                  else
                  else
                    begin
                    begin
-                     if (torddef(ld).typ<>uwidechar) then
+                     if (torddef(ld).ordtype<>uwidechar) then
                        inserttypeconv(left,cwidechartype);
                        inserttypeconv(left,cwidechartype);
-                     if (torddef(rd).typ<>uwidechar) then
+                     if (torddef(rd).ordtype<>uwidechar) then
                        inserttypeconv(right,cwidechartype);
                        inserttypeconv(right,cwidechartype);
                    end;
                    end;
                end
                end
              { is there a currency type ? }
              { is there a currency type ? }
-             else if ((torddef(rd).typ=scurrency) or (torddef(ld).typ=scurrency)) then
+             else if ((torddef(rd).ordtype=scurrency) or (torddef(ld).ordtype=scurrency)) then
                begin
                begin
-                  if (torddef(ld).typ<>scurrency) then
+                  if (torddef(ld).ordtype<>scurrency) then
                    inserttypeconv(left,s64currencytype);
                    inserttypeconv(left,s64currencytype);
-                  if (torddef(rd).typ<>scurrency) then
+                  if (torddef(rd).ordtype<>scurrency) then
                    inserttypeconv(right,s64currencytype);
                    inserttypeconv(right,s64currencytype);
                end
                end
              { and,or,xor work on bit patterns and don't care
              { and,or,xor work on bit patterns and don't care
@@ -962,32 +962,32 @@ implementation
                    inserttypeconv_internal(right,left.resultdef);
                    inserttypeconv_internal(right,left.resultdef);
                end
                end
              { is there a signed 64 bit type ? }
              { is there a signed 64 bit type ? }
-             else if ((torddef(rd).typ=s64bit) or (torddef(ld).typ=s64bit)) then
+             else if ((torddef(rd).ordtype=s64bit) or (torddef(ld).ordtype=s64bit)) then
                begin
                begin
-                  if (torddef(ld).typ<>s64bit) then
+                  if (torddef(ld).ordtype<>s64bit) then
                    inserttypeconv(left,s64inttype);
                    inserttypeconv(left,s64inttype);
-                  if (torddef(rd).typ<>s64bit) then
+                  if (torddef(rd).ordtype<>s64bit) then
                    inserttypeconv(right,s64inttype);
                    inserttypeconv(right,s64inttype);
                end
                end
              { is there a unsigned 64 bit type ? }
              { is there a unsigned 64 bit type ? }
-             else if ((torddef(rd).typ=u64bit) or (torddef(ld).typ=u64bit)) then
+             else if ((torddef(rd).ordtype=u64bit) or (torddef(ld).ordtype=u64bit)) then
                begin
                begin
-                  if (torddef(ld).typ<>u64bit) then
+                  if (torddef(ld).ordtype<>u64bit) then
                    inserttypeconv(left,u64inttype);
                    inserttypeconv(left,u64inttype);
-                  if (torddef(rd).typ<>u64bit) then
+                  if (torddef(rd).ordtype<>u64bit) then
                    inserttypeconv(right,u64inttype);
                    inserttypeconv(right,u64inttype);
                end
                end
              { 64 bit cpus do calculations always in 64 bit }
              { 64 bit cpus do calculations always in 64 bit }
 {$ifndef cpu64bit}
 {$ifndef cpu64bit}
              { is there a cardinal? }
              { is there a cardinal? }
-             else if ((torddef(rd).typ=u32bit) or (torddef(ld).typ=u32bit)) then
+             else if ((torddef(rd).ordtype=u32bit) or (torddef(ld).ordtype=u32bit)) then
                begin
                begin
                  { convert positive constants to u32bit }
                  { convert positive constants to u32bit }
-                 if (torddef(ld).typ<>u32bit) and
+                 if (torddef(ld).ordtype<>u32bit) and
                     is_constintnode(left) and
                     is_constintnode(left) and
                     (tordconstnode(left).value >= 0) then
                     (tordconstnode(left).value >= 0) then
                    inserttypeconv(left,u32inttype);
                    inserttypeconv(left,u32inttype);
-                 if (torddef(rd).typ<>u32bit) and
+                 if (torddef(rd).ordtype<>u32bit) and
                     is_constintnode(right) and
                     is_constintnode(right) and
                     (tordconstnode(right).value >= 0) then
                     (tordconstnode(right).value >= 0) then
                    inserttypeconv(right,u32inttype);
                    inserttypeconv(right,u32inttype);
@@ -1003,9 +1003,9 @@ implementation
                    end
                    end
                  else
                  else
                    begin
                    begin
-                     if (torddef(left.resultdef).typ<>u32bit) then
+                     if (torddef(left.resultdef).ordtype<>u32bit) then
                        inserttypeconv(left,u32inttype);
                        inserttypeconv(left,u32inttype);
-                     if (torddef(right.resultdef).typ<>u32bit) then
+                     if (torddef(right.resultdef).ordtype<>u32bit) then
                        inserttypeconv(right,u32inttype);
                        inserttypeconv(right,u32inttype);
                    end;
                    end;
                end
                end
@@ -1065,7 +1065,7 @@ implementation
            end
            end
 
 
          { if both are floatdefs, conversion is already done before constant folding }
          { if both are floatdefs, conversion is already done before constant folding }
-         else if (ld.deftype=floatdef) then
+         else if (ld.typ=floatdef) then
            begin
            begin
              if not(nodetype in [addn,subn,muln,slashn,equaln,unequaln,ltn,lten,gtn,gten]) then
              if not(nodetype in [addn,subn,muln,slashn,equaln,unequaln,ltn,lten,gtn,gten]) then
                CGMessage3(type_e_operator_not_supported_for_types,node2opstr(nodetype),ld.typename,rd.typename);
                CGMessage3(type_e_operator_not_supported_for_types,node2opstr(nodetype),ld.typename,rd.typename);
@@ -1073,10 +1073,10 @@ implementation
 
 
          { left side a setdef, must be before string processing,
          { left side a setdef, must be before string processing,
            else array constructor can be seen as array of char (PFV) }
            else array constructor can be seen as array of char (PFV) }
-         else if (ld.deftype=setdef) then
+         else if (ld.typ=setdef) then
           begin
           begin
             { trying to add a set element? }
             { trying to add a set element? }
-            if (nodetype=addn) and (rd.deftype<>setdef) then
+            if (nodetype=addn) and (rd.typ<>setdef) then
              begin
              begin
                if (rt=setelementn) then
                if (rt=setelementn) then
                 begin
                 begin
@@ -1091,7 +1091,7 @@ implementation
                if not(nodetype in [addn,subn,symdifn,muln,equaln,unequaln,lten,gten]) then
                if not(nodetype in [addn,subn,symdifn,muln,equaln,unequaln,lten,gten]) then
                 CGMessage(type_e_set_operation_unknown);
                 CGMessage(type_e_set_operation_unknown);
                { right def must be a also be set }
                { right def must be a also be set }
-               if (rd.deftype<>setdef) or not(equal_defs(rd,ld)) then
+               if (rd.typ<>setdef) or not(equal_defs(rd,ld)) then
                 CGMessage(type_e_set_element_are_not_comp);
                 CGMessage(type_e_set_element_are_not_comp);
              end;
              end;
 
 
@@ -1108,7 +1108,7 @@ implementation
 
 
             { if the right side is also a setdef then the settype must
             { if the right side is also a setdef then the settype must
               be the same as the left setdef }
               be the same as the left setdef }
-            if (rd.deftype=setdef) and
+            if (rd.typ=setdef) and
                (tsetdef(ld).settype<>tsetdef(rd).settype) then
                (tsetdef(ld).settype<>tsetdef(rd).settype) then
              begin
              begin
                { when right is a normset we need to typecast both
                { when right is a normset we need to typecast both
@@ -1121,7 +1121,7 @@ implementation
           end
           end
          { pointer comparision and subtraction }
          { pointer comparision and subtraction }
          else if (
          else if (
-                  (rd.deftype=pointerdef) and (ld.deftype=pointerdef)
+                  (rd.typ=pointerdef) and (ld.typ=pointerdef)
                  ) or
                  ) or
                  { compare/add pchar to variable (not stringconst) char arrays
                  { compare/add pchar to variable (not stringconst) char arrays
                    by addresses like BP/Delphi }
                    by addresses like BP/Delphi }
@@ -1216,8 +1216,8 @@ implementation
            care of chararray+chararray and chararray+char.
            care of chararray+chararray and chararray+char.
            Note: Must be done after pointerdef+pointerdef has been checked, else
            Note: Must be done after pointerdef+pointerdef has been checked, else
            pchar is converted to string }
            pchar is converted to string }
-         else if (rd.deftype=stringdef) or
-                 (ld.deftype=stringdef) or
+         else if (rd.typ=stringdef) or
+                 (ld.typ=stringdef) or
                  ((is_pchar(rd) or is_chararray(rd) or is_char(rd) or is_open_chararray(rd) or
                  ((is_pchar(rd) or is_chararray(rd) or is_char(rd) or is_open_chararray(rd) or
                    is_pwidechar(rd) or is_widechararray(rd) or is_widechar(rd) or is_open_widechararray(rd)) and
                    is_pwidechar(rd) or is_widechararray(rd) or is_widechar(rd) or is_open_widechararray(rd)) and
                   (is_pchar(ld) or is_chararray(ld) or is_char(ld) or is_open_chararray(ld) or
                   (is_pchar(ld) or is_chararray(ld) or is_char(ld) or is_open_chararray(ld) or
@@ -1313,7 +1313,7 @@ implementation
               CGMessage3(type_e_operator_not_supported_for_types,node2opstr(nodetype),ld.typename,rd.typename);
               CGMessage3(type_e_operator_not_supported_for_types,node2opstr(nodetype),ld.typename,rd.typename);
           end
           end
 
 
-         else if (rd.deftype=classrefdef) and (ld.deftype=classrefdef) then
+         else if (rd.typ=classrefdef) and (ld.typ=classrefdef) then
           begin
           begin
             if (nodetype in [equaln,unequaln]) then
             if (nodetype in [equaln,unequaln]) then
               begin
               begin
@@ -1328,7 +1328,7 @@ implementation
           end
           end
 
 
          { allows comperasion with nil pointer }
          { allows comperasion with nil pointer }
-         else if is_class_or_interface(rd) or (rd.deftype=classrefdef) then
+         else if is_class_or_interface(rd) or (rd.typ=classrefdef) then
           begin
           begin
             if (nodetype in [equaln,unequaln]) then
             if (nodetype in [equaln,unequaln]) then
               inserttypeconv(left,right.resultdef)
               inserttypeconv(left,right.resultdef)
@@ -1336,7 +1336,7 @@ implementation
               CGMessage3(type_e_operator_not_supported_for_types,node2opstr(nodetype),ld.typename,rd.typename);
               CGMessage3(type_e_operator_not_supported_for_types,node2opstr(nodetype),ld.typename,rd.typename);
           end
           end
 
 
-         else if is_class_or_interface(ld) or (ld.deftype=classrefdef) then
+         else if is_class_or_interface(ld) or (ld.typ=classrefdef) then
           begin
           begin
             if (nodetype in [equaln,unequaln]) then
             if (nodetype in [equaln,unequaln]) then
               inserttypeconv(right,left.resultdef)
               inserttypeconv(right,left.resultdef)
@@ -1345,17 +1345,17 @@ implementation
           end
           end
 
 
        { support procvar=nil,procvar<>nil }
        { support procvar=nil,procvar<>nil }
-         else if ((ld.deftype=procvardef) and (rt=niln)) or
-                 ((rd.deftype=procvardef) and (lt=niln)) then
+         else if ((ld.typ=procvardef) and (rt=niln)) or
+                 ((rd.typ=procvardef) and (lt=niln)) then
           begin
           begin
             if not(nodetype in [equaln,unequaln]) then
             if not(nodetype in [equaln,unequaln]) then
               CGMessage3(type_e_operator_not_supported_for_types,node2opstr(nodetype),ld.typename,rd.typename);
               CGMessage3(type_e_operator_not_supported_for_types,node2opstr(nodetype),ld.typename,rd.typename);
             { find proc field in methodpointer record }
             { find proc field in methodpointer record }
-            hsym:=tfieldvarsym(trecorddef(methodpointertype).symtable.search('proc'));
+            hsym:=tfieldvarsym(trecorddef(methodpointertype).symtable.Find('proc'));
             if not assigned(hsym) then
             if not assigned(hsym) then
               internalerror(200412043);
               internalerror(200412043);
             { For methodpointers compare only tmethodpointer.proc }
             { For methodpointers compare only tmethodpointer.proc }
-            if (rd.deftype=procvardef) and
+            if (rd.typ=procvardef) and
                (not tprocvardef(rd).is_addressonly) then
                (not tprocvardef(rd).is_addressonly) then
               begin
               begin
                 right:=csubscriptnode.create(
                 right:=csubscriptnode.create(
@@ -1363,7 +1363,7 @@ implementation
                            ctypeconvnode.create_internal(right,methodpointertype));
                            ctypeconvnode.create_internal(right,methodpointertype));
                 typecheckpass(right);
                 typecheckpass(right);
                end;
                end;
-            if (ld.deftype=procvardef) and
+            if (ld.typ=procvardef) and
                (not tprocvardef(ld).is_addressonly) then
                (not tprocvardef(ld).is_addressonly) then
               begin
               begin
                 left:=csubscriptnode.create(
                 left:=csubscriptnode.create(
@@ -1417,7 +1417,7 @@ implementation
 
 
          { this is a little bit dangerous, also the left type }
          { this is a little bit dangerous, also the left type }
          { pointer to should be checked! This broke the mmx support      }
          { pointer to should be checked! This broke the mmx support      }
-         else if (rd.deftype=pointerdef) or
+         else if (rd.typ=pointerdef) or
                  (is_zero_based_array(rd) and (rt<>stringconstn)) then
                  (is_zero_based_array(rd) and (rt<>stringconstn)) then
           begin
           begin
             if is_zero_based_array(rd) then
             if is_zero_based_array(rd) then
@@ -1433,7 +1433,7 @@ implementation
                 if not(cs_extsyntax in current_settings.moduleswitches) or
                 if not(cs_extsyntax in current_settings.moduleswitches) or
                    (not(is_pchar(ld)) and not(m_add_pointer in current_settings.modeswitches)) then
                    (not(is_pchar(ld)) and not(m_add_pointer in current_settings.modeswitches)) then
                   CGMessage3(type_e_operator_not_supported_for_types,node2opstr(nodetype),ld.typename,rd.typename);
                   CGMessage3(type_e_operator_not_supported_for_types,node2opstr(nodetype),ld.typename,rd.typename);
-                if (rd.deftype=pointerdef) and
+                if (rd.typ=pointerdef) and
                    (tpointerdef(rd).pointeddef.size>1) then
                    (tpointerdef(rd).pointeddef.size>1) then
                    begin
                    begin
                      left:=caddnode.create(muln,left,
                      left:=caddnode.create(muln,left,
@@ -1445,7 +1445,7 @@ implementation
               CGMessage3(type_e_operator_not_supported_for_types,node2opstr(nodetype),ld.typename,rd.typename);
               CGMessage3(type_e_operator_not_supported_for_types,node2opstr(nodetype),ld.typename,rd.typename);
           end
           end
 
 
-         else if (ld.deftype=pointerdef) or
+         else if (ld.typ=pointerdef) or
                  (is_zero_based_array(ld) and (lt<>stringconstn)) then
                  (is_zero_based_array(ld) and (lt<>stringconstn)) then
            begin
            begin
              if is_zero_based_array(ld) then
              if is_zero_based_array(ld) then
@@ -1462,7 +1462,7 @@ implementation
                  if not(cs_extsyntax in current_settings.moduleswitches) or
                  if not(cs_extsyntax in current_settings.moduleswitches) or
                     (not(is_pchar(ld)) and not(m_add_pointer in current_settings.modeswitches)) then
                     (not(is_pchar(ld)) and not(m_add_pointer in current_settings.modeswitches)) then
                    CGMessage3(type_e_operator_not_supported_for_types,node2opstr(nodetype),ld.typename,rd.typename);
                    CGMessage3(type_e_operator_not_supported_for_types,node2opstr(nodetype),ld.typename,rd.typename);
-                 if (ld.deftype=pointerdef) then
+                 if (ld.typ=pointerdef) then
                  begin
                  begin
                    if is_big_untyped_addrnode(left) then
                    if is_big_untyped_addrnode(left) then
                      CGMessage1(type_w_untyped_arithmetic_unportable,node2opstr(nodetype));
                      CGMessage1(type_w_untyped_arithmetic_unportable,node2opstr(nodetype));
@@ -1485,8 +1485,8 @@ implementation
                CGMessage3(type_e_operator_not_supported_for_types,node2opstr(nodetype),ld.typename,rd.typename);
                CGMessage3(type_e_operator_not_supported_for_types,node2opstr(nodetype),ld.typename,rd.typename);
            end
            end
 
 
-         else if (rd.deftype=procvardef) and
-                 (ld.deftype=procvardef) and
+         else if (rd.typ=procvardef) and
+                 (ld.typ=procvardef) and
                  equal_defs(rd,ld) then
                  equal_defs(rd,ld) then
           begin
           begin
             if (nodetype in [equaln,unequaln]) then
             if (nodetype in [equaln,unequaln]) then
@@ -1499,7 +1499,7 @@ implementation
                 else
                 else
                   begin
                   begin
                     { find proc field in methodpointer record }
                     { find proc field in methodpointer record }
-                    hsym:=tfieldvarsym(trecorddef(methodpointertype).symtable.search('proc'));
+                    hsym:=tfieldvarsym(trecorddef(methodpointertype).symtable.Find('proc'));
                     if not assigned(hsym) then
                     if not assigned(hsym) then
                       internalerror(200412043);
                       internalerror(200412043);
                     { Compare tmehodpointer(left).proc }
                     { Compare tmehodpointer(left).proc }
@@ -1518,7 +1518,7 @@ implementation
           end
           end
 
 
          { enums }
          { enums }
-         else if (ld.deftype=enumdef) and (rd.deftype=enumdef) then
+         else if (ld.typ=enumdef) and (rd.typ=enumdef) then
           begin
           begin
             if allowenumop(nodetype) then
             if allowenumop(nodetype) then
               inserttypeconv(right,left.resultdef)
               inserttypeconv(right,left.resultdef)
@@ -1570,7 +1570,7 @@ implementation
                 end;
                 end;
               muln :
               muln :
                 begin
                 begin
-                  if s64currencytype.deftype=floatdef then
+                  if s64currencytype.typ=floatdef then
                     hp:=caddnode.create(slashn,getcopy,crealconstnode.create(10000.0,s64currencytype))
                     hp:=caddnode.create(slashn,getcopy,crealconstnode.create(10000.0,s64currencytype))
                   else
                   else
                     hp:=cmoddivnode.create(divn,getcopy,cordconstnode.create(10000,s64currencytype,false));
                     hp:=cmoddivnode.create(divn,getcopy,cordconstnode.create(10000,s64currencytype,false));
@@ -1987,7 +1987,7 @@ implementation
 
 
       function canbe32bitint(v: tconstexprint; fromdef: torddef; todefsigned: boolean): boolean;
       function canbe32bitint(v: tconstexprint; fromdef: torddef; todefsigned: boolean): boolean;
         begin
         begin
-          if (fromdef.typ <> u64bit) then
+          if (fromdef.ordtype <> u64bit) then
             result :=
             result :=
              ((v >= 0) or
              ((v >= 0) or
               todefsigned) and
               todefsigned) and
@@ -2005,12 +2005,12 @@ implementation
         result := false;
         result := false;
         if ((left.nodetype = typeconvn) and
         if ((left.nodetype = typeconvn) and
             is_integer(ttypeconvnode(left).left.resultdef) and
             is_integer(ttypeconvnode(left).left.resultdef) and
-            (not(torddef(ttypeconvnode(left).left.resultdef).typ in [u64bit,s64bit]))  and
+            (not(torddef(ttypeconvnode(left).left.resultdef).ordtype in [u64bit,s64bit]))  and
            (((right.nodetype = ordconstn) and
            (((right.nodetype = ordconstn) and
              canbe32bitint(tordconstnode(right).value,torddef(right.resultdef),is_signed(left.resultdef))) or
              canbe32bitint(tordconstnode(right).value,torddef(right.resultdef),is_signed(left.resultdef))) or
             ((right.nodetype = typeconvn) and
             ((right.nodetype = typeconvn) and
              is_integer(ttypeconvnode(right).left.resultdef) and
              is_integer(ttypeconvnode(right).left.resultdef) and
-             not(torddef(ttypeconvnode(right).left.resultdef).typ in [u64bit,s64bit])) and
+             not(torddef(ttypeconvnode(right).left.resultdef).ordtype in [u64bit,s64bit])) and
              (is_signed(ttypeconvnode(left).left.resultdef) =
              (is_signed(ttypeconvnode(left).left.resultdef) =
               is_signed(ttypeconvnode(right).left.resultdef)))) then
               is_signed(ttypeconvnode(right).left.resultdef)))) then
           begin
           begin
@@ -2120,7 +2120,7 @@ implementation
 
 
         if not(target_info.system in system_wince) then
         if not(target_info.system in system_wince) then
           begin
           begin
-            case tfloatdef(left.resultdef).typ of
+            case tfloatdef(left.resultdef).floattype of
               s32real:
               s32real:
                 begin
                 begin
                   fdef:=search_system_type('FLOAT32REC').typedef;
                   fdef:=search_system_type('FLOAT32REC').typedef;
@@ -2198,7 +2198,7 @@ implementation
               else
               else
                 CGMessage3(type_e_operator_not_supported_for_types,node2opstr(nodetype),left.resultdef.typename,right.resultdef.typename);
                 CGMessage3(type_e_operator_not_supported_for_types,node2opstr(nodetype),left.resultdef.typename,right.resultdef.typename);
             end;
             end;
-            case tfloatdef(left.resultdef).typ of
+            case tfloatdef(left.resultdef).floattype of
               s32real:
               s32real:
                 procname:=procname+'S';
                 procname:=procname+'S';
               s64real:
               s64real:
@@ -2297,7 +2297,7 @@ implementation
            end
            end
 
 
          { if both are orddefs then check sub types }
          { if both are orddefs then check sub types }
-         else if (ld.deftype=orddef) and (rd.deftype=orddef) then
+         else if (ld.typ=orddef) and (rd.typ=orddef) then
            begin
            begin
            { 2 booleans ? }
            { 2 booleans ? }
              if is_boolean(ld) and is_boolean(rd) then
              if is_boolean(ld) and is_boolean(rd) then
@@ -2338,7 +2338,7 @@ implementation
                end
                end
 {$ifndef cpu64bit}
 {$ifndef cpu64bit}
               { is there a 64 bit type ? }
               { is there a 64 bit type ? }
-             else if (torddef(ld).typ in [s64bit,u64bit,scurrency]) then
+             else if (torddef(ld).ordtype in [s64bit,u64bit,scurrency]) then
                begin
                begin
                  result := first_add64bitint;
                  result := first_add64bitint;
                  if assigned(result) then
                  if assigned(result) then
@@ -2351,7 +2351,7 @@ implementation
                end
                end
 {$endif cpu64bit}
 {$endif cpu64bit}
              { is there a cardinal? }
              { is there a cardinal? }
-             else if (torddef(ld).typ=u32bit) then
+             else if (torddef(ld).ordtype=u32bit) then
                begin
                begin
                   if nodetype in [addn,subn,muln,andn,orn,xorn] then
                   if nodetype in [addn,subn,muln,andn,orn,xorn] then
                     expectloc:=LOC_REGISTER
                     expectloc:=LOC_REGISTER
@@ -2375,7 +2375,7 @@ implementation
 
 
          { left side a setdef, must be before string processing,
          { left side a setdef, must be before string processing,
            else array constructor can be seen as array of char (PFV) }
            else array constructor can be seen as array of char (PFV) }
-         else if (ld.deftype=setdef) then
+         else if (ld.typ=setdef) then
            begin
            begin
              if tsetdef(ld).settype=smallset then
              if tsetdef(ld).settype=smallset then
                begin
                begin
@@ -2422,7 +2422,7 @@ implementation
            end
            end
 
 
          { is one of the operands a string }
          { is one of the operands a string }
-         else if (ld.deftype=stringdef) then
+         else if (ld.typ=stringdef) then
             begin
             begin
               if is_widestring(ld) then
               if is_widestring(ld) then
                 begin
                 begin
@@ -2475,7 +2475,7 @@ implementation
            end
            end
 
 
          { is one a real float ? }
          { is one a real float ? }
-         else if (rd.deftype=floatdef) or (ld.deftype=floatdef) then
+         else if (rd.typ=floatdef) or (ld.typ=floatdef) then
             begin
             begin
 {$ifdef cpufpemu}
 {$ifdef cpufpemu}
              if (current_settings.fputype=fpu_soft) or (cs_fp_emulation in current_settings.moduleswitches) then
              if (current_settings.fputype=fpu_soft) or (cs_fp_emulation in current_settings.moduleswitches) then
@@ -2502,7 +2502,7 @@ implementation
             end
             end
 
 
          { pointer comperation and subtraction }
          { pointer comperation and subtraction }
-         else if (ld.deftype=pointerdef) then
+         else if (ld.typ=pointerdef) then
             begin
             begin
               if nodetype in [addn,subn,muln,andn,orn,xorn] then
               if nodetype in [addn,subn,muln,andn,orn,xorn] then
                 expectloc:=LOC_REGISTER
                 expectloc:=LOC_REGISTER
@@ -2517,15 +2517,15 @@ implementation
               calcregisters(self,1,0,0);
               calcregisters(self,1,0,0);
             end
             end
 
 
-         else if (ld.deftype=classrefdef) then
+         else if (ld.typ=classrefdef) then
             begin
             begin
               expectloc:=LOC_FLAGS;
               expectloc:=LOC_FLAGS;
               calcregisters(self,1,0,0);
               calcregisters(self,1,0,0);
             end
             end
 
 
          { support procvar=nil,procvar<>nil }
          { support procvar=nil,procvar<>nil }
-         else if ((ld.deftype=procvardef) and (rt=niln)) or
-                 ((rd.deftype=procvardef) and (lt=niln)) then
+         else if ((ld.typ=procvardef) and (rt=niln)) or
+                 ((rd.typ=procvardef) and (lt=niln)) then
             begin
             begin
               expectloc:=LOC_FLAGS;
               expectloc:=LOC_FLAGS;
               calcregisters(self,1,0,0);
               calcregisters(self,1,0,0);
@@ -2542,21 +2542,21 @@ implementation
             end
             end
 {$endif SUPPORT_MMX}
 {$endif SUPPORT_MMX}
 
 
-         else if (rd.deftype=pointerdef) or (ld.deftype=pointerdef) then
+         else if (rd.typ=pointerdef) or (ld.typ=pointerdef) then
             begin
             begin
               expectloc:=LOC_REGISTER;
               expectloc:=LOC_REGISTER;
               calcregisters(self,1,0,0);
               calcregisters(self,1,0,0);
             end
             end
 
 
-         else  if (rd.deftype=procvardef) and
-                  (ld.deftype=procvardef) and
+         else  if (rd.typ=procvardef) and
+                  (ld.typ=procvardef) and
                   equal_defs(rd,ld) then
                   equal_defs(rd,ld) then
            begin
            begin
              expectloc:=LOC_FLAGS;
              expectloc:=LOC_FLAGS;
              calcregisters(self,1,0,0);
              calcregisters(self,1,0,0);
            end
            end
 
 
-         else if (ld.deftype=enumdef) then
+         else if (ld.typ=enumdef) then
            begin
            begin
               expectloc:=LOC_FLAGS;
               expectloc:=LOC_FLAGS;
               calcregisters(self,1,0,0);
               calcregisters(self,1,0,0);

+ 2 - 2
compiler/nbas.pas

@@ -640,7 +640,7 @@ implementation
           (def_cgsize(_typedef)<>OS_NO) and
           (def_cgsize(_typedef)<>OS_NO) and
           { no init/final needed }
           { no init/final needed }
           not (_typedef.needs_inittable) and
           not (_typedef.needs_inittable) and
-          ((_typedef.deftype <> pointerdef) or
+          ((_typedef.typ <> pointerdef) or
            (not tpointerdef(_typedef).pointeddef.needs_inittable));
            (not tpointerdef(_typedef).pointeddef.needs_inittable));
       end;
       end;
 
 
@@ -828,7 +828,7 @@ implementation
         if not tempinfo^.typedef.needs_inittable and
         if not tempinfo^.typedef.needs_inittable and
            tempinfo^.may_be_in_reg then
            tempinfo^.may_be_in_reg then
           begin
           begin
-            if tempinfo^.typedef.deftype=floatdef then
+            if tempinfo^.typedef.typ=floatdef then
               begin
               begin
                 if (tempinfo^.temptype = tt_persistent) then
                 if (tempinfo^.temptype = tt_persistent) then
                   expectloc := LOC_CFPUREGISTER
                   expectloc := LOC_CFPUREGISTER

+ 60 - 65
compiler/ncal.pas

@@ -68,7 +68,7 @@ interface
 
 
           procedure createinlineparas(var createstatement, deletestatement: tstatementnode);
           procedure createinlineparas(var createstatement, deletestatement: tstatementnode);
           function  replaceparaload(var n: tnode; arg: pointer): foreachnoderesult;
           function  replaceparaload(var n: tnode; arg: pointer): foreachnoderesult;
-          procedure createlocaltemps(p:TNamedIndexItem;arg:pointer);
+          procedure createlocaltemps(p:TObject;arg:pointer);
           function  pass1_inline:tnode;
           function  pass1_inline:tnode;
        protected
        protected
           pushedparasize : longint;
           pushedparasize : longint;
@@ -78,7 +78,7 @@ interface
           symtableprocentry : tprocsym;
           symtableprocentry : tprocsym;
           symtableprocentryderef : tderef;
           symtableprocentryderef : tderef;
           { symtable where the entry was found, needed for with support }
           { symtable where the entry was found, needed for with support }
-          symtableproc   : tsymtable;
+          symtableproc   : TSymtable;
           { the definition of the procedure to call }
           { the definition of the procedure to call }
           procdefinition : tabstractprocdef;
           procdefinition : tabstractprocdef;
           procdefinitionderef : tderef;
           procdefinitionderef : tderef;
@@ -100,7 +100,7 @@ interface
 
 
           { only the processor specific nodes need to override this }
           { only the processor specific nodes need to override this }
           { constructor                                             }
           { constructor                                             }
-          constructor create(l:tnode; v : tprocsym;st : tsymtable; mp: tnode; callflags:tcallnodeflags);virtual;
+          constructor create(l:tnode; v : tprocsym;st : TSymtable; mp: tnode; callflags:tcallnodeflags);virtual;
           constructor create_procvar(l,r:tnode);
           constructor create_procvar(l,r:tnode);
           constructor createintern(const name: string; params: tnode);
           constructor createintern(const name: string; params: tnode);
           constructor createinternres(const name: string; params: tnode; res:tdef);
           constructor createinternres(const name: string; params: tnode; res:tdef);
@@ -118,7 +118,7 @@ interface
           { called for each definition in a class and verifies if a method
           { called for each definition in a class and verifies if a method
             is abstract or not, if it is abstract, give out a warning
             is abstract or not, if it is abstract, give out a warning
           }
           }
-          procedure verifyabstract(p : tnamedindexitem;arg:pointer);
+          procedure verifyabstract(p : TObject;arg:pointer);
           procedure insertintolist(l : tnodelist);override;
           procedure insertintolist(l : tnodelist);override;
           function  pass_1 : tnode;override;
           function  pass_1 : tnode;override;
           function  pass_typecheck:tnode;override;
           function  pass_typecheck:tnode;override;
@@ -284,7 +284,7 @@ type
                 newdonestatement:=laststatement(aktcallnode.methodpointerdone);
                 newdonestatement:=laststatement(aktcallnode.methodpointerdone);
               end;
               end;
             { temp create }
             { temp create }
-            usederef:=(p.resultdef.deftype in [arraydef,recorddef]) or
+            usederef:=(p.resultdef.typ in [arraydef,recorddef]) or
                       is_shortstring(p.resultdef) or
                       is_shortstring(p.resultdef) or
                       is_object(p.resultdef);
                       is_object(p.resultdef);
             { avoid refcount increase }
             { avoid refcount increase }
@@ -359,10 +359,10 @@ type
         len:=-1;
         len:=-1;
         loadconst:=true;
         loadconst:=true;
         hightree:=nil;
         hightree:=nil;
-        case p.resultdef.deftype of
+        case p.resultdef.typ of
           arraydef :
           arraydef :
             begin
             begin
-              if (paradef.deftype<>arraydef) then
+              if (paradef.typ<>arraydef) then
                 internalerror(200405241);
                 internalerror(200405241);
               { passing a string to an array of char }
               { passing a string to an array of char }
               if (p.nodetype=stringconstn) then
               if (p.nodetype=stringconstn) then
@@ -594,8 +594,8 @@ type
              { Convert tp procvars, this is needs to be done
              { Convert tp procvars, this is needs to be done
                here to make the change permanent. in the overload
                here to make the change permanent. in the overload
                choosing the changes are only made temporary }
                choosing the changes are only made temporary }
-             if (left.resultdef.deftype=procvardef) and
-                (parasym.vardef.deftype<>procvardef) then
+             if (left.resultdef.typ=procvardef) and
+                (parasym.vardef.typ<>procvardef) then
                begin
                begin
                  if maybe_call_procvar(left,true) then
                  if maybe_call_procvar(left,true) then
                    resultdef:=left.resultdef;
                    resultdef:=left.resultdef;
@@ -604,7 +604,7 @@ type
              { Remove implicitly inserted typecast to pointer for
              { Remove implicitly inserted typecast to pointer for
                @procvar in macpas }
                @procvar in macpas }
              if (m_mac_procvar in current_settings.modeswitches) and
              if (m_mac_procvar in current_settings.modeswitches) and
-                (parasym.vardef.deftype=procvardef) and
+                (parasym.vardef.typ=procvardef) and
                 (left.nodetype=typeconvn) and
                 (left.nodetype=typeconvn) and
                 is_voidpointer(left.resultdef) and
                 is_voidpointer(left.resultdef) and
                 (ttypeconvnode(left).left.nodetype=typeconvn) and
                 (ttypeconvnode(left).left.nodetype=typeconvn) and
@@ -643,7 +643,7 @@ type
                    it here before the arrayconstructor node breaks the tree
                    it here before the arrayconstructor node breaks the tree
                    with its conversions of enum->ord }
                    with its conversions of enum->ord }
                  if (left.nodetype=arrayconstructorn) and
                  if (left.nodetype=arrayconstructorn) and
-                    (parasym.vardef.deftype=setdef) then
+                    (parasym.vardef.typ=setdef) then
                    inserttypeconv(left,parasym.vardef);
                    inserttypeconv(left,parasym.vardef);
 
 
                  { set some settings needed for arrayconstructor }
                  { set some settings needed for arrayconstructor }
@@ -661,19 +661,19 @@ type
                        include(left.flags,nf_novariaallowed);
                        include(left.flags,nf_novariaallowed);
                        { now that the resultting type is know we can insert the required
                        { now that the resultting type is know we can insert the required
                          typeconvs for the array constructor }
                          typeconvs for the array constructor }
-                       if parasym.vardef.deftype=arraydef then
+                       if parasym.vardef.typ=arraydef then
                          tarrayconstructornode(left).force_type(tarraydef(parasym.vardef).elementdef);
                          tarrayconstructornode(left).force_type(tarraydef(parasym.vardef).elementdef);
                      end;
                      end;
                   end;
                   end;
 
 
                  { check if local proc/func is assigned to procvar }
                  { check if local proc/func is assigned to procvar }
-                 if left.resultdef.deftype=procvardef then
+                 if left.resultdef.typ=procvardef then
                    test_local_to_procvar(tprocvardef(left.resultdef),parasym.vardef);
                    test_local_to_procvar(tprocvardef(left.resultdef),parasym.vardef);
 
 
                  { test conversions }
                  { test conversions }
                  if not(is_shortstring(left.resultdef) and
                  if not(is_shortstring(left.resultdef) and
                         is_shortstring(parasym.vardef)) and
                         is_shortstring(parasym.vardef)) and
-                    (parasym.vardef.deftype<>formaldef) then
+                    (parasym.vardef.typ<>formaldef) then
                    begin
                    begin
                       { Process open parameters }
                       { Process open parameters }
                       if paramanager.push_high_param(parasym.varspez,parasym.vardef,aktcallnode.procdefinition.proccalloption) then
                       if paramanager.push_high_param(parasym.varspez,parasym.vardef,aktcallnode.procdefinition.proccalloption) then
@@ -708,7 +708,7 @@ type
                    end;
                    end;
 
 
                  { Handle formal parameters separate }
                  { Handle formal parameters separate }
-                 if (parasym.vardef.deftype=formaldef) then
+                 if (parasym.vardef.typ=formaldef) then
                    begin
                    begin
                      { load procvar if a procedure is passed }
                      { load procvar if a procedure is passed }
                      if ((m_tp_procvar in current_settings.modeswitches) or
                      if ((m_tp_procvar in current_settings.modeswitches) or
@@ -747,7 +747,7 @@ type
                  if (
                  if (
                      not(
                      not(
                          (vo_is_hidden_para in parasym.varoptions) and
                          (vo_is_hidden_para in parasym.varoptions) and
-                         (left.resultdef.deftype in [pointerdef,classrefdef])
+                         (left.resultdef.typ in [pointerdef,classrefdef])
                         ) and
                         ) and
                      paramanager.push_addr_param(parasym.varspez,parasym.vardef,
                      paramanager.push_addr_param(parasym.varspez,parasym.vardef,
                          aktcallnode.procdefinition.proccalloption) and
                          aktcallnode.procdefinition.proccalloption) and
@@ -839,7 +839,7 @@ type
                                  TCALLNODE
                                  TCALLNODE
  ****************************************************************************}
  ****************************************************************************}
 
 
-    constructor tcallnode.create(l:tnode;v : tprocsym;st : tsymtable; mp: tnode; callflags:tcallnodeflags);
+    constructor tcallnode.create(l:tnode;v : tprocsym;st : TSymtable; mp: tnode; callflags:tcallnodeflags);
       begin
       begin
          inherited create(calln,l,nil);
          inherited create(calln,l,nil);
          symtableprocentry:=v;
          symtableprocentry:=v;
@@ -875,10 +875,10 @@ type
        var
        var
          srsym: tsym;
          srsym: tsym;
        begin
        begin
-         srsym := tsym(systemunit.search(name));
+         srsym := tsym(systemunit.Find(name));
          if not assigned(srsym) and
          if not assigned(srsym) and
             (cs_compilesystem in current_settings.moduleswitches) then
             (cs_compilesystem in current_settings.moduleswitches) then
-           srsym := tsym(systemunit.search(upper(name)));
+           srsym := tsym(systemunit.Find(upper(name)));
          if not assigned(srsym) or
          if not assigned(srsym) or
             (srsym.typ<>procsym) then
             (srsym.typ<>procsym) then
            Message1(cg_f_unknown_compilerproc,name);
            Message1(cg_f_unknown_compilerproc,name);
@@ -1135,7 +1135,7 @@ type
       end;
       end;
 
 
 
 
-    procedure tcallnode.verifyabstract(p : tnamedindexitem;arg:pointer);
+    procedure tcallnode.verifyabstract(p : TObject;arg:pointer);
 
 
       var
       var
          hp : tprocdef;
          hp : tprocdef;
@@ -1177,11 +1177,11 @@ type
         }
         }
         if assigned(methodpointer) then
         if assigned(methodpointer) then
           begin
           begin
-            if (methodpointer.resultdef.deftype = objectdef) then
+            if (methodpointer.resultdef.typ = objectdef) then
               objectdf:=tobjectdef(methodpointer.resultdef)
               objectdf:=tobjectdef(methodpointer.resultdef)
             else
             else
-              if (methodpointer.resultdef.deftype = classrefdef) and
-                 (tclassrefdef(methodpointer.resultdef).pointeddef.deftype = objectdef) and
+              if (methodpointer.resultdef.typ = classrefdef) and
+                 (tclassrefdef(methodpointer.resultdef).pointeddef.typ = objectdef) and
                  (methodpointer.nodetype in [typen,loadvmtaddrn]) then
                  (methodpointer.nodetype in [typen,loadvmtaddrn]) then
                 objectdf:=tobjectdef(tclassrefdef(methodpointer.resultdef).pointeddef);
                 objectdf:=tobjectdef(tclassrefdef(methodpointer.resultdef).pointeddef);
           end;
           end;
@@ -1209,7 +1209,7 @@ type
           begin
           begin
              objectdf := objectinfo.objinfo;
              objectdf := objectinfo.objinfo;
              if assigned(objectdf.symtable) then
              if assigned(objectdf.symtable) then
-               objectdf.symtable.foreach(@verifyabstract,nil);
+               objectdf.symtable.SymList.ForEachCall(@verifyabstract,nil);
              objectinfo:=tobjectinfoitem(objectinfo.next);
              objectinfo:=tobjectinfoitem(objectinfo.next);
           end;
           end;
         if assigned(parents) then
         if assigned(parents) then
@@ -1234,7 +1234,7 @@ type
         hsym : tfieldvarsym;
         hsym : tfieldvarsym;
       begin
       begin
         { find self field in methodpointer record }
         { find self field in methodpointer record }
-        hsym:=tfieldvarsym(trecorddef(methodpointertype).symtable.search('self'));
+        hsym:=tfieldvarsym(trecorddef(methodpointertype).symtable.Find('self'));
         if not assigned(hsym) then
         if not assigned(hsym) then
           internalerror(200305251);
           internalerror(200305251);
         { Load tmehodpointer(right).self }
         { Load tmehodpointer(right).self }
@@ -1258,7 +1258,7 @@ type
           if (procdefinition.proctypeoption=potype_constructor) then
           if (procdefinition.proctypeoption=potype_constructor) then
             begin
             begin
               { push 0 as self when allocation is needed }
               { push 0 as self when allocation is needed }
-              if (methodpointer.resultdef.deftype=classrefdef) or
+              if (methodpointer.resultdef.typ=classrefdef) or
                  (cnf_new_call in callnodeflags) then
                  (cnf_new_call in callnodeflags) then
                 selftree:=cpointerconstnode.create(0,voidpointertype)
                 selftree:=cpointerconstnode.create(0,voidpointertype)
               else
               else
@@ -1274,7 +1274,7 @@ type
           if (po_classmethod in procdefinition.procoptions) or
           if (po_classmethod in procdefinition.procoptions) or
              (po_staticmethod in procdefinition.procoptions) then
              (po_staticmethod in procdefinition.procoptions) then
             begin
             begin
-              if (procdefinition.deftype<>procdef) then
+              if (procdefinition.typ<>procdef) then
                 internalerror(200305062);
                 internalerror(200305062);
               if (oo_has_vmt in tprocdef(procdefinition)._class.objectoptions) then
               if (oo_has_vmt in tprocdef(procdefinition)._class.objectoptions) then
                 begin
                 begin
@@ -1282,7 +1282,7 @@ type
                     need to check for typen, because that will always get the
                     need to check for typen, because that will always get the
                     loadvmtaddrnode added }
                     loadvmtaddrnode added }
                   selftree:=methodpointer.getcopy;
                   selftree:=methodpointer.getcopy;
-                  if methodpointer.resultdef.deftype<>classrefdef then
+                  if methodpointer.resultdef.typ<>classrefdef then
                     selftree:=cloadvmtaddrnode.create(selftree);
                     selftree:=cloadvmtaddrnode.create(selftree);
                 end
                 end
               else
               else
@@ -1309,7 +1309,7 @@ type
 
 
         { Handle classes and legacy objects separate to make it
         { Handle classes and legacy objects separate to make it
           more maintainable }
           more maintainable }
-        if (methodpointer.resultdef.deftype=classrefdef) then
+        if (methodpointer.resultdef.typ=classrefdef) then
           begin
           begin
             if not is_class(tclassrefdef(methodpointer.resultdef).pointeddef) then
             if not is_class(tclassrefdef(methodpointer.resultdef).pointeddef) then
               internalerror(200501041);
               internalerror(200501041);
@@ -1693,7 +1693,7 @@ type
                         like a bug. It's also not documented }
                         like a bug. It's also not documented }
                       if (m_delphi in current_settings.modeswitches) and
                       if (m_delphi in current_settings.modeswitches) and
                          (cnf_anon_inherited in callnodeflags) and
                          (cnf_anon_inherited in callnodeflags) and
-                         (symtableprocentry.owner.symtabletype=objectsymtable) and
+                         (symtableprocentry.owner.symtabletype=ObjectSymtable) and
                          (po_overload in symtableprocentry.first_procdef.procoptions) and
                          (po_overload in symtableprocentry.first_procdef.procoptions) and
                          (symtableprocentry.procdef_count>=2) then
                          (symtableprocentry.procdef_count>=2) then
                         result:=cnothingnode.create
                         result:=cnothingnode.create
@@ -1757,15 +1757,6 @@ type
                       { assign procdefinition }
                       { assign procdefinition }
                       if symtableproc=nil then
                       if symtableproc=nil then
                         symtableproc:=procdefinition.owner;
                         symtableproc:=procdefinition.owner;
-
-                      { update browser information }
-                      if make_ref then
-                        begin
-                           tprocdef(procdefinition).lastref:=tref.create(tprocdef(procdefinition).lastref,@fileinfo);
-                           inc(tprocdef(procdefinition).refcount);
-                           if tprocdef(procdefinition).defref=nil then
-                             tprocdef(procdefinition).defref:=tprocdef(procdefinition).lastref;
-                        end;
                     end
                     end
                    else
                    else
                     begin
                     begin
@@ -1790,7 +1781,7 @@ type
            end;
            end;
 
 
           { check for hints (deprecated etc) }
           { check for hints (deprecated etc) }
-          if (procdefinition.deftype = procdef) then
+          if (procdefinition.typ = procdef) then
             check_hints(tprocdef(procdefinition).procsym,tprocdef(procdefinition).symoptions);
             check_hints(tprocdef(procdefinition).procsym,tprocdef(procdefinition).symoptions);
 
 
           { add needed default parameters }
           { add needed default parameters }
@@ -1861,7 +1852,7 @@ type
             if (procdefinition.proctypeoption=potype_constructor) and
             if (procdefinition.proctypeoption=potype_constructor) and
                assigned(methodpointer) and
                assigned(methodpointer) and
                assigned(methodpointer.resultdef) and
                assigned(methodpointer.resultdef) and
-               (methodpointer.resultdef.deftype=classrefdef) then
+               (methodpointer.resultdef.typ=classrefdef) then
               resultdef:=tclassrefdef(methodpointer.resultdef).pointeddef
               resultdef:=tclassrefdef(methodpointer.resultdef).pointeddef
             else
             else
             { Member call to a (inherited) constructor from the class, the return
             { Member call to a (inherited) constructor from the class, the return
@@ -1924,9 +1915,9 @@ type
                if (procdefinition.proctypeoption=potype_constructor) or
                if (procdefinition.proctypeoption=potype_constructor) or
                   ((hpt.nodetype=loadn) and
                   ((hpt.nodetype=loadn) and
                    (
                    (
-                    (methodpointer.resultdef.deftype=classrefdef) or
+                    (methodpointer.resultdef.typ=classrefdef) or
                     (
                     (
-                     (methodpointer.resultdef.deftype=objectdef) and
+                     (methodpointer.resultdef.typ=objectdef) and
                      not(oo_has_virtual in tobjectdef(methodpointer.resultdef).objectoptions)
                      not(oo_has_virtual in tobjectdef(methodpointer.resultdef).objectoptions)
                     )
                     )
                    )
                    )
@@ -1954,7 +1945,7 @@ type
           begin
           begin
             { When this is method the methodpointer must be available }
             { When this is method the methodpointer must be available }
             if (right=nil) and
             if (right=nil) and
-               (procdefinition.owner.symtabletype=objectsymtable) then
+               (procdefinition.owner.symtabletype=ObjectSymtable) then
               internalerror(200305061);
               internalerror(200305061);
           end;
           end;
 
 
@@ -2060,6 +2051,7 @@ type
       var
       var
         paras: tcallparanode;
         paras: tcallparanode;
         temp: tnode;
         temp: tnode;
+        indexnr : integer;
       begin
       begin
         result := fen_false;
         result := fen_false;
         n.fileinfo := pfileposinfo(arg)^;
         n.fileinfo := pfileposinfo(arg)^;
@@ -2085,10 +2077,11 @@ type
                   { local? }
                   { local? }
                   if (tloadnode(n).symtableentry.owner <> tprocdef(procdefinition).localst) then
                   if (tloadnode(n).symtableentry.owner <> tprocdef(procdefinition).localst) then
                     exit;
                     exit;
-                  if (tloadnode(n).symtableentry.indexnr >= inlinelocals.count) or
-                     not assigned(inlinelocals[tloadnode(n).symtableentry.indexnr]) then
+                  indexnr:=tloadnode(n).symtableentry.owner.SymList.IndexOf(tloadnode(n).symtableentry);
+                  if (indexnr >= inlinelocals.count) or
+                     not assigned(inlinelocals[indexnr]) then
                     internalerror(20040720);
                     internalerror(20040720);
-                  temp := tnode(inlinelocals[tloadnode(n).symtableentry.indexnr]).getcopy;
+                  temp := tnode(inlinelocals[indexnr]).getcopy;
                   n.free;
                   n.free;
                   n := temp;
                   n := temp;
                   typecheckpass(n);
                   typecheckpass(n);
@@ -2105,15 +2098,17 @@ type
           createstatement, deletestatement: tstatementnode;
           createstatement, deletestatement: tstatementnode;
         end;
         end;
 
 
-    procedure tcallnode.createlocaltemps(p:TNamedIndexItem;arg:pointer);
+    procedure tcallnode.createlocaltemps(p:TObject;arg:pointer);
       var
       var
         tempinfo: ptempnodes absolute arg;
         tempinfo: ptempnodes absolute arg;
         tempnode: ttempcreatenode;
         tempnode: ttempcreatenode;
+        indexnr : integer;
       begin
       begin
-        if (tsymentry(p).typ <> localvarsym) then
+        if (TSym(p).typ <> localvarsym) then
           exit;
           exit;
-        if (p.indexnr >= inlinelocals.count) then
-          inlinelocals.count:=p.indexnr+10;
+        indexnr:=TSym(p).Owner.SymList.IndexOf(p);
+        if (indexnr >= inlinelocals.count) then
+          inlinelocals.count:=indexnr+10;
         if (vo_is_funcret in tabstractvarsym(p).varoptions) and
         if (vo_is_funcret in tabstractvarsym(p).varoptions) and
            assigned(funcretnode) then
            assigned(funcretnode) then
           begin
           begin
@@ -2125,7 +2120,7 @@ type
                 { a global variable that gets changed inside the function                }
                 { a global variable that gets changed inside the function                }
                 internalerror(2004072101);
                 internalerror(2004072101);
               end;
               end;
-            inlinelocals[tabstractvarsym(p).indexnr] := funcretnode.getcopy
+            inlinelocals[indexnr] := funcretnode.getcopy
           end
           end
         else
         else
           begin
           begin
@@ -2145,7 +2140,7 @@ type
               end
               end
             else
             else
               addstatement(tempinfo^.deletestatement,ctempdeletenode.create(tempnode));
               addstatement(tempinfo^.deletestatement,ctempdeletenode.create(tempnode));
-            inlinelocals[p.indexnr] := ctemprefnode.create(tempnode);
+            inlinelocals[indexnr] := ctemprefnode.create(tempnode);
           end;
           end;
       end;
       end;
 
 
@@ -2157,12 +2152,12 @@ type
         if (n.nodetype = derefn) or
         if (n.nodetype = derefn) or
            ((n.nodetype = loadn) and
            ((n.nodetype = loadn) and
             { globals and fields of (possibly global) objects could always be changed in the callee }
             { globals and fields of (possibly global) objects could always be changed in the callee }
-            ((tloadnode(n).symtable.symtabletype in [globalsymtable,objectsymtable]) or
+            ((tloadnode(n).symtable.symtabletype in [globalsymtable,ObjectSymtable]) or
             { statics can only be modified by functions in the same unit }
             { statics can only be modified by functions in the same unit }
              ((tloadnode(n).symtable.symtabletype = staticsymtable) and
              ((tloadnode(n).symtable.symtabletype = staticsymtable) and
-              (tloadnode(n).symtable = tsymtable(arg))))) or
+              (tloadnode(n).symtable = TSymtable(arg))))) or
            ((n.nodetype = subscriptn) and
            ((n.nodetype = subscriptn) and
-            (tsubscriptnode(n).vs.owner.symtabletype = objectsymtable)) then
+            (tsubscriptnode(n).vs.owner.symtabletype = ObjectSymtable)) then
           result := fen_norecurse_true;
           result := fen_norecurse_true;
       end;
       end;
 
 
@@ -2205,7 +2200,7 @@ type
                   ((tparavarsym(para.parasym).varregable in [vr_none,vr_addr]) and
                   ((tparavarsym(para.parasym).varregable in [vr_none,vr_addr]) and
                    not(para.left.expectloc in [LOC_REFERENCE,LOC_CREFERENCE]))  or
                    not(para.left.expectloc in [LOC_REFERENCE,LOC_CREFERENCE]))  or
                   { we can't assign to formaldef temps }
                   { we can't assign to formaldef temps }
-                  ((para.parasym.vardef.deftype<>formaldef) and
+                  ((para.parasym.vardef.typ<>formaldef) and
                    (
                    (
                     { if paracomplexity > 1, we normally take the address of   }
                     { if paracomplexity > 1, we normally take the address of   }
                     { the parameter expression, store it in a temp and         }
                     { the parameter expression, store it in a temp and         }
@@ -2339,12 +2334,12 @@ type
           end;
           end;
         { local variables }
         { local variables }
         if not assigned(tprocdef(procdefinition).localst) or
         if not assigned(tprocdef(procdefinition).localst) or
-           (tprocdef(procdefinition).localst.symindex.count = 0) then
+           (tprocdef(procdefinition).localst.SymList.count = 0) then
           exit;
           exit;
         tempnodes.createstatement := createstatement;
         tempnodes.createstatement := createstatement;
         tempnodes.deletestatement := deletestatement;
         tempnodes.deletestatement := deletestatement;
-        inlinelocals.count:=tprocdef(procdefinition).localst.symindex.count;
-        tprocdef(procdefinition).localst.foreach(@createlocaltemps,@tempnodes);
+        inlinelocals.count:=tprocdef(procdefinition).localst.SymList.count;
+        tprocdef(procdefinition).localst.SymList.ForEachCall(@createlocaltemps,@tempnodes);
         createstatement := tempnodes.createstatement;
         createstatement := tempnodes.createstatement;
         deletestatement := tempnodes.deletestatement;
         deletestatement := tempnodes.deletestatement;
       end;
       end;
@@ -2430,7 +2425,7 @@ type
 
 
     function tcallnode.pass_1 : tnode;
     function tcallnode.pass_1 : tnode;
       var
       var
-        st : tsymtable;
+        st : TSymtable;
       begin
       begin
          result:=nil;
          result:=nil;
 
 
@@ -2440,7 +2435,7 @@ type
              { Check if we can inline the procedure when it references proc/var that
              { Check if we can inline the procedure when it references proc/var that
                are not in the globally available }
                are not in the globally available }
              st:=procdefinition.owner;
              st:=procdefinition.owner;
-             if (st.symtabletype=objectsymtable) then
+             if (st.symtabletype=ObjectSymtable) then
                st:=st.defowner.owner;
                st:=st.defowner.owner;
              if (pi_uses_static_symtable in tprocdef(procdefinition).inlininginfo^.flags) and
              if (pi_uses_static_symtable in tprocdef(procdefinition).inlininginfo^.flags) and
                 (st.symtabletype=globalsymtable) and
                 (st.symtabletype=globalsymtable) and
@@ -2529,7 +2524,7 @@ type
              { we have only to handle the result if it is used }
              { we have only to handle the result if it is used }
               if (cnf_return_value_used in callnodeflags) then
               if (cnf_return_value_used in callnodeflags) then
                begin
                begin
-                 case resultdef.deftype of
+                 case resultdef.typ of
                    enumdef,
                    enumdef,
                    orddef :
                    orddef :
                      begin
                      begin
@@ -2556,7 +2551,7 @@ type
                        else
                        else
 {$endif cpufpemu}
 {$endif cpufpemu}
 {$ifdef m68k}
 {$ifdef m68k}
-                        if (tfloatdef(resultdef).typ=s32real) then
+                        if (tfloatdef(resultdef).floattype=s32real) then
                          registersint:=1
                          registersint:=1
                        else
                        else
 {$endif m68k}
 {$endif m68k}
@@ -2711,7 +2706,7 @@ type
     procedure tcallnode.printnodedata(var t:text);
     procedure tcallnode.printnodedata(var t:text);
       begin
       begin
         if assigned(procdefinition) and
         if assigned(procdefinition) and
-           (procdefinition.deftype=procdef) then
+           (procdefinition.typ=procdef) then
           writeln(t,printnodeindention,'proc = ',tprocdef(procdefinition).fullprocname(true))
           writeln(t,printnodeindention,'proc = ',tprocdef(procdefinition).fullprocname(true))
         else
         else
           begin
           begin

+ 3 - 3
compiler/ncgadd.pas

@@ -232,9 +232,9 @@ interface
     procedure tcgaddnode.second_opsmallset;
     procedure tcgaddnode.second_opsmallset;
       begin
       begin
         { when a setdef is passed, it has to be a smallset }
         { when a setdef is passed, it has to be a smallset }
-        if ((left.resultdef.deftype=setdef) and
+        if ((left.resultdef.typ=setdef) and
             (tsetdef(left.resultdef).settype<>smallset)) or
             (tsetdef(left.resultdef).settype<>smallset)) or
-           ((right.resultdef.deftype=setdef) and
+           ((right.resultdef.typ=setdef) and
             (tsetdef(right.resultdef).settype<>smallset)) then
             (tsetdef(right.resultdef).settype<>smallset)) then
           internalerror(200203301);
           internalerror(200203301);
 
 
@@ -738,7 +738,7 @@ interface
 
 
     procedure tcgaddnode.pass_generate_code;
     procedure tcgaddnode.pass_generate_code;
       begin
       begin
-        case left.resultdef.deftype of
+        case left.resultdef.typ of
           orddef :
           orddef :
             begin
             begin
               { handling boolean expressions }
               { handling boolean expressions }

+ 1 - 1
compiler/ncgbas.pas

@@ -382,7 +382,7 @@ interface
           end
           end
         else if tempinfo^.may_be_in_reg then
         else if tempinfo^.may_be_in_reg then
           begin
           begin
-            if tempinfo^.typedef.deftype=floatdef then
+            if tempinfo^.typedef.typ=floatdef then
               begin
               begin
 {$ifdef x86}
 {$ifdef x86}
                 if use_sse(tempinfo^.typedef) then
                 if use_sse(tempinfo^.typedef) then

+ 6 - 6
compiler/ncgcal.pas

@@ -131,7 +131,7 @@ implementation
           location_force_reg(current_asmdata.CurrAsmList,left.location,def_cgsize(left.resultdef),false);
           location_force_reg(current_asmdata.CurrAsmList,left.location,def_cgsize(left.resultdef),false);
 
 
         { Handle Floating point types differently }
         { Handle Floating point types differently }
-        if (left.resultdef.deftype=floatdef) and not(cs_fp_emulation in current_settings.moduleswitches) then
+        if (left.resultdef.typ=floatdef) and not(cs_fp_emulation in current_settings.moduleswitches) then
          begin
          begin
 {$ifdef i386}
 {$ifdef i386}
            if tempcgpara.location^.loc<>LOC_REFERENCE then
            if tempcgpara.location^.loc<>LOC_REFERENCE then
@@ -398,7 +398,7 @@ implementation
                  { don't push a node that already generated a pointer type
                  { don't push a node that already generated a pointer type
                    by address for implicit hidden parameters }
                    by address for implicit hidden parameters }
                  if (vo_is_funcret in parasym.varoptions) or
                  if (vo_is_funcret in parasym.varoptions) or
-                    (not(left.resultdef.deftype in [pointerdef,classrefdef]) and
+                    (not(left.resultdef.typ in [pointerdef,classrefdef]) and
                      paramanager.push_addr_param(parasym.varspez,parasym.vardef,
                      paramanager.push_addr_param(parasym.varspez,parasym.vardef,
                          aktcallnode.procdefinition.proccalloption)) then
                          aktcallnode.procdefinition.proccalloption)) then
                    push_addr_para
                    push_addr_para
@@ -406,7 +406,7 @@ implementation
                    push_value_para;
                    push_value_para;
                end
                end
              { formal def }
              { formal def }
-             else if (parasym.vardef.deftype=formaldef) then
+             else if (parasym.vardef.typ=formaldef) then
                begin
                begin
                   { allow passing of a constant to a const formaldef }
                   { allow passing of a constant to a const formaldef }
                   if (parasym.varspez=vs_const) and
                   if (parasym.varspez=vs_const) and
@@ -421,7 +421,7 @@ implementation
                    by address for implicit hidden parameters }
                    by address for implicit hidden parameters }
                  if (not(
                  if (not(
                          (vo_is_hidden_para in parasym.varoptions) and
                          (vo_is_hidden_para in parasym.varoptions) and
-                         (left.resultdef.deftype in [pointerdef,classrefdef])
+                         (left.resultdef.typ in [pointerdef,classrefdef])
                         ) and
                         ) and
                      paramanager.push_addr_param(parasym.varspez,parasym.vardef,
                      paramanager.push_addr_param(parasym.varspez,parasym.vardef,
                          aktcallnode.procdefinition.proccalloption)) and
                          aktcallnode.procdefinition.proccalloption)) and
@@ -603,7 +603,7 @@ implementation
                               cg.a_load_reg_reg(current_asmdata.CurrAsmList,cgsize,def_cgsize(resultdef),procdefinition.funcretloc[callerside].register,location.register);
                               cg.a_load_reg_reg(current_asmdata.CurrAsmList,cgsize,def_cgsize(resultdef),procdefinition.funcretloc[callerside].register,location.register);
                             end;
                             end;
 {$ifdef arm}
 {$ifdef arm}
-                          if (resultdef.deftype=floatdef) and (current_settings.fputype in [fpu_fpa,fpu_fpa10,fpu_fpa11]) then
+                          if (resultdef.typ=floatdef) and (current_settings.fputype in [fpu_fpa,fpu_fpa10,fpu_fpa11]) then
                             begin
                             begin
                               location_force_mem(current_asmdata.CurrAsmList,location);
                               location_force_mem(current_asmdata.CurrAsmList,location);
                             end;
                             end;
@@ -894,7 +894,7 @@ implementation
                  secondpass(methodpointer);
                  secondpass(methodpointer);
 
 
                  { Load VMT from self }
                  { Load VMT from self }
-                 if methodpointer.resultdef.deftype=objectdef then
+                 if methodpointer.resultdef.typ=objectdef then
                    gen_load_vmt_register(current_asmdata.CurrAsmList,tobjectdef(methodpointer.resultdef),methodpointer.location,vmtreg)
                    gen_load_vmt_register(current_asmdata.CurrAsmList,tobjectdef(methodpointer.resultdef),methodpointer.location,vmtreg)
                  else
                  else
                    begin
                    begin

+ 6 - 6
compiler/ncgcnv.pas

@@ -260,7 +260,7 @@ interface
     procedure tcgtypeconvnode.second_char_to_string;
     procedure tcgtypeconvnode.second_char_to_string;
       begin
       begin
          location_reset(location,LOC_REFERENCE,OS_NO);
          location_reset(location,LOC_REFERENCE,OS_NO);
-         case tstringdef(resultdef).string_typ of
+         case tstringdef(resultdef).stringtype of
            st_shortstring :
            st_shortstring :
              begin
              begin
                tg.GetTemp(current_asmdata.CurrAsmList,256,tt_normal,location.reference);
                tg.GetTemp(current_asmdata.CurrAsmList,256,tt_normal,location.reference);
@@ -509,12 +509,12 @@ interface
           or the other way round, move to memory first to prevent
           or the other way round, move to memory first to prevent
           invalid LOC_FPUREGISTER locations }
           invalid LOC_FPUREGISTER locations }
         if (
         if (
-            (resultdef.deftype=floatdef) and
+            (resultdef.typ=floatdef) and
             (location.loc=LOC_CONSTANT)
             (location.loc=LOC_CONSTANT)
            ) or
            ) or
            (
            (
-            (left.resultdef.deftype=floatdef) xor
-            (resultdef.deftype=floatdef)
+            (left.resultdef.typ=floatdef) xor
+            (resultdef.typ=floatdef)
            ) then
            ) then
           location_force_mem(current_asmdata.CurrAsmList,location);
           location_force_mem(current_asmdata.CurrAsmList,location);
 
 
@@ -548,8 +548,8 @@ interface
 {$ifdef TESTOBJEXT2}
 {$ifdef TESTOBJEXT2}
          { Check explicit conversions to objects pointers !! }
          { Check explicit conversions to objects pointers !! }
          if p^.explizit and
          if p^.explizit and
-            (p^.resultdef.deftype=pointerdef) and
-            (tpointerdef(p^.resultdef).definition.deftype=objectdef) and not
+            (p^.resultdef.typ=pointerdef) and
+            (tpointerdef(p^.resultdef).definition.typ=objectdef) and not
             (tobjectdef(tpointerdef(p^.resultdef).definition).isclass) and
             (tobjectdef(tpointerdef(p^.resultdef).definition).isclass) and
             ((tobjectdef(tpointerdef(p^.resultdef).definition).options and oo_hasvmt)<>0) and
             ((tobjectdef(tpointerdef(p^.resultdef).definition).options and oo_hasvmt)<>0) and
             (cs_check_range in current_settings.localswitches) then
             (cs_check_range in current_settings.localswitches) then

+ 1 - 1
compiler/ncgcon.pas

@@ -92,7 +92,7 @@ implementation
       begin
       begin
         location_reset(location,LOC_CREFERENCE,def_cgsize(resultdef));
         location_reset(location,LOC_CREFERENCE,def_cgsize(resultdef));
         lastlabel:=nil;
         lastlabel:=nil;
-        realait:=floattype2ait[tfloatdef(resultdef).typ];
+        realait:=floattype2ait[tfloatdef(resultdef).floattype];
 {$ifdef ARM}
 {$ifdef ARM}
         hiloswapped:=current_settings.fputype in [fpu_fpa,fpu_fpa10,fpu_fpa11];
         hiloswapped:=current_settings.fputype in [fpu_fpa,fpu_fpa10,fpu_fpa11];
 {$endif ARM}
 {$endif ARM}

+ 15 - 10
compiler/ncgflw.pas

@@ -1244,6 +1244,7 @@ implementation
          exceptref,
          exceptref,
          href2: treference;
          href2: treference;
          paraloc1 : tcgpara;
          paraloc1 : tcgpara;
+         exceptvarsym : tlocalvarsym;
       begin
       begin
          paraloc1.init;
          paraloc1.init;
          location_reset(location,LOC_VOID,OS_NO);
          location_reset(location,LOC_VOID,OS_NO);
@@ -1265,14 +1266,18 @@ implementation
          { is it this catch? No. go to next onlabel }
          { is it this catch? No. go to next onlabel }
          cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList,OS_ADDR,OC_EQ,0,NR_FUNCTION_RESULT_REG,nextonlabel);
          cg.a_cmp_const_reg_label(current_asmdata.CurrAsmList,OS_ADDR,OC_EQ,0,NR_FUNCTION_RESULT_REG,nextonlabel);
 
 
-         { what a hack ! }
-         if assigned(exceptsymtable) then
+         { Retrieve exception variable }
+         if assigned(excepTSymtable) then
+           exceptvarsym:=tlocalvarsym(excepTSymtable.SymList[0])
+         else
+           exceptvarsym:=nil;
+
+         if assigned(exceptvarsym) then
            begin
            begin
-             tlocalvarsym(exceptsymtable.symindex.first).localloc.loc:=LOC_REFERENCE;
-             tlocalvarsym(exceptsymtable.symindex.first).localloc.size:=OS_ADDR;
-             tg.GetLocal(current_asmdata.CurrAsmList,sizeof(aint),voidpointertype,
-                tlocalvarsym(exceptsymtable.symindex.first).localloc.reference);
-             cg.a_load_reg_ref(current_asmdata.CurrAsmList,OS_ADDR,OS_ADDR,NR_FUNCTION_RESULT_REG,tlocalvarsym(exceptsymtable.symindex.first).localloc.reference);
+             exceptvarsym.localloc.loc:=LOC_REFERENCE;
+             exceptvarsym.localloc.size:=OS_ADDR;
+             tg.GetLocal(current_asmdata.CurrAsmList,sizeof(aint),voidpointertype,exceptvarsym.localloc.reference);
+             cg.a_load_reg_ref(current_asmdata.CurrAsmList,OS_ADDR,OS_ADDR,NR_FUNCTION_RESULT_REG,exceptvarsym.localloc.reference);
            end
            end
          else
          else
            begin
            begin
@@ -1329,10 +1334,10 @@ implementation
          cg.a_label(current_asmdata.CurrAsmList,doobjectdestroy);
          cg.a_label(current_asmdata.CurrAsmList,doobjectdestroy);
          cleanupobjectstack;
          cleanupobjectstack;
          { clear some stuff }
          { clear some stuff }
-         if assigned(exceptsymtable) then
+         if assigned(exceptvarsym) then
            begin
            begin
-             tg.UngetLocal(current_asmdata.CurrAsmList,tlocalvarsym(exceptsymtable.symindex.first).localloc.reference);
-             tlocalvarsym(exceptsymtable.symindex.first).localloc.loc:=LOC_INVALID;
+             tg.UngetLocal(current_asmdata.CurrAsmList,exceptvarsym.localloc.reference);
+             exceptvarsym.localloc.loc:=LOC_INVALID;
            end
            end
          else
          else
            tg.Ungettemp(current_asmdata.CurrAsmList,exceptref);
            tg.Ungettemp(current_asmdata.CurrAsmList,exceptref);

+ 5 - 5
compiler/ncginl.pas

@@ -263,7 +263,7 @@ implementation
               LOC_CREGISTER,
               LOC_CREGISTER,
               LOC_REGISTER :
               LOC_REGISTER :
                 begin
                 begin
-                  if (left.resultdef.deftype=classrefdef) or
+                  if (left.resultdef.typ=classrefdef) or
                      (po_staticmethod in current_procinfo.procdef.procoptions) then
                      (po_staticmethod in current_procinfo.procdef.procoptions) then
                     cg.a_load_reg_reg(current_asmdata.CurrAsmList,OS_ADDR,OS_ADDR,left.location.register,hregister)
                     cg.a_load_reg_reg(current_asmdata.CurrAsmList,OS_ADDR,OS_ADDR,left.location.register,hregister)
                   else
                   else
@@ -288,7 +288,7 @@ implementation
                   else
                   else
                    begin
                    begin
                      { load VMT pointer, but not for classrefdefs }
                      { load VMT pointer, but not for classrefdefs }
-                     if (left.resultdef.deftype=objectdef) then
+                     if (left.resultdef.typ=objectdef) then
                        inc(left.location.reference.offset,tobjectdef(left.resultdef).vmt_offset);
                        inc(left.location.reference.offset,tobjectdef(left.resultdef).vmt_offset);
                      cg.a_load_ref_reg(current_asmdata.CurrAsmList,OS_ADDR,OS_ADDR,left.location.reference,hregister);
                      cg.a_load_ref_reg(current_asmdata.CurrAsmList,OS_ADDR,OS_ADDR,left.location.reference,hregister);
                    end;
                    end;
@@ -409,7 +409,7 @@ implementation
           secondpass(tcallparanode(left).left);
           secondpass(tcallparanode(left).left);
           cgsize:=def_cgsize(tcallparanode(left).left.resultdef);
           cgsize:=def_cgsize(tcallparanode(left).left.resultdef);
           { get addvalue }
           { get addvalue }
-          case tcallparanode(left).left.resultdef.deftype of
+          case tcallparanode(left).left.resultdef.typ of
             orddef,
             orddef,
             enumdef :
             enumdef :
                 addvalue:=1;
                 addvalue:=1;
@@ -534,9 +534,9 @@ implementation
                  (tsetdef(tcallparanode(left).left.resultdef).settype=smallset)
                  (tsetdef(tcallparanode(left).left.resultdef).settype=smallset)
                   and
                   and
                    { elemenut number between 1 and 32 }
                    { elemenut number between 1 and 32 }
-                  ((tcallparanode(tcallparanode(left).right).left.resultdef.deftype=orddef) and
+                  ((tcallparanode(tcallparanode(left).right).left.resultdef.typ=orddef) and
                    (torddef(tcallparanode(tcallparanode(left).right).left.resultdef).high<=32) or
                    (torddef(tcallparanode(tcallparanode(left).right).left.resultdef).high<=32) or
-                   (tcallparanode(tcallparanode(left).right).left.resultdef.deftype=enumdef) and
+                   (tcallparanode(tcallparanode(left).right).left.resultdef.typ=enumdef) and
                    (tenumdef(tcallparanode(tcallparanode(left).right).left.resultdef).max<=32));
                    (tenumdef(tcallparanode(tcallparanode(left).right).left.resultdef).max<=32));
 
 
               { generate code for the element to set }
               { generate code for the element to set }

+ 14 - 14
compiler/ncgld.pas

@@ -80,7 +80,7 @@ implementation
     procedure tcgloadnode.pass_generate_code;
     procedure tcgloadnode.pass_generate_code;
       var
       var
         hregister : tregister;
         hregister : tregister;
-        symtabletype : tsymtabletype;
+        symtabletype : TSymtabletype;
         href : treference;
         href : treference;
         newsize : tcgsize;
         newsize : tcgsize;
         endrelocatelab,
         endrelocatelab,
@@ -238,7 +238,7 @@ implementation
 {$endif OLDREGVARS}
 {$endif OLDREGVARS}
                          begin
                          begin
                            case symtabletype of
                            case symtabletype of
-                              stt_exceptsymtable,
+                              stt_excepTSymtable,
                               localsymtable,
                               localsymtable,
                               parasymtable :
                               parasymtable :
                                 location:=tabstractnormalvarsym(symtableentry).localloc;
                                 location:=tabstractnormalvarsym(symtableentry).localloc;
@@ -636,7 +636,7 @@ implementation
               LOC_MMREGISTER,
               LOC_MMREGISTER,
               LOC_CMMREGISTER:
               LOC_CMMREGISTER:
                 begin
                 begin
-                  if left.resultdef.deftype=arraydef then
+                  if left.resultdef.typ=arraydef then
                     begin
                     begin
                     end
                     end
                   else
                   else
@@ -661,15 +661,15 @@ implementation
               LOC_FPUREGISTER,
               LOC_FPUREGISTER,
               LOC_CFPUREGISTER :
               LOC_CFPUREGISTER :
                 begin
                 begin
-                  if (left.resultdef.deftype=floatdef) then
-                   fputyp:=tfloatdef(left.resultdef).typ
+                  if (left.resultdef.typ=floatdef) then
+                   fputyp:=tfloatdef(left.resultdef).floattype
                   else
                   else
-                   if (right.resultdef.deftype=floatdef) then
-                    fputyp:=tfloatdef(right.resultdef).typ
+                   if (right.resultdef.typ=floatdef) then
+                    fputyp:=tfloatdef(right.resultdef).floattype
                   else
                   else
                    if (right.nodetype=typeconvn) and
                    if (right.nodetype=typeconvn) and
-                      (ttypeconvnode(right).left.resultdef.deftype=floatdef) then
-                    fputyp:=tfloatdef(ttypeconvnode(right).left.resultdef).typ
+                      (ttypeconvnode(right).left.resultdef.typ=floatdef) then
+                    fputyp:=tfloatdef(ttypeconvnode(right).left.resultdef).floattype
                   else
                   else
                     fputyp:=s32real;
                     fputyp:=s32real;
                   { we can't do direct moves between fpu and mm registers }
                   { we can't do direct moves between fpu and mm registers }
@@ -817,13 +817,13 @@ implementation
                  vtype:=$ff;
                  vtype:=$ff;
                  vaddr:=false;
                  vaddr:=false;
                  lt:=hp.left.resultdef;
                  lt:=hp.left.resultdef;
-                 case lt.deftype of
+                 case lt.typ of
                    enumdef,
                    enumdef,
                    orddef :
                    orddef :
                      begin
                      begin
                        if is_64bit(lt) then
                        if is_64bit(lt) then
                          begin
                          begin
-                            case torddef(lt).typ of
+                            case torddef(lt).ordtype of
                               scurrency:
                               scurrency:
                                 vtype:=vtCurrency;
                                 vtype:=vtCurrency;
                               s64bit:
                               s64bit:
@@ -834,16 +834,16 @@ implementation
                             freetemp:=false;
                             freetemp:=false;
                             vaddr:=true;
                             vaddr:=true;
                          end
                          end
-                       else if (lt.deftype=enumdef) or
+                       else if (lt.typ=enumdef) or
                          is_integer(lt) then
                          is_integer(lt) then
                          vtype:=vtInteger
                          vtype:=vtInteger
                        else
                        else
                          if is_boolean(lt) then
                          if is_boolean(lt) then
                            vtype:=vtBoolean
                            vtype:=vtBoolean
                          else
                          else
-                           if (lt.deftype=orddef) then
+                           if (lt.typ=orddef) then
                              begin
                              begin
-                               case torddef(lt).typ of
+                               case torddef(lt).ordtype of
                                  uchar:
                                  uchar:
                                    vtype:=vtChar;
                                    vtype:=vtChar;
                                  uwidechar:
                                  uwidechar:

+ 1 - 1
compiler/ncgmat.pas

@@ -236,7 +236,7 @@ implementation
              second_mmx
              second_mmx
          else
          else
 {$endif SUPPORT_MMX}
 {$endif SUPPORT_MMX}
-           if (left.resultdef.deftype=floatdef) then
+           if (left.resultdef.typ=floatdef) then
              second_float
              second_float
          else
          else
            second_integer;
            second_integer;

+ 12 - 12
compiler/ncgmem.pas

@@ -136,7 +136,7 @@ implementation
             location_reset(location,LOC_REGISTER,OS_ADDR);
             location_reset(location,LOC_REGISTER,OS_ADDR);
             location.register:=cg.getaddressregister(current_asmdata.CurrAsmList);
             location.register:=cg.getaddressregister(current_asmdata.CurrAsmList);
             { load framepointer of current proc }
             { load framepointer of current proc }
-            hsym:=tparavarsym(currpi.procdef.parast.search('parentfp'));
+            hsym:=tparavarsym(currpi.procdef.parast.Find('parentfp'));
             if not assigned(hsym) then
             if not assigned(hsym) then
               internalerror(200309281);
               internalerror(200309281);
             cg.a_load_loc_reg(current_asmdata.CurrAsmList,OS_ADDR,hsym.localloc,location.register);
             cg.a_load_loc_reg(current_asmdata.CurrAsmList,OS_ADDR,hsym.localloc,location.register);
@@ -146,7 +146,7 @@ implementation
                 currpi:=currpi.parent;
                 currpi:=currpi.parent;
                 if not assigned(currpi) then
                 if not assigned(currpi) then
                   internalerror(200311201);
                   internalerror(200311201);
-                hsym:=tparavarsym(currpi.procdef.parast.search('parentfp'));
+                hsym:=tparavarsym(currpi.procdef.parast.Find('parentfp'));
                 if not assigned(hsym) then
                 if not assigned(hsym) then
                   internalerror(200309282);
                   internalerror(200309282);
 
 
@@ -369,7 +369,7 @@ implementation
                  inc(location.reference.offset,vs.fieldoffset);
                  inc(location.reference.offset,vs.fieldoffset);
 {$ifdef SUPPORT_UNALIGNED}
 {$ifdef SUPPORT_UNALIGNED}
                  { packed? }
                  { packed? }
-                 if (vs.owner.defowner.deftype in [recorddef,objectdef]) and
+                 if (vs.owner.defowner.typ in [recorddef,objectdef]) and
                    (tabstractrecordsymtable(vs.owner).usefieldalignment=1) then
                    (tabstractrecordsymtable(vs.owner).usefieldalignment=1) then
                    location.reference.alignment:=1;
                    location.reference.alignment:=1;
 {$endif SUPPORT_UNALIGNED}
 {$endif SUPPORT_UNALIGNED}
@@ -431,7 +431,7 @@ implementation
           get_mul_size:=1
           get_mul_size:=1
          else
          else
           begin
           begin
-            if (left.resultdef.deftype=arraydef) then
+            if (left.resultdef.typ=arraydef) then
              if not is_packed_array(left.resultdef) then
              if not is_packed_array(left.resultdef) then
               get_mul_size:=tarraydef(left.resultdef).elesize
               get_mul_size:=tarraydef(left.resultdef).elesize
              else
              else
@@ -691,7 +691,7 @@ implementation
            internalerror(200411013);
            internalerror(200411013);
 
 
          { offset can only differ from 0 if arraydef }
          { offset can only differ from 0 if arraydef }
-         if (left.resultdef.deftype=arraydef) and
+         if (left.resultdef.typ=arraydef) and
             not(is_dynamic_array(left.resultdef)) and
             not(is_dynamic_array(left.resultdef)) and
             (not(is_packed_array(left.resultdef)) or
             (not(is_packed_array(left.resultdef)) or
              ((mulsize mod 8 = 0) and
              ((mulsize mod 8 = 0) and
@@ -701,7 +701,7 @@ implementation
          if right.nodetype=ordconstn then
          if right.nodetype=ordconstn then
            begin
            begin
               { offset can only differ from 0 if arraydef }
               { offset can only differ from 0 if arraydef }
-              case left.resultdef.deftype of
+              case left.resultdef.typ of
                 arraydef :
                 arraydef :
                   begin
                   begin
                      if not(is_open_array(left.resultdef)) and
                      if not(is_open_array(left.resultdef)) and
@@ -731,7 +731,7 @@ implementation
                   begin
                   begin
                     if (cs_check_range in current_settings.localswitches) then
                     if (cs_check_range in current_settings.localswitches) then
                      begin
                      begin
-                       case tstringdef(left.resultdef).string_typ of
+                       case tstringdef(left.resultdef).stringtype of
                          { it's the same for ansi- and wide strings }
                          { it's the same for ansi- and wide strings }
                          st_widestring,
                          st_widestring,
                          st_ansistring:
                          st_ansistring:
@@ -805,7 +805,7 @@ implementation
                  { need that fancy code (it would be }
                  { need that fancy code (it would be }
                  { buggy)                            }
                  { buggy)                            }
                  not(cs_check_range in current_settings.localswitches) and
                  not(cs_check_range in current_settings.localswitches) and
-                 (left.resultdef.deftype=arraydef) and
+                 (left.resultdef.typ=arraydef) and
                  not is_packed_array(left.resultdef) then
                  not is_packed_array(left.resultdef) then
                 begin
                 begin
                    extraoffset:=0;
                    extraoffset:=0;
@@ -886,20 +886,20 @@ implementation
               { only range check now, we can't range check loc_flags/loc_jump }
               { only range check now, we can't range check loc_flags/loc_jump }
               if cs_check_range in current_settings.localswitches then
               if cs_check_range in current_settings.localswitches then
                begin
                begin
-                 if left.resultdef.deftype=arraydef then
+                 if left.resultdef.typ=arraydef then
                    rangecheck_array;
                    rangecheck_array;
                end;
                end;
 
 
             { produce possible range check code: }
             { produce possible range check code: }
               if cs_check_range in current_settings.localswitches then
               if cs_check_range in current_settings.localswitches then
                begin
                begin
-                 if left.resultdef.deftype=arraydef then
+                 if left.resultdef.typ=arraydef then
                    begin
                    begin
                      { done defore (PM) }
                      { done defore (PM) }
                    end
                    end
-                 else if (left.resultdef.deftype=stringdef) then
+                 else if (left.resultdef.typ=stringdef) then
                    begin
                    begin
-                      case tstringdef(left.resultdef).string_typ of
+                      case tstringdef(left.resultdef).stringtype of
                          { it's the same for ansi- and wide strings }
                          { it's the same for ansi- and wide strings }
                          st_widestring,
                          st_widestring,
                          st_ansistring:
                          st_ansistring:

+ 2 - 2
compiler/ncgset.pas

@@ -233,8 +233,8 @@ implementation
          { check if we can use smallset operation using btl which is limited
          { check if we can use smallset operation using btl which is limited
            to 32 bits, the left side may also not contain higher values !! }
            to 32 bits, the left side may also not contain higher values !! }
          use_small:=(tsetdef(right.resultdef).settype=smallset) and
          use_small:=(tsetdef(right.resultdef).settype=smallset) and
-                    ((left.resultdef.deftype=orddef) and (torddef(left.resultdef).high<=32) or
-                     (left.resultdef.deftype=enumdef) and (tenumdef(left.resultdef).max<=32));
+                    ((left.resultdef.typ=orddef) and (torddef(left.resultdef).high<=32) or
+                     (left.resultdef.typ=enumdef) and (tenumdef(left.resultdef).max<=32));
 
 
          { Can we generate jumps? Possible for all types of sets }
          { Can we generate jumps? Possible for all types of sets }
          checkgenjumps:=(right.nodetype=setconstn) and
          checkgenjumps:=(right.nodetype=setconstn) and

+ 45 - 45
compiler/ncgutil.pas

@@ -89,7 +89,7 @@ interface
     procedure gen_load_return_value(list:TAsmList);
     procedure gen_load_return_value(list:TAsmList);
 
 
     procedure gen_external_stub(list:TAsmList;pd:tprocdef;const externalname:string);
     procedure gen_external_stub(list:TAsmList;pd:tprocdef;const externalname:string);
-    procedure gen_intf_wrappers(list:TAsmList;st:tsymtable);
+    procedure gen_intf_wrappers(list:TAsmList;st:TSymtable);
     procedure gen_load_vmt_register(list:TAsmList;objdef:tobjectdef;selfloc:tlocation;var vmtreg:tregister);
     procedure gen_load_vmt_register(list:TAsmList;objdef:tobjectdef;selfloc:tlocation;var vmtreg:tregister);
 
 
     procedure get_used_regvars(n: tnode; var rv: tusedregvars);
     procedure get_used_regvars(n: tnode; var rv: tusedregvars);
@@ -140,8 +140,8 @@ interface
 
 
     procedure insertbssdata(sym : tglobalvarsym);
     procedure insertbssdata(sym : tglobalvarsym);
 
 
-    procedure gen_alloc_symtable(list:TAsmList;st:tsymtable);
-    procedure gen_free_symtable(list:TAsmList;st:tsymtable);
+    procedure gen_alloc_symtable(list:TAsmList;st:TSymtable);
+    procedure gen_free_symtable(list:TAsmList;st:TSymtable);
 
 
     { rtti and init/final }
     { rtti and init/final }
     procedure generate_rtti(p:Ttypesym);
     procedure generate_rtti(p:Ttypesym);
@@ -850,7 +850,7 @@ implementation
                             Init/Finalize Code
                             Init/Finalize Code
 ****************************************************************************}
 ****************************************************************************}
 
 
-    procedure copyvalueparas(p : tnamedindexitem;arg:pointer);
+    procedure copyvalueparas(p:TObject;arg:pointer);
       var
       var
         href : treference;
         href : treference;
         hreg : tregister;
         hreg : tregister;
@@ -872,7 +872,7 @@ implementation
                 a local copy }
                 a local copy }
               if not(current_procinfo.procdef.proccalloption in [pocall_cdecl,pocall_cppdecl]) then
               if not(current_procinfo.procdef.proccalloption in [pocall_cdecl,pocall_cppdecl]) then
                 begin
                 begin
-                  hsym:=tparavarsym(tsym(p).owner.search('high'+p.name));
+                  hsym:=tparavarsym(tsym(p).owner.Find('high'+tsym(p).name));
                   if not assigned(hsym) then
                   if not assigned(hsym) then
                     internalerror(200306061);
                     internalerror(200306061);
                   hreg:=cg.getaddressregister(list);
                   hreg:=cg.getaddressregister(list);
@@ -962,7 +962,7 @@ implementation
 
 
 
 
     { trash contents of local variables or parameters (function result) }
     { trash contents of local variables or parameters (function result) }
-    procedure trash_variable(p : tnamedindexitem;arg:pointer);
+    procedure trash_variable(p:TObject;arg:pointer);
       var
       var
         trashintval: aint;
         trashintval: aint;
         list: TAsmList absolute arg;
         list: TAsmList absolute arg;
@@ -1011,7 +1011,7 @@ implementation
 
 
 
 
     { initializes the regvars from staticsymtable with 0 }
     { initializes the regvars from staticsymtable with 0 }
-    procedure initialize_regvars(p : tnamedindexitem;arg:pointer);
+    procedure initialize_regvars(p:TObject;arg:pointer);
       begin
       begin
         if (tsym(p).typ=globalvarsym) then
         if (tsym(p).typ=globalvarsym) then
          begin
          begin
@@ -1043,7 +1043,7 @@ implementation
 
 
 
 
     { generates the code for initialisation of local data }
     { generates the code for initialisation of local data }
-    procedure initialize_data(p : tnamedindexitem;arg:pointer);
+    procedure initialize_data(p:TObject;arg:pointer);
       var
       var
         OldAsmList : TAsmList;
         OldAsmList : TAsmList;
         hp : tnode;
         hp : tnode;
@@ -1082,7 +1082,7 @@ implementation
 
 
 
 
     { generates the code for finalisation of local variables }
     { generates the code for finalisation of local variables }
-    procedure finalize_local_vars(p : tnamedindexitem;arg:pointer);
+    procedure finalize_local_vars(p:TObject;arg:pointer);
       begin
       begin
         if (tsym(p).typ=localvarsym) and
         if (tsym(p).typ=localvarsym) and
            (tlocalvarsym(p).refs>0) and
            (tlocalvarsym(p).refs>0) and
@@ -1095,7 +1095,7 @@ implementation
 
 
 
 
     { generates the code for finalisation of local typedconsts }
     { generates the code for finalisation of local typedconsts }
-    procedure finalize_local_typedconst(p : tnamedindexitem;arg:pointer);
+    procedure finalize_local_typedconst(p:TObject;arg:pointer);
       var
       var
         i : longint;
         i : longint;
         pd : tprocdef;
         pd : tprocdef;
@@ -1115,7 +1115,7 @@ implementation
                   if assigned(pd.localst) and
                   if assigned(pd.localst) and
                      (pd.procsym=tprocsym(p)) and
                      (pd.procsym=tprocsym(p)) and
                      (pd.localst.symtabletype<>staticsymtable) then
                      (pd.localst.symtabletype<>staticsymtable) then
-                    pd.localst.foreach_static(@finalize_local_typedconst,arg);
+                    pd.localst.SymList.ForEachCall(@finalize_local_typedconst,arg);
                 end;
                 end;
             end;
             end;
         end;
         end;
@@ -1124,7 +1124,7 @@ implementation
 
 
     { generates the code for finalization of static symtable and
     { generates the code for finalization of static symtable and
       all local (static) typedconsts }
       all local (static) typedconsts }
-    procedure finalize_static_data(p : tnamedindexitem;arg:pointer);
+    procedure finalize_static_data(p:TObject;arg:pointer);
       var
       var
         i : longint;
         i : longint;
         pd : tprocdef;
         pd : tprocdef;
@@ -1153,7 +1153,7 @@ implementation
                   if assigned(pd.localst) and
                   if assigned(pd.localst) and
                      (pd.procsym=tprocsym(p)) and
                      (pd.procsym=tprocsym(p)) and
                      (pd.localst.symtabletype<>staticsymtable) then
                      (pd.localst.symtabletype<>staticsymtable) then
-                    pd.localst.foreach_static(@finalize_local_typedconst,arg);
+                    pd.localst.SymList.ForEachCall(@finalize_local_typedconst,arg);
                 end;
                 end;
             end;
             end;
         end;
         end;
@@ -1162,7 +1162,7 @@ implementation
 
 
     { generates the code for incrementing the reference count of parameters and
     { generates the code for incrementing the reference count of parameters and
       initialize out parameters }
       initialize out parameters }
-    procedure init_paras(p : tnamedindexitem;arg:pointer);
+    procedure init_paras(p:TObject;arg:pointer);
       var
       var
         href : treference;
         href : treference;
         tmpreg : tregister;
         tmpreg : tregister;
@@ -1219,7 +1219,7 @@ implementation
 
 
 
 
     { generates the code for decrementing the reference count of parameters }
     { generates the code for decrementing the reference count of parameters }
-    procedure final_paras(p : tnamedindexitem;arg:pointer);
+    procedure final_paras(p:TObject;arg:pointer);
       var
       var
         list : TAsmList;
         list : TAsmList;
         href : treference;
         href : treference;
@@ -1314,7 +1314,7 @@ implementation
 
 
         { constructors return self }
         { constructors return self }
         if (current_procinfo.procdef.proctypeoption=potype_constructor) then
         if (current_procinfo.procdef.proctypeoption=potype_constructor) then
-          ressym:=tabstractnormalvarsym(current_procinfo.procdef.parast.search('self'))
+          ressym:=tabstractnormalvarsym(current_procinfo.procdef.parast.Find('self'))
         else
         else
           ressym:=tabstractnormalvarsym(current_procinfo.procdef.funcretsym);
           ressym:=tabstractnormalvarsym(current_procinfo.procdef.funcretsym);
         if (ressym.refs>0) then
         if (ressym.refs>0) then
@@ -1771,7 +1771,7 @@ implementation
         { generate copies of call by value parameters, must be done before
         { generate copies of call by value parameters, must be done before
           the initialization and body is parsed because the refcounts are
           the initialization and body is parsed because the refcounts are
           incremented using the local copies }
           incremented using the local copies }
-        current_procinfo.procdef.parast.foreach_static({$ifndef TP}@{$endif}copyvalueparas,list);
+        current_procinfo.procdef.parast.SymList.ForEachCall(@copyvalueparas,list);
 {$ifdef powerpc}
 {$ifdef powerpc}
         { unget the register that contains the stack pointer before the procedure entry, }
         { unget the register that contains the stack pointer before the procedure entry, }
         { which is used to access the parameters in their original callee-side location  }
         { which is used to access the parameters in their original callee-side location  }
@@ -1796,23 +1796,23 @@ implementation
                 { this is also used for initialization of variables in a
                 { this is also used for initialization of variables in a
                   program which does not have a globalsymtable }
                   program which does not have a globalsymtable }
                 if assigned(current_module.globalsymtable) then
                 if assigned(current_module.globalsymtable) then
-                  tsymtable(current_module.globalsymtable).foreach_static({$ifndef TP}@{$endif}initialize_data,list);
-                tsymtable(current_module.localsymtable).foreach_static({$ifndef TP}@{$endif}initialize_data,list);
-                tsymtable(current_module.localsymtable).foreach_static({$ifndef TP}@{$endif}initialize_regvars,list);
+                  TSymtable(current_module.globalsymtable).SymList.ForEachCall(@initialize_data,list);
+                TSymtable(current_module.localsymtable).SymList.ForEachCall(@initialize_data,list);
+                TSymtable(current_module.localsymtable).SymList.ForEachCall(@initialize_regvars,list);
              end;
              end;
            { units have seperate code for initilization and finalization }
            { units have seperate code for initilization and finalization }
            potype_unitfinalize: ;
            potype_unitfinalize: ;
            { program init/final is generated in separate procedure }
            { program init/final is generated in separate procedure }
            potype_proginit:
            potype_proginit:
              begin
              begin
-               tsymtable(current_module.localsymtable).foreach_static({$ifndef TP}@{$endif}initialize_regvars,list);
+               TSymtable(current_module.localsymtable).SymList.ForEachCall(@initialize_regvars,list);
              end;
              end;
            else
            else
              begin
              begin
                if (localvartrashing <> -1) and
                if (localvartrashing <> -1) and
                   not(po_assembler in current_procinfo.procdef.procoptions) then
                   not(po_assembler in current_procinfo.procdef.procoptions) then
-                 current_procinfo.procdef.localst.foreach_static({$ifndef TP}@{$endif}trash_variable,list);
-               current_procinfo.procdef.localst.foreach_static({$ifndef TP}@{$endif}initialize_data,list);
+                 current_procinfo.procdef.localst.SymList.ForEachCall(@trash_variable,list);
+               current_procinfo.procdef.localst.SymList.ForEachCall(@initialize_data,list);
              end;
              end;
         end;
         end;
 
 
@@ -1821,7 +1821,7 @@ implementation
 
 
         { initialize ansi/widesstring para's }
         { initialize ansi/widesstring para's }
         if not(po_assembler in current_procinfo.procdef.procoptions) then
         if not(po_assembler in current_procinfo.procdef.procoptions) then
-          current_procinfo.procdef.parast.foreach_static({$ifndef TP}@{$endif}init_paras,list);
+          current_procinfo.procdef.parast.SymList.ForEachCall(@init_paras,list);
 
 
 {$ifdef OLDREGVARS}
 {$ifdef OLDREGVARS}
         load_regvars(list,nil);
         load_regvars(list,nil);
@@ -1845,21 +1845,21 @@ implementation
                 { this is also used for initialization of variables in a
                 { this is also used for initialization of variables in a
                   program which does not have a globalsymtable }
                   program which does not have a globalsymtable }
                 if assigned(current_module.globalsymtable) then
                 if assigned(current_module.globalsymtable) then
-                  tsymtable(current_module.globalsymtable).foreach_static({$ifndef TP}@{$endif}finalize_static_data,list);
-                tsymtable(current_module.localsymtable).foreach_static({$ifndef TP}@{$endif}finalize_static_data,list);
+                  TSymtable(current_module.globalsymtable).SymList.ForEachCall(@finalize_static_data,list);
+                TSymtable(current_module.localsymtable).SymList.ForEachCall(@finalize_static_data,list);
              end;
              end;
            { units/progs have separate code for initialization and finalization }
            { units/progs have separate code for initialization and finalization }
            potype_unitinit: ;
            potype_unitinit: ;
            { program init/final is generated in separate procedure }
            { program init/final is generated in separate procedure }
            potype_proginit: ;
            potype_proginit: ;
            else
            else
-             current_procinfo.procdef.localst.foreach_static({$ifndef TP}@{$endif}finalize_local_vars,list);
+             current_procinfo.procdef.localst.SymList.ForEachCall(@finalize_local_vars,list);
         end;
         end;
 
 
         { finalize paras data }
         { finalize paras data }
         if assigned(current_procinfo.procdef.parast) and
         if assigned(current_procinfo.procdef.parast) and
            not(po_assembler in current_procinfo.procdef.procoptions) then
            not(po_assembler in current_procinfo.procdef.procoptions) then
-          current_procinfo.procdef.parast.foreach_static({$ifndef TP}@{$endif}final_paras,list);
+          current_procinfo.procdef.parast.SymList.ForEachCall(@final_paras,list);
       end;
       end;
 
 
 
 
@@ -2242,15 +2242,16 @@ implementation
       end;
       end;
 
 
 
 
-    procedure gen_alloc_symtable(list:TAsmList;st:tsymtable);
+    procedure gen_alloc_symtable(list:TAsmList;st:TSymtable);
       var
       var
+        i       : longint;
         sym     : tsym;
         sym     : tsym;
         isaddr  : boolean;
         isaddr  : boolean;
         cgsize  : tcgsize;
         cgsize  : tcgsize;
       begin
       begin
-        sym:=tsym(st.symindex.first);
-        while assigned(sym) do
+        for i:=0 to st.SymList.Count-1 do
           begin
           begin
+            sym:=tsym(st.SymList[i]);
             if (sym.typ in [globalvarsym,localvarsym,paravarsym]) then
             if (sym.typ in [globalvarsym,localvarsym,paravarsym]) then
               begin
               begin
                 with tabstractnormalvarsym(sym) do
                 with tabstractnormalvarsym(sym) do
@@ -2302,7 +2303,7 @@ implementation
                                     end;
                                     end;
                                 end;
                                 end;
                               localsymtable,
                               localsymtable,
-                              stt_exceptsymtable :
+                              stt_excepTSymtable :
                                 begin
                                 begin
                                   tg.GetLocal(list,getsize,vardef,initialloc.reference);
                                   tg.GetLocal(list,getsize,vardef,initialloc.reference);
                                 end;
                                 end;
@@ -2332,7 +2333,6 @@ implementation
                     localloc:=initialloc;
                     localloc:=initialloc;
                   end;
                   end;
               end;
               end;
-            sym:=tsym(sym.indexnext);
           end;
           end;
       end;
       end;
 
 
@@ -2570,7 +2570,7 @@ implementation
            assigned(current_procinfo.procdef.funcretsym) and
            assigned(current_procinfo.procdef.funcretsym) and
            (tabstractvarsym(current_procinfo.procdef.funcretsym).refs <> 0) then
            (tabstractvarsym(current_procinfo.procdef.funcretsym).refs <> 0) then
           if (current_procinfo.procdef.proctypeoption=potype_constructor) then
           if (current_procinfo.procdef.proctypeoption=potype_constructor) then
-            rr.ressym:=tsym(current_procinfo.procdef.parast.search('self'))
+            rr.ressym:=tsym(current_procinfo.procdef.parast.Find('self'))
          else
          else
             rr.ressym:=current_procinfo.procdef.funcretsym;
             rr.ressym:=current_procinfo.procdef.funcretsym;
 
 
@@ -2613,13 +2613,14 @@ implementation
       end;
       end;
 
 
 
 
-    procedure gen_free_symtable(list:TAsmList;st:tsymtable);
+    procedure gen_free_symtable(list:TAsmList;st:TSymtable);
       var
       var
+        i   : longint;
         sym : tsym;
         sym : tsym;
       begin
       begin
-        sym:=tsym(st.symindex.first);
-        while assigned(sym) do
+        for i:=0 to st.SymList.Count-1 do
           begin
           begin
+            sym:=tsym(st.SymList[i]);
             if (sym.typ in [globalvarsym,localvarsym,paravarsym]) then
             if (sym.typ in [globalvarsym,localvarsym,paravarsym]) then
               begin
               begin
                 with tabstractnormalvarsym(sym) do
                 with tabstractnormalvarsym(sym) do
@@ -2648,14 +2649,13 @@ implementation
                           case st.symtabletype of
                           case st.symtabletype of
                             localsymtable,
                             localsymtable,
                             parasymtable,
                             parasymtable,
-                            stt_exceptsymtable :
+                            stt_excepTSymtable :
                               tg.Ungetlocal(list,localloc.reference);
                               tg.Ungetlocal(list,localloc.reference);
                           end;
                           end;
                         end;
                         end;
                     end;
                     end;
                   end;
                   end;
               end;
               end;
-            sym:=tsym(sym.indexnext);
           end;
           end;
       end;
       end;
 
 
@@ -2669,7 +2669,7 @@ implementation
         { rtti can only be generated for classes that are always typesyms }
         { rtti can only be generated for classes that are always typesyms }
         def:=tstoreddef(ttypesym(p).typedef);
         def:=tstoreddef(ttypesym(p).typedef);
         { there is an error, skip rtti info }
         { there is an error, skip rtti info }
-        if (def.deftype=errordef) or (Errorcount>0) then
+        if (def.typ=errordef) or (Errorcount>0) then
           exit;
           exit;
         { only create rtti once for each definition }
         { only create rtti once for each definition }
         if not(df_has_rttitable in def.defoptions) then
         if not(df_has_rttitable in def.defoptions) then
@@ -2764,16 +2764,16 @@ implementation
       end;
       end;
 
 
 
 
-    procedure gen_intf_wrappers(list:TAsmList;st:tsymtable);
+    procedure gen_intf_wrappers(list:TAsmList;st:TSymtable);
       var
       var
-        def : tstoreddef;
+        i   : longint;
+        def : tdef;
       begin
       begin
-        def:=tstoreddef(st.defindex.first);
-        while assigned(def) do
+        for i:=0 to st.DefList.Count-1 do
           begin
           begin
+            def:=tdef(st.DefList[i]);
             if is_class(def) then
             if is_class(def) then
               gen_intf_wrapper(list,tobjectdef(def));
               gen_intf_wrapper(list,tobjectdef(def));
-            def:=tstoreddef(def.indexnext);
           end;
           end;
       end;
       end;
 
 

+ 52 - 52
compiler/ncnv.pas

@@ -234,7 +234,7 @@ implementation
 
 
         { don't insert obsolete type conversions }
         { don't insert obsolete type conversions }
         if equal_defs(p.resultdef,def) and
         if equal_defs(p.resultdef,def) and
-           not ((p.resultdef.deftype=setdef) and
+           not ((p.resultdef.typ=setdef) and
                 (tsetdef(p.resultdef).settype <>
                 (tsetdef(p.resultdef).settype <>
                  tsetdef(def).settype)) then
                  tsetdef(def).settype)) then
          begin
          begin
@@ -260,7 +260,7 @@ implementation
 
 
         { don't insert obsolete type conversions }
         { don't insert obsolete type conversions }
         if equal_defs(p.resultdef,def) and
         if equal_defs(p.resultdef,def) and
-           not ((p.resultdef.deftype=setdef) and
+           not ((p.resultdef.typ=setdef) and
                 (tsetdef(p.resultdef).settype <>
                 (tsetdef(p.resultdef).settype <>
                  tsetdef(def).settype)) then
                  tsetdef(def).settype)) then
          begin
          begin
@@ -291,10 +291,10 @@ implementation
 
 
         procedure update_constsethi(def:tdef);
         procedure update_constsethi(def:tdef);
           begin
           begin
-            if ((def.deftype=orddef) and
+            if ((def.typ=orddef) and
                 (torddef(def).high>=constsethi)) then
                 (torddef(def).high>=constsethi)) then
               begin
               begin
-                if torddef(def).typ=uwidechar then
+                if torddef(def).ordtype=uwidechar then
                   begin
                   begin
                     constsethi:=255;
                     constsethi:=255;
                     if hdef=nil then
                     if hdef=nil then
@@ -315,7 +315,7 @@ implementation
                       constsethi:=255;
                       constsethi:=255;
                   end;
                   end;
               end
               end
-            else if ((def.deftype=enumdef) and
+            else if ((def.typ=enumdef) and
                     (tenumdef(def).max>=constsethi)) then
                     (tenumdef(def).max>=constsethi)) then
               begin
               begin
                  if hdef=nil then
                  if hdef=nil then
@@ -381,7 +381,7 @@ implementation
                 end;
                 end;
               if codegenerror then
               if codegenerror then
                break;
                break;
-              case p2.resultdef.deftype of
+              case p2.resultdef.typ of
                  enumdef,
                  enumdef,
                  orddef:
                  orddef:
                    begin
                    begin
@@ -445,7 +445,7 @@ implementation
                               begin
                               begin
                                 { for constant set elements, delphi allows the usage of elements of enumerations which
                                 { for constant set elements, delphi allows the usage of elements of enumerations which
                                   have value>255 if there is no element with a value > 255 used }
                                   have value>255 if there is no element with a value > 255 used }
-                                if (m_delphi in current_settings.modeswitches) and (p2.resultdef.deftype=enumdef) then
+                                if (m_delphi in current_settings.modeswitches) and (p2.resultdef.typ=enumdef) then
                                   begin
                                   begin
                                     if tordconstnode(p2).value>constsethi then
                                     if tordconstnode(p2).value>constsethi then
                                       constsethi:=tordconstnode(p2).value;
                                       constsethi:=tordconstnode(p2).value;
@@ -528,7 +528,7 @@ implementation
            (p.nodetype=stringconstn) then
            (p.nodetype=stringconstn) then
           p:=ctypeconvnode.create_internal(p,cansistringtype)
           p:=ctypeconvnode.create_internal(p,cansistringtype)
         else
         else
-          case p.resultdef.deftype of
+          case p.resultdef.typ of
             enumdef :
             enumdef :
               p:=ctypeconvnode.create_internal(p,s32inttype);
               p:=ctypeconvnode.create_internal(p,s32inttype);
             arraydef :
             arraydef :
@@ -563,7 +563,7 @@ implementation
                   if is_constrealnode(p) and
                   if is_constrealnode(p) and
                      not(nf_explicit in p.flags) then
                      not(nf_explicit in p.flags) then
                     MessagePos(p.fileinfo,type_w_double_c_varargs);
                     MessagePos(p.fileinfo,type_w_double_c_varargs);
-                  if (tfloatdef(p.resultdef).typ in [{$ifndef x86_64}s32real,{$endif}s64currency]) or
+                  if (tfloatdef(p.resultdef).floattype in [{$ifndef x86_64}s32real,{$endif}s64currency]) or
                      (is_constrealnode(p) and
                      (is_constrealnode(p) and
                       not(nf_explicit in p.flags)) then
                       not(nf_explicit in p.flags)) then
                     p:=ctypeconvnode.create(p,s64floattype);
                     p:=ctypeconvnode.create(p,s64floattype);
@@ -843,7 +843,7 @@ implementation
              left := nil;
              left := nil;
 
 
              { when converting to shortstrings, we have to pass high(destination) too }
              { when converting to shortstrings, we have to pass high(destination) too }
-             if (tstringdef(resultdef).string_typ = st_shortstring) then
+             if (tstringdef(resultdef).stringtype = st_shortstring) then
                stringpara.right := ccallparanode.create(cinlinenode.create(
                stringpara.right := ccallparanode.create(cinlinenode.create(
                  in_high_x,false,self.getcopy),nil);
                  in_high_x,false,self.getcopy),nil);
 
 
@@ -865,10 +865,10 @@ implementation
          result:=nil;
          result:=nil;
          if left.nodetype=ordconstn then
          if left.nodetype=ordconstn then
            begin
            begin
-              if tstringdef(resultdef).string_typ=st_widestring then
+              if tstringdef(resultdef).stringtype=st_widestring then
                begin
                begin
                  initwidestring(ws);
                  initwidestring(ws);
-                 if torddef(left.resultdef).typ=uwidechar then
+                 if torddef(left.resultdef).ordtype=uwidechar then
                    concatwidestringchar(ws,tcompilerwidechar(tordconstnode(left).value))
                    concatwidestringchar(ws,tcompilerwidechar(tordconstnode(left).value))
                  else
                  else
                    concatwidestringchar(ws,tcompilerwidechar(chr(tordconstnode(left).value)));
                    concatwidestringchar(ws,tcompilerwidechar(chr(tordconstnode(left).value)));
@@ -884,7 +884,7 @@ implementation
            end
            end
          else
          else
            { shortstrings are handled 'inline' }
            { shortstrings are handled 'inline' }
-           if tstringdef(resultdef).string_typ <> st_shortstring then
+           if tstringdef(resultdef).stringtype <> st_shortstring then
              begin
              begin
                { create the parameter }
                { create the parameter }
                para := ccallparanode.create(left,nil);
                para := ccallparanode.create(left,nil);
@@ -939,16 +939,16 @@ implementation
          result:=nil;
          result:=nil;
          if left.nodetype=ordconstn then
          if left.nodetype=ordconstn then
            begin
            begin
-             if (torddef(resultdef).typ=uchar) and
-                (torddef(left.resultdef).typ=uwidechar) then
+             if (torddef(resultdef).ordtype=uchar) and
+                (torddef(left.resultdef).ordtype=uwidechar) then
               begin
               begin
                 hp:=cordconstnode.create(
                 hp:=cordconstnode.create(
                       ord(unicode2asciichar(tcompilerwidechar(tordconstnode(left).value))),
                       ord(unicode2asciichar(tcompilerwidechar(tordconstnode(left).value))),
                       cchartype,true);
                       cchartype,true);
                 result:=hp;
                 result:=hp;
               end
               end
-             else if (torddef(resultdef).typ=uwidechar) and
-                     (torddef(left.resultdef).typ=uchar) then
+             else if (torddef(resultdef).ordtype=uwidechar) and
+                     (torddef(left.resultdef).ordtype=uchar) then
               begin
               begin
                 hp:=cordconstnode.create(
                 hp:=cordconstnode.create(
                       asciichar2unicode(chr(tordconstnode(left).value)),
                       asciichar2unicode(chr(tordconstnode(left).value)),
@@ -972,7 +972,7 @@ implementation
            v:=tordconstnode(left).value;
            v:=tordconstnode(left).value;
            if is_currency(resultdef) then
            if is_currency(resultdef) then
              v:=v*10000;
              v:=v*10000;
-           if (resultdef.deftype=pointerdef) then
+           if (resultdef.typ=pointerdef) then
              result:=cpointerconstnode.create(TConstPtrUInt(v),resultdef)
              result:=cpointerconstnode.create(TConstPtrUInt(v),resultdef)
            else
            else
              begin
              begin
@@ -984,7 +984,7 @@ implementation
         else if left.nodetype=pointerconstn then
         else if left.nodetype=pointerconstn then
          begin
          begin
            v:=tpointerconstnode(left).value;
            v:=tpointerconstnode(left).value;
-           if (resultdef.deftype=pointerdef) then
+           if (resultdef.typ=pointerdef) then
              result:=cpointerconstnode.create(v,resultdef)
              result:=cpointerconstnode.create(v,resultdef)
            else
            else
              begin
              begin
@@ -1317,9 +1317,9 @@ implementation
       end;
       end;
 
 
 
 
-    procedure copyparasym(p:TNamedIndexItem;arg:pointer);
+    procedure copyparasym(p:TObject;arg:pointer);
       var
       var
-        newparast : tsymtable absolute arg;
+        newparast : TSymtable absolute arg;
         vs : tparavarsym;
         vs : tparavarsym;
       begin
       begin
         if tsym(p).typ<>paravarsym then
         if tsym(p).typ<>paravarsym then
@@ -1348,7 +1348,7 @@ implementation
         tprocvardef(resultdef).returndef:=pd.returndef;
         tprocvardef(resultdef).returndef:=pd.returndef;
 
 
         { method ? then set the methodpointer flag }
         { method ? then set the methodpointer flag }
-        if (pd.owner.symtabletype=objectsymtable) then
+        if (pd.owner.symtabletype=ObjectSymtable) then
           include(tprocvardef(resultdef).procoptions,po_methodpointer);
           include(tprocvardef(resultdef).procoptions,po_methodpointer);
 
 
         { was it a local procedure? }
         { was it a local procedure? }
@@ -1365,7 +1365,7 @@ implementation
         { Add parameters use only references, we don't need to keep the
         { Add parameters use only references, we don't need to keep the
           parast. We use the parast from the original function to calculate
           parast. We use the parast from the original function to calculate
           our parameter data and reset it afterwards }
           our parameter data and reset it afterwards }
-        pd.parast.foreach_static(@copyparasym,tprocvardef(resultdef).parast);
+        pd.parast.SymList.ForEachCall(@copyparasym,tprocvardef(resultdef).parast);
         tprocvardef(resultdef).calcparas;
         tprocvardef(resultdef).calcparas;
       end;
       end;
 
 
@@ -1463,12 +1463,12 @@ implementation
           convert on the procvar value. This is used to access the
           convert on the procvar value. This is used to access the
           fields of a methodpointer }
           fields of a methodpointer }
         if not(nf_load_procvar in flags) and
         if not(nf_load_procvar in flags) and
-           not(resultdef.deftype in [procvardef,recorddef,setdef]) then
+           not(resultdef.typ in [procvardef,recorddef,setdef]) then
           maybe_call_procvar(left,true);
           maybe_call_procvar(left,true);
 
 
         { convert array constructors to sets, because there is no conversion
         { convert array constructors to sets, because there is no conversion
           possible for array constructors }
           possible for array constructors }
-        if (resultdef.deftype<>arraydef) and
+        if (resultdef.typ<>arraydef) and
            is_array_constructor(left.resultdef) then
            is_array_constructor(left.resultdef) then
           begin
           begin
             arrayconstructor_to_set(left);
             arrayconstructor_to_set(left);
@@ -1493,8 +1493,8 @@ implementation
 
 
                   { because is_equal only checks the basetype for sets we need to
                   { because is_equal only checks the basetype for sets we need to
                     check here if we are loading a smallset into a normalset }
                     check here if we are loading a smallset into a normalset }
-                  if (resultdef.deftype=setdef) and
-                     (left.resultdef.deftype=setdef) and
+                  if (resultdef.typ=setdef) and
+                     (left.resultdef.typ=setdef) and
                      ((tsetdef(resultdef).settype = smallset) xor
                      ((tsetdef(resultdef).settype = smallset) xor
                       (tsetdef(left.resultdef).settype = smallset)) then
                       (tsetdef(left.resultdef).settype = smallset)) then
                     begin
                     begin
@@ -1560,7 +1560,7 @@ implementation
                     use an extra check for them.}
                     use an extra check for them.}
                   if (left.nodetype=calln) and
                   if (left.nodetype=calln) and
                      (tcallnode(left).para_count=0) and
                      (tcallnode(left).para_count=0) and
-                     (resultdef.deftype=procvardef) and
+                     (resultdef.typ=procvardef) and
                      (
                      (
                       (m_tp_procvar in current_settings.modeswitches) or
                       (m_tp_procvar in current_settings.modeswitches) or
                       (m_mac_procvar in current_settings.modeswitches)
                       (m_mac_procvar in current_settings.modeswitches)
@@ -1577,10 +1577,10 @@ implementation
                      else
                      else
                       begin
                       begin
                         convtype:=tc_proc_2_procvar;
                         convtype:=tc_proc_2_procvar;
-                        currprocdef:=Tprocsym(Tcallnode(left).symtableprocentry).search_procdef_byprocvardef(Tprocvardef(resultdef));
+                        currprocdef:=Tprocsym(Tcallnode(left).symtableprocentry).Find_procdef_byprocvardef(Tprocvardef(resultdef));
                         hp:=cloadnode.create_procvar(tprocsym(tcallnode(left).symtableprocentry),
                         hp:=cloadnode.create_procvar(tprocsym(tcallnode(left).symtableprocentry),
                             tprocdef(currprocdef),tcallnode(left).symtableproc);
                             tprocdef(currprocdef),tcallnode(left).symtableproc);
-                        if (tcallnode(left).symtableprocentry.owner.symtabletype=objectsymtable) then
+                        if (tcallnode(left).symtableprocentry.owner.symtabletype=ObjectSymtable) then
                          begin
                          begin
                            if assigned(tcallnode(left).methodpointer) then
                            if assigned(tcallnode(left).methodpointer) then
                              tloadnode(hp).set_mp(tcallnode(left).get_load_methodpointer)
                              tloadnode(hp).set_mp(tcallnode(left).get_load_methodpointer)
@@ -1631,8 +1631,8 @@ implementation
                      { check if the result could be in a register }
                      { check if the result could be in a register }
                      if (not(tstoreddef(resultdef).is_intregable) and
                      if (not(tstoreddef(resultdef).is_intregable) and
                          not(tstoreddef(resultdef).is_fpuregable)) or
                          not(tstoreddef(resultdef).is_fpuregable)) or
-                        ((left.resultdef.deftype = floatdef) and
-                         (resultdef.deftype <> floatdef))  then
+                        ((left.resultdef.typ = floatdef) and
+                         (resultdef.typ <> floatdef))  then
                        make_not_regable(left,vr_addr);
                        make_not_regable(left,vr_addr);
 
 
                      { class/interface to class/interface, with checkobject support }
                      { class/interface to class/interface, with checkobject support }
@@ -1673,7 +1673,7 @@ implementation
                        begin
                        begin
                          { only if the same size or formal def }
                          { only if the same size or formal def }
                          if not(
                          if not(
-                                (left.resultdef.deftype=formaldef) or
+                                (left.resultdef.typ=formaldef) or
                                 (
                                 (
                                  not(is_open_array(left.resultdef)) and
                                  not(is_open_array(left.resultdef)) and
                                  not(is_array_constructor(left.resultdef)) and
                                  not(is_array_constructor(left.resultdef)) and
@@ -1701,10 +1701,10 @@ implementation
         if not(nf_internal in flags) and
         if not(nf_internal in flags) and
            (left.nodetype<>ordconstn) and
            (left.nodetype<>ordconstn) and
            not(is_void(left.resultdef)) and
            not(is_void(left.resultdef)) and
-           (((left.resultdef.deftype=orddef) and
-             (resultdef.deftype in [pointerdef,procvardef,classrefdef])) or
-            ((resultdef.deftype=orddef) and
-             (left.resultdef.deftype in [pointerdef,procvardef,classrefdef]))) then
+           (((left.resultdef.typ=orddef) and
+             (resultdef.typ in [pointerdef,procvardef,classrefdef])) or
+            ((resultdef.typ=orddef) and
+             (left.resultdef.typ in [pointerdef,procvardef,classrefdef]))) then
           begin
           begin
             { Give a warning when sizes don't match, because then info will be lost }
             { Give a warning when sizes don't match, because then info will be lost }
             if left.resultdef.size=resultdef.size then
             if left.resultdef.size=resultdef.size then
@@ -1753,7 +1753,7 @@ implementation
           niln :
           niln :
             begin
             begin
               { nil to ordinal node }
               { nil to ordinal node }
-              if (resultdef.deftype=orddef) then
+              if (resultdef.typ=orddef) then
                begin
                begin
                  hp:=cordconstnode.create(0,resultdef,true);
                  hp:=cordconstnode.create(0,resultdef,true);
                  if ([nf_explicit,nf_internal] * flags <> []) then
                  if ([nf_explicit,nf_internal] * flags <> []) then
@@ -1763,7 +1763,7 @@ implementation
                end
                end
               else
               else
                { fold nil to any pointer type }
                { fold nil to any pointer type }
-               if (resultdef.deftype=pointerdef) then
+               if (resultdef.typ=pointerdef) then
                 begin
                 begin
                   hp:=cnilnode.create;
                   hp:=cnilnode.create;
                   hp.resultdef:=resultdef;
                   hp.resultdef:=resultdef;
@@ -1776,7 +1776,7 @@ implementation
                { remove typeconv after niln, but not when the result is a
                { remove typeconv after niln, but not when the result is a
                  methodpointer. The typeconv of the methodpointer will then
                  methodpointer. The typeconv of the methodpointer will then
                  take care of updateing size of niln to OS_64 }
                  take care of updateing size of niln to OS_64 }
-               if not((resultdef.deftype=procvardef) and
+               if not((resultdef.typ=procvardef) and
                       (po_methodpointer in tprocvardef(resultdef).procoptions)) then
                       (po_methodpointer in tprocvardef(resultdef).procoptions)) then
                  begin
                  begin
                    left.resultdef:=resultdef;
                    left.resultdef:=resultdef;
@@ -1794,7 +1794,7 @@ implementation
               { but not char to char because it is a widechar to char or via versa }
               { but not char to char because it is a widechar to char or via versa }
               { which needs extra code to do the code page transistion             }
               { which needs extra code to do the code page transistion             }
               { constant ordinal to pointer }
               { constant ordinal to pointer }
-              if (resultdef.deftype=pointerdef) and
+              if (resultdef.typ=pointerdef) and
                  (convtype<>tc_cchar_2_pchar) then
                  (convtype<>tc_cchar_2_pchar) then
                 begin
                 begin
                    hp:=cpointerconstnode.create(TConstPtrUInt(tordconstnode(left).value),resultdef);
                    hp:=cpointerconstnode.create(TConstPtrUInt(tordconstnode(left).value),resultdef);
@@ -1820,7 +1820,7 @@ implementation
           pointerconstn :
           pointerconstn :
             begin
             begin
               { pointerconstn to any pointer is folded too }
               { pointerconstn to any pointer is folded too }
-              if (resultdef.deftype=pointerdef) then
+              if (resultdef.typ=pointerdef) then
                 begin
                 begin
                    left.resultdef:=resultdef;
                    left.resultdef:=resultdef;
                    if ([nf_explicit,nf_internal] * flags <> []) then
                    if ([nf_explicit,nf_internal] * flags <> []) then
@@ -1979,9 +1979,9 @@ implementation
           begin
           begin
             if target_info.system in system_wince then
             if target_info.system in system_wince then
               begin
               begin
-                case tfloatdef(left.resultdef).typ of
+                case tfloatdef(left.resultdef).floattype of
                   s32real:
                   s32real:
-                    case tfloatdef(resultdef).typ of
+                    case tfloatdef(resultdef).floattype of
                       s64real:
                       s64real:
                         result:=ccallnode.createintern('STOD',ccallparanode.create(left,nil));
                         result:=ccallnode.createintern('STOD',ccallparanode.create(left,nil));
                       s32real:
                       s32real:
@@ -1993,7 +1993,7 @@ implementation
                         internalerror(2005082704);
                         internalerror(2005082704);
                     end;
                     end;
                   s64real:
                   s64real:
-                    case tfloatdef(resultdef).typ of
+                    case tfloatdef(resultdef).floattype of
                       s32real:
                       s32real:
                         result:=ccallnode.createintern('DTOS',ccallparanode.create(left,nil));
                         result:=ccallnode.createintern('DTOS',ccallparanode.create(left,nil));
                       s64real:
                       s64real:
@@ -2013,9 +2013,9 @@ implementation
               end
               end
             else
             else
               begin
               begin
-                case tfloatdef(left.resultdef).typ of
+                case tfloatdef(left.resultdef).floattype of
                   s32real:
                   s32real:
-                    case tfloatdef(resultdef).typ of
+                    case tfloatdef(resultdef).floattype of
                       s64real:
                       s64real:
                         result:=ctypeconvnode.create_explicit(ccallnode.createintern('float32_to_float64',ccallparanode.create(
                         result:=ctypeconvnode.create_explicit(ccallnode.createintern('float32_to_float64',ccallparanode.create(
                           ctypeconvnode.create_internal(left,search_system_type('FLOAT32REC').typedef),nil)),resultdef);
                           ctypeconvnode.create_internal(left,search_system_type('FLOAT32REC').typedef),nil)),resultdef);
@@ -2028,7 +2028,7 @@ implementation
                         internalerror(200610151);
                         internalerror(200610151);
                     end;
                     end;
                   s64real:
                   s64real:
-                    case tfloatdef(resultdef).typ of
+                    case tfloatdef(resultdef).floattype of
                       s32real:
                       s32real:
                         result:=ctypeconvnode.create_explicit(ccallnode.createintern('float64_to_float32',ccallparanode.create(
                         result:=ctypeconvnode.create_explicit(ccallnode.createintern('float64_to_float32',ccallparanode.create(
                           ctypeconvnode.create_internal(left,search_system_type('FLOAT64').typedef),nil)),resultdef);
                           ctypeconvnode.create_internal(left,search_system_type('FLOAT64').typedef),nil)),resultdef);
@@ -2409,7 +2409,7 @@ implementation
         result:=(convtype=tc_equal) or
         result:=(convtype=tc_equal) or
                 { typecasting from void is always allowed }
                 { typecasting from void is always allowed }
                 is_void(left.resultdef) or
                 is_void(left.resultdef) or
-                (left.resultdef.deftype=formaldef) or
+                (left.resultdef.typ=formaldef) or
                 { int 2 int with same size reuses same location, or for
                 { int 2 int with same size reuses same location, or for
                   tp7 mode also allow size < orignal size }
                   tp7 mode also allow size < orignal size }
                 (
                 (
@@ -2652,7 +2652,7 @@ implementation
          if codegenerror then
          if codegenerror then
            exit;
            exit;
 
 
-         if (right.resultdef.deftype=classrefdef) then
+         if (right.resultdef.typ=classrefdef) then
           begin
           begin
             { left must be a class }
             { left must be a class }
             if is_class(left.resultdef) then
             if is_class(left.resultdef) then
@@ -2763,7 +2763,7 @@ implementation
          if codegenerror then
          if codegenerror then
            exit;
            exit;
 
 
-         if (right.resultdef.deftype=classrefdef) then
+         if (right.resultdef.typ=classrefdef) then
           begin
           begin
             { left must be a class }
             { left must be a class }
             if is_class(left.resultdef) then
             if is_class(left.resultdef) then
@@ -2829,7 +2829,7 @@ implementation
         if not assigned(call) then
         if not assigned(call) then
           begin
           begin
             if is_class(left.resultdef) and
             if is_class(left.resultdef) and
-               (right.resultdef.deftype=classrefdef) then
+               (right.resultdef.typ=classrefdef) then
               call := ccallnode.createinternres('fpc_do_as',
               call := ccallnode.createinternres('fpc_do_as',
                 ccallparanode.create(left,ccallparanode.create(right,nil)),
                 ccallparanode.create(left,ccallparanode.create(right,nil)),
                 resultdef)
                 resultdef)

+ 4 - 4
compiler/ncon.pas

@@ -710,10 +710,10 @@ implementation
         pw : pcompilerwidestring;
         pw : pcompilerwidestring;
         pc : pchar;
         pc : pchar;
       begin
       begin
-        if def.deftype<>stringdef then
+        if def.typ<>stringdef then
           internalerror(200510011);
           internalerror(200510011);
         { convert ascii 2 unicode }
         { convert ascii 2 unicode }
-        if (tstringdef(def).string_typ=st_widestring) and
+        if (tstringdef(def).stringtype=st_widestring) and
            (cst_type<>cst_widestring) then
            (cst_type<>cst_widestring) then
           begin
           begin
             initwidestring(pw);
             initwidestring(pw);
@@ -724,7 +724,7 @@ implementation
         else
         else
           { convert unicode 2 ascii }
           { convert unicode 2 ascii }
           if (cst_type=cst_widestring) and
           if (cst_type=cst_widestring) and
-            (tstringdef(def).string_typ<>st_widestring) then
+            (tstringdef(def).stringtype<>st_widestring) then
             begin
             begin
               pw:=pcompilerwidestring(value_str);
               pw:=pcompilerwidestring(value_str);
               getmem(pc,getlengthwidestring(pw)+1);
               getmem(pc,getlengthwidestring(pw)+1);
@@ -732,7 +732,7 @@ implementation
               donewidestring(pw);
               donewidestring(pw);
               value_str:=pc;
               value_str:=pc;
             end;
             end;
-        cst_type:=st2cst[tstringdef(def).string_typ];
+        cst_type:=st2cst[tstringdef(def).stringtype];
         resultdef:=def;
         resultdef:=def;
       end;
       end;
 
 

+ 8 - 8
compiler/nflw.pas

@@ -194,7 +194,7 @@ interface
        ttryfinallynodeclass = class of ttryfinallynode;
        ttryfinallynodeclass = class of ttryfinallynode;
 
 
        tonnode = class(tbinarynode)
        tonnode = class(tbinarynode)
-          exceptsymtable : tsymtable;
+          excepTSymtable : TSymtable;
           excepttype : tobjectdef;
           excepttype : tobjectdef;
           constructor create(l,r:tnode);virtual;
           constructor create(l,r:tnode);virtual;
           destructor destroy;override;
           destructor destroy;override;
@@ -389,7 +389,7 @@ implementation
 
 
          if not is_boolean(left.resultdef) then
          if not is_boolean(left.resultdef) then
            begin
            begin
-             if left.resultdef.deftype=variantdef then
+             if left.resultdef.typ=variantdef then
                inserttypeconv(left,booltype)
                inserttypeconv(left,booltype)
              else
              else
                CGMessage1(type_e_boolean_expr_expected,left.resultdef.typename);
                CGMessage1(type_e_boolean_expr_expected,left.resultdef.typename);
@@ -686,7 +686,7 @@ implementation
 
 
          if not is_boolean(left.resultdef) then
          if not is_boolean(left.resultdef) then
            begin
            begin
-             if left.resultdef.deftype=variantdef then
+             if left.resultdef.typ=variantdef then
                inserttypeconv(left,booltype)
                inserttypeconv(left,booltype)
              else
              else
                Message1(type_e_boolean_expr_expected,left.resultdef.typename);
                Message1(type_e_boolean_expr_expected,left.resultdef.typename);
@@ -1461,7 +1461,7 @@ implementation
     constructor tonnode.create(l,r:tnode);
     constructor tonnode.create(l,r:tnode);
       begin
       begin
          inherited create(onn,l,r);
          inherited create(onn,l,r);
-         exceptsymtable:=nil;
+         excepTSymtable:=nil;
          excepttype:=nil;
          excepttype:=nil;
       end;
       end;
 
 
@@ -1469,8 +1469,8 @@ implementation
     destructor tonnode.destroy;
     destructor tonnode.destroy;
       begin
       begin
         { copied nodes don't need to release the symtable }
         { copied nodes don't need to release the symtable }
-        if assigned(exceptsymtable) then
-         exceptsymtable.free;
+        if assigned(excepTSymtable) then
+         excepTSymtable.free;
         inherited destroy;
         inherited destroy;
       end;
       end;
 
 
@@ -1478,7 +1478,7 @@ implementation
     constructor tonnode.ppuload(t:tnodetype;ppufile:tcompilerppufile);
     constructor tonnode.ppuload(t:tnodetype;ppufile:tcompilerppufile);
       begin
       begin
         inherited ppuload(t,ppufile);
         inherited ppuload(t,ppufile);
-        exceptsymtable:=nil;
+        excepTSymtable:=nil;
         excepttype:=nil;
         excepttype:=nil;
       end;
       end;
 
 
@@ -1488,7 +1488,7 @@ implementation
          n : tonnode;
          n : tonnode;
       begin
       begin
          n:=tonnode(inherited dogetcopy);
          n:=tonnode(inherited dogetcopy);
-         n.exceptsymtable:=exceptsymtable.getcopy;
+         n.excepTSymtable:=excepTSymtable.getcopy;
          n.excepttype:=excepttype;
          n.excepttype:=excepttype;
          result:=n;
          result:=n;
       end;
       end;

+ 45 - 45
compiler/ninl.pas

@@ -169,12 +169,12 @@ implementation
             exit;
             exit;
           end;
           end;
 
 
-        is_real := source.resultdef.deftype = floatdef;
+        is_real := source.resultdef.typ = floatdef;
 
 
-        if ((dest.left.resultdef.deftype<>stringdef) and
+        if ((dest.left.resultdef.typ<>stringdef) and
             not(is_chararray(dest.left.resultdef))) or
             not(is_chararray(dest.left.resultdef))) or
            not(is_real or
            not(is_real or
-               (source.left.resultdef.deftype = orddef)) then
+               (source.left.resultdef.typ = orddef)) then
           begin
           begin
             CGMessagePos(fileinfo,parser_e_illegal_expression);
             CGMessagePos(fileinfo,parser_e_illegal_expression);
             exit;
             exit;
@@ -222,7 +222,7 @@ implementation
           begin
           begin
             { insert realtype parameter }
             { insert realtype parameter }
             newparas.right := ccallparanode.create(cordconstnode.create(
             newparas.right := ccallparanode.create(cordconstnode.create(
-              ord(tfloatdef(source.left.resultdef).typ),s32inttype,true),
+              ord(tfloatdef(source.left.resultdef).floattype),s32inttype,true),
                newparas.right);
                newparas.right);
             { if necessary, insert a fraction parameter }
             { if necessary, insert a fraction parameter }
             if not assigned(fracpara) then
             if not assigned(fracpara) then
@@ -256,7 +256,7 @@ implementation
         if is_real then
         if is_real then
           procname := procname + 'float'
           procname := procname + 'float'
         else
         else
-          case torddef(source.resultdef).typ of
+          case torddef(source.resultdef).ordtype of
 {$ifdef cpu64bit}
 {$ifdef cpu64bit}
             u64bit:
             u64bit:
               procname := procname + 'uint';
               procname := procname + 'uint';
@@ -347,7 +347,7 @@ implementation
             { check if we have a file parameter and if yes, what kind it is }
             { check if we have a file parameter and if yes, what kind it is }
             filepara := tcallparanode(left);
             filepara := tcallparanode(left);
 
 
-            if (filepara.resultdef.deftype=filedef) then
+            if (filepara.resultdef.typ=filedef) then
               begin
               begin
                 if (tfiledef(filepara.resultdef).filetyp=ft_untyped) then
                 if (tfiledef(filepara.resultdef).filetyp=ft_untyped) then
                   begin
                   begin
@@ -470,7 +470,7 @@ implementation
         if is_typed then
         if is_typed then
           begin
           begin
             { add the typesize to the filepara }
             { add the typesize to the filepara }
-            if filepara.resultdef.deftype=filedef then
+            if filepara.resultdef.typ=filedef then
               filepara.right := ccallparanode.create(cordconstnode.create(
               filepara.right := ccallparanode.create(cordconstnode.create(
                 tfiledef(filepara.resultdef).typedfiledef.size,s32inttype,true),nil);
                 tfiledef(filepara.resultdef).typedfiledef.size,s32inttype,true),nil);
 
 
@@ -492,14 +492,14 @@ implementation
                   end;
                   end;
 
 
                 { support writeln(procvar) }
                 { support writeln(procvar) }
-                if (para.left.resultdef.deftype=procvardef) then
+                if (para.left.resultdef.typ=procvardef) then
                   begin
                   begin
                     p1:=ccallnode.create_procvar(nil,para.left);
                     p1:=ccallnode.create_procvar(nil,para.left);
                     typecheckpass(p1);
                     typecheckpass(p1);
                     para.left:=p1;
                     para.left:=p1;
                   end;
                   end;
 
 
-                if filepara.resultdef.deftype=filedef then
+                if filepara.resultdef.typ=filedef then
                   inserttypeconv(para.left,tfiledef(filepara.resultdef).typedfiledef);
                   inserttypeconv(para.left,tfiledef(filepara.resultdef).typedfiledef);
 
 
                 if assigned(para.right) and
                 if assigned(para.right) and
@@ -582,7 +582,7 @@ implementation
                   end;
                   end;
 
 
                 { support writeln(procvar) }
                 { support writeln(procvar) }
-                if (para.left.resultdef.deftype=procvardef) then
+                if (para.left.resultdef.typ=procvardef) then
                   begin
                   begin
                     p1:=ccallnode.create_procvar(nil,para.left);
                     p1:=ccallnode.create_procvar(nil,para.left);
                     typecheckpass(p1);
                     typecheckpass(p1);
@@ -593,7 +593,7 @@ implementation
                 if is_currency(para.left.resultdef) then
                 if is_currency(para.left.resultdef) then
                   inserttypeconv(para.left,pbestrealtype^);
                   inserttypeconv(para.left,pbestrealtype^);
 
 
-                case para.left.resultdef.deftype of
+                case para.left.resultdef.typ of
                   stringdef :
                   stringdef :
                     begin
                     begin
                       name := procprefix+tstringdef(para.left.resultdef).stringtypname;
                       name := procprefix+tstringdef(para.left.resultdef).stringtypname;
@@ -616,7 +616,7 @@ implementation
                     end;
                     end;
                   orddef :
                   orddef :
                     begin
                     begin
-                      case torddef(para.left.resultdef).typ of
+                      case torddef(para.left.resultdef).ordtype of
 {$ifdef cpu64bit}
 {$ifdef cpu64bit}
                         s64bit,
                         s64bit,
 {$endif cpu64bit}
 {$endif cpu64bit}
@@ -769,7 +769,7 @@ implementation
                             { and add the realtype para (this also removes the link }
                             { and add the realtype para (this also removes the link }
                             { to any parameters coming after it)                    }
                             { to any parameters coming after it)                    }
                             fracpara.right := ccallparanode.create(
                             fracpara.right := ccallparanode.create(
-                                cordconstnode.create(ord(tfloatdef(para.left.resultdef).typ),
+                                cordconstnode.create(ord(tfloatdef(para.left.resultdef).floattype),
                                 sinttype,true),nil);
                                 sinttype,true),nil);
                           end;
                           end;
                       end;
                       end;
@@ -821,7 +821,7 @@ implementation
                         tcallparanode(para.right).right := lenpara;
                         tcallparanode(para.right).right := lenpara;
                         { in case of writing a chararray, add whether it's }
                         { in case of writing a chararray, add whether it's }
                         { zero-based                                       }
                         { zero-based                                       }
-                        if (para.left.resultdef.deftype = arraydef) then
+                        if (para.left.resultdef.typ = arraydef) then
                           para := ccallparanode.create(cordconstnode.create(
                           para := ccallparanode.create(cordconstnode.create(
                             ord(tarraydef(para.left.resultdef).lowrange=0),booltype,false),para);
                             ord(tarraydef(para.left.resultdef).lowrange=0),booltype,false),para);
                         { create the call statement }
                         { create the call statement }
@@ -923,7 +923,7 @@ implementation
         { check if codepara is valid }
         { check if codepara is valid }
         if assigned(codepara) and
         if assigned(codepara) and
            (
            (
-            (codepara.resultdef.deftype <> orddef)
+            (codepara.resultdef.typ <> orddef)
 {$ifndef cpu64bit}
 {$ifndef cpu64bit}
             or is_64bitint(codepara.resultdef)
             or is_64bitint(codepara.resultdef)
 {$endif cpu64bit}
 {$endif cpu64bit}
@@ -934,7 +934,7 @@ implementation
           end;
           end;
 
 
         { check if dest para is valid }
         { check if dest para is valid }
-        if not(destpara.resultdef.deftype in [orddef,floatdef]) then
+        if not(destpara.resultdef.typ in [orddef,floatdef]) then
           begin
           begin
             CGMessagePos(destpara.fileinfo,type_e_integer_or_real_expr_expected);
             CGMessagePos(destpara.fileinfo,type_e_integer_or_real_expr_expected);
             exit;
             exit;
@@ -972,7 +972,7 @@ implementation
             { we need its resultdef later on }
             { we need its resultdef later on }
             codepara.get_paratype;
             codepara.get_paratype;
           end
           end
-        else if (torddef(codepara.resultdef).typ = torddef(sinttype).typ) then
+        else if (torddef(codepara.resultdef).ordtype = torddef(sinttype).ordtype) then
           { because code is a var parameter, it must match types exactly    }
           { because code is a var parameter, it must match types exactly    }
           { however, since it will return values in [0..255], both longints }
           { however, since it will return values in [0..255], both longints }
           { and cardinals are fine. Since the formal code para type is      }
           { and cardinals are fine. Since the formal code para type is      }
@@ -988,10 +988,10 @@ implementation
         { create the procedure name }
         { create the procedure name }
         procname := 'fpc_val_';
         procname := 'fpc_val_';
 
 
-        case destpara.resultdef.deftype of
+        case destpara.resultdef.typ of
           orddef:
           orddef:
             begin
             begin
-              case torddef(destpara.resultdef).typ of
+              case torddef(destpara.resultdef).ordtype of
 {$ifdef cpu64bit}
 {$ifdef cpu64bit}
                 scurrency,
                 scurrency,
                 s64bit,
                 s64bit,
@@ -1031,7 +1031,7 @@ implementation
 
 
         { play a trick to have tcallnode handle invalid source parameters: }
         { play a trick to have tcallnode handle invalid source parameters: }
         { the shortstring-longint val routine by default                   }
         { the shortstring-longint val routine by default                   }
-        if (sourcepara.resultdef.deftype = stringdef) then
+        if (sourcepara.resultdef.typ = stringdef) then
           procname := procname + tstringdef(sourcepara.resultdef).stringtypname
           procname := procname + tstringdef(sourcepara.resultdef).stringtypname
         else
         else
           procname := procname + 'shortstr';
           procname := procname + 'shortstr';
@@ -1102,7 +1102,7 @@ implementation
            enum : tenumsym;
            enum : tenumsym;
            hp   : tnode;
            hp   : tnode;
         begin
         begin
-           case def.deftype of
+           case def.typ of
              orddef:
              orddef:
                begin
                begin
                   if inlinenumber=in_low_x then
                   if inlinenumber=in_low_x then
@@ -1114,7 +1114,7 @@ implementation
                   { 1.0.x doesn't support int64($ffffffff) correct, it'll expand
                   { 1.0.x doesn't support int64($ffffffff) correct, it'll expand
                     to -1 instead of staying $ffffffff. Therefor we use $ffff with
                     to -1 instead of staying $ffffffff. Therefor we use $ffff with
                     shl twice (PFV) }
                     shl twice (PFV) }
-                  case torddef(def).typ of
+                  case torddef(def).ordtype of
                     s64bit,scurrency :
                     s64bit,scurrency :
                       begin
                       begin
                         if (inlinenumber=in_low_x) then
                         if (inlinenumber=in_low_x) then
@@ -1137,7 +1137,7 @@ implementation
                   hp:=cordconstnode.create(v,def,true);
                   hp:=cordconstnode.create(v,def,true);
                   typecheckpass(hp);
                   typecheckpass(hp);
                   { fix high(qword) }
                   { fix high(qword) }
-                  if (torddef(def).typ=u64bit) and
+                  if (torddef(def).ordtype=u64bit) and
                      (inlinenumber = in_high_x) then
                      (inlinenumber = in_high_x) then
                     tordconstnode(hp).value := -1; { is the same as qword($ffffffffffffffff) }
                     tordconstnode(hp).value := -1; { is the same as qword($ffffffffffffffff) }
                   do_lowhigh:=hp;
                   do_lowhigh:=hp;
@@ -1217,8 +1217,8 @@ implementation
 
 
       procedure setfloatresultdef;
       procedure setfloatresultdef;
         begin
         begin
-          if (left.resultdef.deftype=floatdef) and
-            (tfloatdef(left.resultdef).typ in [s32real,s64real,s80real,s128real]) then
+          if (left.resultdef.typ=floatdef) and
+            (tfloatdef(left.resultdef).floattype in [s32real,s64real,s80real,s128real]) then
             resultdef:=left.resultdef
             resultdef:=left.resultdef
           else
           else
             begin
             begin
@@ -1250,7 +1250,7 @@ implementation
               else
               else
                 packedarraydef := tarraydef(source.left.resultdef);
                 packedarraydef := tarraydef(source.left.resultdef);
               { target can be any kind of array, as long as it's not packed }
               { target can be any kind of array, as long as it's not packed }
-              if (target.left.resultdef.deftype <> arraydef) or
+              if (target.left.resultdef.typ <> arraydef) or
                  is_packed_array(target.left.resultdef) then
                  is_packed_array(target.left.resultdef) then
                 CGMessagePos2(target.left.fileinfo,type_e_got_expected_unpacked_array,'2',target.left.resultdef.GetTypeName)
                 CGMessagePos2(target.left.fileinfo,type_e_got_expected_unpacked_array,'2',target.left.resultdef.GetTypeName)
               else
               else
@@ -1262,7 +1262,7 @@ implementation
               target := tcallparanode(index.right);
               target := tcallparanode(index.right);
 
 
               { source can be any kind of array, as long as it's not packed }
               { source can be any kind of array, as long as it's not packed }
-              if (source.left.resultdef.deftype <> arraydef) or
+              if (source.left.resultdef.typ <> arraydef) or
                  is_packed_array(source.left.resultdef) then
                  is_packed_array(source.left.resultdef) then
                 CGMessagePos2(source.left.fileinfo,type_e_got_expected_unpacked_array,'1',source.left.resultdef.GetTypeName)
                 CGMessagePos2(source.left.fileinfo,type_e_got_expected_unpacked_array,'1',source.left.resultdef.GetTypeName)
               else
               else
@@ -1434,7 +1434,7 @@ implementation
                       begin
                       begin
                         hp:=caddnode.create(addn,hightree,
                         hp:=caddnode.create(addn,hightree,
                                          cordconstnode.create(1,sinttype,false));
                                          cordconstnode.create(1,sinttype,false));
-                        if (left.resultdef.deftype=arraydef) then
+                        if (left.resultdef.typ=arraydef) then
                           if not is_packed_array(tarraydef(left.resultdef)) then
                           if not is_packed_array(tarraydef(left.resultdef)) then
                             begin
                             begin
                               if (tarraydef(left.resultdef).elesize<>1) then
                               if (tarraydef(left.resultdef).elesize<>1) then
@@ -1483,10 +1483,10 @@ implementation
                       goto myexit;
                       goto myexit;
                     end;
                     end;
                    set_varstate(left,vs_read,[vsf_must_be_valid]);
                    set_varstate(left,vs_read,[vsf_must_be_valid]);
-                   case left.resultdef.deftype of
+                   case left.resultdef.typ of
                      orddef :
                      orddef :
                        begin
                        begin
-                         case torddef(left.resultdef).typ of
+                         case torddef(left.resultdef).ordtype of
                            bool8bit,
                            bool8bit,
                            uchar:
                            uchar:
                              begin
                              begin
@@ -1563,7 +1563,7 @@ implementation
                 begin
                 begin
                   set_varstate(left,vs_read,[vsf_must_be_valid]);
                   set_varstate(left,vs_read,[vsf_must_be_valid]);
 
 
-                  case left.resultdef.deftype of
+                  case left.resultdef.typ of
                     variantdef:
                     variantdef:
                       begin
                       begin
                         inserttypeconv(left,cansistringtype);
                         inserttypeconv(left,cansistringtype);
@@ -1573,7 +1573,7 @@ implementation
                       begin
                       begin
                         { we don't need string convertions here }
                         { we don't need string convertions here }
                         if (left.nodetype=typeconvn) and
                         if (left.nodetype=typeconvn) and
-                           (ttypeconvnode(left).left.resultdef.deftype=stringdef) then
+                           (ttypeconvnode(left).left.resultdef.typ=stringdef) then
                          begin
                          begin
                            hp:=ttypeconvnode(left).left;
                            hp:=ttypeconvnode(left).left;
                            ttypeconvnode(left).left:=nil;
                            ttypeconvnode(left).left:=nil;
@@ -1720,14 +1720,14 @@ implementation
                      CGMessage(type_e_ordinal_expr_expected)
                      CGMessage(type_e_ordinal_expr_expected)
                    else
                    else
                      begin
                      begin
-                       if (resultdef.deftype=enumdef) and
+                       if (resultdef.typ=enumdef) and
                           (tenumdef(resultdef).has_jumps) and
                           (tenumdef(resultdef).has_jumps) and
                           not(m_delphi in current_settings.modeswitches) then
                           not(m_delphi in current_settings.modeswitches) then
                          CGMessage(type_e_succ_and_pred_enums_with_assign_not_possible);
                          CGMessage(type_e_succ_and_pred_enums_with_assign_not_possible);
                      end;
                      end;
 
 
                    { only if the result is an enum do we do range checking }
                    { only if the result is an enum do we do range checking }
-                   if (resultdef.deftype=enumdef) then
+                   if (resultdef.typ=enumdef) then
                      checkrange := true
                      checkrange := true
                    else
                    else
                      checkrange := false;
                      checkrange := false;
@@ -1760,7 +1760,7 @@ implementation
                        valid_for_var(tcallparanode(left).left,true);
                        valid_for_var(tcallparanode(left).left,true);
                        set_varstate(tcallparanode(left).left,vs_readwritten,[vsf_must_be_valid]);
                        set_varstate(tcallparanode(left).left,vs_readwritten,[vsf_must_be_valid]);
 
 
-                       if (left.resultdef.deftype in [enumdef,pointerdef]) or
+                       if (left.resultdef.typ in [enumdef,pointerdef]) or
                           is_ordinal(left.resultdef) or
                           is_ordinal(left.resultdef) or
                           is_currency(left.resultdef) then
                           is_currency(left.resultdef) then
                         begin
                         begin
@@ -1833,7 +1833,7 @@ implementation
                   valid_for_var(tcallparanode(left).left,true);
                   valid_for_var(tcallparanode(left).left,true);
                   set_varstate(tcallparanode(left).left,vs_readwritten,[vsf_must_be_valid]);
                   set_varstate(tcallparanode(left).left,vs_readwritten,[vsf_must_be_valid]);
                   { check type }
                   { check type }
-                  if (left.resultdef.deftype=setdef) then
+                  if (left.resultdef.typ=setdef) then
                     begin
                     begin
                       { insert a type conversion       }
                       { insert a type conversion       }
                       { to the type of the set elements  }
                       { to the type of the set elements  }
@@ -1854,7 +1854,7 @@ implementation
                 begin
                 begin
                   result:=nil;
                   result:=nil;
                   resultdef:=tcallparanode(left).left.resultdef;
                   resultdef:=tcallparanode(left).left.resultdef;
-                  if (resultdef.deftype <> arraydef) then
+                  if (resultdef.typ <> arraydef) then
                     CGMessagePos(left.fileinfo,type_e_mismatch)
                     CGMessagePos(left.fileinfo,type_e_mismatch)
                   else if is_packed_array(resultdef) then
                   else if is_packed_array(resultdef) then
                     CGMessagePos2(left.fileinfo,type_e_got_expected_unpacked_array,'1',resultdef.typename);
                     CGMessagePos2(left.fileinfo,type_e_got_expected_unpacked_array,'1',resultdef.typename);
@@ -1867,7 +1867,7 @@ implementation
               in_low_x,
               in_low_x,
               in_high_x:
               in_high_x:
                 begin
                 begin
-                  case left.resultdef.deftype of
+                  case left.resultdef.typ of
                     orddef,
                     orddef,
                     enumdef:
                     enumdef:
                       begin
                       begin
@@ -2314,10 +2314,10 @@ implementation
                   { range/overflow checking doesn't work properly }
                   { range/overflow checking doesn't work properly }
                   { with the inc/dec code that's generated (JM)   }
                   { with the inc/dec code that's generated (JM)   }
                   (
                   (
-                   (((left.resultdef.deftype = orddef) and
+                   (((left.resultdef.typ = orddef) and
                      not(is_char(left.resultdef)) and
                      not(is_char(left.resultdef)) and
                      not(is_boolean(left.resultdef))) or
                      not(is_boolean(left.resultdef))) or
-                    (left.resultdef.deftype = pointerdef)) and
+                    (left.resultdef.typ = pointerdef)) and
                    (current_settings.localswitches * [cs_check_overflow,cs_check_range] <> [])
                    (current_settings.localswitches * [cs_check_overflow,cs_check_range] <> [])
                   ) then
                   ) then
                  { convert to simple add (JM) }
                  { convert to simple add (JM) }
@@ -2339,14 +2339,14 @@ implementation
                      end;
                      end;
                    typecheckpass(hpp);
                    typecheckpass(hpp);
 {$ifndef cpu64bit}
 {$ifndef cpu64bit}
-                   if not((hpp.resultdef.deftype=orddef) and
-                          (torddef(hpp.resultdef).typ<>u32bit)) then
+                   if not((hpp.resultdef.typ=orddef) and
+                          (torddef(hpp.resultdef).ordtype<>u32bit)) then
 {$endif cpu64bit}
 {$endif cpu64bit}
                      inserttypeconv_internal(hpp,sinttype);
                      inserttypeconv_internal(hpp,sinttype);
                    { No overflow check for pointer operations, because inc(pointer,-1) will always
                    { No overflow check for pointer operations, because inc(pointer,-1) will always
                      trigger an overflow. For uint32 it works because then the operation is done
                      trigger an overflow. For uint32 it works because then the operation is done
                      in 64bit }
                      in 64bit }
-                   if (tcallparanode(left).left.resultdef.deftype=pointerdef) then
+                   if (tcallparanode(left).left.resultdef.typ=pointerdef) then
                      exclude(current_settings.localswitches,cs_check_overflow);
                      exclude(current_settings.localswitches,cs_check_overflow);
                    { make sure we don't call functions part of the left node twice (and generally }
                    { make sure we don't call functions part of the left node twice (and generally }
                    { optimize the code generation)                                                }
                    { optimize the code generation)                                                }
@@ -2380,7 +2380,7 @@ implementation
                    { return new node }
                    { return new node }
                    result := newblock;
                    result := newblock;
                  end
                  end
-               else if (left.resultdef.deftype in [enumdef,pointerdef]) or
+               else if (left.resultdef.typ in [enumdef,pointerdef]) or
                        is_ordinal(left.resultdef) then
                        is_ordinal(left.resultdef) then
                  begin
                  begin
                     { two paras ? }
                     { two paras ? }
@@ -2737,7 +2737,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).typ,ulorange,uhirange);
+         temprangedef:=torddef.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));

+ 13 - 13
compiler/nld.pas

@@ -40,9 +40,9 @@ interface
        public
        public
           symtableentry : tsym;
           symtableentry : tsym;
           symtableentryderef : tderef;
           symtableentryderef : tderef;
-          symtable : tsymtable;
-          constructor create(v : tsym;st : tsymtable);virtual;
-          constructor create_procvar(v : tsym;d:tprocdef;st : tsymtable);virtual;
+          symtable : TSymtable;
+          constructor create(v : tsym;st : TSymtable);virtual;
+          constructor create_procvar(v : tsym;d:tprocdef;st : TSymtable);virtual;
           constructor ppuload(t:tnodetype;ppufile:tcompilerppufile);override;
           constructor ppuload(t:tnodetype;ppufile:tcompilerppufile);override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure buildderefimpl;override;
           procedure buildderefimpl;override;
@@ -155,7 +155,7 @@ implementation
                              TLOADNODE
                              TLOADNODE
 *****************************************************************************}
 *****************************************************************************}
 
 
-    constructor tloadnode.create(v : tsym;st : tsymtable);
+    constructor tloadnode.create(v : tsym;st : TSymtable);
       begin
       begin
          inherited create(loadn,nil);
          inherited create(loadn,nil);
          if not assigned(v) then
          if not assigned(v) then
@@ -166,7 +166,7 @@ implementation
       end;
       end;
 
 
 
 
-    constructor tloadnode.create_procvar(v : tsym;d:tprocdef;st : tsymtable);
+    constructor tloadnode.create_procvar(v : tsym;d:tprocdef;st : TSymtable);
       begin
       begin
          inherited create(loadn,nil);
          inherited create(loadn,nil);
          if not assigned(v) then
          if not assigned(v) then
@@ -590,11 +590,11 @@ implementation
 
 
         { tp procvar support, when we don't expect a procvar
         { tp procvar support, when we don't expect a procvar
           then we need to call the procvar }
           then we need to call the procvar }
-        if (left.resultdef.deftype<>procvardef) then
+        if (left.resultdef.typ<>procvardef) then
           maybe_call_procvar(right,true);
           maybe_call_procvar(right,true);
 
 
         { assignments to formaldefs and open arrays aren't allowed }
         { assignments to formaldefs and open arrays aren't allowed }
-        if (left.resultdef.deftype=formaldef) or
+        if (left.resultdef.typ=formaldef) or
            is_open_array(left.resultdef) then
            is_open_array(left.resultdef) then
           CGMessage(type_e_operator_not_allowed);
           CGMessage(type_e_operator_not_allowed);
 
 
@@ -621,9 +621,9 @@ implementation
              secondpass and except for ansi/wide string that can
              secondpass and except for ansi/wide string that can
              be converted immediatly }
              be converted immediatly }
            if not(is_char(right.resultdef) or
            if not(is_char(right.resultdef) or
-                  (right.resultdef.deftype=stringdef)) then
+                  (right.resultdef.typ=stringdef)) then
              inserttypeconv(right,left.resultdef);
              inserttypeconv(right,left.resultdef);
-           if right.resultdef.deftype=stringdef then
+           if right.resultdef.typ=stringdef then
             begin
             begin
               useshelper:=true;
               useshelper:=true;
               { convert constant strings to shortstrings. But
               { convert constant strings to shortstrings. But
@@ -684,7 +684,7 @@ implementation
 
 
         { call helpers for variant, they can contain non ref. counted types like
         { call helpers for variant, they can contain non ref. counted types like
           vararrays which must be really copied }
           vararrays which must be really copied }
-        if left.resultdef.deftype=variantdef then
+        if left.resultdef.typ=variantdef then
          begin
          begin
            hp:=ccallparanode.create(ctypeconvnode.create_internal(
            hp:=ccallparanode.create(ctypeconvnode.create_internal(
                  caddrnode.create_internal(right),voidpointertype),
                  caddrnode.create_internal(right),voidpointertype),
@@ -710,7 +710,7 @@ implementation
          end;
          end;
 
 
         { check if local proc/func is assigned to procvar }
         { check if local proc/func is assigned to procvar }
-        if right.resultdef.deftype=procvardef then
+        if right.resultdef.typ=procvardef then
           test_local_to_procvar(tprocvardef(right.resultdef),left.resultdef);
           test_local_to_procvar(tprocvardef(right.resultdef),left.resultdef);
       end;
       end;
 
 
@@ -780,7 +780,7 @@ implementation
 
 
         if (is_shortstring(left.resultdef)) then
         if (is_shortstring(left.resultdef)) then
           begin
           begin
-           if right.resultdef.deftype=stringdef then
+           if right.resultdef.typ=stringdef then
             begin
             begin
               if (right.nodetype<>stringconstn) or
               if (right.nodetype<>stringconstn) or
                  (tstringconstnode(right).len<>0) then
                  (tstringconstnode(right).len<>0) then
@@ -1109,7 +1109,7 @@ implementation
         result:=nil;
         result:=nil;
         resultdef:=typedef;
         resultdef:=typedef;
         { check if it's valid }
         { check if it's valid }
-        if typedef.deftype = errordef then
+        if typedef.typ = errordef then
           CGMessage(parser_e_illegal_expression);
           CGMessage(parser_e_illegal_expression);
       end;
       end;
 
 

+ 34 - 34
compiler/nmat.pas

@@ -132,14 +132,14 @@ implementation
 
 
             case nodetype of
             case nodetype of
               modn:
               modn:
-                if (torddef(ld).typ <> u64bit) or
-                   (torddef(rd).typ <> u64bit) then
+                if (torddef(ld).ordtype <> u64bit) or
+                   (torddef(rd).ordtype <> u64bit) then
                   t:=genintconstnode(lv mod rv)
                   t:=genintconstnode(lv mod rv)
                 else
                 else
                   t:=genintconstnode(int64(qword(lv) mod qword(rv)));
                   t:=genintconstnode(int64(qword(lv) mod qword(rv)));
               divn:
               divn:
-                if (torddef(ld).typ <> u64bit) or
-                   (torddef(rd).typ <> u64bit) then
+                if (torddef(ld).ordtype <> u64bit) or
+                   (torddef(rd).ordtype <> u64bit) then
                   t:=genintconstnode(lv div rv)
                   t:=genintconstnode(lv div rv)
                 else
                 else
                   t:=genintconstnode(int64(qword(lv) div qword(rv)));
                   t:=genintconstnode(int64(qword(lv) div qword(rv)));
@@ -177,9 +177,9 @@ implementation
            end;
            end;
 
 
          { we need 2 orddefs always }
          { we need 2 orddefs always }
-         if (left.resultdef.deftype<>orddef) then
+         if (left.resultdef.typ<>orddef) then
            inserttypeconv(right,sinttype);
            inserttypeconv(right,sinttype);
-         if (right.resultdef.deftype<>orddef) then
+         if (right.resultdef.typ<>orddef) then
            inserttypeconv(right,sinttype);
            inserttypeconv(right,sinttype);
          if codegenerror then
          if codegenerror then
            exit;
            exit;
@@ -204,14 +204,14 @@ implementation
          { Do the same for qwords and positive constants as well, otherwise things like   }
          { Do the same for qwords and positive constants as well, otherwise things like   }
          { "qword mod 10" are evaluated with int64 as result, which is wrong if the       }
          { "qword mod 10" are evaluated with int64 as result, which is wrong if the       }
          { "qword" was > high(int64) (JM)                                                 }
          { "qword" was > high(int64) (JM)                                                 }
-         if (rd.typ in [u32bit,u64bit]) and
+         if (rd.ordtype in [u32bit,u64bit]) and
             is_constintnode(left) and
             is_constintnode(left) and
             (tordconstnode(left).value >= 0) then
             (tordconstnode(left).value >= 0) then
            begin
            begin
              inserttypeconv(left,right.resultdef);
              inserttypeconv(left,right.resultdef);
              ld:=torddef(left.resultdef);
              ld:=torddef(left.resultdef);
            end;
            end;
-         if (ld.typ in [u32bit,u64bit]) and
+         if (ld.ordtype in [u32bit,u64bit]) and
             is_constintnode(right) and
             is_constintnode(right) and
             (tordconstnode(right).value >= 0) then
             (tordconstnode(right).value >= 0) then
           begin
           begin
@@ -221,12 +221,12 @@ implementation
 
 
          { when there is one currency value, everything is done
          { when there is one currency value, everything is done
            using currency }
            using currency }
-         if (ld.typ=scurrency) or
-            (rd.typ=scurrency) then
+         if (ld.ordtype=scurrency) or
+            (rd.ordtype=scurrency) then
            begin
            begin
-             if (ld.typ<>scurrency) then
+             if (ld.ordtype<>scurrency) then
               inserttypeconv(left,s64currencytype);
               inserttypeconv(left,s64currencytype);
-             if (rd.typ<>scurrency) then
+             if (rd.ordtype<>scurrency) then
               inserttypeconv(right,s64currencytype);
               inserttypeconv(right,s64currencytype);
              resultdef:=left.resultdef;
              resultdef:=left.resultdef;
            end
            end
@@ -239,31 +239,31 @@ implementation
            begin
            begin
              if is_signed(rd) or is_signed(ld) then
              if is_signed(rd) or is_signed(ld) then
                begin
                begin
-                  if (ld.typ<>s64bit) then
+                  if (ld.ordtype<>s64bit) then
                     inserttypeconv(left,s64inttype);
                     inserttypeconv(left,s64inttype);
-                  if (rd.typ<>s64bit) then
+                  if (rd.ordtype<>s64bit) then
                     inserttypeconv(right,s64inttype);
                     inserttypeconv(right,s64inttype);
                end
                end
              else
              else
                begin
                begin
-                  if (ld.typ<>u64bit) then
+                  if (ld.ordtype<>u64bit) then
                     inserttypeconv(left,u64inttype);
                     inserttypeconv(left,u64inttype);
-                  if (rd.typ<>u64bit) then
+                  if (rd.ordtype<>u64bit) then
                     inserttypeconv(right,u64inttype);
                     inserttypeconv(right,u64inttype);
                end;
                end;
              resultdef:=left.resultdef;
              resultdef:=left.resultdef;
            end
            end
          else
          else
           { when mixing cardinals and signed numbers, convert everythign to 64bit (JM) }
           { when mixing cardinals and signed numbers, convert everythign to 64bit (JM) }
-          if ((rd.typ = u32bit) and
+          if ((rd.ordtype = u32bit) and
               is_signed(ld)) or
               is_signed(ld)) or
-             ((ld.typ = u32bit) and
+             ((ld.ordtype = u32bit) and
               is_signed(rd)) then
               is_signed(rd)) then
            begin
            begin
               CGMessage(type_w_mixed_signed_unsigned);
               CGMessage(type_w_mixed_signed_unsigned);
-              if (ld.typ<>s64bit) then
+              if (ld.ordtype<>s64bit) then
                 inserttypeconv(left,s64inttype);
                 inserttypeconv(left,s64inttype);
-              if (rd.typ<>s64bit) then
+              if (rd.ordtype<>s64bit) then
                 inserttypeconv(right,s64inttype);
                 inserttypeconv(right,s64inttype);
               resultdef:=left.resultdef;
               resultdef:=left.resultdef;
            end
            end
@@ -271,9 +271,9 @@ implementation
 {$endif cpu64bit}
 {$endif cpu64bit}
            begin
            begin
               { Make everything always default singed int }
               { Make everything always default singed int }
-              if not(rd.typ in [torddef(sinttype).typ,torddef(uinttype).typ]) then
+              if not(rd.ordtype in [torddef(sinttype).ordtype,torddef(uinttype).ordtype]) then
                 inserttypeconv(right,sinttype);
                 inserttypeconv(right,sinttype);
-              if not(ld.typ in [torddef(sinttype).typ,torddef(uinttype).typ]) then
+              if not(ld.ordtype in [torddef(sinttype).ordtype,torddef(uinttype).ordtype]) then
                 inserttypeconv(left,sinttype);
                 inserttypeconv(left,sinttype);
               resultdef:=right.resultdef;
               resultdef:=right.resultdef;
            end;
            end;
@@ -433,8 +433,8 @@ implementation
 
 
 {$ifndef cpu64bit}
 {$ifndef cpu64bit}
          { 64bit }
          { 64bit }
-         if (left.resultdef.deftype=orddef) and
-            (right.resultdef.deftype=orddef) and
+         if (left.resultdef.typ=orddef) and
+            (right.resultdef.typ=orddef) and
             (is_64bitint(left.resultdef) or is_64bitint(right.resultdef)) then
             (is_64bitint(left.resultdef) or is_64bitint(right.resultdef)) then
            begin
            begin
              result := first_moddiv64bitint;
              result := first_moddiv64bitint;
@@ -511,7 +511,7 @@ implementation
            32 bit for backwards compatibility. That way 'shl 33' is
            32 bit for backwards compatibility. That way 'shl 33' is
            the same as 'shl 1'. It's ugly but compatible with delphi/tp/gcc }
            the same as 'shl 1'. It's ugly but compatible with delphi/tp/gcc }
          if (not is_64bit(left.resultdef)) and
          if (not is_64bit(left.resultdef)) and
-            (torddef(left.resultdef).typ<>u32bit) then
+            (torddef(left.resultdef).ordtype<>u32bit) then
            inserttypeconv(left,s32inttype);
            inserttypeconv(left,s32inttype);
 
 
          inserttypeconv(right,sinttype);
          inserttypeconv(right,sinttype);
@@ -618,7 +618,7 @@ implementation
            exit;
            exit;
 
 
          resultdef:=left.resultdef;
          resultdef:=left.resultdef;
-         if (left.resultdef.deftype=floatdef) then
+         if (left.resultdef.typ=floatdef) then
            begin
            begin
            end
            end
 {$ifdef SUPPORT_MMX}
 {$ifdef SUPPORT_MMX}
@@ -639,7 +639,7 @@ implementation
            begin
            begin
            end
            end
 {$endif cpu64bit}
 {$endif cpu64bit}
-         else if (left.resultdef.deftype=orddef) then
+         else if (left.resultdef.typ=orddef) then
            begin
            begin
               inserttypeconv(left,sinttype);
               inserttypeconv(left,sinttype);
               resultdef:=left.resultdef;
               resultdef:=left.resultdef;
@@ -671,11 +671,11 @@ implementation
         if codegenerror then
         if codegenerror then
           exit;
           exit;
 
 
-        if (cs_fp_emulation in current_settings.moduleswitches) and (left.resultdef.deftype=floatdef) then
+        if (cs_fp_emulation in current_settings.moduleswitches) and (left.resultdef.typ=floatdef) then
           begin
           begin
             if not(target_info.system in system_wince) then
             if not(target_info.system in system_wince) then
               begin
               begin
-                case tfloatdef(resultdef).typ of
+                case tfloatdef(resultdef).floattype of
                   s32real:
                   s32real:
                     begin
                     begin
                       procname:='float32_sub';
                       procname:='float32_sub';
@@ -698,7 +698,7 @@ implementation
               end
               end
             else
             else
               begin
               begin
-                case tfloatdef(resultdef).typ of
+                case tfloatdef(resultdef).floattype of
                   s32real:
                   s32real:
                     procname:='NEGS';
                     procname:='NEGS';
                   s64real:
                   s64real:
@@ -722,7 +722,7 @@ implementation
             registersmmx:=left.registersmmx;
             registersmmx:=left.registersmmx;
 {$endif SUPPORT_MMX}
 {$endif SUPPORT_MMX}
 
 
-            if (left.resultdef.deftype=floatdef) then
+            if (left.resultdef.typ=floatdef) then
               begin
               begin
                 if (left.expectloc<>LOC_REGISTER) and
                 if (left.expectloc<>LOC_REGISTER) and
                   (registersfpu<1) then
                   (registersfpu<1) then
@@ -747,7 +747,7 @@ implementation
                   expectloc:=LOC_REGISTER;
                   expectloc:=LOC_REGISTER;
                end
                end
 {$endif cpu64bit}
 {$endif cpu64bit}
-             else if (left.resultdef.deftype=orddef) then
+             else if (left.resultdef.typ=orddef) then
                begin
                begin
                   if (left.expectloc<>LOC_REGISTER) and
                   if (left.expectloc<>LOC_REGISTER) and
                      (registersint<1) then
                      (registersint<1) then
@@ -794,7 +794,7 @@ implementation
            { Not of boolean expression. Turn around the operator and remove
            { Not of boolean expression. Turn around the operator and remove
              the not. This is not allowed for sets with the gten/lten,
              the not. This is not allowed for sets with the gten/lten,
              because there is no ltn/gtn support }
              because there is no ltn/gtn support }
-           if (taddnode(left).left.resultdef.deftype<>setdef) or
+           if (taddnode(left).left.resultdef.typ<>setdef) or
               (left.nodetype in [equaln,unequaln]) then
               (left.nodetype in [equaln,unequaln]) then
             begin
             begin
               result:=left;
               result:=left;
@@ -809,7 +809,7 @@ implementation
           begin
           begin
              v:=tordconstnode(left).value;
              v:=tordconstnode(left).value;
              def:=left.resultdef;
              def:=left.resultdef;
-             case torddef(left.resultdef).typ of
+             case torddef(left.resultdef).ordtype of
                bool8bit,
                bool8bit,
                bool16bit,
                bool16bit,
                bool32bit,
                bool32bit,

+ 13 - 13
compiler/nmem.pas

@@ -149,7 +149,7 @@ implementation
         if codegenerror then
         if codegenerror then
          exit;
          exit;
 
 
-        case left.resultdef.deftype of
+        case left.resultdef.typ of
           classrefdef :
           classrefdef :
             resultdef:=left.resultdef;
             resultdef:=left.resultdef;
           objectdef :
           objectdef :
@@ -248,7 +248,7 @@ implementation
                 currpi:=currpi.parent;
                 currpi:=currpi.parent;
                 if not assigned(currpi) then
                 if not assigned(currpi) then
                   internalerror(2005040602);
                   internalerror(2005040602);
-                hsym:=tparavarsym(currpi.procdef.parast.search('parentfp'));
+                hsym:=tparavarsym(currpi.procdef.parast.Find('parentfp'));
                 if not assigned(hsym) then
                 if not assigned(hsym) then
                   internalerror(2005040601);
                   internalerror(2005040601);
                 hsym.varregable:=vr_none;
                 hsym.varregable:=vr_none;
@@ -359,14 +359,14 @@ implementation
 
 
         { Handle @proc special, also @procvar in tp-mode needs
         { Handle @proc special, also @procvar in tp-mode needs
           special handling }
           special handling }
-        if (left.resultdef.deftype=procdef) or
+        if (left.resultdef.typ=procdef) or
            (
            (
-            (left.resultdef.deftype=procvardef) and
+            (left.resultdef.typ=procvardef) and
             ((m_tp_procvar in current_settings.modeswitches) or
             ((m_tp_procvar in current_settings.modeswitches) or
              (m_mac_procvar in current_settings.modeswitches))
              (m_mac_procvar in current_settings.modeswitches))
            ) then
            ) then
           begin
           begin
-            isprocvar:=(left.resultdef.deftype=procvardef);
+            isprocvar:=(left.resultdef.typ=procvardef);
 
 
             if not isprocvar then
             if not isprocvar then
               begin
               begin
@@ -393,7 +393,7 @@ implementation
                     if isprocvar then
                     if isprocvar then
                       begin
                       begin
                         { find proc field in methodpointer record }
                         { find proc field in methodpointer record }
-                        hsym:=tfieldvarsym(trecorddef(methodpointertype).symtable.search('proc'));
+                        hsym:=tfieldvarsym(trecorddef(methodpointertype).symtable.Find('proc'));
                         if not assigned(hsym) then
                         if not assigned(hsym) then
                           internalerror(200412041);
                           internalerror(200412041);
                         { Load tmehodpointer(left).proc }
                         { Load tmehodpointer(left).proc }
@@ -498,7 +498,7 @@ implementation
          { tp procvar support }
          { tp procvar support }
          maybe_call_procvar(left,true);
          maybe_call_procvar(left,true);
 
 
-         if left.resultdef.deftype=pointerdef then
+         if left.resultdef.typ=pointerdef then
           resultdef:=tpointerdef(left.resultdef).pointeddef
           resultdef:=tpointerdef(left.resultdef).pointeddef
          else
          else
           CGMessage(parser_e_invalid_qualifier);
           CGMessage(parser_e_invalid_qualifier);
@@ -588,7 +588,7 @@ implementation
         resultdef:=vs.vardef;
         resultdef:=vs.vardef;
 
 
         // don't put records from which we load fields which aren't regable in integer registers
         // don't put records from which we load fields which aren't regable in integer registers
-        if (left.resultdef.deftype = recorddef) and
+        if (left.resultdef.typ = recorddef) and
            not(tstoreddef(resultdef).is_intregable) then
            not(tstoreddef(resultdef).is_intregable) then
           make_not_regable(left,vr_addr);
           make_not_regable(left,vr_addr);
       end;
       end;
@@ -686,7 +686,7 @@ implementation
                 is_ansistring(left.resultdef) or
                 is_ansistring(left.resultdef) or
                 is_widestring(left.resultdef) or
                 is_widestring(left.resultdef) or
                 { implicit pointer dereference -> pointer is read }
                 { implicit pointer dereference -> pointer is read }
-                (left.resultdef.deftype = pointerdef);
+                (left.resultdef.typ = pointerdef);
          if valid then
          if valid then
            set_varstate(left,vs_read,[vsf_must_be_valid]);
            set_varstate(left,vs_read,[vsf_must_be_valid]);
 {
 {
@@ -702,17 +702,17 @@ implementation
            do not convert enums,booleans,char
            do not convert enums,booleans,char
            and do not convert range nodes }
            and do not convert range nodes }
          if (right.nodetype<>rangen) and (
          if (right.nodetype<>rangen) and (
-             ((right.resultdef.deftype<>enumdef) and
+             ((right.resultdef.typ<>enumdef) and
                not(is_char(right.resultdef) or is_widechar(right.resultdef)) and
                not(is_char(right.resultdef) or is_widechar(right.resultdef)) and
                not(is_boolean(right.resultdef))
                not(is_boolean(right.resultdef))
              ) or
              ) or
-             (left.resultdef.deftype <> arraydef) 
+             (left.resultdef.typ <> arraydef) 
             ) then
             ) then
            begin
            begin
              inserttypeconv(right,sinttype);
              inserttypeconv(right,sinttype);
            end;
            end;
 
 
-         case left.resultdef.deftype of
+         case left.resultdef.typ of
            arraydef :
            arraydef :
              begin
              begin
                { check type of the index value }
                { check type of the index value }
@@ -748,7 +748,7 @@ implementation
              end;
              end;
            stringdef :
            stringdef :
              begin
              begin
-                case tstringdef(left.resultdef).string_typ of
+                case tstringdef(left.resultdef).stringtype of
                   st_widestring :
                   st_widestring :
                     elementdef:=cwidechartype;
                     elementdef:=cwidechartype;
                   st_ansistring :
                   st_ansistring :

+ 34 - 34
compiler/nobj.pas

@@ -51,7 +51,7 @@ interface
 
 
       pvmtentry = ^tvmtentry;
       pvmtentry = ^tvmtentry;
       tvmtentry = record
       tvmtentry = record
-         speedvalue   : cardinal;
+         hash         : longword;
          name         : pshortstring;
          name         : pshortstring;
          firstprocdef : pprocdefcoll;
          firstprocdef : pprocdefcoll;
          next         : pvmtentry;
          next         : pvmtentry;
@@ -64,8 +64,8 @@ interface
         { message tables }
         { message tables }
         root : pprocdeftree;
         root : pprocdeftree;
         procedure disposeprocdeftree(p : pprocdeftree);
         procedure disposeprocdeftree(p : pprocdeftree);
-        procedure insertmsgint(p : tnamedindexitem;arg:pointer);
-        procedure insertmsgstr(p : tnamedindexitem;arg:pointer);
+        procedure insertmsgint(p:TObject;arg:pointer);
+        procedure insertmsgstr(p:TObject;arg:pointer);
         procedure insertint(p : pprocdeftree;var at : pprocdeftree;var count:longint);
         procedure insertint(p : pprocdeftree;var at : pprocdeftree;var count:longint);
         procedure insertstr(p : pprocdeftree;var at : pprocdeftree;var count:longint);
         procedure insertstr(p : pprocdeftree;var at : pprocdeftree;var count:longint);
         procedure writenames(p : pprocdeftree);
         procedure writenames(p : pprocdeftree);
@@ -74,14 +74,14 @@ interface
 {$ifdef WITHDMT}
 {$ifdef WITHDMT}
       private
       private
         { dmt }
         { dmt }
-        procedure insertdmtentry(p : tnamedindexitem;arg:pointer);
+        procedure insertdmtentry(p:TObject;arg:pointer);
         procedure writedmtindexentry(p : pprocdeftree);
         procedure writedmtindexentry(p : pprocdeftree);
         procedure writedmtaddressentry(p : pprocdeftree);
         procedure writedmtaddressentry(p : pprocdeftree);
 {$endif}
 {$endif}
       private
       private
         { published methods }
         { published methods }
-        procedure do_count_published_methods(p : tnamedindexitem;arg:pointer);
-        procedure do_gen_published_methods(p : tnamedindexitem;arg:pointer);
+        procedure do_count_published_methods(p:TObject;arg:pointer);
+        procedure do_gen_published_methods(p:TObject;arg:pointer);
       private
       private
         { vmt }
         { vmt }
         firstvmtentry      : pvmtentry;
         firstvmtentry      : pvmtentry;
@@ -90,7 +90,7 @@ interface
         has_virtual_method : boolean;
         has_virtual_method : boolean;
         procedure newdefentry(vmtentry:pvmtentry;pd:tprocdef;is_visible:boolean);
         procedure newdefentry(vmtentry:pvmtentry;pd:tprocdef;is_visible:boolean);
         function  newvmtentry(sym:tprocsym):pvmtentry;
         function  newvmtentry(sym:tprocsym):pvmtentry;
-        procedure eachsym(sym : tnamedindexitem;arg:pointer);
+        procedure eachsym(sym : TObject;arg:pointer);
         procedure disposevmttree;
         procedure disposevmttree;
         procedure writevirtualmethods(List:TAsmList);
         procedure writevirtualmethods(List:TAsmList);
       private
       private
@@ -207,7 +207,7 @@ implementation
            end;
            end;
       end;
       end;
 
 
-    procedure tclassheader.insertmsgint(p : tnamedindexitem;arg:pointer);
+    procedure tclassheader.insertmsgint(p:TObject;arg:pointer);
 
 
       var
       var
          i  : cardinal;
          i  : cardinal;
@@ -230,7 +230,7 @@ implementation
               end;
               end;
       end;
       end;
 
 
-    procedure tclassheader.insertmsgstr(p : tnamedindexitem;arg:pointer);
+    procedure tclassheader.insertmsgstr(p:TObject;arg:pointer);
 
 
       var
       var
          i  : cardinal;
          i  : cardinal;
@@ -295,7 +295,7 @@ implementation
          root:=nil;
          root:=nil;
          count:=0;
          count:=0;
          { insert all message handlers into a tree, sorted by name }
          { insert all message handlers into a tree, sorted by name }
-         _class.symtable.foreach(@insertmsgstr,@count);
+         _class.symtable.SymList.ForEachCall(@insertmsgstr,@count);
 
 
          { write all names }
          { write all names }
          if assigned(root) then
          if assigned(root) then
@@ -336,7 +336,7 @@ implementation
          root:=nil;
          root:=nil;
          count:=0;
          count:=0;
          { insert all message handlers into a tree, sorted by name }
          { insert all message handlers into a tree, sorted by name }
-         _class.symtable.foreach(@insertmsgint,@count);
+         _class.symtable.SymList.ForEachCall(@insertmsgint,@count);
 
 
          { now start writing of the message string table }
          { now start writing of the message string table }
          current_asmdata.getdatalabel(r);
          current_asmdata.getdatalabel(r);
@@ -357,7 +357,7 @@ implementation
               DMT
               DMT
 **************************************}
 **************************************}
 
 
-    procedure tclassheader.insertdmtentry(p : tnamedindexitem;arg:pointer);
+    procedure tclassheader.insertdmtentry(p:TObject;arg:pointer);
 
 
       var
       var
          hp : tprocdef;
          hp : tprocdef;
@@ -412,7 +412,7 @@ implementation
          count:=0;
          count:=0;
          gendmt:=nil;
          gendmt:=nil;
          { insert all message handlers into a tree, sorted by number }
          { insert all message handlers into a tree, sorted by number }
-         _class.symtable.foreach(insertdmtentry);
+         _class.symtable.SymList.ForEachCall(insertdmtentry);
 
 
          if count>0 then
          if count>0 then
            begin
            begin
@@ -440,7 +440,7 @@ implementation
         Published Methods
         Published Methods
 **************************************}
 **************************************}
 
 
-    procedure tclassheader.do_count_published_methods(p : tnamedindexitem;arg:pointer);
+    procedure tclassheader.do_count_published_methods(p:TObject;arg:pointer);
       var
       var
         i : longint;
         i : longint;
         pd : tprocdef;
         pd : tprocdef;
@@ -458,7 +458,7 @@ implementation
       end;
       end;
 
 
 
 
-    procedure tclassheader.do_gen_published_methods(p : tnamedindexitem;arg:pointer);
+    procedure tclassheader.do_gen_published_methods(p:TObject;arg:pointer);
       var
       var
         i  : longint;
         i  : longint;
         l  : tasmlabel;
         l  : tasmlabel;
@@ -498,14 +498,14 @@ implementation
 
 
       begin
       begin
          count:=0;
          count:=0;
-         _class.symtable.foreach(@do_count_published_methods,@count);
+         _class.symtable.SymList.ForEachCall(@do_count_published_methods,@count);
          if count>0 then
          if count>0 then
            begin
            begin
               current_asmdata.getdatalabel(l);
               current_asmdata.getdatalabel(l);
               current_asmdata.asmlists[al_globals].concat(cai_align.create(const_align(sizeof(aint))));
               current_asmdata.asmlists[al_globals].concat(cai_align.create(const_align(sizeof(aint))));
               current_asmdata.asmlists[al_globals].concat(Tai_label.Create(l));
               current_asmdata.asmlists[al_globals].concat(Tai_label.Create(l));
               current_asmdata.asmlists[al_globals].concat(Tai_const.Create_32bit(count));
               current_asmdata.asmlists[al_globals].concat(Tai_const.Create_32bit(count));
-              _class.symtable.foreach(@do_gen_published_methods,nil);
+              _class.symtable.SymList.ForEachCall(@do_gen_published_methods,nil);
               genpublishedmethodstable:=l;
               genpublishedmethodstable:=l;
            end
            end
          else
          else
@@ -572,7 +572,7 @@ implementation
       begin
       begin
         { generate new vmtentry }
         { generate new vmtentry }
         new(result);
         new(result);
-        result^.speedvalue:=sym.speedvalue;
+        result^.Hash:=sym.Hash;
         result^.name:=stringdup(sym.name);
         result^.name:=stringdup(sym.name);
         result^.next:=firstvmtentry;
         result^.next:=firstvmtentry;
         result^.firstprocdef:=nil;
         result^.firstprocdef:=nil;
@@ -580,7 +580,7 @@ implementation
       end;
       end;
 
 
 
 
-    procedure tclassheader.eachsym(sym : tnamedindexitem;arg:pointer);
+    procedure tclassheader.eachsym(sym : TObject;arg:pointer);
       const
       const
         po_comp = [po_classmethod,po_virtualmethod,po_staticmethod,po_interrupt,po_iocheck,po_msgstr,po_msgint,
         po_comp = [po_classmethod,po_virtualmethod,po_staticmethod,po_interrupt,po_iocheck,po_msgstr,po_msgint,
                    po_exports,po_varargs,po_explicitparaloc,po_nostackframe];
                    po_exports,po_varargs,po_explicitparaloc,po_nostackframe];
@@ -601,15 +601,15 @@ implementation
           exit;
           exit;
 
 
         { check the current list of symbols }
         { check the current list of symbols }
-        _name:=sym.name;
-        _speed:=sym.speedvalue;
+        _name:=TSym(sym).name;
+        _speed:=TSym(sym).Hash;
         vmtentry:=firstvmtentry;
         vmtentry:=firstvmtentry;
         while assigned(vmtentry) do
         while assigned(vmtentry) do
          begin
          begin
            { does the symbol already exist in the list? First
            { does the symbol already exist in the list? First
              compare speedvalue before doing the string compare to
              compare speedvalue before doing the string compare to
              speed it up a little }
              speed it up a little }
-           if (_speed=vmtentry^.speedvalue) and
+           if (_speed=vmtentry^.Hash) and
               (_name=vmtentry^.name^) then
               (_name=vmtentry^.name^) then
             begin
             begin
               hasoverloads:=(Tprocsym(sym).procdef_count>1);
               hasoverloads:=(Tprocsym(sym).procdef_count>1);
@@ -703,8 +703,8 @@ implementation
 
 
                                      { error, if the return types aren't equal }
                                      { error, if the return types aren't equal }
                                      if not(equal_defs(procdefcoll^.data.returndef,pd.returndef)) and
                                      if not(equal_defs(procdefcoll^.data.returndef,pd.returndef)) and
-                                        not((procdefcoll^.data.returndef.deftype=objectdef) and
-                                         (pd.returndef.deftype=objectdef) and
+                                        not((procdefcoll^.data.returndef.typ=objectdef) and
+                                         (pd.returndef.typ=objectdef) and
                                          is_class_or_interface(procdefcoll^.data.returndef) and
                                          is_class_or_interface(procdefcoll^.data.returndef) and
                                          is_class_or_interface(pd.returndef) and
                                          is_class_or_interface(pd.returndef) and
                                          (tobjectdef(pd.returndef).is_related(
                                          (tobjectdef(pd.returndef).is_related(
@@ -833,7 +833,7 @@ implementation
              do_genvmt(p.childof);
              do_genvmt(p.childof);
 
 
            { walk through all public syms }
            { walk through all public syms }
-           p.symtable.foreach(@eachsym,nil);
+           p.symtable.SymList.ForEachCall(@eachsym,nil);
         end;
         end;
 
 
       begin
       begin
@@ -1057,7 +1057,7 @@ implementation
             if ImplIntf.VtblImplIntf=ImplIntf then
             if ImplIntf.VtblImplIntf=ImplIntf then
               begin
               begin
                 { allocate a pointer in the object memory }
                 { allocate a pointer in the object memory }
-                with tobjectsymtable(_class.symtable) do
+                with tObjectSymtable(_class.symtable) do
                   begin
                   begin
                     datasize:=align(datasize,sizeof(aint));
                     datasize:=align(datasize,sizeof(aint));
                     ImplIntf.Ioffset:=datasize;
                     ImplIntf.Ioffset:=datasize;
@@ -1103,7 +1103,7 @@ implementation
               for class entries as the tree keeps always the same }
               for class entries as the tree keeps always the same }
             if (not tprocsym(sym).overloadchecked) and
             if (not tprocsym(sym).overloadchecked) and
                (po_overload in tprocsym(sym).first_procdef.procoptions) and
                (po_overload in tprocsym(sym).first_procdef.procoptions) and
-               (tprocsym(sym).owner.symtabletype=objectsymtable) then
+               (tprocsym(sym).owner.symtabletype=ObjectSymtable) then
              search_class_overloads(tprocsym(sym));
              search_class_overloads(tprocsym(sym));
 
 
             for i:=1 to tprocsym(sym).procdef_count do
             for i:=1 to tprocsym(sym).procdef_count do
@@ -1124,17 +1124,18 @@ implementation
 
 
     procedure tclassheader.intf_get_procdefs(ImplIntf:TImplementedInterface;IntfDef:TObjectDef);
     procedure tclassheader.intf_get_procdefs(ImplIntf:TImplementedInterface;IntfDef:TObjectDef);
       var
       var
-        def: tdef;
+        i   : longint;
+        def : tdef;
         hs,
         hs,
         prefix,
         prefix,
         mappedname: string;
         mappedname: string;
         implprocdef: tprocdef;
         implprocdef: tprocdef;
       begin
       begin
         prefix:=ImplIntf.IntfDef.symtable.name^+'.';
         prefix:=ImplIntf.IntfDef.symtable.name^+'.';
-        def:=tdef(IntfDef.symtable.defindex.first);
-        while assigned(def) do
+        for i:=0 to IntfDef.symtable.DefList.Count-1 do
           begin
           begin
-            if def.deftype=procdef then
+            def:=tdef(IntfDef.symtable.DefList[i]);
+            if def.typ=procdef then
               begin
               begin
                 { Find implementing procdef
                 { Find implementing procdef
                    1. Check for mapped name
                    1. Check for mapped name
@@ -1153,7 +1154,6 @@ implementation
                   if ImplIntf.IntfDef.iitype = etStandard then
                   if ImplIntf.IntfDef.iitype = etStandard then
                     Message1(sym_e_no_matching_implementation_found,tprocdef(def).fullprocname(false));
                     Message1(sym_e_no_matching_implementation_found,tprocdef(def).fullprocname(false));
               end;
               end;
-            def:=tdef(def.indexnext);
           end;
           end;
       end;
       end;
 
 
@@ -1313,8 +1313,8 @@ implementation
 
 
          { determine the size with symtable.datasize, because }
          { determine the size with symtable.datasize, because }
          { size gives back 4 for classes                    }
          { size gives back 4 for classes                    }
-         current_asmdata.asmlists[al_globals].concat(Tai_const.Create(aitconst_ptr,tobjectsymtable(_class.symtable).datasize));
-         current_asmdata.asmlists[al_globals].concat(Tai_const.Create(aitconst_ptr,-int64(tobjectsymtable(_class.symtable).datasize)));
+         current_asmdata.asmlists[al_globals].concat(Tai_const.Create(aitconst_ptr,tObjectSymtable(_class.symtable).datasize));
+         current_asmdata.asmlists[al_globals].concat(Tai_const.Create(aitconst_ptr,-int64(tObjectSymtable(_class.symtable).datasize)));
 {$ifdef WITHDMT}
 {$ifdef WITHDMT}
          if _class.classtype=ct_object then
          if _class.classtype=ct_object then
            begin
            begin

+ 1 - 1
compiler/node.pas

@@ -634,7 +634,7 @@ implementation
 
 
     function is_constenumnode(p : tnode) : boolean;
     function is_constenumnode(p : tnode) : boolean;
       begin
       begin
-         is_constenumnode:=(p.nodetype=ordconstn) and (p.resultdef.deftype=enumdef);
+         is_constenumnode:=(p.nodetype=ordconstn) and (p.resultdef.typ=enumdef);
       end;
       end;
 
 
 {****************************************************************************
 {****************************************************************************

+ 1 - 1
compiler/nopt.pas

@@ -290,7 +290,7 @@ var
   i  : longint;
   i  : longint;
 begin
 begin
   result:=false;
   result:=false;
-  if p.resultdef.deftype<>stringdef then
+  if p.resultdef.typ<>stringdef then
     exit;
     exit;
   i:=0;
   i:=0;
   hp:=p;
   hp:=p;

+ 5 - 5
compiler/nset.pas

@@ -180,7 +180,7 @@ implementation
           i : longint;
           i : longint;
         begin
         begin
           new(pcs);
           new(pcs);
-          case psd.elementdef.deftype of
+          case psd.elementdef.typ of
             enumdef :
             enumdef :
               begin
               begin
                 pes:=tenumsym(tenumdef(psd.elementdef).firstenum);
                 pes:=tenumsym(tenumdef(psd.elementdef).firstenum);
@@ -216,7 +216,7 @@ implementation
              exit;
              exit;
           end;
           end;
 
 
-         if right.resultdef.deftype<>setdef then
+         if right.resultdef.typ<>setdef then
            CGMessage(sym_e_set_expected);
            CGMessage(sym_e_set_expected);
 
 
          if (right.nodetype=typen) then
          if (right.nodetype=typen) then
@@ -243,12 +243,12 @@ implementation
                elements with the in operator.
                elements with the in operator.
              }
              }
              if  (
              if  (
-                   (left.resultdef.deftype = orddef) and not
-                   (torddef(left.resultdef).typ in [s8bit,u8bit,uchar,bool8bit])
+                   (left.resultdef.typ = orddef) and not
+                   (torddef(left.resultdef).ordtype in [s8bit,u8bit,uchar,bool8bit])
                  )
                  )
                 or
                 or
                  (
                  (
-                   (left.resultdef.deftype = enumdef) and
+                   (left.resultdef.typ = enumdef) and
                    (tenumdef(left.resultdef).maxval > 255)
                    (tenumdef(left.resultdef).maxval > 255)
                  )
                  )
               then
               then

+ 6 - 6
compiler/nutils.pas

@@ -279,7 +279,7 @@ implementation
         hp : tnode;
         hp : tnode;
       begin
       begin
         result:=false;
         result:=false;
-        if (p1.resultdef.deftype<>procvardef) or
+        if (p1.resultdef.typ<>procvardef) or
            (tponly and
            (tponly and
             not(m_tp_procvar in current_settings.modeswitches)) then
             not(m_tp_procvar in current_settings.modeswitches)) then
           exit;
           exit;
@@ -309,7 +309,7 @@ implementation
 
 
     function get_high_value_sym(vs: tparavarsym):tsym;
     function get_high_value_sym(vs: tparavarsym):tsym;
       begin
       begin
-        result := tsym(vs.owner.search('high'+vs.name));
+        result := tsym(vs.owner.Find('high'+vs.name));
       end;
       end;
 
 
 
 
@@ -332,7 +332,7 @@ implementation
     function load_self_node:tnode;
     function load_self_node:tnode;
       var
       var
         srsym : tsym;
         srsym : tsym;
-        srsymtable : tsymtable;
+        srsymtable : TSymtable;
       begin
       begin
         result:=nil;
         result:=nil;
         searchsym('self',srsym,srsymtable);
         searchsym('self',srsym,srsymtable);
@@ -353,7 +353,7 @@ implementation
     function load_result_node:tnode;
     function load_result_node:tnode;
       var
       var
         srsym : tsym;
         srsym : tsym;
-        srsymtable : tsymtable;
+        srsymtable : TSymtable;
       begin
       begin
         result:=nil;
         result:=nil;
         searchsym('result',srsym,srsymtable);
         searchsym('result',srsym,srsymtable);
@@ -371,7 +371,7 @@ implementation
     function load_self_pointer_node:tnode;
     function load_self_pointer_node:tnode;
       var
       var
         srsym : tsym;
         srsym : tsym;
-        srsymtable : tsymtable;
+        srsymtable : TSymtable;
       begin
       begin
         result:=nil;
         result:=nil;
         searchsym('self',srsym,srsymtable);
         searchsym('self',srsym,srsymtable);
@@ -392,7 +392,7 @@ implementation
     function load_vmt_pointer_node:tnode;
     function load_vmt_pointer_node:tnode;
       var
       var
         srsym : tsym;
         srsym : tsym;
-        srsymtable : tsymtable;
+        srsymtable : TSymtable;
       begin
       begin
         result:=nil;
         result:=nil;
         searchsym('vmt',srsym,srsymtable);
         searchsym('vmt',srsym,srsymtable);

+ 1 - 1
compiler/oglx.pas

@@ -331,7 +331,7 @@ begin
     header.os_type:=1;          {OS/2}
     header.os_type:=1;          {OS/2}
     {Set the initial EIP.}
     {Set the initial EIP.}
     header.eip_object:=code_object;
     header.eip_object:=code_object;
-    hsym:=tasmsymbol(globalsyms.search('start'));
+    hsym:=tasmsymbol(globalsyms.Find('start'));
     if not assigned(hsym) then
     if not assigned(hsym) then
     begin
     begin
         comment(V_Error,'Entrypoint "start" not defined');
         comment(V_Error,'Entrypoint "start" not defined');

+ 1 - 32
compiler/options.pas

@@ -75,9 +75,6 @@ uses
   cutils,cmsgs,
   cutils,cmsgs,
   comphook,
   comphook,
   symtable,scanner,rabase
   symtable,scanner,rabase
-{$ifdef BrowserLog}
-  ,browlog
-{$endif BrowserLog}
   ;
   ;
 
 
 const
 const
@@ -446,35 +443,7 @@ begin
 
 
            'b' :
            'b' :
              begin
              begin
-{$ifdef supportbrowser}
-               if UnsetBool(More,0) then
-                begin
-                  exclude(init_settings.moduleswitches,cs_browser);
-                  exclude(init_settings.moduleswitches,cs_local_browser);
-{$ifdef BrowserLog}
-                  exclude(init_settings.globalswitches,cs_browser_log);
-{$endif}
-                end
-               else
-                begin
-                  include(init_settings.moduleswitches,cs_browser);
-{$ifdef BrowserLog}
-                  include(init_settings.globalswitches,cs_browser_log);
-{$endif}
-                end;
-               if More<>'' then
-                 if (More='l') or (More='l+') then
-                   include(init_settings.moduleswitches,cs_local_browser)
-                 else
-                  if More='l-' then
-                   exclude(init_settings.moduleswitches,cs_local_browser)
-                 else
-{$ifdef BrowserLog}
-                   browserlog.elements_to_list.insert(more);
-{$else}
-                   IllegalPara(opt);
-{$endif}
-{$endif supportbrowser}
+               Message1(option_obsolete_switch,'-b');
              end;
              end;
 
 
            'B' :
            'B' :

+ 7 - 7
compiler/paramgr.pas

@@ -137,14 +137,14 @@ implementation
     { true if uses a parameter as return value }
     { true if uses a parameter as return value }
     function tparamanager.ret_in_param(def : tdef;calloption : tproccalloption) : boolean;
     function tparamanager.ret_in_param(def : tdef;calloption : tproccalloption) : boolean;
       begin
       begin
-         ret_in_param:=((def.deftype=arraydef) and not(is_dynamic_array(def))) or
-           (def.deftype=recorddef) or
-           ((def.deftype=stringdef) and (tstringdef(def).string_typ in [st_shortstring,st_longstring])) or
-           ((def.deftype=procvardef) and (po_methodpointer in tprocvardef(def).procoptions)) or
+         ret_in_param:=((def.typ=arraydef) and not(is_dynamic_array(def))) or
+           (def.typ=recorddef) or
+           ((def.typ=stringdef) and (tstringdef(def).stringtype in [st_shortstring,st_longstring])) or
+           ((def.typ=procvardef) and (po_methodpointer in tprocvardef(def).procoptions)) or
            { interfaces are also passed by reference to be compatible with delphi and COM }
            { interfaces are also passed by reference to be compatible with delphi and COM }
-           ((def.deftype=objectdef) and (is_object(def) or is_interface(def))) or
-           (def.deftype=variantdef) or
-           ((def.deftype=setdef) and (tsetdef(def).settype<>smallset));
+           ((def.typ=objectdef) and (is_object(def) or is_interface(def))) or
+           (def.typ=variantdef) or
+           ((def.typ=setdef) and (tsetdef(def).settype<>smallset));
       end;
       end;
 
 
 
 

+ 3 - 31
compiler/parser.pas

@@ -47,12 +47,6 @@ implementation
       aasmbase,aasmtai,aasmdata,
       aasmbase,aasmtai,aasmdata,
       cgbase,
       cgbase,
       script,gendef,
       script,gendef,
-{$ifdef BrowserCol}
-      browcol,
-{$endif BrowserCol}
-{$ifdef BrowserLog}
-      browlog,
-{$endif BrowserLog}
       comphook,
       comphook,
       scanner,scandir,
       scanner,scandir,
       pbase,ptype,psystem,pmodules,psub,
       pbase,ptype,psystem,pmodules,psub,
@@ -268,7 +262,7 @@ implementation
           old_block_type : tblock_type;
           old_block_type : tblock_type;
         { symtable }
         { symtable }
           oldsymtablestack,
           oldsymtablestack,
-          oldmacrosymtablestack : tsymtablestack;
+          oldmacrosymtablestack : TSymtablestack;
           oldaktprocsym    : tprocsym;
           oldaktprocsym    : tprocsym;
         { cg }
         { cg }
           oldparse_only  : boolean;
           oldparse_only  : boolean;
@@ -328,8 +322,8 @@ implementation
          Message1(parser_i_compiling,filename);
          Message1(parser_i_compiling,filename);
 
 
        { reset symtable }
        { reset symtable }
-         symtablestack:=tsymtablestack.create;
-         macrosymtablestack:=tsymtablestack.create;
+         symtablestack:=TSymtablestack.create;
+         macrosymtablestack:=TSymtablestack.create;
          systemunit:=nil;
          systemunit:=nil;
          current_settings.defproccall:=init_settings.defproccall;
          current_settings.defproccall:=init_settings.defproccall;
          aktexceptblock:=0;
          aktexceptblock:=0;
@@ -482,28 +476,6 @@ implementation
                   Message1(exec_i_closing_script,AsmRes.Fn);
                   Message1(exec_i_closing_script,AsmRes.Fn);
                   AsmRes.WriteToDisk;
                   AsmRes.WriteToDisk;
                 end;
                 end;
-
-                { do not create browsers on errors !! }
-                if status.errorcount=0 then
-                begin
-{$ifdef BrowserLog}
-                  { Write Browser Log }
-                  if (cs_browser_log in current_settings.globalswitches) and
-                      (cs_browser in current_settings.moduleswitches) then
-                    begin
-                      if browserlog.elements_to_list.empty then
-                      begin
-                        Message1(parser_i_writing_browser_log,browserlog.Fname);
-                        WriteBrowserLog;
-                      end
-                      else
-                      browserlog.list_elements;
-                    end;
-{$endif BrowserLog}
-                  { Write Browser Collections, also used by the TextMode IDE to
-                    retrieve a list of sourcefiles }
-                  do_extractsymbolinfo();
-                end;
               end;
               end;
 
 
            dec(compile_level);
            dec(compile_level);

+ 6 - 6
compiler/pbase.pas

@@ -86,10 +86,10 @@ interface
     { reads a list of identifiers into a string list }
     { reads a list of identifiers into a string list }
     { consume a symbol, if not found give an error and
     { consume a symbol, if not found give an error and
       and return an errorsym }
       and return an errorsym }
-    function consume_sym(var srsym:tsym;var srsymtable:tsymtable):boolean;
-    function consume_sym_orgid(var srsym:tsym;var srsymtable:tsymtable;var s : string):boolean;
+    function consume_sym(var srsym:tsym;var srsymtable:TSymtable):boolean;
+    function consume_sym_orgid(var srsym:tsym;var srsymtable:TSymtable;var s : string):boolean;
 
 
-    function try_consume_unitsym(var srsym:tsym;var srsymtable:tsymtable):boolean;
+    function try_consume_unitsym(var srsym:tsym;var srsymtable:TSymtable):boolean;
 
 
     function try_consume_hintdirective(var symopt:tsymoptions):boolean;
     function try_consume_hintdirective(var symopt:tsymoptions):boolean;
 
 
@@ -184,7 +184,7 @@ implementation
       If this code is changed, it's likly that consume_sym_orgid and factor_read_id
       If this code is changed, it's likly that consume_sym_orgid and factor_read_id
       must be changed as well (FK)
       must be changed as well (FK)
     }
     }
-    function consume_sym(var srsym:tsym;var srsymtable:tsymtable):boolean;
+    function consume_sym(var srsym:tsym;var srsymtable:TSymtable):boolean;
       begin
       begin
         { first check for identifier }
         { first check for identifier }
         if token<>_ID then
         if token<>_ID then
@@ -215,7 +215,7 @@ implementation
     { check if a symbol contains the hint directive, and if so gives out a hint
     { check if a symbol contains the hint directive, and if so gives out a hint
       if required and returns the id with it's original casing
       if required and returns the id with it's original casing
     }
     }
-    function consume_sym_orgid(var srsym:tsym;var srsymtable:tsymtable;var s : string):boolean;
+    function consume_sym_orgid(var srsym:tsym;var srsymtable:TSymtable;var s : string):boolean;
       begin
       begin
         { first check for identifier }
         { first check for identifier }
         if token<>_ID then
         if token<>_ID then
@@ -243,7 +243,7 @@ implementation
         result:=assigned(srsym);
         result:=assigned(srsym);
       end;
       end;
 
 
-    function try_consume_unitsym(var srsym:tsym;var srsymtable:tsymtable):boolean;
+    function try_consume_unitsym(var srsym:tsym;var srsymtable:TSymtable):boolean;
       begin
       begin
         result:=false;
         result:=false;
         if assigned(srsym) and
         if assigned(srsym) and

+ 19 - 19
compiler/pdecl.pas

@@ -89,7 +89,7 @@ implementation
         case p.nodetype of
         case p.nodetype of
            ordconstn:
            ordconstn:
              begin
              begin
-               if p.resultdef.deftype=pointerdef then
+               if p.resultdef.typ=pointerdef then
                  hp:=tconstsym.create_ordptr(orgname,constpointer,tordconstnode(p).value,p.resultdef)
                  hp:=tconstsym.create_ordptr(orgname,constpointer,tordconstnode(p).value,p.resultdef)
                else
                else
                  hp:=tconstsym.create_ord(orgname,constord,tordconstnode(p).value,p.resultdef);
                  hp:=tconstsym.create_ord(orgname,constord,tordconstnode(p).value,p.resultdef);
@@ -156,7 +156,7 @@ implementation
 
 
     procedure const_dec;
     procedure const_dec;
       var
       var
-         orgname : stringid;
+         orgname : TIDString;
          hdef : tdef;
          hdef : tdef;
          sym : tsym;
          sym : tsym;
          dummysymoptions : tsymoptions;
          dummysymoptions : tsymoptions;
@@ -207,7 +207,7 @@ implementation
                    current_tokenpos:=storetokenpos;
                    current_tokenpos:=storetokenpos;
                    symtablestack.top.insert(sym);
                    symtablestack.top.insert(sym);
                    { procvar can have proc directives, but not type references }
                    { procvar can have proc directives, but not type references }
-                   if (hdef.deftype=procvardef) and
+                   if (hdef.typ=procvardef) and
                       (hdef.typesym=nil) then
                       (hdef.typesym=nil) then
                     begin
                     begin
                       { support p : procedure;stdcall=nil; }
                       { support p : procedure;stdcall=nil; }
@@ -275,13 +275,13 @@ implementation
 
 
 
 
     { search in symtablestack used, but not defined type }
     { search in symtablestack used, but not defined type }
-    procedure resolve_type_forward(p : tnamedindexitem;arg:pointer);
+    procedure resolve_type_forward(p:TObject;arg:pointer);
       var
       var
         hpd,pd : tdef;
         hpd,pd : tdef;
         stpos  : tfileposinfo;
         stpos  : tfileposinfo;
         again  : boolean;
         again  : boolean;
         srsym  : tsym;
         srsym  : tsym;
-        srsymtable : tsymtable;
+        srsymtable : TSymtable;
 
 
       begin
       begin
          { Check only typesyms or record/object fields }
          { Check only typesyms or record/object fields }
@@ -295,7 +295,7 @@ implementation
          end;
          end;
          repeat
          repeat
            again:=false;
            again:=false;
-           case pd.deftype of
+           case pd.typ of
              arraydef :
              arraydef :
                begin
                begin
                  { elementdef could also be defined using a forwarddef }
                  { elementdef could also be defined using a forwarddef }
@@ -308,7 +308,7 @@ implementation
                  { classrefdef inherits from pointerdef }
                  { classrefdef inherits from pointerdef }
                  hpd:=tabstractpointerdef(pd).pointeddef;
                  hpd:=tabstractpointerdef(pd).pointeddef;
                  { still a forward def ? }
                  { still a forward def ? }
-                 if hpd.deftype=forwarddef then
+                 if hpd.typ=forwarddef then
                   begin
                   begin
                     { try to resolve the forward }
                     { try to resolve the forward }
                     { get the correct position for it }
                     { get the correct position for it }
@@ -333,7 +333,7 @@ implementation
                        { avoid wrong unused warnings web bug 801 PM }
                        { avoid wrong unused warnings web bug 801 PM }
                        inc(ttypesym(srsym).refs);
                        inc(ttypesym(srsym).refs);
                        { we need a class type for classrefdef }
                        { we need a class type for classrefdef }
-                       if (pd.deftype=classrefdef) and
+                       if (pd.typ=classrefdef) and
                           not(is_class(ttypesym(srsym).typedef)) then
                           not(is_class(ttypesym(srsym).typedef)) then
                          Message1(type_e_class_type_expected,ttypesym(srsym).typedef.typename);
                          Message1(type_e_class_type_expected,ttypesym(srsym).typedef.typename);
                      end
                      end
@@ -346,7 +346,7 @@ implementation
                   end;
                   end;
                end;
                end;
              recorddef :
              recorddef :
-               trecorddef(pd).symtable.foreach_static(@resolve_type_forward,nil);
+               trecorddef(pd).symtable.SymList.ForEachCall(@resolve_type_forward,nil);
              objectdef :
              objectdef :
                begin
                begin
                  if not(m_fpc in current_settings.modeswitches) and
                  if not(m_fpc in current_settings.modeswitches) and
@@ -361,8 +361,8 @@ implementation
                     { Check all fields of the object declaration, but don't
                     { Check all fields of the object declaration, but don't
                       check objectdefs in objects/records, because these
                       check objectdefs in objects/records, because these
                       can't exist (anonymous objects aren't allowed) }
                       can't exist (anonymous objects aren't allowed) }
-                    if not(tsym(p).owner.symtabletype in [objectsymtable,recordsymtable]) then
-                     tobjectdef(pd).symtable.foreach_static(@resolve_type_forward,nil);
+                    if not(tsym(p).owner.symtabletype in [ObjectSymtable,recordsymtable]) then
+                     tobjectdef(pd).symtable.SymList.ForEachCall(@resolve_type_forward,nil);
                   end;
                   end;
                end;
                end;
           end;
           end;
@@ -388,10 +388,10 @@ implementation
         end;
         end;
 
 
       var
       var
-         typename,orgtypename : stringid;
+         typename,orgtypename : TIDString;
          newtype  : ttypesym;
          newtype  : ttypesym;
          sym      : tsym;
          sym      : tsym;
-         srsymtable : tsymtable;
+         srsymtable : TSymtable;
          hdef     : tdef;
          hdef     : tdef;
          oldfilepos,
          oldfilepos,
          defpos,storetokenpos : tfileposinfo;
          defpos,storetokenpos : tfileposinfo;
@@ -501,12 +501,12 @@ implementation
               { KAZ: handle TGUID declaration in system unit }
               { KAZ: handle TGUID declaration in system unit }
               if (cs_compilesystem in current_settings.moduleswitches) and not assigned(rec_tguid) and
               if (cs_compilesystem in current_settings.moduleswitches) and not assigned(rec_tguid) and
                  (typename='TGUID') and { name: TGUID and size=16 bytes that is 128 bits }
                  (typename='TGUID') and { name: TGUID and size=16 bytes that is 128 bits }
-                 assigned(hdef) and (hdef.deftype=recorddef) and (hdef.size=16) then
+                 assigned(hdef) and (hdef.typ=recorddef) and (hdef.size=16) then
                 rec_tguid:=trecorddef(hdef);
                 rec_tguid:=trecorddef(hdef);
             end;
             end;
            if assigned(hdef) then
            if assigned(hdef) then
             begin
             begin
-              case hdef.deftype of
+              case hdef.typ of
                 pointerdef :
                 pointerdef :
                   begin
                   begin
                     consume(_SEMICOLON);
                     consume(_SEMICOLON);
@@ -540,7 +540,7 @@ implementation
               end;
               end;
             end;
             end;
 
 
-           if isgeneric and not(hdef.deftype in [objectdef,recorddef]) then
+           if isgeneric and not(hdef.typ in [objectdef,recorddef]) then
              message(parser_e_cant_create_generics_of_this_type);
              message(parser_e_cant_create_generics_of_this_type);
 
 
            { Stop recording a generic template }
            { Stop recording a generic template }
@@ -572,7 +572,7 @@ implementation
                 This need to be done after the rtti has been written, because
                 This need to be done after the rtti has been written, because
                 it can contain a reference to that data (PFV)
                 it can contain a reference to that data (PFV)
                 This is not for forward classes }
                 This is not for forward classes }
-              if (hdef.deftype=objectdef) and
+              if (hdef.typ=objectdef) and
                  (hdef.owner.symtabletype in [staticsymtable,globalsymtable]) then
                  (hdef.owner.symtabletype in [staticsymtable,globalsymtable]) then
                 with Tobjectdef(hdef) do
                 with Tobjectdef(hdef) do
                   begin
                   begin
@@ -602,7 +602,7 @@ implementation
             end;
             end;
          until token<>_ID;
          until token<>_ID;
          typecanbeforward:=false;
          typecanbeforward:=false;
-         symtablestack.top.foreach_static(@resolve_type_forward,nil);
+         symtablestack.top.SymList.ForEachCall(@resolve_type_forward,nil);
          block_type:=old_block_type;
          block_type:=old_block_type;
       end;
       end;
 
 
@@ -654,7 +654,7 @@ implementation
 
 
     procedure resourcestring_dec;
     procedure resourcestring_dec;
       var
       var
-         orgname : stringid;
+         orgname : TIDString;
          p : tnode;
          p : tnode;
          dummysymoptions : tsymoptions;
          dummysymoptions : tsymoptions;
          storetokenpos,filepos : tfileposinfo;
          storetokenpos,filepos : tfileposinfo;

+ 17 - 19
compiler/pdecobj.pas

@@ -30,7 +30,7 @@ interface
       globtype,symtype,symdef;
       globtype,symtype,symdef;
 
 
     { parses a object declaration }
     { parses a object declaration }
-    function object_dec(const n : stringid;genericdef:tstoreddef;genericlist:TFPObjectList;fd : tobjectdef) : tdef;
+    function object_dec(const n : TIDString;genericdef:tstoreddef;genericlist:TFPObjectList;fd : tobjectdef) : tdef;
 
 
 implementation
 implementation
 
 
@@ -50,11 +50,11 @@ implementation
       current_procinfo = 'error';
       current_procinfo = 'error';
 
 
 
 
-    function object_dec(const n : stringid;genericdef:tstoreddef;genericlist:TFPObjectList;fd : tobjectdef) : tdef;
+    function object_dec(const n : TIDString;genericdef:tstoreddef;genericlist:TFPObjectList;fd : tobjectdef) : tdef;
     { this function parses an object or class declaration }
     { this function parses an object or class declaration }
       var
       var
          there_is_a_destructor : boolean;
          there_is_a_destructor : boolean;
-         classtype : tobjectdeftype;
+         classtype : tobjecttyp;
          pcrd      : tclassrefdef;
          pcrd      : tclassrefdef;
          hdef      : tdef;
          hdef      : tdef;
          old_object_option : tsymoptions;
          old_object_option : tsymoptions;
@@ -169,22 +169,20 @@ implementation
       procedure setinterfacemethodoptions;
       procedure setinterfacemethodoptions;
 
 
         var
         var
-          i: longint;
-          defs: TIndexArray;
-          pd: tdef;
+          i   : longint;
+          def : tdef;
         begin
         begin
           include(aktobjectdef.objectoptions,oo_has_virtual);
           include(aktobjectdef.objectoptions,oo_has_virtual);
-          defs:=aktobjectdef.symtable.defindex;
-          for i:=1 to defs.count do
+          for i:=0 to aktobjectdef.symtable.DefList.count-1 do
             begin
             begin
-              pd:=tdef(defs.search(i));
-              if assigned(pd) and
-                 (pd.deftype=procdef) then
+              def:=tdef(aktobjectdef.symtable.DefList[i]);
+              if assigned(def) and
+                 (def.typ=procdef) then
                 begin
                 begin
-                  tprocdef(pd).extnumber:=aktobjectdef.lastvtableindex;
+                  tprocdef(def).extnumber:=aktobjectdef.lastvtableindex;
                   inc(aktobjectdef.lastvtableindex);
                   inc(aktobjectdef.lastvtableindex);
-                  include(tprocdef(pd).procoptions,po_virtualmethod);
-                  tprocdef(pd).forwarddef:=false;
+                  include(tprocdef(def).procoptions,po_virtualmethod);
+                  tprocdef(def).forwarddef:=false;
                 end;
                 end;
             end;
             end;
         end;
         end;
@@ -277,7 +275,7 @@ implementation
                         single_type(hdef,typecanbeforward);
                         single_type(hdef,typecanbeforward);
 
 
                         { accept hp1, if is a forward def or a class }
                         { accept hp1, if is a forward def or a class }
-                        if (hdef.deftype=forwarddef) or
+                        if (hdef.typ=forwarddef) or
                            is_class(hdef) then
                            is_class(hdef) then
                           begin
                           begin
                              pcrd:=tclassrefdef.create(hdef);
                              pcrd:=tclassrefdef.create(hdef);
@@ -331,7 +329,7 @@ implementation
                  exit;
                  exit;
               end;
               end;
             if aktobjectdef.find_implemented_interface(intfdef)<>nil then
             if aktobjectdef.find_implemented_interface(intfdef)<>nil then
-              Message1(sym_e_duplicate_id,intfdef.name)
+              Message1(sym_e_duplicate_id,intfdef.objname^)
             else
             else
               begin
               begin
                 { allocate and prepare the GUID only if the class
                 { allocate and prepare the GUID only if the class
@@ -349,7 +347,7 @@ implementation
           while try_to_consume(_COMMA) do
           while try_to_consume(_COMMA) do
             begin
             begin
                id_type(hdef,false);
                id_type(hdef,false);
-               if (hdef.deftype<>objectdef) then
+               if (hdef.typ<>objectdef) then
                  begin
                  begin
                     Message1(type_e_interface_type_expected,hdef.typename);
                     Message1(type_e_interface_type_expected,hdef.typename);
                     continue;
                     continue;
@@ -397,7 +395,7 @@ implementation
             begin
             begin
               id_type(hdef,false);
               id_type(hdef,false);
               if (not assigned(hdef)) or
               if (not assigned(hdef)) or
-                 (hdef.deftype<>objectdef) then
+                 (hdef.typ<>objectdef) then
                 begin
                 begin
                   if assigned(hdef) then
                   if assigned(hdef) then
                     Message1(type_e_class_type_expected,hdef.typename);
                     Message1(type_e_class_type_expected,hdef.typename);
@@ -552,7 +550,7 @@ implementation
              for i:=0 to genericlist.count-1 do
              for i:=0 to genericlist.count-1 do
                begin
                begin
                  generictype:=ttypesym(genericlist[i]);
                  generictype:=ttypesym(genericlist[i]);
-                 if generictype.typedef.deftype=undefineddef then
+                 if generictype.typedef.typ=undefineddef then
                    include(aktobjectdef.defoptions,df_generic)
                    include(aktobjectdef.defoptions,df_generic)
                  else
                  else
                    include(aktobjectdef.defoptions,df_specialization);
                    include(aktobjectdef.defoptions,df_specialization);

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 225 - 221
compiler/pdecsub.pas


+ 30 - 30
compiler/pdecvar.pas

@@ -73,8 +73,8 @@ implementation
           var
           var
             idx : longint;
             idx : longint;
             sym : tsym;
             sym : tsym;
-            srsymtable : tsymtable;
-            st  : tsymtable;
+            srsymtable : TSymtable;
+            st  : TSymtable;
             p   : tnode;
             p   : tnode;
           begin
           begin
             result:=true;
             result:=true;
@@ -126,10 +126,10 @@ implementation
                        consume(_POINT);
                        consume(_POINT);
                        if assigned(def) then
                        if assigned(def) then
                         begin
                         begin
-                          st:=def.getsymtable(gs_record);
+                          st:=def.GetSymtable(gs_record);
                           if assigned(st) then
                           if assigned(st) then
                            begin
                            begin
-                             sym:=tsym(st.search(pattern));
+                             sym:=tsym(st.Find(pattern));
                              if assigned(sym) then
                              if assigned(sym) then
                               begin
                               begin
                                 pl.addsym(sl_subscript,sym);
                                 pl.addsym(sl_subscript,sym);
@@ -166,7 +166,7 @@ implementation
                      begin
                      begin
                        consume(_LECKKLAMMER);
                        consume(_LECKKLAMMER);
                        repeat
                        repeat
-                         if def.deftype=arraydef then
+                         if def.typ=arraydef then
                           begin
                           begin
                             idx:=0;
                             idx:=0;
                             p:=comp_expr(true);
                             p:=comp_expr(true);
@@ -409,7 +409,7 @@ implementation
                           { we ignore hidden stuff here because the property access symbol might have
                           { we ignore hidden stuff here because the property access symbol might have
                             non default calling conventions which might change the hidden stuff;
                             non default calling conventions which might change the hidden stuff;
                             see tw3216.pp (FK) }
                             see tw3216.pp (FK) }
-                          p.propaccesslist[palt_read].procdef:=Tprocsym(sym).search_procdef_bypara(readprocdef.paras,p.propdef,[cpo_allowdefaults,cpo_ignorehidden]);
+                          p.propaccesslist[palt_read].procdef:=Tprocsym(sym).Find_procdef_bypara(readprocdef.paras,p.propdef,[cpo_allowdefaults,cpo_ignorehidden]);
                           if not assigned(p.propaccesslist[palt_read].procdef) then
                           if not assigned(p.propaccesslist[palt_read].procdef) then
                             Message(parser_e_ill_property_access_sym);
                             Message(parser_e_ill_property_access_sym);
                         end;
                         end;
@@ -453,7 +453,7 @@ implementation
                           { Insert hidden parameters }
                           { Insert hidden parameters }
                           handle_calling_convention(writeprocdef);
                           handle_calling_convention(writeprocdef);
                           { search procdefs matching writeprocdef }
                           { search procdefs matching writeprocdef }
-                          p.propaccesslist[palt_write].procdef:=Tprocsym(sym).search_procdef_bypara(writeprocdef.paras,writeprocdef.returndef,[cpo_allowdefaults]);
+                          p.propaccesslist[palt_write].procdef:=Tprocsym(sym).Find_procdef_bypara(writeprocdef.paras,writeprocdef.returndef,[cpo_allowdefaults]);
                           if not assigned(p.propaccesslist[palt_write].procdef) then
                           if not assigned(p.propaccesslist[palt_write].procdef) then
                             Message(parser_e_ill_property_access_sym);
                             Message(parser_e_ill_property_access_sym);
                         end;
                         end;
@@ -525,7 +525,7 @@ implementation
                                 begin
                                 begin
                                    { Insert hidden parameters }
                                    { Insert hidden parameters }
                                    handle_calling_convention(storedprocdef);
                                    handle_calling_convention(storedprocdef);
-                                   p.propaccesslist[palt_stored].procdef:=Tprocsym(sym).search_procdef_bypara(storedprocdef.paras,storedprocdef.returndef,[cpo_allowdefaults,cpo_ignorehidden]);
+                                   p.propaccesslist[palt_stored].procdef:=Tprocsym(sym).Find_procdef_bypara(storedprocdef.paras,storedprocdef.returndef,[cpo_allowdefaults,cpo_ignorehidden]);
                                    if not assigned(p.propaccesslist[palt_stored].procdef) then
                                    if not assigned(p.propaccesslist[palt_stored].procdef) then
                                      message(parser_e_ill_property_storage_sym);
                                      message(parser_e_ill_property_storage_sym);
                                 end;
                                 end;
@@ -564,10 +564,10 @@ implementation
 {$endif cpu64bit}
 {$endif cpu64bit}
                      is_class(p.propdef) or
                      is_class(p.propdef) or
                      is_single(p.propdef) or
                      is_single(p.propdef) or
-                     (p.propdef.deftype in [classrefdef,pointerdef]) or
-                     ((p.propdef.deftype=setdef) and
+                     (p.propdef.typ in [classrefdef,pointerdef]) or
+                     ((p.propdef.typ=setdef) and
                       (tsetdef(p.propdef).settype=smallset))) or
                       (tsetdef(p.propdef).settype=smallset))) or
-                     ((p.propdef.deftype=arraydef) and
+                     ((p.propdef.typ=arraydef) and
                       (ppo_indexed in p.propoptions)) or
                       (ppo_indexed in p.propoptions)) or
                  (ppo_hasparameters in p.propoptions) then
                  (ppo_hasparameters in p.propoptions) then
                 begin
                 begin
@@ -581,7 +581,7 @@ implementation
                   { Get the result of the default, the firstpass is
                   { Get the result of the default, the firstpass is
                     needed to support values like -1 }
                     needed to support values like -1 }
                   pt:=comp_expr(true);
                   pt:=comp_expr(true);
-                  if (p.propdef.deftype=setdef) and
+                  if (p.propdef.typ=setdef) and
                      (pt.nodetype=arrayconstructorn) then
                      (pt.nodetype=arrayconstructorn) then
                     begin
                     begin
                       arrayconstructor_to_set(pt);
                       arrayconstructor_to_set(pt);
@@ -652,7 +652,7 @@ implementation
        begin
        begin
          result:=false;
          result:=false;
          { Process procvar directives before = and ; }
          { Process procvar directives before = and ; }
-         if (def.deftype=procvardef) and
+         if (def.typ=procvardef) and
             (def.typesym=nil) and
             (def.typesym=nil) and
             check_proc_directive(true) then
             check_proc_directive(true) then
            begin
            begin
@@ -696,8 +696,8 @@ implementation
             begin
             begin
               tcsym:=ttypedconstsym.create(vs.realname,def,true);
               tcsym:=ttypedconstsym.create(vs.realname,def,true);
               tcsym.fileinfo:=vs.fileinfo;
               tcsym.fileinfo:=vs.fileinfo;
-              symtablestack.top.replace(vs,tcsym);
-              vs.free;
+              Hidesym(vs);
+              vs.owner.Insert(tcsym);
               consume(_EQUAL);
               consume(_EQUAL);
               readtypedconst(current_asmdata.asmlists[al_typedconsts],def,tcsym,true);
               readtypedconst(current_asmdata.asmlists[al_typedconsts],def,tcsym,true);
             end;
             end;
@@ -821,8 +821,8 @@ implementation
                    abssym.abstyp:=toasm;
                    abssym.abstyp:=toasm;
                    abssym.asmname:=stringdup(hs);
                    abssym.asmname:=stringdup(hs);
                    { replace the varsym }
                    { replace the varsym }
-                   symtablestack.top.replace(vs,abssym);
-                   vs.free;
+                   Hidesym(vs);
+                   vs.owner.insert(abssym);
                  end
                  end
                 { address }
                 { address }
                 else if is_constintnode(pt) and
                 else if is_constintnode(pt) and
@@ -853,8 +853,8 @@ implementation
                          Message(type_e_ordinal_expr_expected);
                          Message(type_e_ordinal_expr_expected);
                     end;
                     end;
 {$endif i386}
 {$endif i386}
-                   symtablestack.top.replace(vs,abssym);
-                   vs.free;
+                   HideSym(vs);
+                   vs.owner.Insert(abssym);
                  end
                  end
                 { variable }
                 { variable }
                 else
                 else
@@ -873,8 +873,8 @@ implementation
                        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);
-                       symtablestack.top.replace(vs,abssym);
-                       vs.free;
+                       Hidesym(vs);
+                       vs.owner.insert(abssym);
                      end
                      end
                     else
                     else
                      Message(parser_e_absolute_only_to_var_or_const);
                      Message(parser_e_absolute_only_to_var_or_const);
@@ -900,7 +900,7 @@ implementation
                 (symtablestack.top.symtabletype<>parasymtable) then
                 (symtablestack.top.symtabletype<>parasymtable) then
                begin
                begin
                  { Add calling convention for procvar }
                  { Add calling convention for procvar }
-                 if (hdef.deftype=procvardef) and
+                 if (hdef.typ=procvardef) and
                     (hdef.typesym=nil) then
                     (hdef.typesym=nil) then
                    handle_calling_convention(tprocvardef(hdef));
                    handle_calling_convention(tprocvardef(hdef));
                  read_default_value(sc,hdef,vd_threadvar in options);
                  read_default_value(sc,hdef,vd_threadvar in options);
@@ -918,7 +918,7 @@ implementation
 
 
              { Support calling convention for procvars after semicolon }
              { Support calling convention for procvars after semicolon }
              if not(hasdefaultvalue) and
              if not(hasdefaultvalue) and
-                (hdef.deftype=procvardef) and
+                (hdef.typ=procvardef) and
                 (hdef.typesym=nil) then
                 (hdef.typesym=nil) then
                begin
                begin
                  { Parse procvar directives after ; }
                  { Parse procvar directives after ; }
@@ -1113,12 +1113,12 @@ implementation
          hstaticvs : tglobalvarsym;
          hstaticvs : tglobalvarsym;
          vs    : tabstractvarsym;
          vs    : tabstractvarsym;
          srsym : tsym;
          srsym : tsym;
-         srsymtable : tsymtable;
+         srsymtable : TSymtable;
          recst : tabstractrecordsymtable;
          recst : tabstractrecordsymtable;
          unionsymtable : trecordsymtable;
          unionsymtable : trecordsymtable;
          offset : longint;
          offset : longint;
          uniondef : trecorddef;
          uniondef : trecorddef;
-         unionsym : tfieldvarsym;
+//         unionsym : tfieldvarsym;
          hintsymoptions : tsymoptions;
          hintsymoptions : tsymoptions;
          semicoloneaten: boolean;
          semicoloneaten: boolean;
 {$ifdef powerpc}
 {$ifdef powerpc}
@@ -1188,9 +1188,9 @@ implementation
                 (trecordsymtable(symtablestack.top).usefieldalignment = -1) then
                 (trecordsymtable(symtablestack.top).usefieldalignment = -1) then
                begin
                begin
                  tempdef := hdef;
                  tempdef := hdef;
-                 while tempdef.deftype = arraydef do
+                 while tempdef.typ = arraydef do
                    tempdef := tarraydef(tempdef).elementdef;
                    tempdef := tarraydef(tempdef).elementdef;
-                 if tempdef.deftype <> recorddef then
+                 if tempdef.typ <> recorddef then
                    maxpadalign := tempdef.alignment
                    maxpadalign := tempdef.alignment
                  else
                  else
                    maxpadalign := trecorddef(tempdef).padalignment;
                    maxpadalign := trecorddef(tempdef).padalignment;
@@ -1222,7 +1222,7 @@ implementation
              maybe_parse_proc_directives(hdef);
              maybe_parse_proc_directives(hdef);
 
 
              { Add calling convention for procvar }
              { Add calling convention for procvar }
-             if (hdef.deftype=procvardef) and
+             if (hdef.typ=procvardef) and
                 (hdef.typesym=nil) then
                 (hdef.typesym=nil) then
                handle_calling_convention(tprocvardef(hdef));
                handle_calling_convention(tprocvardef(hdef));
 
 
@@ -1359,7 +1359,7 @@ implementation
               { at last set the record size to that of the biggest variant }
               { at last set the record size to that of the biggest variant }
               unionsymtable.datasize:=maxsize;
               unionsymtable.datasize:=maxsize;
               unionsymtable.fieldalignment:=maxalignment;
               unionsymtable.fieldalignment:=maxalignment;
-              UnionSym:=tfieldvarsym.create('$case',vs_value,uniondef,[]);
+//              UnionSym:=tfieldvarsym.create('$case',vs_value,uniondef,[]);
               unionsymtable.addalignmentpadding;
               unionsymtable.addalignmentpadding;
 {$ifdef powerpc}
 {$ifdef powerpc}
               { parent inherits the alignment padding if the variant is the first "field" of the parent record/variant }
               { parent inherits the alignment padding if the variant is the first "field" of the parent record/variant }
@@ -1382,7 +1382,7 @@ implementation
                 recst.fieldalignment:=unionsymtable.recordalignment;
                 recst.fieldalignment:=unionsymtable.recordalignment;
 
 
               trecordsymtable(recst).insertunionst(Unionsymtable,offset);
               trecordsymtable(recst).insertunionst(Unionsymtable,offset);
-              unionsym.free;
+//              unionsym.free;
               uniondef.free;
               uniondef.free;
            end;
            end;
          block_type:=old_block_type;
          block_type:=old_block_type;

+ 1 - 1
compiler/pexports.pas

@@ -58,7 +58,7 @@ implementation
         InternalProcName : string;
         InternalProcName : string;
         pt               : tnode;
         pt               : tnode;
         srsym            : tsym;
         srsym            : tsym;
-        srsymtable : tsymtable;
+        srsymtable : TSymtable;
 
 
         function IsGreater(hp1,hp2:texported_item):boolean;
         function IsGreater(hp1,hp2:texported_item):boolean;
         var
         var

+ 40 - 40
compiler/pexpr.pas

@@ -41,7 +41,7 @@ interface
 
 
     procedure string_dec(var def: tdef);
     procedure string_dec(var def: tdef);
 
 
-    procedure propaccesslist_to_node(var p1:tnode;st:tsymtable;pl:tpropaccesslist);
+    procedure propaccesslist_to_node(var p1:tnode;st:TSymtable;pl:tpropaccesslist);
 
 
     function node_to_propaccesslist(p1:tnode):tpropaccesslist;
     function node_to_propaccesslist(p1:tnode):tpropaccesslist;
 
 
@@ -142,7 +142,7 @@ implementation
 
 
 
 
 
 
-    procedure propaccesslist_to_node(var p1:tnode;st:tsymtable;pl:tpropaccesslist);
+    procedure propaccesslist_to_node(var p1:tnode;st:TSymtable;pl:tpropaccesslist);
       var
       var
         plist : ppropaccesslistitem;
         plist : ppropaccesslistitem;
       begin
       begin
@@ -163,7 +163,7 @@ implementation
                     case st.symtabletype of
                     case st.symtabletype of
                       withsymtable :
                       withsymtable :
                         p1:=tnode(twithsymtable(st).withrefnode).getcopy;
                         p1:=tnode(twithsymtable(st).withrefnode).getcopy;
-                      objectsymtable :
+                      ObjectSymtable :
                         p1:=load_self_node;
                         p1:=load_self_node;
                     end;
                     end;
                   end;
                   end;
@@ -486,11 +486,11 @@ implementation
                 ttypenode(p1).allowed:=true;
                 ttypenode(p1).allowed:=true;
               { Allow classrefdef, which is required for
               { Allow classrefdef, which is required for
                 Typeof(self) in static class methods }
                 Typeof(self) in static class methods }
-              if (p1.resultdef.deftype = objectdef) or
+              if (p1.resultdef.typ = objectdef) or
                  (assigned(current_procinfo) and
                  (assigned(current_procinfo) and
                   ((po_classmethod in current_procinfo.procdef.procoptions) or
                   ((po_classmethod in current_procinfo.procdef.procoptions) or
                    (po_staticmethod in current_procinfo.procdef.procoptions)) and
                    (po_staticmethod in current_procinfo.procdef.procoptions)) and
-                  (p1.resultdef.deftype=classrefdef)) then
+                  (p1.resultdef.typ=classrefdef)) then
                statement_syssym:=geninlinenode(in_typeof_x,false,p1)
                statement_syssym:=geninlinenode(in_typeof_x,false,p1)
               else
               else
                begin
                begin
@@ -598,7 +598,7 @@ implementation
                 end;
                 end;
               if not codegenerror then
               if not codegenerror then
                begin
                begin
-                 case p1.resultdef.deftype of
+                 case p1.resultdef.typ of
                    procdef, { procvar }
                    procdef, { procvar }
                    pointerdef,
                    pointerdef,
                    procvardef,
                    procvardef,
@@ -769,7 +769,7 @@ implementation
                   begin
                   begin
                     { Force string type if it isn't yet }
                     { Force string type if it isn't yet }
                     if not(
                     if not(
-                           (p1.resultdef.deftype=stringdef) or
+                           (p1.resultdef.typ=stringdef) or
                            is_chararray(p1.resultdef) or
                            is_chararray(p1.resultdef) or
                            is_char(p1.resultdef)
                            is_char(p1.resultdef)
                           ) then
                           ) then
@@ -916,7 +916,7 @@ implementation
       end;
       end;
 
 
 
 
-    function maybe_load_methodpointer(st:tsymtable;var p1:tnode):boolean;
+    function maybe_load_methodpointer(st:TSymtable;var p1:tnode):boolean;
       begin
       begin
         maybe_load_methodpointer:=false;
         maybe_load_methodpointer:=false;
         if not assigned(p1) then
         if not assigned(p1) then
@@ -924,10 +924,10 @@ implementation
            case st.symtabletype of
            case st.symtabletype of
              withsymtable :
              withsymtable :
                begin
                begin
-                 if (st.defowner.deftype=objectdef) then
+                 if (st.defowner.typ=objectdef) then
                    p1:=tnode(twithsymtable(st).withrefnode).getcopy;
                    p1:=tnode(twithsymtable(st).withrefnode).getcopy;
                end;
                end;
-             objectsymtable :
+             ObjectSymtable :
                begin
                begin
                  p1:=load_self_node;
                  p1:=load_self_node;
                  { We are calling a member }
                  { We are calling a member }
@@ -939,7 +939,7 @@ implementation
 
 
 
 
     { reads the parameter for a subroutine call }
     { reads the parameter for a subroutine call }
-    procedure do_proc_call(sym:tsym;st:tsymtable;obj:tobjectdef;getaddr:boolean;var again : boolean;var p1:tnode;callflags:tcallnodeflags);
+    procedure do_proc_call(sym:tsym;st:TSymtable;obj:tobjectdef;getaddr:boolean;var again : boolean;var p1:tnode;callflags:tcallnodeflags);
       var
       var
          membercall,
          membercall,
          prevafterassn : boolean;
          prevafterassn : boolean;
@@ -964,14 +964,14 @@ implementation
             if (block_type=bt_const) or
             if (block_type=bt_const) or
                getaddr then
                getaddr then
              begin
              begin
-               aprocdef:=Tprocsym(sym).search_procdef_byprocvardef(getprocvardef);
+               aprocdef:=Tprocsym(sym).Find_procdef_byprocvardef(getprocvardef);
                getaddr:=true;
                getaddr:=true;
              end
              end
             else
             else
              if (m_tp_procvar in current_settings.modeswitches) or
              if (m_tp_procvar in current_settings.modeswitches) or
                 (m_mac_procvar in current_settings.modeswitches) then
                 (m_mac_procvar in current_settings.modeswitches) then
               begin
               begin
-                aprocdef:=Tprocsym(sym).search_procdef_byprocvardef(getprocvardef);
+                aprocdef:=Tprocsym(sym).Find_procdef_byprocvardef(getprocvardef);
                 if assigned(aprocdef) then
                 if assigned(aprocdef) then
                  getaddr:=true;
                  getaddr:=true;
               end;
               end;
@@ -984,7 +984,7 @@ implementation
                aprocdef is already loaded above so we can reuse it }
                aprocdef is already loaded above so we can reuse it }
              if not assigned(aprocdef) and
              if not assigned(aprocdef) and
                 assigned(getprocvardef) then
                 assigned(getprocvardef) then
-               aprocdef:=Tprocsym(sym).search_procdef_byprocvardef(getprocvardef);
+               aprocdef:=Tprocsym(sym).Find_procdef_byprocvardef(getprocvardef);
 
 
              { generate a methodcallnode or proccallnode }
              { generate a methodcallnode or proccallnode }
              { we shouldn't convert things like @tcollection.load }
              { we shouldn't convert things like @tcollection.load }
@@ -1049,7 +1049,7 @@ implementation
                include(callflags,cnf_member_call);
                include(callflags,cnf_member_call);
              if assigned(obj) then
              if assigned(obj) then
                begin
                begin
-                 if (st.symtabletype<>objectsymtable) then
+                 if (st.symtabletype<>ObjectSymtable) then
                    internalerror(200310031);
                    internalerror(200310031);
                  p1:=ccallnode.create(para,tprocsym(sym),obj.symtable,p1,callflags);
                  p1:=ccallnode.create(para,tprocsym(sym),obj.symtable,p1,callflags);
                end
                end
@@ -1084,7 +1084,7 @@ implementation
               { a procvar can't have parameters! }
               { a procvar can't have parameters! }
               not assigned(tcallnode(hp).left) then
               not assigned(tcallnode(hp).left) then
             begin
             begin
-              currprocdef:=tcallnode(hp).symtableprocentry.search_procdef_byprocvardef(pv);
+              currprocdef:=tcallnode(hp).symtableprocentry.Find_procdef_byprocvardef(pv);
               if assigned(currprocdef) then
               if assigned(currprocdef) then
                begin
                begin
                  hp2:=cloadnode.create_procvar(tprocsym(tcallnode(hp).symtableprocentry),currprocdef,tcallnode(hp).symtableproc);
                  hp2:=cloadnode.create_procvar(tprocsym(tcallnode(hp).symtableprocentry),currprocdef,tcallnode(hp).symtableproc);
@@ -1100,7 +1100,7 @@ implementation
 
 
 
 
     { the following procedure handles the access to a property symbol }
     { the following procedure handles the access to a property symbol }
-    procedure handle_propertysym(propsym : tpropertysym;st : tsymtable;var p1 : tnode);
+    procedure handle_propertysym(propsym : tpropertysym;st : TSymtable;var p1 : tnode);
       var
       var
          paras : tnode;
          paras : tnode;
          p2    : tnode;
          p2    : tnode;
@@ -1163,7 +1163,7 @@ implementation
                          paras:=nil;
                          paras:=nil;
                          consume(_ASSIGNMENT);
                          consume(_ASSIGNMENT);
                          { read the expression }
                          { read the expression }
-                         if propsym.propdef.deftype=procvardef then
+                         if propsym.propdef.typ=procvardef then
                            getprocvardef:=tprocvardef(propsym.propdef);
                            getprocvardef:=tprocvardef(propsym.propdef);
                          p2:=comp_expr(true);
                          p2:=comp_expr(true);
                          if assigned(getprocvardef) then
                          if assigned(getprocvardef) then
@@ -1243,7 +1243,7 @@ implementation
       var
       var
          static_name : string;
          static_name : string;
          isclassref  : boolean;
          isclassref  : boolean;
-         srsymtable  : tsymtable;
+         srsymtable  : TSymtable;
       begin
       begin
          if sym=nil then
          if sym=nil then
            begin
            begin
@@ -1261,7 +1261,7 @@ implementation
                begin
                begin
                  if not assigned(p1.resultdef) then
                  if not assigned(p1.resultdef) then
                    do_typecheckpass(p1);
                    do_typecheckpass(p1);
-                 isclassref:=(p1.resultdef.deftype=classrefdef);
+                 isclassref:=(p1.resultdef.typ=classrefdef);
                end
                end
               else
               else
                isclassref:=false;
                isclassref:=false;
@@ -1337,7 +1337,7 @@ implementation
            srsym : tsym;
            srsym : tsym;
            unit_found,
            unit_found,
            possible_error : boolean;
            possible_error : boolean;
-           srsymtable : tsymtable;
+           srsymtable : TSymtable;
            hdef  : tdef;
            hdef  : tdef;
            static_name : string;
            static_name : string;
            storedpattern : string;
            storedpattern : string;
@@ -1401,7 +1401,7 @@ implementation
             begin
             begin
               hdef:=tdef(srsym.owner.defowner);
               hdef:=tdef(srsym.owner.defowner);
               if assigned(hdef) and
               if assigned(hdef) and
-                 (hdef.deftype=procdef) then
+                 (hdef.typ=procdef) then
                 srsym:=tprocdef(hdef).procsym
                 srsym:=tprocdef(hdef).procsym
               else
               else
                 begin
                 begin
@@ -1442,16 +1442,16 @@ implementation
                      begin
                      begin
                        { are we in a class method, we check here the
                        { are we in a class method, we check here the
                          srsymtable, because a field in another object
                          srsymtable, because a field in another object
-                         also has objectsymtable. And withsymtable is
+                         also has ObjectSymtable. And withsymtable is
                          not possible for self in class methods (PFV) }
                          not possible for self in class methods (PFV) }
-                       if (srsymtable.symtabletype=objectsymtable) and
+                       if (srsymtable.symtabletype=ObjectSymtable) and
                           assigned(current_procinfo) and
                           assigned(current_procinfo) and
                           (po_classmethod in current_procinfo.procdef.procoptions) then
                           (po_classmethod in current_procinfo.procdef.procoptions) then
                          Message(parser_e_only_class_methods);
                          Message(parser_e_only_class_methods);
                      end;
                      end;
 
 
                     case srsymtable.symtabletype of
                     case srsymtable.symtabletype of
-                      objectsymtable :
+                      ObjectSymtable :
                         begin
                         begin
                           p1:=csubscriptnode.create(srsym,load_self_node);
                           p1:=csubscriptnode.create(srsym,load_self_node);
                           node_tree_set_filepos(p1,current_filepos);
                           node_tree_set_filepos(p1,current_filepos);
@@ -1637,7 +1637,7 @@ implementation
                   begin
                   begin
                     { are we in a class method ? }
                     { are we in a class method ? }
                     possible_error:=(srsymtable.symtabletype<>withsymtable) and
                     possible_error:=(srsymtable.symtabletype<>withsymtable) and
-                                    (srsym.owner.symtabletype=objectsymtable) and
+                                    (srsym.owner.symtabletype=ObjectSymtable) and
                                     not(is_interface(tdef(srsym.owner.defowner))) and
                                     not(is_interface(tdef(srsym.owner.defowner))) and
                                     assigned(current_procinfo) and
                                     assigned(current_procinfo) and
                                     (po_classmethod in current_procinfo.procdef.procoptions);
                                     (po_classmethod in current_procinfo.procdef.procoptions);
@@ -1660,7 +1660,7 @@ implementation
                   begin
                   begin
                     { access to property in a method }
                     { access to property in a method }
                     { are we in a class method ? }
                     { are we in a class method ? }
-                    if (srsymtable.symtabletype=objectsymtable) and
+                    if (srsymtable.symtabletype=ObjectSymtable) and
                        assigned(current_procinfo) and
                        assigned(current_procinfo) and
                        (po_classmethod in current_procinfo.procdef.procoptions) then
                        (po_classmethod in current_procinfo.procdef.procoptions) then
                      Message(parser_e_only_class_methods);
                      Message(parser_e_only_class_methods);
@@ -1855,7 +1855,7 @@ implementation
           protsym  : tpropertysym;
           protsym  : tpropertysym;
           p2,p3  : tnode;
           p2,p3  : tnode;
           srsym  : tsym;
           srsym  : tsym;
-          srsymtable : tsymtable;
+          srsymtable : TSymtable;
           classh     : tobjectdef;
           classh     : tobjectdef;
         label
         label
           skipreckklammercheck;
           skipreckklammercheck;
@@ -1881,14 +1881,14 @@ implementation
                       pointer type }
                       pointer type }
                     if ((m_tp_procvar in current_settings.modeswitches) or
                     if ((m_tp_procvar in current_settings.modeswitches) or
                         (m_mac_procvar in current_settings.modeswitches)) and
                         (m_mac_procvar in current_settings.modeswitches)) and
-                       (p1.resultdef.deftype=procvardef) and
-                       (tprocvardef(p1.resultdef).returndef.deftype=pointerdef) then
+                       (p1.resultdef.typ=procvardef) and
+                       (tprocvardef(p1.resultdef).returndef.typ=pointerdef) then
                       begin
                       begin
                         p1:=ccallnode.create_procvar(nil,p1);
                         p1:=ccallnode.create_procvar(nil,p1);
                         typecheckpass(p1);
                         typecheckpass(p1);
                       end;
                       end;
 
 
-                    if (p1.resultdef.deftype<>pointerdef) then
+                    if (p1.resultdef.typ<>pointerdef) then
                       begin
                       begin
                          { ^ as binary operator is a problem!!!! (FK) }
                          { ^ as binary operator is a problem!!!! (FK) }
                          again:=false;
                          again:=false;
@@ -1925,11 +1925,11 @@ implementation
                       begin
                       begin
                         consume(_LECKKLAMMER);
                         consume(_LECKKLAMMER);
                         repeat
                         repeat
-                          case p1.resultdef.deftype of
+                          case p1.resultdef.typ of
                             pointerdef:
                             pointerdef:
                               begin
                               begin
                                  { support delphi autoderef }
                                  { support delphi autoderef }
-                                 if (tpointerdef(p1.resultdef).pointeddef.deftype=arraydef) and
+                                 if (tpointerdef(p1.resultdef).pointeddef.typ=arraydef) and
                                     (m_autoderef in current_settings.modeswitches) then
                                     (m_autoderef in current_settings.modeswitches) then
                                    p1:=cderefnode.create(p1);
                                    p1:=cderefnode.create(p1);
                                  p2:=comp_expr(true);
                                  p2:=comp_expr(true);
@@ -2014,18 +2014,18 @@ implementation
                _POINT :
                _POINT :
                   begin
                   begin
                     consume(_POINT);
                     consume(_POINT);
-                    if (p1.resultdef.deftype=pointerdef) and
+                    if (p1.resultdef.typ=pointerdef) and
                        (m_autoderef in current_settings.modeswitches) then
                        (m_autoderef in current_settings.modeswitches) then
                       begin
                       begin
                         p1:=cderefnode.create(p1);
                         p1:=cderefnode.create(p1);
                         do_typecheckpass(p1);
                         do_typecheckpass(p1);
                       end;
                       end;
-                    case p1.resultdef.deftype of
+                    case p1.resultdef.typ of
                       recorddef:
                       recorddef:
                         begin
                         begin
                           if token=_ID then
                           if token=_ID then
                             begin
                             begin
-                              srsym:=tsym(trecorddef(p1.resultdef).symtable.search(pattern));
+                              srsym:=tsym(trecorddef(p1.resultdef).symtable.Find(pattern));
                               if assigned(srsym) and
                               if assigned(srsym) and
                                  (srsym.typ=fieldvarsym) then
                                  (srsym.typ=fieldvarsym) then
                                 begin
                                 begin
@@ -2113,7 +2113,7 @@ implementation
                        pointerdef:
                        pointerdef:
                          begin
                          begin
                            Message(parser_e_invalid_qualifier);
                            Message(parser_e_invalid_qualifier);
-                           if tpointerdef(p1.resultdef).pointeddef.deftype in [recorddef,objectdef,classrefdef] then
+                           if tpointerdef(p1.resultdef).pointeddef.typ in [recorddef,objectdef,classrefdef] then
                              Message(parser_h_maybe_deref_caret_missing);
                              Message(parser_h_maybe_deref_caret_missing);
                          end;
                          end;
                        else
                        else
@@ -2131,7 +2131,7 @@ implementation
                  begin
                  begin
                    { is this a procedure variable ? }
                    { is this a procedure variable ? }
                    if assigned(p1.resultdef) and
                    if assigned(p1.resultdef) and
-                      (p1.resultdef.deftype=procvardef) then
+                      (p1.resultdef.typ=procvardef) then
                      begin
                      begin
                        if assigned(getprocvardef) and
                        if assigned(getprocvardef) and
                           equal_defs(p1.resultdef,getprocvardef) then
                           equal_defs(p1.resultdef,getprocvardef) then
@@ -2180,7 +2180,7 @@ implementation
          code       : integer;
          code       : integer;
          again      : boolean;
          again      : boolean;
          srsym      : tsym;
          srsym      : tsym;
-         srsymtable : tsymtable;
+         srsymtable : TSymtable;
          pd         : tprocdef;
          pd         : tprocdef;
          hclassdef     : tobjectdef;
          hclassdef     : tobjectdef;
          d          : bestreal;
          d          : bestreal;
@@ -2798,7 +2798,7 @@ implementation
            _ASSIGNMENT :
            _ASSIGNMENT :
              begin
              begin
                 consume(_ASSIGNMENT);
                 consume(_ASSIGNMENT);
-                if (p1.resultdef.deftype=procvardef) then
+                if (p1.resultdef.typ=procvardef) then
                   getprocvardef:=tprocvardef(p1.resultdef);
                   getprocvardef:=tprocvardef(p1.resultdef);
                 p2:=sub_expr(opcompare,true);
                 p2:=sub_expr(opcompare,true);
                 if assigned(getprocvardef) then
                 if assigned(getprocvardef) then

+ 12 - 12
compiler/pinline.pas

@@ -68,7 +68,7 @@ implementation
         para         : tcallparanode;
         para         : tcallparanode;
         p,p2     : tnode;
         p,p2     : tnode;
         again    : boolean; { dummy for do_proc_call }
         again    : boolean; { dummy for do_proc_call }
-        destructorname : stringid;
+        destructorname : TIDString;
         sym      : tsym;
         sym      : tsym;
         classh   : tobjectdef;
         classh   : tobjectdef;
         callflag : tcallnodeflag;
         callflag : tcallnodeflag;
@@ -148,7 +148,7 @@ implementation
             destructorpos:=current_tokenpos;
             destructorpos:=current_tokenpos;
             consume(_ID);
             consume(_ID);
 
 
-            if (p.resultdef.deftype<>pointerdef) then
+            if (p.resultdef.typ<>pointerdef) then
               begin
               begin
                  Message1(type_e_pointer_type_expected,p.resultdef.typename);
                  Message1(type_e_pointer_type_expected,p.resultdef.typename);
                  p.free;
                  p.free;
@@ -159,7 +159,7 @@ implementation
                  exit;
                  exit;
               end;
               end;
             { first parameter must be an object or class }
             { first parameter must be an object or class }
-            if tpointerdef(p.resultdef).pointeddef.deftype<>objectdef then
+            if tpointerdef(p.resultdef).pointeddef.typ<>objectdef then
               begin
               begin
                  Message(parser_e_pointer_to_class_expected);
                  Message(parser_e_pointer_to_class_expected);
                  p.free;
                  p.free;
@@ -262,18 +262,18 @@ implementation
           end
           end
         else
         else
           begin
           begin
-             if (p.resultdef.deftype<>pointerdef) then
+             if (p.resultdef.typ<>pointerdef) then
                Begin
                Begin
                   Message1(type_e_pointer_type_expected,p.resultdef.typename);
                   Message1(type_e_pointer_type_expected,p.resultdef.typename);
                   new_dispose_statement:=cerrornode.create;
                   new_dispose_statement:=cerrornode.create;
                end
                end
              else
              else
                begin
                begin
-                  if (tpointerdef(p.resultdef).pointeddef.deftype=objectdef) and
+                  if (tpointerdef(p.resultdef).pointeddef.typ=objectdef) and
                      (oo_has_vmt in tobjectdef(tpointerdef(p.resultdef).pointeddef).objectoptions) then
                      (oo_has_vmt in tobjectdef(tpointerdef(p.resultdef).pointeddef).objectoptions) then
                     Message(parser_w_use_extended_syntax_for_objects);
                     Message(parser_w_use_extended_syntax_for_objects);
-                  if (tpointerdef(p.resultdef).pointeddef.deftype=orddef) and
-                     (torddef(tpointerdef(p.resultdef).pointeddef).typ=uvoid) then
+                  if (tpointerdef(p.resultdef).pointeddef.typ=orddef) and
+                     (torddef(tpointerdef(p.resultdef).pointeddef).ordtype=uvoid) then
                     begin
                     begin
                       if (m_tp7 in current_settings.modeswitches) or
                       if (m_tp7 in current_settings.modeswitches) or
                          (m_delphi in current_settings.modeswitches) then
                          (m_delphi in current_settings.modeswitches) then
@@ -336,7 +336,7 @@ implementation
         p1,p2  : tnode;
         p1,p2  : tnode;
         classh : tobjectdef;
         classh : tobjectdef;
         srsym    : tsym;
         srsym    : tsym;
-        srsymtable : tsymtable;
+        srsymtable : TSymtable;
         again  : boolean; { dummy for do_proc_call }
         again  : boolean; { dummy for do_proc_call }
       begin
       begin
         consume(_LKLAMMER);
         consume(_LKLAMMER);
@@ -351,7 +351,7 @@ implementation
            exit;
            exit;
          end;
          end;
 
 
-        if (p1.resultdef.deftype<>pointerdef) then
+        if (p1.resultdef.typ<>pointerdef) then
          begin
          begin
            Message1(type_e_pointer_type_expected,p1.resultdef.typename);
            Message1(type_e_pointer_type_expected,p1.resultdef.typename);
            consume_all_until(_RKLAMMER);
            consume_all_until(_RKLAMMER);
@@ -363,7 +363,7 @@ implementation
 
 
         if try_to_consume(_RKLAMMER) then
         if try_to_consume(_RKLAMMER) then
           begin
           begin
-            if (tpointerdef(p1.resultdef).pointeddef.deftype=objectdef) and
+            if (tpointerdef(p1.resultdef).pointeddef.typ=objectdef) and
                (oo_has_vmt in tobjectdef(tpointerdef(p1.resultdef).pointeddef).objectoptions)  then
                (oo_has_vmt in tobjectdef(tpointerdef(p1.resultdef).pointeddef).objectoptions)  then
               Message(parser_w_use_extended_syntax_for_objects);
               Message(parser_w_use_extended_syntax_for_objects);
 
 
@@ -404,7 +404,7 @@ implementation
         else
         else
           begin
           begin
             consume(_COMMA);
             consume(_COMMA);
-            if tpointerdef(p1.resultdef).pointeddef.deftype<>objectdef then
+            if tpointerdef(p1.resultdef).pointeddef.typ<>objectdef then
              begin
              begin
                Message(parser_e_pointer_to_class_expected);
                Message(parser_e_pointer_to_class_expected);
                consume_all_until(_RKLAMMER);
                consume_all_until(_RKLAMMER);
@@ -495,7 +495,7 @@ implementation
         dec(parsing_para_level);
         dec(parsing_para_level);
         { first param must be a string or dynamic array ...}
         { first param must be a string or dynamic array ...}
         isarray:=is_dynamic_array(destppn.resultdef);
         isarray:=is_dynamic_array(destppn.resultdef);
-        if not((destppn.resultdef.deftype=stringdef) or
+        if not((destppn.resultdef.typ=stringdef) or
                isarray) then
                isarray) then
          begin
          begin
            CGMessage(type_e_mismatch);
            CGMessage(type_e_mismatch);

+ 18 - 19
compiler/pmodules.pas

@@ -179,7 +179,7 @@ implementation
         ltvTables.free;
         ltvTables.free;
       end;
       end;
 
 
-    procedure AddToThreadvarList(p:tnamedindexitem;arg:pointer);
+    procedure AddToThreadvarList(p:TObject;arg:pointer);
       var
       var
         ltvTable : TAsmList;
         ltvTable : TAsmList;
       begin
       begin
@@ -204,8 +204,8 @@ implementation
            exit;
            exit;
          ltvTable:=TAsmList.create;
          ltvTable:=TAsmList.create;
          if assigned(current_module.globalsymtable) then
          if assigned(current_module.globalsymtable) then
-           current_module.globalsymtable.foreach_static(@AddToThreadvarList,ltvTable);
-         current_module.localsymtable.foreach_static(@AddToThreadvarList,ltvTable);
+           current_module.globalsymtable.SymList.ForEachCall(@AddToThreadvarList,ltvTable);
+         current_module.localsymtable.SymList.ForEachCall(@AddToThreadvarList,ltvTable);
          if ltvTable.first<>nil then
          if ltvTable.first<>nil then
           begin
           begin
             s:=make_mangledname('THREADVARLIST',current_module.localsymtable,'');
             s:=make_mangledname('THREADVARLIST',current_module.localsymtable,'');
@@ -468,6 +468,10 @@ implementation
            { create system defines }
            { create system defines }
            create_intern_symbols;
            create_intern_symbols;
            create_intern_types;
            create_intern_types;
+           { Set the owner of errorsym and errortype to symtable to
+             prevent crashes when accessing .owner }
+           generrorsym.owner:=systemunit;
+           generrordef.owner:=systemunit;
            exit;
            exit;
          end;
          end;
 
 
@@ -536,7 +540,7 @@ implementation
 
 
     procedure loadunits;
     procedure loadunits;
       var
       var
-         s,sorg  : stringid;
+         s,sorg  : TIDString;
          fn      : string;
          fn      : string;
          pu      : tused_unit;
          pu      : tused_unit;
          hp2     : tmodule;
          hp2     : tmodule;
@@ -662,28 +666,27 @@ implementation
        end;
        end;
 
 
 
 
-    procedure free_localsymtables(st:tsymtable);
+    procedure free_localsymtables(st:TSymtable);
       var
       var
+        i   : longint;
         def : tstoreddef;
         def : tstoreddef;
         pd  : tprocdef;
         pd  : tprocdef;
       begin
       begin
-        def:=tstoreddef(st.defindex.first);
-        while assigned(def) do
+        for i:=0 to st.DefList.Count-1 do
           begin
           begin
-            if def.deftype=procdef then
+            def:=tstoreddef(st.DefList[i]);
+            if def.typ=procdef then
               begin
               begin
                 pd:=tprocdef(def);
                 pd:=tprocdef(def);
                 if assigned(pd.localst) and
                 if assigned(pd.localst) and
                    (pd.localst.symtabletype<>staticsymtable) and
                    (pd.localst.symtabletype<>staticsymtable) and
-                   not((po_inline in pd.procoptions) or
-                       ((current_module.flags and uf_local_browser)<>0)) then
+                   not(po_inline in pd.procoptions) then
                   begin
                   begin
                     free_localsymtables(pd.localst);
                     free_localsymtables(pd.localst);
                     pd.localst.free;
                     pd.localst.free;
                     pd.localst:=nil;
                     pd.localst:=nil;
                   end;
                   end;
               end;
               end;
-             def:=tstoreddef(def.indexnext);
           end;
           end;
       end;
       end;
 
 
@@ -697,10 +700,6 @@ implementation
 
 
     procedure setupglobalswitches;
     procedure setupglobalswitches;
       begin
       begin
-        { can't have local browser when no global browser }
-        if (cs_local_browser in current_settings.moduleswitches) and
-           not(cs_browser in current_settings.moduleswitches) then
-          exclude(current_settings.moduleswitches,cs_local_browser);
         if (cs_create_pic in current_settings.moduleswitches) then
         if (cs_create_pic in current_settings.moduleswitches) then
           begin
           begin
             def_system_macro('FPC_PIC');
             def_system_macro('FPC_PIC');
@@ -709,7 +708,7 @@ implementation
       end;
       end;
 
 
 
 
-    function create_main_proc(const name:string;potype:tproctypeoption;st:tsymtable):tprocdef;
+    function create_main_proc(const name:string;potype:tproctypeoption;st:TSymtable):tprocdef;
       var
       var
         ps  : tprocsym;
         ps  : tprocsym;
         pd  : tprocdef;
         pd  : tprocdef;
@@ -764,7 +763,7 @@ implementation
       end;
       end;
 
 
 
 
-    procedure gen_implicit_initfinal(flag:word;st:tsymtable);
+    procedure gen_implicit_initfinal(flag:word;st:TSymtable);
       var
       var
         pd : tprocdef;
         pd : tprocdef;
       begin
       begin
@@ -791,7 +790,7 @@ implementation
       end;
       end;
 
 
 
 
-    procedure copy_macro(p:TNamedIndexItem; arg:pointer);
+    procedure copy_macro(p:TObject; arg:pointer);
       begin
       begin
         current_module.globalmacrosymtable.insert(tmacro(p).getcopy);
         current_module.globalmacrosymtable.insert(tmacro(p).getcopy);
       end;
       end;
@@ -948,7 +947,7 @@ implementation
          if (m_mac in current_settings.modeswitches) then
          if (m_mac in current_settings.modeswitches) then
           begin
           begin
             current_module.globalmacrosymtable:=tmacrosymtable.create(true);
             current_module.globalmacrosymtable:=tmacrosymtable.create(true);
-            current_module.localmacrosymtable.foreach_static(@copy_macro,nil);
+            current_module.localmacrosymtable.SymList.ForEachCall(@copy_macro,nil);
           end;
           end;
 
 
          { leave when we got an error }
          { leave when we got an error }

+ 5 - 5
compiler/powerpc/cgcpu.pas

@@ -1,4 +1,4 @@
-{
+    {
     Copyright (c) 1998-2002 by Florian Klaempfl
     Copyright (c) 1998-2002 by Florian Klaempfl
 
 
     This unit implements the code generator for the PowerPC
     This unit implements the code generator for the PowerPC
@@ -1990,9 +1990,9 @@ const
          if not(cs_check_overflow in current_settings.localswitches) then
          if not(cs_check_overflow in current_settings.localswitches) then
           exit;
           exit;
          current_asmdata.getjumplabel(hl);
          current_asmdata.getjumplabel(hl);
-         if not ((def.deftype=pointerdef) or
-                ((def.deftype=orddef) and
-                 (torddef(def).typ in [u64bit,u16bit,u32bit,u8bit,uchar,
+         if not ((def.typ=pointerdef) or
+                ((def.typ=orddef) and
+                 (torddef(def).ordtype in [u64bit,u16bit,u32bit,u8bit,uchar,
                                                   bool8bit,bool16bit,bool32bit,bool64bit]))) then
                                                   bool8bit,bool16bit,bool32bit,bool64bit]))) then
            begin
            begin
              list.concat(taicpu.op_reg(A_MCRXR,NR_CR7));
              list.concat(taicpu.op_reg(A_MCRXR,NR_CR7));
@@ -2044,7 +2044,7 @@ const
            (procdef.procoptions*[po_classmethod, po_staticmethod,
            (procdef.procoptions*[po_classmethod, po_staticmethod,
              po_methodpointer, po_interrupt, po_iocheck]<>[]) then
              po_methodpointer, po_interrupt, po_iocheck]<>[]) then
           Internalerror(200006138);
           Internalerror(200006138);
-        if procdef.owner.symtabletype<>objectsymtable then
+        if procdef.owner.symtabletype<>ObjectSymtable then
           Internalerror(200109191);
           Internalerror(200109191);
 
 
         make_global:=false;
         make_global:=false;

+ 13 - 13
compiler/powerpc/cpupara.pas

@@ -117,7 +117,7 @@ unit cpupara;
          { Later, the LOC_REFERENCE is in most cases changed into LOC_REGISTER
          { Later, the LOC_REFERENCE is in most cases changed into LOC_REGISTER
            if push_addr_param for the def is true
            if push_addr_param for the def is true
          }
          }
-         case p.deftype of
+         case p.typ of
             orddef:
             orddef:
               result:=LOC_REGISTER;
               result:=LOC_REGISTER;
             floatdef:
             floatdef:
@@ -181,7 +181,7 @@ unit cpupara;
             result:=true;
             result:=true;
             exit;
             exit;
           end;
           end;
-        case def.deftype of
+        case def.typ of
           variantdef,
           variantdef,
           formaldef :
           formaldef :
             result:=true;
             result:=true;
@@ -205,7 +205,7 @@ unit cpupara;
           setdef :
           setdef :
             result:=(tsetdef(def).settype<>smallset);
             result:=(tsetdef(def).settype<>smallset);
           stringdef :
           stringdef :
-            result:=tstringdef(def).string_typ in [st_shortstring,st_longstring];
+            result:=tstringdef(def).stringtype in [st_shortstring,st_longstring];
           procvardef :
           procvardef :
             result:=po_methodpointer in tprocvardef(def).procoptions;
             result:=po_methodpointer in tprocvardef(def).procoptions;
         end;
         end;
@@ -248,7 +248,7 @@ unit cpupara;
           end;
           end;
 
 
         { Return in FPU register? }
         { Return in FPU register? }
-        if p.returndef.deftype=floatdef then
+        if p.returndef.typ=floatdef then
           begin
           begin
             p.funcretloc[side].loc:=LOC_FPUREGISTER;
             p.funcretloc[side].loc:=LOC_FPUREGISTER;
             p.funcretloc[side].register:=NR_FPU_RESULT_REG;
             p.funcretloc[side].register:=NR_FPU_RESULT_REG;
@@ -381,20 +381,20 @@ unit cpupara;
                     paralen := tcgsize2size[def_cgsize(paradef)];
                     paralen := tcgsize2size[def_cgsize(paradef)];
                   loc := getparaloc(paradef);
                   loc := getparaloc(paradef);
                   if (target_info.abi = abi_powerpc_aix) and
                   if (target_info.abi = abi_powerpc_aix) and
-                     (paradef.deftype = recorddef) and
+                     (paradef.typ = recorddef) and
                      (hp.varspez in [vs_value,vs_const]) then
                      (hp.varspez in [vs_value,vs_const]) then
                     begin
                     begin
                       { if a record has only one field and that field is }
                       { if a record has only one field and that field is }
                       { non-composite (not array or record), it must be  }
                       { non-composite (not array or record), it must be  }
                       { passed according to the rules of that type.       }
                       { passed according to the rules of that type.       }
-                      if (trecorddef(hp.vardef).symtable.symindex.count = 1) and
+                      if (trecorddef(hp.vardef).symtable.SymList.count = 1) and
                          (not trecorddef(hp.vardef).isunion) and
                          (not trecorddef(hp.vardef).isunion) and
-                         ((tabstractvarsym(trecorddef(hp.vardef).symtable.symindex.search(1)).vardef.deftype = floatdef) or
+                         ((tabstractvarsym(trecorddef(hp.vardef).symtable.SymList[0]).vardef.typ = floatdef) or
                           ((target_info.system = system_powerpc_darwin) and
                           ((target_info.system = system_powerpc_darwin) and
-                           (tabstractvarsym(trecorddef(hp.vardef).symtable.symindex.search(1)).vardef.deftype in [orddef,enumdef]))) then
+                           (tabstractvarsym(trecorddef(hp.vardef).symtable.SymList[0]).vardef.typ in [orddef,enumdef]))) then
                         begin
                         begin
                           paradef :=
                           paradef :=
-                           tabstractvarsym(trecorddef(hp.vardef).symtable.symindex.search(1)).vardef;
+                           tabstractvarsym(trecorddef(hp.vardef).symtable.SymList[0]).vardef;
                           paracgsize:=def_cgsize(paradef);
                           paracgsize:=def_cgsize(paradef);
                         end
                         end
                       else
                       else
@@ -416,7 +416,7 @@ unit cpupara;
 
 
               if varargsparas and
               if varargsparas and
                  (target_info.abi = abi_powerpc_aix) and
                  (target_info.abi = abi_powerpc_aix) and
-                 (paradef.deftype = floatdef) then
+                 (paradef.typ = floatdef) then
                 begin
                 begin
                   loc := LOC_REGISTER;
                   loc := LOC_REGISTER;
                   if paracgsize = OS_F64 then
                   if paracgsize = OS_F64 then
@@ -429,7 +429,7 @@ unit cpupara;
               hp.paraloc[side].size:=paracgsize;
               hp.paraloc[side].size:=paracgsize;
               hp.paraloc[side].intsize:=paralen;
               hp.paraloc[side].intsize:=paralen;
               if (target_info.abi = abi_powerpc_aix) and
               if (target_info.abi = abi_powerpc_aix) and
-                 (paradef.deftype in [recorddef,arraydef]) then
+                 (paradef.typ in [recorddef,arraydef]) then
                 hp.paraloc[side].composite:=true;
                 hp.paraloc[side].composite:=true;
 {$ifndef cpu64bit}
 {$ifndef cpu64bit}
               if (target_info.abi=abi_powerpc_sysv) and
               if (target_info.abi=abi_powerpc_sysv) and
@@ -438,7 +438,7 @@ unit cpupara;
                 inc(nextintreg);
                 inc(nextintreg);
 {$endif not cpu64bit}
 {$endif not cpu64bit}
               if (paralen = 0) then
               if (paralen = 0) then
-                if (paradef.deftype = recorddef) then
+                if (paradef.typ = recorddef) then
                   begin
                   begin
                     paraloc:=hp.paraloc[side].add_location;
                     paraloc:=hp.paraloc[side].add_location;
                     paraloc^.loc := LOC_VOID;
                     paraloc^.loc := LOC_VOID;
@@ -454,7 +454,7 @@ unit cpupara;
                     begin
                     begin
                       paraloc^.loc := loc;
                       paraloc^.loc := loc;
                       { make sure we don't lose whether or not the type is signed }
                       { make sure we don't lose whether or not the type is signed }
-                      if (paradef.deftype <> orddef) then
+                      if (paradef.typ <> orddef) then
                         paracgsize := int_cgsize(paralen);
                         paracgsize := int_cgsize(paralen);
                       if (paracgsize in [OS_NO,OS_64,OS_S64]) then
                       if (paracgsize in [OS_NO,OS_64,OS_S64]) then
                         paraloc^.size := OS_INT
                         paraloc^.size := OS_INT

+ 1 - 1
compiler/powerpc/cpupi.pas

@@ -91,7 +91,7 @@ unit cpupi;
         else
         else
           begin
           begin
             locals := 0;
             locals := 0;
-            current_procinfo.procdef.localst.foreach_static(@count_locals,@locals);
+            current_procinfo.procdef.localst.SymList.ForEachCall(@count_locals,@locals);
             if locals <> 0 then
             if locals <> 0 then
               begin
               begin
                 { at 0(r1), the previous value of r1 will be stored }
                 { at 0(r1), the previous value of r1 will be stored }

+ 6 - 6
compiler/powerpc/nppcadd.pas

@@ -264,10 +264,10 @@ interface
         pass_left_and_right;
         pass_left_and_right;
 
 
         cmpop:=false;
         cmpop:=false;
-        unsigned:=((left.resultdef.deftype=orddef) and
-                   (torddef(left.resultdef).typ=u64bit)) or
-                  ((right.resultdef.deftype=orddef) and
-                   (torddef(right.resultdef).typ=u64bit));
+        unsigned:=((left.resultdef.typ=orddef) and
+                   (torddef(left.resultdef).ordtype=u64bit)) or
+                  ((right.resultdef.typ=orddef) and
+                   (torddef(right.resultdef).ordtype=u64bit));
         case nodetype of
         case nodetype of
           addn :
           addn :
             begin
             begin
@@ -295,7 +295,7 @@ interface
           muln:
           muln:
             begin
             begin
               { should be handled in pass_1 (JM) }
               { should be handled in pass_1 (JM) }
-              if not(torddef(left.resultdef).typ in [U32bit,s32bit]) or
+              if not(torddef(left.resultdef).ordtype in [U32bit,s32bit]) or
                  (torddef(left.resultdef).typ <> torddef(right.resultdef).typ) then
                  (torddef(left.resultdef).typ <> torddef(right.resultdef).typ) then
                 internalerror(200109051);
                 internalerror(200109051);
               { handled separately }
               { handled separately }
@@ -751,7 +751,7 @@ interface
       begin
       begin
          { to make it more readable, string and set (not smallset!) have their
          { to make it more readable, string and set (not smallset!) have their
            own procedures }
            own procedures }
-         case left.resultdef.deftype of
+         case left.resultdef.typ of
            orddef :
            orddef :
              begin
              begin
                { handling boolean expressions }
                { handling boolean expressions }

+ 3 - 3
compiler/powerpc/nppccnv.pas

@@ -221,7 +221,7 @@ implementation
            location.register,tmpfpureg));
            location.register,tmpfpureg));
 
 
          { work around bug in some PowerPC processors }
          { work around bug in some PowerPC processors }
-         if (tfloatdef(resultdef).typ = s32real) then
+         if (tfloatdef(resultdef).floattype = s32real) then
            current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_FRSP,location.register,
            current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_FRSP,location.register,
              location.register));
              location.register));
        end;
        end;
@@ -232,8 +232,8 @@ implementation
           inherited second_real_to_real;
           inherited second_real_to_real;
           { work around bug in some powerpc processors where doubles aren't }
           { work around bug in some powerpc processors where doubles aren't }
           { properly converted to singles                                   }
           { properly converted to singles                                   }
-          if (tfloatdef(left.resultdef).typ = s64real) and
-             (tfloatdef(resultdef).typ = s32real) then
+          if (tfloatdef(left.resultdef).floattype = s64real) and
+             (tfloatdef(resultdef).floattype = s32real) then
             current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_FRSP,location.register,
             current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_FRSP,location.register,
               location.register));
               location.register));
        end;
        end;

+ 2 - 2
compiler/powerpc/nppcmat.pas

@@ -594,7 +594,7 @@ end;
                   end;
                   end;
                 LOC_REFERENCE,LOC_CREFERENCE:
                 LOC_REFERENCE,LOC_CREFERENCE:
                   begin
                   begin
-                     if (left.resultdef.deftype=floatdef) then
+                     if (left.resultdef.typ=floatdef) then
                        begin
                        begin
                           src1 := cg.getfpuregister(current_asmdata.CurrAsmList,def_cgsize(left.resultdef));
                           src1 := cg.getfpuregister(current_asmdata.CurrAsmList,def_cgsize(left.resultdef));
                           location.register := src1;
                           location.register := src1;
@@ -612,7 +612,7 @@ end;
                   end;
                   end;
               end;
               end;
               { choose appropriate operand }
               { choose appropriate operand }
-              if left.resultdef.deftype <> floatdef then
+              if left.resultdef.typ <> floatdef then
                 begin
                 begin
                   if not(cs_check_overflow in current_settings.localswitches) then
                   if not(cs_check_overflow in current_settings.localswitches) then
                     op := A_NEG
                     op := A_NEG

+ 11 - 11
compiler/powerpc64/cgcpu.pas

@@ -1273,7 +1273,7 @@ begin
       opsize := OS_S32
       opsize := OS_S32
     else
     else
       opsize := OS_32;
       opsize := OS_32;
-    a_load_reg_reg(current_asmdata.CurrAsmList, size, opsize, reg, reg); 
+    a_load_reg_reg(current_asmdata.CurrAsmList, size, opsize, reg, reg);
   end;
   end;
 
 
   { can we use immediate compares? }
   { can we use immediate compares? }
@@ -1305,7 +1305,7 @@ begin
   {$note Commented out below check because of compiler weirdness}
   {$note Commented out below check because of compiler weirdness}
   {
   {
   if (not (size in [OS_32, OS_S32, OS_64, OS_S64])) then
   if (not (size in [OS_32, OS_S32, OS_64, OS_S64])) then
-    internalerror(200606041); 
+    internalerror(200606041);
   }
   }
 
 
   if cmp_op in [OC_GT, OC_LT, OC_GTE, OC_LTE] then
   if cmp_op in [OC_GT, OC_LT, OC_GTE, OC_LTE] then
@@ -1443,7 +1443,7 @@ begin
       a_load_reg_ref(list, OS_INT, para.paraloc[calleeside].Location^.size,
       a_load_reg_ref(list, OS_INT, para.paraloc[calleeside].Location^.size,
         para.paraloc[calleeside].Location^.register, para.localloc.reference);
         para.paraloc[calleeside].Location^.register, para.localloc.reference);
     LOC_FPUREGISTER, LOC_CFPUREGISTER:
     LOC_FPUREGISTER, LOC_CFPUREGISTER:
-      a_loadfpu_reg_ref(list, para.paraloc[calleeside].Location^.size, 
+      a_loadfpu_reg_ref(list, para.paraloc[calleeside].Location^.size,
         para.paraloc[calleeside].Location^.register, para.localloc.reference);
         para.paraloc[calleeside].Location^.register, para.localloc.reference);
     LOC_MMREGISTER, LOC_CMMREGISTER:
     LOC_MMREGISTER, LOC_CMMREGISTER:
       { not supported }
       { not supported }
@@ -1455,10 +1455,10 @@ procedure tcgppc.profilecode_restorepara(para : tparavarsym; list : TAsmList);
 begin
 begin
   case (para.paraloc[calleeside].Location^.loc) of
   case (para.paraloc[calleeside].Location^.loc) of
     LOC_REGISTER, LOC_CREGISTER:
     LOC_REGISTER, LOC_CREGISTER:
-      a_load_ref_reg(list, para.paraloc[calleeside].Location^.size, OS_INT, 
+      a_load_ref_reg(list, para.paraloc[calleeside].Location^.size, OS_INT,
         para.localloc.reference, para.paraloc[calleeside].Location^.register);
         para.localloc.reference, para.paraloc[calleeside].Location^.register);
     LOC_FPUREGISTER, LOC_CFPUREGISTER:
     LOC_FPUREGISTER, LOC_CFPUREGISTER:
-      a_loadfpu_ref_reg(list, para.paraloc[calleeside].Location^.size, 
+      a_loadfpu_ref_reg(list, para.paraloc[calleeside].Location^.size,
         para.localloc.reference, para.paraloc[calleeside].Location^.register);
         para.localloc.reference, para.paraloc[calleeside].Location^.register);
     LOC_MMREGISTER, LOC_CMMREGISTER:
     LOC_MMREGISTER, LOC_CMMREGISTER:
       { not supported }
       { not supported }
@@ -1556,7 +1556,7 @@ begin
 
 
   { determine whether we need to save the link register }
   { determine whether we need to save the link register }
   needslinkreg :=
   needslinkreg :=
-    ((not (po_assembler in current_procinfo.procdef.procoptions)) and 
+    ((not (po_assembler in current_procinfo.procdef.procoptions)) and
       ((pi_do_call in current_procinfo.flags) or (cs_profile in init_settings.moduleswitches))) or
       ((pi_do_call in current_procinfo.flags) or (cs_profile in init_settings.moduleswitches))) or
     ((cs_opt_size in current_settings.optimizerswitches) and ((fprcount > 0) or (gprcount > 0))) or
     ((cs_opt_size in current_settings.optimizerswitches) and ((fprcount > 0) or (gprcount > 0))) or
     ([cs_lineinfo, cs_debuginfo] * current_settings.moduleswitches <> []);
     ([cs_lineinfo, cs_debuginfo] * current_settings.moduleswitches <> []);
@@ -1695,7 +1695,7 @@ begin
 
 
   { determine whether we need to restore the link register }
   { determine whether we need to restore the link register }
   needslinkreg :=
   needslinkreg :=
-    ((not (po_assembler in current_procinfo.procdef.procoptions)) and 
+    ((not (po_assembler in current_procinfo.procdef.procoptions)) and
       ((pi_do_call in current_procinfo.flags) or (cs_profile in init_settings.moduleswitches))) or
       ((pi_do_call in current_procinfo.flags) or (cs_profile in init_settings.moduleswitches))) or
     ((cs_opt_size in current_settings.optimizerswitches) and ((fprcount > 0) or (gprcount > 0))) or
     ((cs_opt_size in current_settings.optimizerswitches) and ((fprcount > 0) or (gprcount > 0))) or
     ([cs_lineinfo, cs_debuginfo] * current_settings.moduleswitches <> []);
     ([cs_lineinfo, cs_debuginfo] * current_settings.moduleswitches <> []);
@@ -1976,9 +1976,9 @@ begin
   if not (cs_check_overflow in current_settings.localswitches) then
   if not (cs_check_overflow in current_settings.localswitches) then
     exit;
     exit;
   current_asmdata.getjumplabel(hl);
   current_asmdata.getjumplabel(hl);
-  if not ((def.deftype = pointerdef) or
-    ((def.deftype = orddef) and
-    (torddef(def).typ in [u64bit, u16bit, u32bit, u8bit, uchar,
+  if not ((def.typ = pointerdef) or
+    ((def.typ = orddef) and
+    (torddef(def).ordtype in [u64bit, u16bit, u32bit, u8bit, uchar,
     bool8bit, bool16bit, bool32bit]))) then
     bool8bit, bool16bit, bool32bit]))) then
   begin
   begin
     { ... instructions setting overflow flag ...
     { ... instructions setting overflow flag ...
@@ -2046,7 +2046,7 @@ begin
     (procdef.procoptions * [po_classmethod, po_staticmethod,
     (procdef.procoptions * [po_classmethod, po_staticmethod,
     po_methodpointer, po_interrupt, po_iocheck] <> []) then
     po_methodpointer, po_interrupt, po_iocheck] <> []) then
     Internalerror(200006138);
     Internalerror(200006138);
-  if procdef.owner.symtabletype <> objectsymtable then
+  if procdef.owner.symtabletype <> ObjectSymtable then
     Internalerror(200109191);
     Internalerror(200109191);
 
 
   make_global := false;
   make_global := false;

+ 11 - 11
compiler/powerpc64/cpupara.pas

@@ -108,7 +108,7 @@ begin
   { Later, the LOC_REFERENCE is in most cases changed into LOC_REGISTER
   { Later, the LOC_REFERENCE is in most cases changed into LOC_REGISTER
     if push_addr_param for the def is true
     if push_addr_param for the def is true
   }
   }
-  case p.deftype of
+  case p.typ of
     orddef:
     orddef:
       result := LOC_REGISTER;
       result := LOC_REGISTER;
     floatdef:
     floatdef:
@@ -167,7 +167,7 @@ begin
     result := true;
     result := true;
     exit;
     exit;
   end;
   end;
-  case def.deftype of
+  case def.typ of
     variantdef,
     variantdef,
     formaldef:
     formaldef:
       result := true;
       result := true;
@@ -189,7 +189,7 @@ begin
     setdef:
     setdef:
       result := (tsetdef(def).settype <> smallset);
       result := (tsetdef(def).settype <> smallset);
     stringdef:
     stringdef:
-      result := tstringdef(def).string_typ in [st_shortstring, st_longstring];
+      result := tstringdef(def).stringtype in [st_shortstring, st_longstring];
     procvardef:
     procvardef:
       result := po_methodpointer in tprocvardef(def).procoptions;
       result := po_methodpointer in tprocvardef(def).procoptions;
   end;
   end;
@@ -225,7 +225,7 @@ begin
   end;
   end;
 
 
   { Return in FPU register? }
   { Return in FPU register? }
-  if p.returndef.deftype = floatdef then begin
+  if p.returndef.typ = floatdef then begin
     p.funcretloc[side].loc := LOC_FPUREGISTER;
     p.funcretloc[side].loc := LOC_FPUREGISTER;
     p.funcretloc[side].register := NR_FPU_RESULT_REG;
     p.funcretloc[side].register := NR_FPU_RESULT_REG;
     p.funcretloc[side].size := retcgsize;
     p.funcretloc[side].size := retcgsize;
@@ -323,16 +323,16 @@ begin
         paralen := paradef.size
         paralen := paradef.size
       else
       else
         paralen := tcgsize2size[def_cgsize(paradef)];
         paralen := tcgsize2size[def_cgsize(paradef)];
-      if (paradef.deftype = recorddef) and
+      if (paradef.typ = recorddef) and
         (hp.varspez in [vs_value, vs_const]) then begin
         (hp.varspez in [vs_value, vs_const]) then begin
         { if a record has only one field and that field is }
         { if a record has only one field and that field is }
         { non-composite (not array or record), it must be  }
         { non-composite (not array or record), it must be  }
         { passed according to the rules of that type.       }
         { passed according to the rules of that type.       }
-        if (trecorddef(hp.vardef).symtable.symindex.count = 1) and
+        if (trecorddef(hp.vardef).symtable.SymList.count = 1) and
           (not trecorddef(hp.vardef).isunion)  and
           (not trecorddef(hp.vardef).isunion)  and
-          (tabstractvarsym(trecorddef(hp.vardef).symtable.symindex.search(1)).vardef.deftype in [orddef, enumdef, floatdef])  then begin
+          (tabstractvarsym(trecorddef(hp.vardef).symtable.SymList[0]).vardef.typ in [orddef, enumdef, floatdef])  then begin
           paradef :=
           paradef :=
-            tabstractvarsym(trecorddef(hp.vardef).symtable.symindex.search(1)).vardef;
+            tabstractvarsym(trecorddef(hp.vardef).symtable.SymList[0]).vardef;
           loc := getparaloc(paradef);
           loc := getparaloc(paradef);
           paracgsize := def_cgsize(paradef);
           paracgsize := def_cgsize(paradef);
         end else begin
         end else begin
@@ -355,7 +355,7 @@ begin
     { patch FPU values into integer registers if we currently have
     { patch FPU values into integer registers if we currently have
      to pass them as vararg parameters     
      to pass them as vararg parameters     
     }
     }
-    if (isVararg) and (paradef.deftype = floatdef) then begin
+    if (isVararg) and (paradef.typ = floatdef) then begin
       loc := LOC_REGISTER;
       loc := LOC_REGISTER;
       if paracgsize = OS_F64 then
       if paracgsize = OS_F64 then
         paracgsize := OS_64
         paracgsize := OS_64
@@ -367,7 +367,7 @@ begin
     hp.paraloc[side].size := paracgsize;
     hp.paraloc[side].size := paracgsize;
     hp.paraloc[side].intsize := paralen;
     hp.paraloc[side].intsize := paralen;
     if (paralen = 0) then
     if (paralen = 0) then
-      if (paradef.deftype = recorddef) then begin
+      if (paradef.typ = recorddef) then begin
         paraloc := hp.paraloc[side].add_location;
         paraloc := hp.paraloc[side].add_location;
         paraloc^.loc := LOC_VOID;
         paraloc^.loc := LOC_VOID;
       end else
       end else
@@ -381,7 +381,7 @@ begin
         paraloc^.shiftval := parashift;
         paraloc^.shiftval := parashift;
 
 
         { make sure we don't lose whether or not the type is signed }
         { make sure we don't lose whether or not the type is signed }
-        if (paracgsize <> OS_NO) and (paradef.deftype <> orddef) then
+        if (paracgsize <> OS_NO) and (paradef.typ <> orddef) then
           paracgsize := int_cgsize(paralen);
           paracgsize := int_cgsize(paralen);
         if (paracgsize = OS_NO) then
         if (paracgsize = OS_NO) then
           paraloc^.size := OS_INT
           paraloc^.size := OS_INT

+ 1 - 1
compiler/powerpc64/cpupi.pas

@@ -79,7 +79,7 @@ begin
     tg.setfirsttemp(ofs);
     tg.setfirsttemp(ofs);
   end else begin
   end else begin
     locals := 0;
     locals := 0;
-    current_procinfo.procdef.localst.foreach_static(@count_locals, @locals);
+    current_procinfo.procdef.localst.SymList.ForEachCall(@count_locals, @locals);
     if locals <> 0 then
     if locals <> 0 then
       { at 0(r1), the previous value of r1 will be stored }
       { at 0(r1), the previous value of r1 will be stored }
       tg.setfirsttemp(8);
       tg.setfirsttemp(8);

+ 1 - 1
compiler/powerpc64/nppcadd.pas

@@ -153,7 +153,7 @@ var
 begin
 begin
   { to make it more readable, string and set (not smallset!) have their
   { to make it more readable, string and set (not smallset!) have their
     own procedures }
     own procedures }
-  case left.resultdef.deftype of
+  case left.resultdef.typ of
     orddef:
     orddef:
       begin
       begin
         { handling boolean expressions }
         { handling boolean expressions }

+ 1 - 1
compiler/powerpc64/nppccnv.pas

@@ -79,7 +79,7 @@ begin
     // everything that is less than 64 bits is converted to a 64 bit signed
     // everything that is less than 64 bits is converted to a 64 bit signed
     // integer - because the int_to_real conversion is faster for 64 bit
     // integer - because the int_to_real conversion is faster for 64 bit
     // signed ints compared to 64 bit unsigned ints.
     // signed ints compared to 64 bit unsigned ints.
-    if (not (torddef(left.resultdef).typ in [s64bit, u64bit, scurrency])) then begin
+    if (not (torddef(left.resultdef).ordtype in [s64bit, u64bit, scurrency])) then begin
       inserttypeconv(left, s64inttype);
       inserttypeconv(left, s64inttype);
     end;
     end;
   end;
   end;

+ 2 - 2
compiler/powerpc64/nppcmat.pas

@@ -286,7 +286,7 @@ begin
         end;
         end;
       LOC_REFERENCE, LOC_CREFERENCE:
       LOC_REFERENCE, LOC_CREFERENCE:
         begin
         begin
-          if (left.resultdef.deftype = floatdef) then begin
+          if (left.resultdef.typ = floatdef) then begin
             src1 := cg.getfpuregister(current_asmdata.CurrAsmList,
             src1 := cg.getfpuregister(current_asmdata.CurrAsmList,
               def_cgsize(left.resultdef));
               def_cgsize(left.resultdef));
             location.register := src1;
             location.register := src1;
@@ -302,7 +302,7 @@ begin
         end;
         end;
     end;
     end;
     { choose appropriate operand }
     { choose appropriate operand }
-    if left.resultdef.deftype <> floatdef then begin
+    if left.resultdef.typ <> floatdef then begin
       if not (cs_check_overflow in current_settings.localswitches) then
       if not (cs_check_overflow in current_settings.localswitches) then
         op := A_NEG
         op := A_NEG
       else
       else

+ 9 - 9
compiler/ppcgen/ngppcadd.pas

@@ -69,7 +69,7 @@ implementation
       begin
       begin
         typecheckpass(left);
         typecheckpass(left);
         if (nodetype in [equaln,unequaln]) and
         if (nodetype in [equaln,unequaln]) and
-           (left.resultdef.deftype = orddef) and
+           (left.resultdef.typ = orddef) and
            is_64bit(left.resultdef) then
            is_64bit(left.resultdef) then
           begin
           begin
             result := nil;
             result := nil;
@@ -136,7 +136,7 @@ implementation
 
 
     function tgenppcaddnode.getresflags : tresflags;
     function tgenppcaddnode.getresflags : tresflags;
       begin
       begin
-        if (left.resultdef.deftype <> floatdef) then
+        if (left.resultdef.typ <> floatdef) then
           result.cr := RS_CR0
           result.cr := RS_CR0
         else
         else
           result.cr := RS_CR1;
           result.cr := RS_CR1;
@@ -178,12 +178,12 @@ implementation
         firstcomplex(self);
         firstcomplex(self);
 
 
         cmpop:=false;
         cmpop:=false;
-        if (torddef(left.resultdef).typ=bool8bit) or
-           (torddef(right.resultdef).typ=bool8bit) then
+        if (torddef(left.resultdef).ordtype=bool8bit) or
+           (torddef(right.resultdef).ordtype=bool8bit) then
          cgsize:=OS_8
          cgsize:=OS_8
         else
         else
-          if (torddef(left.resultdef).typ=bool16bit) or
-             (torddef(right.resultdef).typ=bool16bit) then
+          if (torddef(left.resultdef).ordtype=bool16bit) or
+             (torddef(right.resultdef).ordtype=bool16bit) then
            cgsize:=OS_16
            cgsize:=OS_16
         else
         else
            cgsize:=OS_32;
            cgsize:=OS_32;
@@ -301,7 +301,7 @@ implementation
         pass_left_and_right;
         pass_left_and_right;
 
 
         cmpop:=false;
         cmpop:=false;
-        singleprec:=tfloatdef(left.resultdef).typ=s32real;
+        singleprec:=tfloatdef(left.resultdef).floattype=s32real;
         case nodetype of
         case nodetype of
           addn :
           addn :
             if singleprec then
             if singleprec then
@@ -383,9 +383,9 @@ implementation
         pass_left_and_right;
         pass_left_and_right;
 
 
         { when a setdef is passed, it has to be a smallset }
         { when a setdef is passed, it has to be a smallset }
-        if ((left.resultdef.deftype=setdef) and
+        if ((left.resultdef.typ=setdef) and
             (tsetdef(left.resultdef).settype<>smallset)) or
             (tsetdef(left.resultdef).settype<>smallset)) or
-           ((right.resultdef.deftype=setdef) and
+           ((right.resultdef.typ=setdef) and
             (tsetdef(right.resultdef).settype<>smallset)) then
             (tsetdef(right.resultdef).settype<>smallset)) then
          internalerror(200203301);
          internalerror(200203301);
 
 

+ 7 - 7
compiler/ppu.pas

@@ -43,7 +43,7 @@ type
 {$endif Test_Double_checksum}
 {$endif Test_Double_checksum}
 
 
 const
 const
-  CurrentPPUVersion=67;
+  CurrentPPUVersion=68;
 
 
 { buffer sizes }
 { buffer sizes }
   maxentrysize = 1024;
   maxentrysize = 1024;
@@ -60,7 +60,7 @@ const
   ibendsyms           = 251;
   ibendsyms           = 251;
   ibendinterface      = 252;
   ibendinterface      = 252;
   ibendimplementation = 253;
   ibendimplementation = 253;
-  ibendbrowser        = 254;
+//  ibendbrowser        = 254;
   ibend               = 255;
   ibend               = 255;
   {general}
   {general}
   ibmodulename           = 1;
   ibmodulename           = 1;
@@ -76,8 +76,8 @@ const
   ibImportSymbols        = 11;
   ibImportSymbols        = 11;
   ibsymref               = 12;
   ibsymref               = 12;
   ibdefref               = 13;
   ibdefref               = 13;
-  ibendsymtablebrowser   = 14;
-  ibbeginsymtablebrowser = 15;
+//  ibendsymtablebrowser   = 14;
+//  ibbeginsymtablebrowser = 15;
 {$IFDEF MACRO_DIFF_HINT}
 {$IFDEF MACRO_DIFF_HINT}
   ibusedmacros           = 16;
   ibusedmacros           = 16;
 {$ENDIF}
 {$ENDIF}
@@ -94,7 +94,7 @@ const
   ibabsolutevarsym = 26;
   ibabsolutevarsym = 26;
   ibpropertysym    = 27;
   ibpropertysym    = 27;
   ibfieldvarsym    = 28;
   ibfieldvarsym    = 28;
-  ibunitsym        = 29;  { needed for browser }
+  ibunitsym        = 29;
   iblabelsym       = 30;
   iblabelsym       = 30;
   ibsyssym         = 31;
   ibsyssym         = 31;
   ibrttisym        = 32;
   ibrttisym        = 32;
@@ -129,12 +129,12 @@ const
   uf_init          = $1;
   uf_init          = $1;
   uf_finalize      = $2;
   uf_finalize      = $2;
   uf_big_endian    = $4;
   uf_big_endian    = $4;
-  uf_has_browser   = $10;
+//  uf_has_browser   = $10;
   uf_in_library    = $20;     { is the file in another file than <ppufile>.* ? }
   uf_in_library    = $20;     { is the file in another file than <ppufile>.* ? }
   uf_smart_linked  = $40;     { the ppu can be smartlinked }
   uf_smart_linked  = $40;     { the ppu can be smartlinked }
   uf_static_linked = $80;     { the ppu can be linked static }
   uf_static_linked = $80;     { the ppu can be linked static }
   uf_shared_linked = $100;    { the ppu can be linked shared }
   uf_shared_linked = $100;    { the ppu can be linked shared }
-  uf_local_browser = $200;
+//  uf_local_browser = $200;
   uf_no_link       = $400;    { unit has no .o generated, but can still have
   uf_no_link       = $400;    { unit has no .o generated, but can still have
                                 external linking! }
                                 external linking! }
   uf_has_resourcestrings = $800;    { unit has resource string section }
   uf_has_resourcestrings = $800;    { unit has resource string section }

+ 33 - 28
compiler/pstatmnt.pas

@@ -126,7 +126,7 @@ implementation
          { determines result type }
          { determines result type }
          do_typecheckpass(caseexpr);
          do_typecheckpass(caseexpr);
          { variants must be accepted, but first they must be converted to integer }
          { variants must be accepted, but first they must be converted to integer }
-         if caseexpr.resultdef.deftype=variantdef then
+         if caseexpr.resultdef.typ=variantdef then
            begin
            begin
              caseexpr:=ctypeconvnode.create_internal(caseexpr,sinttype);
              caseexpr:=ctypeconvnode.create_internal(caseexpr,sinttype);
              do_typecheckpass(caseexpr);
              do_typecheckpass(caseexpr);
@@ -329,7 +329,7 @@ implementation
                 (
                 (
                  (m_tp7 in current_settings.modeswitches) and
                  (m_tp7 in current_settings.modeswitches) and
                  (hp.nodetype=subscriptn) and
                  (hp.nodetype=subscriptn) and
-                 ((tsubscriptnode(hp).left.resultdef.deftype=recorddef) or
+                 ((tsubscriptnode(hp).left.resultdef.typ=recorddef) or
                   is_object(tsubscriptnode(hp).left.resultdef))
                   is_object(tsubscriptnode(hp).left.resultdef))
                 ) or
                 ) or
                 { constant array index }
                 { constant array index }
@@ -441,7 +441,7 @@ implementation
       var
       var
          p   : tnode;
          p   : tnode;
          i   : longint;
          i   : longint;
-         st  : tsymtable;
+         st  : TSymtable;
          newblock : tblocknode;
          newblock : tblocknode;
          newstatement : tstatementnode;
          newstatement : tstatementnode;
          calltempnode,
          calltempnode,
@@ -460,7 +460,7 @@ implementation
            pushobjchild(obj.childof);
            pushobjchild(obj.childof);
            { keep the original tobjectdef as owner, because that is used for
            { keep the original tobjectdef as owner, because that is used for
              visibility of the symtable }
              visibility of the symtable }
-           st:=twithsymtable.create(tobjectdef(p.resultdef),obj.symtable.symsearch,refnode.getcopy);
+           st:=twithsymtable.create(tobjectdef(p.resultdef),obj.symtable.SymList,refnode.getcopy);
            symtablestack.push(st);
            symtablestack.push(st);
            withsymtablelist.add(st);
            withsymtablelist.add(st);
          end;
          end;
@@ -473,7 +473,7 @@ implementation
             (nf_memseg in p.flags) then
             (nf_memseg in p.flags) then
            CGMessage(parser_e_no_with_for_variable_in_other_segments);
            CGMessage(parser_e_no_with_for_variable_in_other_segments);
 
 
-         if (p.resultdef.deftype in [objectdef,recorddef]) then
+         if (p.resultdef.typ in [objectdef,recorddef]) then
           begin
           begin
             newblock:=nil;
             newblock:=nil;
             valuenode:=nil;
             valuenode:=nil;
@@ -546,19 +546,19 @@ implementation
               end;
               end;
 
 
             withsymtablelist:=TFPObjectList.create(true);
             withsymtablelist:=TFPObjectList.create(true);
-            case p.resultdef.deftype of
+            case p.resultdef.typ of
               objectdef :
               objectdef :
                 begin
                 begin
                    { push symtables of all parents in reverse order }
                    { push symtables of all parents in reverse order }
                    pushobjchild(tobjectdef(p.resultdef).childof);
                    pushobjchild(tobjectdef(p.resultdef).childof);
                    { push object symtable }
                    { push object symtable }
-                   st:=twithsymtable.Create(tobjectdef(p.resultdef),tobjectdef(p.resultdef).symtable.symsearch,refnode);
+                   st:=twithsymtable.Create(tobjectdef(p.resultdef),tobjectdef(p.resultdef).symtable.SymList,refnode);
                    symtablestack.push(st);
                    symtablestack.push(st);
                    withsymtablelist.add(st);
                    withsymtablelist.add(st);
                  end;
                  end;
               recorddef :
               recorddef :
                 begin
                 begin
-                   st:=twithsymtable.create(trecorddef(p.resultdef),trecorddef(p.resultdef).symtable.symsearch,refnode);
+                   st:=twithsymtable.create(trecorddef(p.resultdef),trecorddef(p.resultdef).symtable.SymList,refnode);
                    symtablestack.push(st);
                    symtablestack.push(st);
                    withsymtablelist.add(st);
                    withsymtablelist.add(st);
                 end;
                 end;
@@ -579,7 +579,7 @@ implementation
 
 
             { remove symtables in reverse order from the stack }
             { remove symtables in reverse order from the stack }
             for i:=withsymtablelist.count-1 downto 0 do
             for i:=withsymtablelist.count-1 downto 0 do
-              symtablestack.pop(tsymtable(withsymtablelist[i]));
+              symtablestack.pop(TSymtable(withsymtablelist[i]));
             withsymtablelist.free;
             withsymtablelist.free;
 
 
 //            p:=cwithnode.create(right,twithsymtable(withsymtable),levelcount,refnode);
 //            p:=cwithnode.create(right,twithsymtable(withsymtable),levelcount,refnode);
@@ -664,10 +664,10 @@ implementation
          ot : tDef;
          ot : tDef;
          sym : tlocalvarsym;
          sym : tlocalvarsym;
          old_block_type : tblock_type;
          old_block_type : tblock_type;
-         exceptsymtable : tsymtable;
-         objname,objrealname : stringid;
+         excepTSymtable : TSymtable;
+         objname,objrealname : TIDString;
          srsym : tsym;
          srsym : tsym;
-         srsymtable : tsymtable;
+         srsymtable : TSymtable;
          oldaktexceptblock: integer;
          oldaktexceptblock: integer;
 
 
       begin
       begin
@@ -748,9 +748,9 @@ implementation
                                     else
                                     else
                                       Message1(type_e_class_type_expected,ot.typename);
                                       Message1(type_e_class_type_expected,ot.typename);
                                  end;
                                  end;
-                               exceptsymtable:=tstt_exceptsymtable.create;
-                               exceptsymtable.insert(sym);
-                               symtablestack.push(exceptsymtable);
+                               excepTSymtable:=tstt_excepTSymtable.create;
+                               excepTSymtable.insert(sym);
+                               symtablestack.push(excepTSymtable);
                             end
                             end
                           else
                           else
                             begin
                             begin
@@ -786,14 +786,14 @@ implementation
                                     else
                                     else
                                       Message1(type_e_class_type_expected,ot.typename);
                                       Message1(type_e_class_type_expected,ot.typename);
                                  end;
                                  end;
-                               exceptsymtable:=nil;
+                               excepTSymtable:=nil;
                             end;
                             end;
                        end
                        end
                      else
                      else
                        consume(_ID);
                        consume(_ID);
                      consume(_DO);
                      consume(_DO);
                      hp:=connode.create(nil,statement);
                      hp:=connode.create(nil,statement);
-                     if ot.deftype=errordef then
+                     if ot.typ=errordef then
                        begin
                        begin
                           hp.free;
                           hp.free;
                           hp:=cerrornode.create;
                           hp:=cerrornode.create;
@@ -814,14 +814,14 @@ implementation
                      if last.nodetype = onn then
                      if last.nodetype = onn then
                        begin
                        begin
                          tonnode(last).excepttype:=tobjectdef(ot);
                          tonnode(last).excepttype:=tobjectdef(ot);
-                         tonnode(last).exceptsymtable:=exceptsymtable;
+                         tonnode(last).excepTSymtable:=excepTSymtable;
                        end;
                        end;
                      { remove exception symtable }
                      { remove exception symtable }
-                     if assigned(exceptsymtable) then
+                     if assigned(excepTSymtable) then
                        begin
                        begin
-                         symtablestack.pop(exceptsymtable);
+                         symtablestack.pop(excepTSymtable);
                          if last.nodetype <> onn then
                          if last.nodetype <> onn then
-                           exceptsymtable.free;
+                           excepTSymtable.free;
                        end;
                        end;
                      if not try_to_consume(_SEMICOLON) then
                      if not try_to_consume(_SEMICOLON) then
                         break;
                         break;
@@ -920,8 +920,8 @@ implementation
          code    : tnode;
          code    : tnode;
          filepos : tfileposinfo;
          filepos : tfileposinfo;
          srsym   : tsym;
          srsym   : tsym;
-         srsymtable : tsymtable;
-         s       : stringid;
+         srsymtable : TSymtable;
+         s       : TIDString;
       begin
       begin
          filepos:=current_tokenpos;
          filepos:=current_tokenpos;
          case token of
          case token of
@@ -1134,10 +1134,15 @@ implementation
       var
       var
         p : tnode;
         p : tnode;
         locals : longint;
         locals : longint;
+        srsym : tsym;
       begin
       begin
          { Rename the funcret so that recursive calls are possible }
          { Rename the funcret so that recursive calls are possible }
          if not is_void(current_procinfo.procdef.returndef) then
          if not is_void(current_procinfo.procdef.returndef) then
-           current_procinfo.procdef.localst.rename(current_procinfo.procdef.resultname,'$hiddenresult');
+           begin
+             srsym:=TSym(current_procinfo.procdef.localst.Find(current_procinfo.procdef.procsym.name));
+             if assigned(srsym) then
+               srsym.realname:='$hiddenresult';
+           end;
 
 
          { delphi uses register calling for assembler methods }
          { delphi uses register calling for assembler methods }
          if (m_delphi in current_settings.modeswitches) and
          if (m_delphi in current_settings.modeswitches) and
@@ -1164,12 +1169,12 @@ implementation
                  (vm, i386, vm only currently)
                  (vm, i386, vm only currently)
              }
              }
              locals:=0;
              locals:=0;
-             current_procinfo.procdef.localst.foreach_static(@count_locals,@locals);
-             current_procinfo.procdef.parast.foreach_static(@count_locals,@locals);
+             current_procinfo.procdef.localst.SymList.ForEachCall(@count_locals,@locals);
+             current_procinfo.procdef.parast.SymList.ForEachCall(@count_locals,@locals);
              if (locals=0) and
              if (locals=0) and
-                (current_procinfo.procdef.owner.symtabletype<>objectsymtable) and
+                (current_procinfo.procdef.owner.symtabletype<>ObjectSymtable) and
                 (not assigned(current_procinfo.procdef.funcretsym) or
                 (not assigned(current_procinfo.procdef.funcretsym) or
-                 (tabstractvarsym(current_procinfo.procdef.funcretsym).refcount<=1)) and
+                 (tabstractvarsym(current_procinfo.procdef.funcretsym).refs<=1)) and
                 not(paramanager.ret_in_param(current_procinfo.procdef.returndef,current_procinfo.procdef.proccalloption)) then
                 not(paramanager.ret_in_param(current_procinfo.procdef.returndef,current_procinfo.procdef.proccalloption)) then
                begin
                begin
                  { Only need to set the framepointer, the locals will
                  { Only need to set the framepointer, the locals will

+ 34 - 38
compiler/psub.pas

@@ -118,7 +118,7 @@ implementation
                       PROCEDURE/FUNCTION BODY PARSING
                       PROCEDURE/FUNCTION BODY PARSING
 ****************************************************************************}
 ****************************************************************************}
 
 
-    procedure initializevars(p:tnamedindexitem;arg:pointer);
+    procedure initializevars(p:TObject;arg:pointer);
       var
       var
         b : tblocknode;
         b : tblocknode;
       begin
       begin
@@ -139,7 +139,7 @@ implementation
       end;
       end;
 
 
 
 
-    procedure check_finalize_paras(p : tnamedindexitem;arg:pointer);
+    procedure check_finalize_paras(p:TObject;arg:pointer);
       begin
       begin
         if (tsym(p).typ=paravarsym) and
         if (tsym(p).typ=paravarsym) and
            (tparavarsym(p).varspez=vs_value) and
            (tparavarsym(p).varspez=vs_value) and
@@ -149,7 +149,7 @@ implementation
       end;
       end;
 
 
 
 
-    procedure check_finalize_locals(p : tnamedindexitem;arg:pointer);
+    procedure check_finalize_locals(p:TObject;arg:pointer);
       begin
       begin
         if (tsym(p).typ=localvarsym) and
         if (tsym(p).typ=localvarsym) and
            (tlocalvarsym(p).refs>0) and
            (tlocalvarsym(p).refs>0) and
@@ -231,7 +231,7 @@ implementation
             begin
             begin
                block:=statement_block(_BEGIN);
                block:=statement_block(_BEGIN);
                if current_procinfo.procdef.localst.symtabletype=localsymtable then
                if current_procinfo.procdef.localst.symtabletype=localsymtable then
-                 current_procinfo.procdef.localst.foreach_static(@initializevars,block);
+                 current_procinfo.procdef.localst.SymList.ForEachCall(@initializevars,block);
             end;
             end;
       end;
       end;
 
 
@@ -459,7 +459,7 @@ implementation
         if assigned(current_procinfo.procdef._class) and
         if assigned(current_procinfo.procdef._class) and
            (current_procinfo.procdef.proctypeoption=potype_constructor) then
            (current_procinfo.procdef.proctypeoption=potype_constructor) then
           begin
           begin
-            pd:=current_procinfo.procdef._class.searchdestructor;
+            pd:=current_procinfo.procdef._class.Finddestructor;
             if assigned(pd) then
             if assigned(pd) then
               begin
               begin
                 { if vmt<>0 then call destructor }
                 { if vmt<>0 then call destructor }
@@ -600,7 +600,7 @@ implementation
       end;
       end;
 
 
 
 
-    procedure clearrefs(p : tnamedindexitem;arg:pointer);
+    procedure clearrefs(p:TObject;arg:pointer);
       begin
       begin
          if (tsym(p).typ in [localvarsym,paravarsym,globalvarsym]) then
          if (tsym(p).typ in [localvarsym,paravarsym,globalvarsym]) then
            if tabstractvarsym(p).refs>1 then
            if tabstractvarsym(p).refs>1 then
@@ -608,7 +608,7 @@ implementation
       end;
       end;
 
 
 
 
-    procedure translate_registers(p : tnamedindexitem;list:pointer);
+    procedure translate_registers(p:TObject;list:pointer);
       begin
       begin
          if (tsym(p).typ in [localvarsym,paravarsym,globalvarsym]) and
          if (tsym(p).typ in [localvarsym,paravarsym,globalvarsym]) and
             (tabstractnormalvarsym(p).localloc.loc in [LOC_REGISTER,LOC_CREGISTER,LOC_MMREGISTER,
             (tabstractnormalvarsym(p).localloc.loc in [LOC_REGISTER,LOC_CREGISTER,LOC_MMREGISTER,
@@ -623,7 +623,7 @@ implementation
       end;
       end;
 
 
 
 
-    procedure check_for_stack(p : tnamedindexitem;arg:pointer);
+    procedure check_for_stack(p:TObject;arg:pointer);
       begin
       begin
          if tsym(p).typ=paravarsym then
          if tsym(p).typ=paravarsym then
            begin
            begin
@@ -642,7 +642,7 @@ implementation
     function tcgprocinfo.stack_tainting_parameter : boolean;
     function tcgprocinfo.stack_tainting_parameter : boolean;
       begin
       begin
         result:=false;
         result:=false;
-        procdef.parast.foreach_static(@check_for_stack,@result);
+        procdef.parast.SymList.ForEachCall(@check_for_stack,@result);
       end;
       end;
 
 
 
 
@@ -710,8 +710,8 @@ implementation
           cg.t_times:=100;
           cg.t_times:=100;
 
 
         { clear register count }
         { clear register count }
-        procdef.localst.foreach_static(@clearrefs,nil);
-        procdef.parast.foreach_static(@clearrefs,nil);
+        procdef.localst.SymList.ForEachCall(@clearrefs,nil);
+        procdef.parast.SymList.ForEachCall(@clearrefs,nil);
 
 
         { there's always a call to FPC_INITIALIZEUNITS/FPC_DO_EXIT in the main program }
         { there's always a call to FPC_INITIALIZEUNITS/FPC_DO_EXIT in the main program }
         if (procdef.localst.symtablelevel=main_program_level) and
         if (procdef.localst.symtablelevel=main_program_level) and
@@ -719,8 +719,8 @@ implementation
           include(flags,pi_do_call);
           include(flags,pi_do_call);
 
 
         { set implicit_finally flag when there are locals/paras to be finalized }
         { set implicit_finally flag when there are locals/paras to be finalized }
-        procdef.parast.foreach_static(@check_finalize_paras,nil);
-        procdef.localst.foreach_static(@check_finalize_locals,nil);
+        procdef.parast.SymList.ForEachCall(@check_finalize_paras,nil);
+        procdef.localst.SymList.ForEachCall(@check_finalize_locals,nil);
 
 
         { firstpass everything }
         { firstpass everything }
         flowcontrol:=[];
         flowcontrol:=[];
@@ -921,8 +921,8 @@ implementation
               this is necessary for debuginfo and verbose assembler output
               this is necessary for debuginfo and verbose assembler output
               when SSA will be implented, this will be more complicated because we've to
               when SSA will be implented, this will be more complicated because we've to
               maintain location lists }
               maintain location lists }
-            current_procinfo.procdef.parast.foreach_static(@translate_registers,templist);
-            current_procinfo.procdef.localst.foreach_static(@translate_registers,templist);
+            current_procinfo.procdef.parast.SymList.ForEachCall(@translate_registers,templist);
+            current_procinfo.procdef.localst.SymList.ForEachCall(@translate_registers,templist);
 
 
             { Add save and restore of used registers }
             { Add save and restore of used registers }
             current_filepos:=entrypos;
             current_filepos:=entrypos;
@@ -1107,7 +1107,7 @@ implementation
             { re-basing of the index, i.e. if you pass an array[1..10] as open array, }
             { re-basing of the index, i.e. if you pass an array[1..10] as open array, }
             { you have to add 1 to all index operations if you directly inline it     }
             { you have to add 1 to all index operations if you directly inline it     }
             if ((currpara.varspez in [vs_out,vs_var,vs_const]) and
             if ((currpara.varspez in [vs_out,vs_var,vs_const]) and
-                (currpara.vardef.deftype=formaldef)) or
+                (currpara.vardef.typ=formaldef)) or
                is_special_array(currpara.vardef)  then
                is_special_array(currpara.vardef)  then
               exit;
               exit;
           end;
           end;
@@ -1119,7 +1119,7 @@ implementation
       var
       var
          oldprocinfo : tprocinfo;
          oldprocinfo : tprocinfo;
          oldblock_type : tblock_type;
          oldblock_type : tblock_type;
-         st : tsymtable;
+         st : TSymtable;
       begin
       begin
          oldprocinfo:=current_procinfo;
          oldprocinfo:=current_procinfo;
          oldblock_type:=block_type;
          oldblock_type:=block_type;
@@ -1146,10 +1146,6 @@ implementation
          { allocate the symbol for this procedure }
          { allocate the symbol for this procedure }
          alloc_proc_symbol(procdef);
          alloc_proc_symbol(procdef);
 
 
-         { create a local symbol table for this routine }
-         if not assigned(procdef.localst) then
-           procdef.insert_localst;
-
          { add parast/localst to symtablestack }
          { add parast/localst to symtablestack }
          add_to_symtablestack;
          add_to_symtablestack;
 
 
@@ -1175,7 +1171,7 @@ implementation
              { Give a warning for accesses in the static symtable that aren't visible
              { Give a warning for accesses in the static symtable that aren't visible
                outside the current unit }
                outside the current unit }
              st:=procdef.owner;
              st:=procdef.owner;
-             while (st.symtabletype=objectsymtable) do
+             while (st.symtabletype=ObjectSymtable) do
                st:=st.defowner.owner;
                st:=st.defowner.owner;
              if (pi_uses_static_symtable in flags) and
              if (pi_uses_static_symtable in flags) and
                 (st.symtabletype<>staticsymtable) then
                 (st.symtabletype<>staticsymtable) then
@@ -1259,7 +1255,7 @@ implementation
 ****************************************************************************}
 ****************************************************************************}
 
 
 
 
-    procedure check_init_paras(p:tnamedindexitem;arg:pointer);
+    procedure check_init_paras(p:TObject;arg:pointer);
       begin
       begin
         if tsym(p).typ<>paravarsym then
         if tsym(p).typ<>paravarsym then
          exit;
          exit;
@@ -1324,7 +1320,7 @@ implementation
         { check if there are para's which require initing -> set }
         { check if there are para's which require initing -> set }
         { pi_do_call (if not yet set)                            }
         { pi_do_call (if not yet set)                            }
         if not(pi_do_call in current_procinfo.flags) then
         if not(pi_do_call in current_procinfo.flags) then
-          pd.parast.foreach_static(@check_init_paras,nil);
+          pd.parast.SymList.ForEachCall(@check_init_paras,nil);
 
 
         { set _FAIL as keyword if constructor }
         { set _FAIL as keyword if constructor }
         if (pd.proctypeoption=potype_constructor) then
         if (pd.proctypeoption=potype_constructor) then
@@ -1550,10 +1546,10 @@ implementation
 ****************************************************************************}
 ****************************************************************************}
 
 
     { search in symtablestack for not complete classes }
     { search in symtablestack for not complete classes }
-    procedure check_forward_class(p : tnamedindexitem;arg:pointer);
+    procedure check_forward_class(p:TObject;arg:pointer);
       begin
       begin
         if (tsym(p).typ=typesym) and
         if (tsym(p).typ=typesym) and
-           (ttypesym(p).typedef.deftype=objectdef) and
+           (ttypesym(p).typedef.typ=objectdef) and
            (oo_is_forward in tobjectdef(ttypesym(p).typedef).objectoptions) then
            (oo_is_forward in tobjectdef(ttypesym(p).typedef).objectoptions) then
           MessagePos1(tsym(p).fileinfo,sym_e_forward_type_not_resolved,tsym(p).realname);
           MessagePos1(tsym(p).fileinfo,sym_e_forward_type_not_resolved,tsym(p).realname);
       end;
       end;
@@ -1627,7 +1623,7 @@ implementation
          { check for incomplete class definitions, this is only required
          { check for incomplete class definitions, this is only required
            for fpc modes }
            for fpc modes }
          if (m_fpc in current_settings.modeswitches) then
          if (m_fpc in current_settings.modeswitches) then
-           current_procinfo.procdef.localst.foreach_static(@check_forward_class,nil);
+           current_procinfo.procdef.localst.SymList.ForEachCall(@check_forward_class,nil);
       end;
       end;
 
 
 
 
@@ -1668,7 +1664,7 @@ implementation
          { check for incomplete class definitions, this is only required
          { check for incomplete class definitions, this is only required
            for fpc modes }
            for fpc modes }
          if (m_fpc in current_settings.modeswitches) then
          if (m_fpc in current_settings.modeswitches) then
-          symtablestack.top.foreach_static(@check_forward_class,nil);
+          symtablestack.top.SymList.ForEachCall(@check_forward_class,nil);
       end;
       end;
 
 
 
 
@@ -1677,25 +1673,26 @@ implementation
 ****************************************************************************}
 ****************************************************************************}
 
 
 
 
-    procedure specialize_objectdefs(p:tnamedindexitem;arg:pointer);
+    procedure specialize_objectdefs(p:TObject;arg:pointer);
       var
       var
+        i  : longint;
         hp : tdef;
         hp : tdef;
         oldcurrent_filepos : tfileposinfo;
         oldcurrent_filepos : tfileposinfo;
       begin
       begin
         if not((tsym(p).typ=typesym) and
         if not((tsym(p).typ=typesym) and
-               (ttypesym(p).typedef.deftype=objectdef) and
+               (ttypesym(p).typedef.typ=objectdef) and
                (df_specialization in ttypesym(p).typedef.defoptions)
                (df_specialization in ttypesym(p).typedef.defoptions)
               ) then
               ) then
           exit;
           exit;
 
 
         { definitions }
         { definitions }
-        hp:=tdef(tobjectdef(ttypesym(p).typedef).symtable.defindex.first);
-        while assigned(hp) do
-         begin
-           if hp.deftype=procdef then
+        for i:=0 to tobjectdef(ttypesym(p).typedef).symtable.DefList.Count-1 do
+          begin
+            hp:=tdef(tobjectdef(ttypesym(p).typedef).symtable.DefList[i]);
+            if hp.typ=procdef then
              begin
              begin
                if assigned(tprocdef(hp).genericdef) and
                if assigned(tprocdef(hp).genericdef) and
-                 (tprocdef(hp).genericdef.deftype=procdef) and
+                 (tprocdef(hp).genericdef.typ=procdef) and
                  assigned(tprocdef(tprocdef(hp).genericdef).generictokenbuf) then
                  assigned(tprocdef(tprocdef(hp).genericdef).generictokenbuf) then
                  begin
                  begin
                    oldcurrent_filepos:=current_filepos;
                    oldcurrent_filepos:=current_filepos;
@@ -1708,7 +1705,6 @@ implementation
                else
                else
                  MessagePos1(tprocdef(tprocdef(hp).genericdef).fileinfo,sym_e_forward_not_resolved,tprocdef(tprocdef(hp).genericdef).fullprocname(false));
                  MessagePos1(tprocdef(tprocdef(hp).genericdef).fileinfo,sym_e_forward_not_resolved,tprocdef(tprocdef(hp).genericdef).fullprocname(false));
              end;
              end;
-           hp:=tdef(hp.indexnext);
          end;
          end;
       end;
       end;
 
 
@@ -1716,11 +1712,11 @@ implementation
     procedure generate_specialization_procs;
     procedure generate_specialization_procs;
       begin
       begin
         if assigned(current_module.globalsymtable) then
         if assigned(current_module.globalsymtable) then
-          current_module.globalsymtable.foreach_static(@specialize_objectdefs,nil);
+          current_module.globalsymtable.SymList.ForEachCall(@specialize_objectdefs,nil);
         if assigned(current_module.localsymtable) then
         if assigned(current_module.localsymtable) then
           begin
           begin
             symtablestack.push(current_module.localsymtable);
             symtablestack.push(current_module.localsymtable);
-            current_module.localsymtable.foreach_static(@specialize_objectdefs,nil);
+            current_module.localsymtable.SymList.ForEachCall(@specialize_objectdefs,nil);
             symtablestack.pop(current_module.localsymtable);
             symtablestack.pop(current_module.localsymtable);
           end;
           end;
       end;
       end;

+ 18 - 12
compiler/ptconst.pas

@@ -71,11 +71,12 @@ implementation
          c         : char;
          c         : char;
          ca        : pchar;
          ca        : pchar;
          tmpguid   : tguid;
          tmpguid   : tguid;
+         symidx,
          aktpos    : longint;
          aktpos    : longint;
          obj       : tobjectdef;
          obj       : tobjectdef;
          recsym,
          recsym,
          srsym     : tsym;
          srsym     : tsym;
-         symt      : tsymtable;
+         symt      : TSymtable;
          value     : bestreal;
          value     : bestreal;
          intvalue  : tconstexprint;
          intvalue  : tconstexprint;
          strval    : pchar;
          strval    : pchar;
@@ -103,11 +104,11 @@ implementation
          block_type:=bt_const;
          block_type:=bt_const;
          datalist:=tasmlist.create;
          datalist:=tasmlist.create;
 
 
-         case def.deftype of
+         case def.typ of
             orddef:
             orddef:
               begin
               begin
                  p:=comp_expr(true);
                  p:=comp_expr(true);
-                 case torddef(def).typ of
+                 case torddef(def).ordtype of
                     bool8bit :
                     bool8bit :
                       begin
                       begin
                          if is_constboolnode(p) then
                          if is_constboolnode(p) then
@@ -180,7 +181,7 @@ implementation
                          if is_constintnode(p) then
                          if is_constintnode(p) then
                            begin
                            begin
                               datalist.concat(Tai_const.Create_32bit(longint(tordconstnode(p).value)));
                               datalist.concat(Tai_const.Create_32bit(longint(tordconstnode(p).value)));
-                              if torddef(def).typ<>u32bit then
+                              if torddef(def).ordtype<>u32bit then
                                check_range(torddef(def));
                                check_range(torddef(def));
                            end
                            end
                          else
                          else
@@ -193,7 +194,7 @@ implementation
                          if is_constintnode(p) then
                          if is_constintnode(p) then
                            intvalue := tordconstnode(p).value
                            intvalue := tordconstnode(p).value
                          else if is_constrealnode(p) and
                          else if is_constrealnode(p) and
-                                 (torddef(def).typ=scurrency)
+                                 (torddef(def).ordtype=scurrency)
                            { allow bootstrapping }
                            { allow bootstrapping }
                            then
                            then
                              begin
                              begin
@@ -221,7 +222,7 @@ implementation
               else
               else
                 Message(parser_e_illegal_expression);
                 Message(parser_e_illegal_expression);
 
 
-              case tfloatdef(def).typ of
+              case tfloatdef(def).floattype of
                  s32real :
                  s32real :
                    datalist.concat(Tai_real_32bit.Create(ts32real(value)));
                    datalist.concat(Tai_real_32bit.Create(ts32real(value)));
                  s64real :
                  s64real :
@@ -375,7 +376,7 @@ implementation
                              case hp.nodetype of
                              case hp.nodetype of
                                vecn :
                                vecn :
                                  begin
                                  begin
-                                   case tvecnode(hp).left.resultdef.deftype of
+                                   case tvecnode(hp).left.resultdef.typ of
                                      stringdef :
                                      stringdef :
                                        begin
                                        begin
                                           { this seems OK for shortstring and ansistrings PM }
                                           { this seems OK for shortstring and ansistrings PM }
@@ -559,7 +560,7 @@ implementation
                 end;
                 end;
               if strlength>=0 then
               if strlength>=0 then
                begin
                begin
-                 case tstringdef(def).string_typ of
+                 case tstringdef(def).stringtype of
                    st_shortstring:
                    st_shortstring:
                      begin
                      begin
                        if strlength>=def.size then
                        if strlength>=def.size then
@@ -811,7 +812,8 @@ implementation
                    consume(_LKLAMMER);
                    consume(_LKLAMMER);
                    sorg:='';
                    sorg:='';
                    aktpos:=0;
                    aktpos:=0;
-                   srsym := tsym(trecorddef(def).symtable.symindex.first);
+                   symidx:=0;
+                   srsym:=tsym(trecorddef(def).symtable.SymList[symidx]);
                    recsym := nil;
                    recsym := nil;
                    while token<>_RKLAMMER do
                    while token<>_RKLAMMER do
                      begin
                      begin
@@ -820,7 +822,7 @@ implementation
                         consume(_ID);
                         consume(_ID);
                         consume(_COLON);
                         consume(_COLON);
                         error := false;
                         error := false;
-                        recsym := tsym(trecorddef(def).symtable.search(s));
+                        recsym := tsym(trecorddef(def).symtable.Find(s));
                         if not assigned(recsym) then
                         if not assigned(recsym) then
                           begin
                           begin
                             Message1(sym_e_illegal_field,sorg);
                             Message1(sym_e_illegal_field,sorg);
@@ -884,7 +886,11 @@ implementation
                              { record was initialized (JM)                    }
                              { record was initialized (JM)                    }
                              recsym := srsym;
                              recsym := srsym;
                              { goto next field }
                              { goto next field }
-                             srsym := tsym(srsym.indexnext);
+                             inc(symidx);
+                             if symidx<trecorddef(def).symtable.SymList.Count then
+                               srsym:=tsym(trecorddef(def).symtable.SymList[symidx])
+                             else
+                               srsym:=nil;
 
 
                              if token=_SEMICOLON then
                              if token=_SEMICOLON then
                                consume(_SEMICOLON)
                                consume(_SEMICOLON)
@@ -945,7 +951,7 @@ implementation
                         symt:=obj.symtable;
                         symt:=obj.symtable;
                         while (srsym=nil) and assigned(symt) do
                         while (srsym=nil) and assigned(symt) do
                           begin
                           begin
-                             srsym:=tsym(symt.search(s));
+                             srsym:=tsym(symt.Find(s));
                              if assigned(obj) then
                              if assigned(obj) then
                                obj:=obj.childof;
                                obj:=obj.childof;
                              if assigned(obj) then
                              if assigned(obj) then

+ 20 - 20
compiler/ptype.pas

@@ -41,7 +41,7 @@ interface
     { tdef }
     { tdef }
     procedure single_type(var def:tdef;isforwarddef:boolean);
     procedure single_type(var def:tdef;isforwarddef:boolean);
 
 
-    procedure read_named_type(var def:tdef;const name : stringid;genericdef:tstoreddef;genericlist:TFPObjectList;parseprocvardir:boolean);
+    procedure read_named_type(var def:tdef;const name : TIDString;genericdef:tstoreddef;genericlist:TFPObjectList;parseprocvardir:boolean);
     procedure read_anon_type(var def : tdef;parseprocvardir:boolean);
     procedure read_anon_type(var def : tdef;parseprocvardir:boolean);
 
 
     { reads a type definition }
     { reads a type definition }
@@ -73,10 +73,11 @@ implementation
 
 
     procedure generate_specialization(var pt1:tnode;const name:string);
     procedure generate_specialization(var pt1:tnode;const name:string);
       var
       var
-        st  : tsymtable;
+        st  : TSymtable;
         pt2 : tnode;
         pt2 : tnode;
         first,
         first,
         err : boolean;
         err : boolean;
+        i   : longint;
         sym : tsym;
         sym : tsym;
         genericdef : tstoreddef;
         genericdef : tstoreddef;
         generictype : ttypesym;
         generictype : ttypesym;
@@ -105,20 +106,20 @@ implementation
         err:=false;
         err:=false;
         first:=true;
         first:=true;
         generictypelist:=TFPObjectList.create(false);
         generictypelist:=TFPObjectList.create(false);
-        case genericdef.deftype of
+        case genericdef.typ of
           procdef :
           procdef :
-            st:=genericdef.getsymtable(gs_para);
+            st:=genericdef.GetSymtable(gs_para);
           objectdef,
           objectdef,
           recorddef :
           recorddef :
-            st:=genericdef.getsymtable(gs_record);
+            st:=genericdef.GetSymtable(gs_record);
         end;
         end;
         if not assigned(st) then
         if not assigned(st) then
           internalerror(200511182);
           internalerror(200511182);
-        sym:=tsym(st.symindex.first);
-        while assigned(sym) do
+        for i:=0 to st.SymList.Count-1 do
           begin
           begin
+            sym:=tsym(st.SymList[i]);
             if (sym.typ=typesym) and
             if (sym.typ=typesym) and
-               (ttypesym(sym).typedef.deftype=undefineddef) then
+               (ttypesym(sym).typedef.typ=undefineddef) then
               begin
               begin
                 if not first then
                 if not first then
                   begin
                   begin
@@ -138,7 +139,6 @@ implementation
                   end;
                   end;
                 pt2.free;
                 pt2.free;
               end;
               end;
-            sym:=tsym(sym.indexnext);
           end;
           end;
         { Reparse the original type definition }
         { Reparse the original type definition }
         if not err then
         if not err then
@@ -163,8 +163,8 @@ implementation
         is_unit_specific : boolean;
         is_unit_specific : boolean;
         pos : tfileposinfo;
         pos : tfileposinfo;
         srsym : tsym;
         srsym : tsym;
-        srsymtable : tsymtable;
-        s,sorg : stringid;
+        srsymtable : TSymtable;
+        s,sorg : TIDString;
       begin
       begin
          s:=pattern;
          s:=pattern;
          sorg:=orgpattern;
          sorg:=orgpattern;
@@ -195,7 +195,7 @@ implementation
            table as forwarddef are not resolved directly }
            table as forwarddef are not resolved directly }
          if assigned(srsym) and
          if assigned(srsym) and
             (srsym.typ=typesym) and
             (srsym.typ=typesym) and
-            (ttypesym(srsym).typedef.deftype=errordef) then
+            (ttypesym(srsym).typedef.typ=errordef) then
           begin
           begin
             Message1(type_e_type_is_not_completly_defined,ttypesym(srsym).realname);
             Message1(type_e_type_is_not_completly_defined,ttypesym(srsym).realname);
             def:=generrordef;
             def:=generrordef;
@@ -223,7 +223,7 @@ implementation
             exit;
             exit;
           end;
           end;
          { Give an error when referring to an errordef }
          { Give an error when referring to an errordef }
-         if (ttypesym(srsym).typedef.deftype=errordef) then
+         if (ttypesym(srsym).typedef.typ=errordef) then
           begin
           begin
             Message(sym_e_error_in_type_def);
             Message(sym_e_error_in_type_def);
             def:=generrordef;
             def:=generrordef;
@@ -312,12 +312,12 @@ implementation
 
 
 
 
     { reads a type definition and returns a pointer to it }
     { reads a type definition and returns a pointer to it }
-    procedure read_named_type(var def : tdef;const name : stringid;genericdef:tstoreddef;genericlist:TFPObjectList;parseprocvardir:boolean);
+    procedure read_named_type(var def : tdef;const name : TIDString;genericdef:tstoreddef;genericlist:TFPObjectList;parseprocvardir:boolean);
       var
       var
         pt : tnode;
         pt : tnode;
         tt2 : tdef;
         tt2 : tdef;
         aktenumdef : tenumdef;
         aktenumdef : tenumdef;
-        s : stringid;
+        s : TIDString;
         l,v : TConstExprInt;
         l,v : TConstExprInt;
         oldpackrecords : longint;
         oldpackrecords : longint;
         defpos,storepos : tfileposinfo;
         defpos,storepos : tfileposinfo;
@@ -372,7 +372,7 @@ implementation
                    else
                    else
                      begin
                      begin
                        { All checks passed, create the new def }
                        { All checks passed, create the new def }
-                       case pt1.resultdef.deftype of
+                       case pt1.resultdef.typ of
                          enumdef :
                          enumdef :
                            def:=tenumdef.create_subrange(tenumdef(pt1.resultdef),lv,hv);
                            def:=tenumdef.create_subrange(tenumdef(pt1.resultdef),lv,hv);
                          orddef :
                          orddef :
@@ -416,7 +416,7 @@ implementation
           read_anon_type(tt2,true);
           read_anon_type(tt2,true);
           if assigned(tt2) then
           if assigned(tt2) then
            begin
            begin
-             case tt2.deftype of
+             case tt2.typ of
                { don't forget that min can be negativ  PM }
                { don't forget that min can be negativ  PM }
                enumdef :
                enumdef :
                  if tenumdef(tt2).min>=0 then
                  if tenumdef(tt2).min>=0 then
@@ -426,7 +426,7 @@ implementation
                   Message(sym_e_ill_type_decl_set);
                   Message(sym_e_ill_type_decl_set);
                orddef :
                orddef :
                  begin
                  begin
-                   if (torddef(tt2).typ<>uvoid) and
+                   if (torddef(tt2).ordtype<>uvoid) and
                       (torddef(tt2).low>=0) then
                       (torddef(tt2).low>=0) then
                      // !! def:=tsetdef.create(tt2,torddef(tt2.def).low,torddef(tt2.def).high))
                      // !! def:=tsetdef.create(tt2,torddef(tt2.def).low,torddef(tt2.def).high))
                      def:=tsetdef.create(tt2,torddef(tt2).high)
                      def:=tsetdef.create(tt2,torddef(tt2).high)
@@ -452,7 +452,7 @@ implementation
 
 
           procedure setdefdecl(def:tdef);
           procedure setdefdecl(def:tdef);
           begin
           begin
-            case def.deftype of
+            case def.typ of
               enumdef :
               enumdef :
                 begin
                 begin
                   lowval:=tenumdef(def).min;
                   lowval:=tenumdef(def).min;
@@ -464,7 +464,7 @@ implementation
                 end;
                 end;
               orddef :
               orddef :
                 begin
                 begin
-                  if torddef(def).typ in [uchar,
+                  if torddef(def).ordtype in [uchar,
                     u8bit,u16bit,
                     u8bit,u16bit,
                     s8bit,s16bit,s32bit,
                     s8bit,s16bit,s32bit,
 {$ifdef cpu64bit}
 {$ifdef cpu64bit}

+ 3 - 3
compiler/raatt.pas

@@ -178,7 +178,7 @@ unit raatt;
       var
       var
         len : longint;
         len : longint;
         srsym : tsym;
         srsym : tsym;
-        srsymtable : tsymtable;
+        srsymtable : TSymtable;
       begin
       begin
         { save old token and reset new token }
         { save old token and reset new token }
         prevasmtoken:=actasmtoken;
         prevasmtoken:=actasmtoken;
@@ -1203,7 +1203,7 @@ unit raatt;
         errorflag : boolean;
         errorflag : boolean;
         prevtok : tasmtoken;
         prevtok : tasmtoken;
         sym : tsym;
         sym : tsym;
-        srsymtable : tsymtable;
+        srsymtable : TSymtable;
         hl  : tasmlabel;
         hl  : tasmlabel;
       Begin
       Begin
         asmsym:='';
         asmsym:='';
@@ -1418,7 +1418,7 @@ unit raatt;
                                end;
                                end;
                            typesym :
                            typesym :
                              begin
                              begin
-                               if not(ttypesym(sym).typedef.deftype in [recorddef,objectdef]) then
+                               if not(ttypesym(sym).typedef.typ in [recorddef,objectdef]) then
                                 Message(asmr_e_wrong_sym_type);
                                 Message(asmr_e_wrong_sym_type);
                              end;
                              end;
                            else
                            else

+ 26 - 26
compiler/rautils.pas

@@ -182,7 +182,7 @@ Function EscapeToPascal(const s:string): string;
                      Symbol helper routines
                      Symbol helper routines
 ---------------------------------------------------------------------}
 ---------------------------------------------------------------------}
 
 
-procedure AsmSearchSym(const s:string;var srsym:tsym;var srsymtable:tsymtable);
+procedure AsmSearchSym(const s:string;var srsym:tsym;var srsymtable:TSymtable);
 Function GetRecordOffsetSize(s:string;Var Offset: aint;var Size:aint):boolean;
 Function GetRecordOffsetSize(s:string;Var Offset: aint;var Size:aint):boolean;
 Function SearchType(const hs:string;var size:aint): Boolean;
 Function SearchType(const hs:string;var size:aint): Boolean;
 Function SearchRecordType(const s:string): boolean;
 Function SearchRecordType(const s:string): boolean;
@@ -710,20 +710,20 @@ end;
 
 
 Function TOperand.SetupVar(const s:string;GetOffset : boolean): Boolean;
 Function TOperand.SetupVar(const s:string;GetOffset : boolean): Boolean;
 
 
-  function symtable_has_localvarsyms(st:tsymtable):boolean;
+  function symtable_has_localvarsyms(st:TSymtable):boolean;
   var
   var
     sym : tsym;
     sym : tsym;
+    i   : longint;
   begin
   begin
     result:=false;
     result:=false;
-    sym:=tsym(st.symindex.first);
-    while assigned(sym) do
+    for i:=0 to st.SymList.Count-1 do
       begin
       begin
+        sym:=tsym(st.SymList[i]);
         if sym.typ=localvarsym then
         if sym.typ=localvarsym then
           begin
           begin
             result:=true;
             result:=true;
             exit;
             exit;
           end;
           end;
-        sym:=tsym(sym.indexnext);
       end;
       end;
   end;
   end;
 
 
@@ -753,7 +753,7 @@ Function TOperand.SetupVar(const s:string;GetOffset : boolean): Boolean;
 { if not found returns FALSE.                               }
 { if not found returns FALSE.                               }
 var
 var
   sym : tsym;
   sym : tsym;
-  srsymtable : tsymtable;
+  srsymtable : TSymtable;
   harrdef : tarraydef;
   harrdef : tarraydef;
   indexreg : tregister;
   indexreg : tregister;
   l : aint;
   l : aint;
@@ -841,7 +841,7 @@ Begin
                 SetSize(sizeof(aint),false);
                 SetSize(sizeof(aint),false);
             end;
             end;
         end;
         end;
-        case tabstractvarsym(sym).vardef.deftype of
+        case tabstractvarsym(sym).vardef.typ of
           orddef,
           orddef,
           enumdef,
           enumdef,
           pointerdef,
           pointerdef,
@@ -855,7 +855,7 @@ Begin
                 multiple indexes }
                 multiple indexes }
               harrdef:=tarraydef(tabstractvarsym(sym).vardef);
               harrdef:=tarraydef(tabstractvarsym(sym).vardef);
               while assigned(harrdef.elementdef) and
               while assigned(harrdef.elementdef) and
-                    (harrdef.elementdef.deftype=arraydef) do
+                    (harrdef.elementdef.typ=arraydef) do
                harrdef:=tarraydef(harrdef.elementdef);
                harrdef:=tarraydef(harrdef.elementdef);
               SetSize(harrdef.elesize,false);
               SetSize(harrdef.elesize,false);
             end;
             end;
@@ -869,7 +869,7 @@ Begin
       begin
       begin
         initref;
         initref;
         opr.ref.symbol:=current_asmdata.RefAsmSymbol(ttypedconstsym(sym).mangledname);
         opr.ref.symbol:=current_asmdata.RefAsmSymbol(ttypedconstsym(sym).mangledname);
-        case ttypedconstsym(sym).typedconstdef.deftype of
+        case ttypedconstsym(sym).typedconstdef.typ of
           orddef,
           orddef,
           enumdef,
           enumdef,
           pointerdef,
           pointerdef,
@@ -881,7 +881,7 @@ Begin
                 multiple indexes }
                 multiple indexes }
               harrdef:=tarraydef(ttypedconstsym(sym).typedconstdef);
               harrdef:=tarraydef(ttypedconstsym(sym).typedconstdef);
               while assigned(harrdef.elementdef) and
               while assigned(harrdef.elementdef) and
-                    (harrdef.elementdef.deftype=arraydef) do
+                    (harrdef.elementdef.typ=arraydef) do
                harrdef:=tarraydef(harrdef.elementdef);
                harrdef:=tarraydef(harrdef.elementdef);
               if not is_packed_array(harrdef) then
               if not is_packed_array(harrdef) then
                 SetSize(harrdef.elesize,false)
                 SetSize(harrdef.elesize,false)
@@ -908,7 +908,7 @@ Begin
       end;
       end;
     typesym :
     typesym :
       begin
       begin
-        if ttypesym(sym).typedef.deftype in [recorddef,objectdef] then
+        if ttypesym(sym).typedef.typ in [recorddef,objectdef] then
          begin
          begin
            setconst(0);
            setconst(0);
            SetupVar:=TRUE;
            SetupVar:=TRUE;
@@ -1155,7 +1155,7 @@ end;
                       Symbol table helper routines
                       Symbol table helper routines
 ****************************************************************************}
 ****************************************************************************}
 
 
-procedure AsmSearchSym(const s:string;var srsym:tsym;var srsymtable:tsymtable);
+procedure AsmSearchSym(const s:string;var srsym:tsym;var srsymtable:TSymtable);
 var
 var
   i : integer;
   i : integer;
 begin
 begin
@@ -1185,7 +1185,7 @@ end;
 Function SearchType(const hs:string;var size:aint): Boolean;
 Function SearchType(const hs:string;var size:aint): Boolean;
 var
 var
   srsym : tsym;
   srsym : tsym;
-  srsymtable : tsymtable;
+  srsymtable : TSymtable;
 begin
 begin
   result:=false;
   result:=false;
   size:=0;
   size:=0;
@@ -1203,7 +1203,7 @@ end;
 Function SearchRecordType(const s:string): boolean;
 Function SearchRecordType(const s:string): boolean;
 var
 var
   srsym : tsym;
   srsym : tsym;
-  srsymtable : tsymtable;
+  srsymtable : TSymtable;
 Begin
 Begin
   SearchRecordType:=false;
   SearchRecordType:=false;
 { Check the constants in symtable }
 { Check the constants in symtable }
@@ -1213,7 +1213,7 @@ Begin
      case srsym.typ of
      case srsym.typ of
        typesym :
        typesym :
          begin
          begin
-           if ttypesym(srsym).typedef.deftype in [recorddef,objectdef] then
+           if ttypesym(srsym).typedef.typ in [recorddef,objectdef] then
             begin
             begin
               SearchRecordType:=true;
               SearchRecordType:=true;
               exit;
               exit;
@@ -1235,7 +1235,7 @@ Function SearchIConstant(const s:string; var l:aint): boolean;
 {**********************************************************************}
 {**********************************************************************}
 var
 var
   srsym : tsym;
   srsym : tsym;
-  srsymtable : tsymtable;
+  srsymtable : TSymtable;
 Begin
 Begin
   SearchIConstant:=false;
   SearchIConstant:=false;
 { check for TRUE or FALSE reserved words first }
 { check for TRUE or FALSE reserved words first }
@@ -1282,10 +1282,10 @@ Function GetRecordOffsetSize(s:string;Var Offset: aint;var Size:aint):boolean;
 { returns FALSE if not found.                                  }
 { returns FALSE if not found.                                  }
 { used when base is a variable or a typed constant name.       }
 { used when base is a variable or a typed constant name.       }
 var
 var
-  st   : tsymtable;
+  st   : TSymtable;
   harrdef : tarraydef;
   harrdef : tarraydef;
   sym  : tsym;
   sym  : tsym;
-  srsymtable : tsymtable;
+  srsymtable : TSymtable;
   i    : longint;
   i    : longint;
   base : string;
   base : string;
 Begin
 Begin
@@ -1309,11 +1309,11 @@ Begin
          globalvarsym,
          globalvarsym,
          localvarsym,
          localvarsym,
          paravarsym :
          paravarsym :
-           st:=Tabstractvarsym(sym).vardef.getsymtable(gs_record);
+           st:=Tabstractvarsym(sym).vardef.GetSymtable(gs_record);
          typesym :
          typesym :
-           st:=Ttypesym(sym).typedef.getsymtable(gs_record);
+           st:=Ttypesym(sym).typedef.GetSymtable(gs_record);
          typedconstsym :
          typedconstsym :
-           st:=Ttypedconstsym(sym).typedconstdef.getsymtable(gs_record);
+           st:=Ttypedconstsym(sym).typedconstdef.GetSymtable(gs_record);
        end
        end
      else
      else
        s:='';
        s:='';
@@ -1327,10 +1327,10 @@ Begin
       i:=255;
       i:=255;
      base:=Copy(s,1,i-1);
      base:=Copy(s,1,i-1);
      delete(s,1,i);
      delete(s,1,i);
-     if st.symtabletype=objectsymtable then
+     if st.symtabletype=ObjectSymtable then
        sym:=search_class_member(tobjectdef(st.defowner),base)
        sym:=search_class_member(tobjectdef(st.defowner),base)
      else
      else
-       sym:=tsym(st.search(base));
+       sym:=tsym(st.Find(base));
      if not assigned(sym) then
      if not assigned(sym) then
       begin
       begin
         GetRecordOffsetSize:=false;
         GetRecordOffsetSize:=false;
@@ -1343,14 +1343,14 @@ Begin
            begin
            begin
              inc(Offset,fieldoffset);
              inc(Offset,fieldoffset);
              size:=getsize;
              size:=getsize;
-             case vardef.deftype of
+             case vardef.typ of
                arraydef :
                arraydef :
                  begin
                  begin
                    { for arrays try to get the element size, take care of
                    { for arrays try to get the element size, take care of
                      multiple indexes }
                      multiple indexes }
                    harrdef:=tarraydef(vardef);
                    harrdef:=tarraydef(vardef);
                    while assigned(harrdef.elementdef) and
                    while assigned(harrdef.elementdef) and
-                         (harrdef.elementdef.deftype=arraydef) do
+                         (harrdef.elementdef.typ=arraydef) do
                     harrdef:=tarraydef(harrdef.elementdef);
                     harrdef:=tarraydef(harrdef.elementdef);
                    if not is_packed_array(harrdef) then
                    if not is_packed_array(harrdef) then
                      size:=harrdef.elesize
                      size:=harrdef.elesize
@@ -1386,7 +1386,7 @@ end;
 Function SearchLabel(const s: string; var hl: tasmlabel;emit:boolean): boolean;
 Function SearchLabel(const s: string; var hl: tasmlabel;emit:boolean): boolean;
 var
 var
   sym : tsym;
   sym : tsym;
-  srsymtable : tsymtable;
+  srsymtable : TSymtable;
   hs  : string;
   hs  : string;
 Begin
 Begin
   hl:=nil;
   hl:=nil;

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.