瀏覽代碼

* 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/assemble.pas svneol=native#text/plain
 compiler/browcol.pas svneol=native#text/plain
-compiler/browlog.pas svneol=native#text/plain
 compiler/bsdcompile -text
 compiler/catch.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
            if push_addr_param for the def is true
          }
-         case p.deftype of
+         case p.typ of
             orddef:
               getparaloc:=LOC_REGISTER;
             floatdef:
@@ -248,7 +248,7 @@ unit cpupara;
 
     function talphaparamanager.getfuncretparaloc(p : tabstractprocdef) : tparalocation;
       begin
-         case p.returndef.deftype of
+         case p.returndef.typ of
             orddef,
             enumdef:
               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;
         { returns whether P is a load instruction (load contents from a }
         { 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 }
         { 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 }
         { 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 }
-        Function a_load_reg_reg(reg1, reg2: TRegister): taicpu; Virtual;
+        Function a_load_reg_reg(reg1, reg2: TRegister): taicpu; Virtual; Abstract;
 
     end;
 
@@ -234,24 +234,4 @@ unit aoptbase;
     RegsSameSize := True
   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.

+ 2 - 22
compiler/aoptda.pas

@@ -41,7 +41,7 @@ Unit aoptda;
         Procedure DoDFA;
 
         { 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 }
         { last one that modified the register                               }
@@ -50,7 +50,7 @@ Unit aoptda;
         { convert a TInsChange value into the corresponding register }
         //!!!!!!!!!! Function TCh2Reg(Ch: TInsChange): TRegister; Virtual;
         { 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;
 
   Implementation
@@ -160,24 +160,4 @@ Unit aoptda;
     }
     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.

+ 0 - 4
compiler/aoptobj.pas

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

+ 6 - 6
compiler/arm/cgcpu.pas

@@ -139,9 +139,9 @@ unit cgcpu;
 
     function get_fpu_postfix(def : tdef) : toppostfix;
       begin
-        if def.deftype=floatdef then
+        if def.typ=floatdef then
           begin
-            case tfloatdef(def).typ of
+            case tfloatdef(def).floattype of
               s32real:
                 result:=PF_S;
               s64real:
@@ -1724,9 +1724,9 @@ unit cgcpu;
               ai:=taicpu.op_sym(A_B,hl);
               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)
               else
                 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,
              po_methodpointer, po_interrupt, po_iocheck]<>[]) then
           Internalerror(200006138);
-        if procdef.owner.symtabletype<>objectsymtable then
+        if procdef.owner.symtabletype<>ObjectSymtable then
           Internalerror(200109191);
 
         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
            if push_addr_param for the def is true
          }
-         case p.deftype of
+         case p.typ of
             orddef:
               getparaloc:=LOC_REGISTER;
             floatdef:
@@ -159,7 +159,7 @@ unit cpupara;
             result:=true;
             exit;
           end;
-        case def.deftype of
+        case def.typ of
           objectdef,
           variantdef,
           formaldef,
@@ -173,20 +173,20 @@ unit cpupara;
           setdef :
             result:=(tsetdef(def).settype<>smallset);
           stringdef :
-            result:=tstringdef(def).string_typ in [st_shortstring,st_longstring];
+            result:=tstringdef(def).stringtype in [st_shortstring,st_longstring];
         end;
       end;
 
 
     function tarmparamanager.ret_in_param(def : tdef;calloption : tproccalloption) : boolean;
       begin
-        case def.deftype of
+        case def.typ of
           recorddef:
             { this is how gcc 4.0.4 on linux seems to do it, it doesn't look like being
               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
           arraydef:
@@ -283,7 +283,7 @@ unit cpupara;
                 else
                   paralen := tcgsize2size[def_cgsize(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
                   (hp.varspez in [vs_value,vs_const]) then
                   paracgsize := int_cgsize(paralen)
@@ -434,7 +434,7 @@ unit cpupara;
           retcgsize:=OS_ADDR
         else
           retcgsize:=def_cgsize(p.returndef);
-          
+
         location_reset(p.funcretloc[side],LOC_INVALID,OS_NO);
         p.funcretloc[side].size:=retcgsize;
 
@@ -446,7 +446,7 @@ unit cpupara;
           end;
 
         { Return in FPU register? }
-        if p.returndef.deftype=floatdef then
+        if p.returndef.typ=floatdef then
           begin
             if (p.proccalloption in [pocall_softfloat]) or (cs_fp_emulation in current_settings.moduleswitches) then
               begin

+ 1 - 1
compiler/arm/narmcnv.pas

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

+ 1 - 1
compiler/arm/narmcon.pas

@@ -65,7 +65,7 @@ interface
       begin
         location_reset(location,LOC_CREFERENCE,def_cgsize(resultdef));
         lastlabel:=nil;
-        realait:=floattype2ait[tfloatdef(resultdef).typ];
+        realait:=floattype2ait[tfloatdef(resultdef).floattype];
         hiloswapped:=current_settings.fputype in [fpu_fpa,fpu_fpa10,fpu_fpa11];
         { const already used ? }
         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
                   begin
                     hs:=strpas(pstr);
-                    StabstrEntry:=StabStrDict.Search(hs);
+                    StabstrEntry:=StabStrDict.Find(hs);
                     if not assigned(StabstrEntry) then
                       begin
                         StabstrEntry:=TStabStrEntry.Create(hs);

+ 20 - 20
compiler/browcol.pas

@@ -1156,7 +1156,6 @@ end;
 
   procedure ProcessSymTable(OwnerSym: PSymbol; var Owner: PSymbolCollection; Table: TSymTable);
   var J: longint;
-      Ref: TRef;
       Sym: TSym;
       Symbol: PSymbol;
       Reference: PReference;
@@ -1211,7 +1210,7 @@ end;
   var Name: string;
   begin
     Name:='';
-    case def.string_typ of
+    case def.stringtype of
       st_shortstring :
         if def.len=255 then
           Name:='shortstring'
@@ -1327,7 +1326,7 @@ end;
       if assigned(def.typesym) then
         Name:=def.typesym.name;
       if Name='' then
-      case def.deftype of
+      case def.typ of
         arraydef :
           Name:=GetArrayDefStr(tarraydef(def));
         stringdef :
@@ -1373,7 +1372,7 @@ end;
     case sym.consttyp of
       constord :
         begin
-          if sym.constdef.deftype=enumdef then
+          if sym.constdef.typ=enumdef then
             Name:=sym.constdef.typesym.name+'('+IntToStr(sym.value.valueord)+')'
           else
             if is_boolean(sym.constdef) then
@@ -1402,7 +1401,7 @@ end;
       only usefull for unamed types PM }
     if assigned(definition) and not assigned(definition.typesym) then
     begin
-      case definition.deftype of
+      case definition.typ of
         recorddef :
           if trecorddef(definition).symtable<>Table then
             ProcessSymTable(Symbol,Symbol^.Items,trecorddef(definition).symtable);
@@ -1420,14 +1419,15 @@ end;
   end;
   var MemInfo: TSymbolMemInfo;
       ObjDef: tobjectdef;
+      symidx : longint;
   begin
     if not Assigned(Table) then
      Exit;
     if Owner=nil then
      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
+        sym:=tsym(Table.SymList[symidx]);
         New(Symbol, Init(Sym.Name,Sym.Typ,'',nil));
         case Sym.Typ of
           globalvarsym,
@@ -1442,7 +1442,7 @@ end;
                    SetVType(Symbol,GetDefinitionStr(vardef));
                ProcessDefIfStruct(vardef);
                if assigned(vardef) then
-                 if (vardef.deftype=pointerdef) and
+                 if (vardef.typ=pointerdef) and
                     assigned(tpointerdef(vardef).pointeddef) then
                  begin
                    Symbol^.Flags:=(Symbol^.Flags or sfPointer);
@@ -1457,7 +1457,7 @@ end;
                    else
                      MemInfo.Addr:=0;
                  end;
-               if assigned(vardef) and (vardef.deftype=arraydef) then
+               if assigned(vardef) and (vardef.typ=arraydef) then
                  begin
                    if tarraydef(vardef).highrange<tarraydef(vardef).lowrange then
                      MemInfo.Size:=-1
@@ -1473,7 +1473,7 @@ end;
           fieldvarsym :
              with tfieldvarsym(sym) do
              begin
-               if assigned(vardef) and (vardef.deftype=arraydef) then
+               if assigned(vardef) and (vardef.typ=arraydef) then
                  begin
                    if tarraydef(vardef).highrange<tarraydef(vardef).lowrange then
                      MemInfo.Size:=-1
@@ -1504,8 +1504,7 @@ end;
               with tprocsym(sym) do
               if assigned(first_procdef) then
               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
                   begin
                     Symbol^.Params:=TypeNames^.Add(GetAbsProcParmDefStr(first_procdef));
@@ -1516,7 +1515,7 @@ end;
                   begin
                     Symbol^.Params:=TypeNames^.Add('...');
                   end;
-                if cs_local_browser in current_settings.moduleswitches then
+//                if cs_local_browser in current_settings.moduleswitches then
                  begin
                    if assigned(first_procdef.localst) and
                      (first_procdef.localst.symtabletype<>staticsymtable) then
@@ -1530,7 +1529,7 @@ end;
               if assigned(typedef) then
                begin
                 Symbol^.TypeID:=Ptrint(typedef);
-                case typedef.deftype of
+                case typedef.typ of
                   arraydef :
                     SetDType(Symbol,GetArrayDefStr(tarraydef(typedef)));
                   enumdef :
@@ -1570,6 +1569,7 @@ end;
                end;
             end;
         end;
+{$ifdef use_refs}
         Ref:=tstoredsym(sym).defref;
         while Assigned(Symbol) and assigned(Ref) do
           begin
@@ -1582,6 +1582,7 @@ end;
               end;
             Ref:=Ref.nextref;
           end;
+{$endif use_refs}
         if Assigned(Symbol) then
           begin
             if not Owner^.Search(Symbol,J) then
@@ -1592,7 +1593,6 @@ end;
                 Symbol:=nil;
               end;
           end;
-        sym:=tsym(sym.indexnext);
       end;
   end;
 
@@ -1619,10 +1619,10 @@ var
   pif: tinputfile;
 begin
   DisposeBrowserCol;
-  if (cs_browser in current_settings.moduleswitches) then
+//  if (cs_browser in current_settings.moduleswitches) then
     NewBrowserCol;
   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
     begin
        t:=tsymtable(hp.globalsymtable);
@@ -1646,7 +1646,7 @@ begin
 
            Modules^.Insert(UnitS);
            ProcessSymTable(UnitS,UnitS^.Items,T);
-           if cs_local_browser in current_settings.moduleswitches then
+//           if cs_local_browser in current_settings.moduleswitches then
              begin
                 t:=tsymtable(hp.localsymtable);
                 if assigned(t) then
@@ -1657,7 +1657,7 @@ begin
     end;
 
   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
     begin
        t:=tsymtable(hp.globalsymtable);
@@ -1684,7 +1684,7 @@ begin
        hp:=tmodule(hp.next);
     end;
 
-  if (cs_browser in current_settings.moduleswitches) then
+  //if (cs_browser in current_settings.moduleswitches) then
     BuildObjectInfo;
   { can allways be done
     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;
       end;
 
+    function  bstoslash(const s : string) : string;
     {Gives the absolute path to the current directory}
     function  GetCurrentDir:string;
     {Gives the relative path to the current directory,
@@ -288,10 +289,19 @@ implementation
                                    Utils
 ****************************************************************************}
 
-    procedure WarnNonExistingPath(const path : string);
+    function bstoslash(const s : string) : string;
+    {
+      return string s with all \ changed into /
+    }
+      var
+         i : longint;
       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;
 
 
@@ -731,10 +741,12 @@ implementation
         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);
      var
@@ -752,6 +764,12 @@ implementation
 {$endif usedircache}
        hp       : TStringListItem;
 
+       procedure WarnNonExistingPath(const path : string);
+       begin
+         if assigned(do_comment) then
+           do_comment(V_Tried,'Path "'+path+'" not found');
+       end;
+
        procedure AddCurrPath;
        begin
          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 }
               { always fit in a 64bit int (todef is 64bit)                       }
               (from_signed or
-               (torddef(fromdef).typ = u64bit)) then
+               (torddef(fromdef).ordtype = u64bit)) then
              begin
                { in all cases, there is only a problem if the higest bit is set }
                if l.loc in [LOC_REGISTER,LOC_CREGISTER] then

+ 10 - 10
compiler/cgobj.pas

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

+ 1 - 16
compiler/compiler.pas

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

+ 4 - 4
compiler/cresstr.pas

@@ -55,7 +55,7 @@ uses
       Tresourcestrings=class
       private
         List : TLinkedList;
-        procedure ConstSym_Register(p:tnamedindexitem;arg:pointer);
+        procedure ConstSym_Register(p:TObject;arg:pointer);
       public
         constructor Create;
         destructor  Destroy;override;
@@ -295,7 +295,7 @@ uses
       end;
 
 
-    procedure Tresourcestrings.ConstSym_Register(p:tnamedindexitem;arg:pointer);
+    procedure Tresourcestrings.ConstSym_Register(p:TObject;arg:pointer);
       begin
         if (tsym(p).typ=constsym) and
            (tconstsym(p).consttyp=constresourcestring) then
@@ -306,8 +306,8 @@ uses
     procedure Tresourcestrings.RegisterResourceStrings;
       begin
         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;
 
 

+ 0 - 41
compiler/cutils.pas

@@ -124,9 +124,6 @@ interface
     { ambivalent to pchar2pshortstring }
     function pshortstring2pchar(p : pshortstring) : pchar;
 
-    { Speed/Hash value }
-    Function GetSpeedValue(Const s:String):cardinal;
-
     { Ansistring (pchar+length) support }
     procedure ansistringdispose(var p : pchar;length : longint);
     function compareansistrings(p1,p2 : pchar;length1,length2 : longint) : longint;
@@ -959,43 +956,6 @@ implementation
       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)
 *****************************************************************************}
@@ -1193,6 +1153,5 @@ implementation
 
 initialization
   internalerrorproc:=@defaulterror;
-  makecrc32tbl;
   initupperlower;
 end.

+ 5 - 5
compiler/dbgbase.pas

@@ -43,11 +43,11 @@ interface
         procedure insertlineinfo(list:TAsmList);virtual;
         procedure referencesections(list:TAsmList);virtual;
         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 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;
       TDebugInfoClass=class of TDebugInfo;
 
@@ -104,7 +104,7 @@ implementation
       end;
 
 
-    procedure TDebugInfo.field_write_defs(p:Tnamedindexitem;arg:pointer);
+    procedure TDebugInfo.field_write_defs(p:TObject;arg:pointer);
       begin
         if (Tsym(p).typ=fieldvarsym) and
            not(sp_static in Tsym(p).symoptions) then
@@ -112,7 +112,7 @@ implementation
       end;
 
 
-    procedure TDebugInfo.method_write_defs(p :tnamedindexitem;arg:pointer);
+    procedure TDebugInfo.method_write_defs(p:TObject;arg:pointer);
       var
         pd : tprocdef;
       begin

+ 35 - 40
compiler/dbgdwarf.pas

@@ -51,7 +51,7 @@ interface
         DW_TAG_imported_declaration := $08,DW_TAG_label := $0a,
         DW_TAG_lexical_block := $0b,DW_TAG_member := $0d,
         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_typedef := $16,DW_TAG_union_type := $17,
         DW_TAG_unspecified_parameters := $18,
@@ -200,9 +200,6 @@ interface
         currabbrevnumber : longint;
 
         { collect all defs in one list so we can reset them easily }
-        { not used (MWE)
-        nextdefnumber    : longint;
-        }
         defnumberlist,
         deftowritelist   : TFPObjectList;
 
@@ -221,7 +218,7 @@ interface
 
         function def_dwarf_lab(def:tdef) : tasmsymbol;
         function get_file_index(afile: tinputfile): Integer;
-        procedure write_symtable_syms(st:tsymtable);
+        procedure write_symtable_syms(st:TSymtable);
       protected
         isdwarf64: Boolean;
         vardatadef: trecorddef;
@@ -262,7 +259,7 @@ interface
 
         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_entry;
@@ -277,7 +274,7 @@ interface
         procedure referencesections(list:TAsmList);override;
         procedure insertlineinfo(list:TAsmList);override;
         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;
 
       { TDebugInfoDwarf2 }
@@ -666,7 +663,7 @@ implementation
         inherited Destroy;
       end;
 
-    procedure TDebugInfoDwarf.enum_membersyms_callback(p: Tnamedindexitem; arg: pointer);
+    procedure TDebugInfoDwarf.enum_membersyms_callback(p:TObject; arg: pointer);
       begin
         case tsym(p).typ of
           fieldvarsym:
@@ -896,7 +893,7 @@ implementation
 
     procedure TDebugInfoDwarf.appenddef_ord(def:torddef);
       begin
-        case def.typ of
+        case def.ordtype of
           s8bit,
           s16bit,
           s32bit :
@@ -1034,7 +1031,7 @@ implementation
 
     procedure TDebugInfoDwarf.appenddef_float(def:tfloatdef);
       begin
-        case def.typ of
+        case def.floattype of
           s32real,
           s64real,
           s80real:
@@ -1199,7 +1196,7 @@ implementation
             DW_AT_byte_size,DW_FORM_udata,def.size
             ]);
         finish_entry;
-        def.symtable.foreach(@enum_membersyms_callback,nil);
+        def.symtable.symList.ForEachCall(@enum_membersyms_callback,nil);
         finish_children;
       end;
 
@@ -1218,7 +1215,7 @@ implementation
         slen : aint;
         arr : tasmlabel;
       begin
-        case def.string_typ of
+        case def.stringtype of
           st_shortstring:
             begin
               { fix length of openshortstring }
@@ -1397,7 +1394,7 @@ implementation
         else
           current_asmdata.asmlists[al_dwarf_info].concat(tai_symbol.create(labsym,0));
 
-        case def.deftype of
+        case def.typ of
           stringdef :
             appenddef_string(tstringdef(def));
           enumdef :
@@ -1441,19 +1438,19 @@ implementation
         appenddef(def);
       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
-           p : tdef;
+           def : tdef;
+           i   : longint;
          begin
-           p:=tdef(st.defindex.first);
-           while assigned(p) do
+           for i:=0 to st.DefList.Count-1 do
              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;
 
@@ -1722,7 +1719,7 @@ implementation
             constreal:
               begin
                 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:
                     begin
                       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)
           { 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);
           }
         end;
@@ -1918,19 +1915,20 @@ implementation
       end;
 
 
-    procedure TDebugInfoDwarf.write_symtable_syms(st:tsymtable);
+    procedure TDebugInfoDwarf.write_symtable_syms(st:TSymtable);
       var
-        p : tsym;
+        i   : longint;
+        sym : tsym;
         old_writing_def_dwarf : boolean;
       begin
         old_writing_def_dwarf:=writing_def_dwarf;
         writing_def_dwarf:=false;
-        p:=tsym(st.symindex.first);
-        while assigned(p) do
+        for i:=0 to st.SymList.Count-1 do
           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;
         writing_def_dwarf:=old_writing_def_dwarf;
       end;
@@ -2140,15 +2138,12 @@ implementation
         currabbrevnumber:=0;
         writing_def_dwarf:=false;
 
-        { not used (MWE)
-        nextdefnumber:=0;
-        }
         defnumberlist:=TFPObjectList.create(false);
         deftowritelist:=TFPObjectList.create(false);
 
         { not exported (FK)
-        filerecdef:=getderefdef('FILEREC');
-        textrecdef:=getderefdef('TEXTREC');
+            FILEREC
+            TEXTREC
         }
         vardatadef:=trecorddef(search_system_type('TVARDATA').typedef);
 
@@ -2464,7 +2459,7 @@ implementation
               finish_entry;
             end;
 
-          def.symtable.foreach(@enum_membersyms_callback,nil);
+          def.symtable.symList.ForEachCall(@enum_membersyms_callback,nil);
           finish_children;
         end;
 
@@ -2658,7 +2653,7 @@ implementation
             end;
 
         { add members }
-        def.symtable.foreach(@enum_membersyms_callback,nil);
+        def.symtable.symList.ForEachCall(@enum_membersyms_callback,nil);
         finish_children;
       end;
 
@@ -2744,7 +2739,7 @@ implementation
         finish_entry;
 
         { discriminant }
-        fs := tfieldvarsym(vardatadef.symtable.search('VTYPE'));
+        fs := tfieldvarsym(vardatadef.symtable.Find('VTYPE'));
         if (fs = nil) or (fs.typ <> fieldvarsym) then
           internalerror(200609271);
         current_asmdata.asmlists[al_dwarf_info].concat(tai_symbol.create(lbl,0));
@@ -2760,7 +2755,7 @@ implementation
 
             if VARIANTS[idx].name <> '' then
               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
                   internalerror(20060927200+idx);
                 appendsym_fieldvar(fs);

+ 49 - 47
compiler/dbgstabs.pas

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

+ 62 - 62
compiler/defcmp.pas

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

+ 112 - 116
compiler/defutil.pas

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

+ 1 - 1
compiler/finput.pas

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

+ 2 - 2
compiler/fmodule.pas

@@ -126,9 +126,9 @@ interface
         deflist,
         symlist       : TFPObjectList;
         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 }
-        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 }
         procinfo      : TObject;  { current procedure being compiled }
         asmdata       : TObject;  { Assembler data }

+ 6 - 57
compiler/fppu.pas

@@ -62,7 +62,6 @@ interface
           function  search_unit(onlysource,shortname:boolean):boolean;
           procedure load_interface;
           procedure load_implementation;
-          procedure load_symtable_refs;
           procedure load_usedunits;
           procedure printcomments;
           procedure queuecomment(s:string;v,w:longint);
@@ -86,7 +85,7 @@ interface
        end;
 
     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
@@ -659,7 +658,7 @@ uses
            hs:=ppufile.getstring;
            was_initial:=boolean(ppufile.getbyte);
            was_used:=boolean(ppufile.getbyte);
-           mac:=tmacro(initialmacrosymtable.search(hs));
+           mac:=tmacro(initialmacrosymtable.Find(hs));
            if assigned(mac) then
              begin
 {$ifndef EXTDEBUG}
@@ -958,25 +957,6 @@ uses
       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;
       var
         pu : tused_unit;
@@ -984,10 +964,6 @@ uses
          Message1(unit_u_ppu_write,realmodulename^);
 
          { 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
           flags:=flags or uf_release;
          if assigned(localsymtable) then
@@ -1053,7 +1029,7 @@ uses
          { write the symtable entries }
          tstoredsymtable(globalsymtable).ppuwrite(ppufile);
 
-         if assigned(globalmacrosymtable) and (globalmacrosymtable.symindex.count > 0) then
+         if assigned(globalmacrosymtable) and (globalmacrosymtable.SymList.count > 0) then
            begin
              ppufile.putbyte(byte(true));
              ppufile.writeentry(ibexportedmacros);
@@ -1079,25 +1055,6 @@ uses
          if (flags and uf_local_symtable)<>0 then
            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 }
 
          { flush to be sure }
@@ -1160,7 +1117,7 @@ uses
          { write the symtable entries }
          tstoredsymtable(globalsymtable).ppuwrite(ppufile);
 
-         if assigned(globalmacrosymtable) and (globalmacrosymtable.symindex.count > 0) then
+         if assigned(globalmacrosymtable) and (globalmacrosymtable.SymList.count > 0) then
            begin
              ppufile.putbyte(byte(true));
              ppufile.writeentry(ibexportedmacros);
@@ -1308,14 +1265,6 @@ uses
         tstoredsymtable(globalsymtable).derefimpl;
         if assigned(localsymtable) then
           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;
 
 
@@ -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
-        ups   : stringid;
+        ups   : TIDString;
         hp    : tppumodule;
         hp2   : tmodule;
       begin

+ 184 - 16
compiler/globals.pas

@@ -137,6 +137,37 @@ interface
          maxfpuregisters : shortint;
        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
        { specified inputfile }
        inputfilepath     : string;
@@ -285,9 +316,6 @@ interface
        { actual values are defined in ncgutil.pas }
        nroftrashvalues = 4;
 
-    procedure abstract;
-
-    function bstoslash(const s : string) : string;
 
     function getdatestr:string;
     function gettimestr:string;
@@ -331,25 +359,165 @@ implementation
 {$endif}
       comphook;
 
-    procedure abstract;
+{****************************************************************************
+                                 TLinkStrMap
+****************************************************************************}
+
+    Constructor TLinkStrMap.create;
       begin
-        do_internalerror(255);
+        inherited;
+        itemcnt:=0;
       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
-         i : longint;
+        i : Longint;
       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;
 
 

+ 2 - 4
compiler/globtype.pas

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

+ 66 - 64
compiler/htypechk.pas

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

+ 1 - 1
compiler/i386/cgcpu.pas

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

+ 6 - 6
compiler/i386/cpupara.pas

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

+ 3 - 3
compiler/i386/daopt386.pas

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

+ 8 - 8
compiler/i386/n386add.pas

@@ -69,10 +69,10 @@ interface
         op2:=A_NONE;
         mboverflow:=false;
         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
           addn :
             begin
@@ -261,10 +261,10 @@ interface
 
         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?  }
         { 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);
             cg.getcpuregister(current_asmdata.CurrAsmList,NR_EDX);
             {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)
             else
               emit_none(A_CDQ,S_NO);
 
             {Division depends on the right type.}
-            if Torddef(right.resultdef).typ=u32bit then
+            if Torddef(right.resultdef).ordtype=u32bit then
               op:=A_DIV
             else
               op:=A_IDIV;

+ 1 - 1
compiler/m68k/cgcpu.pas

@@ -1236,7 +1236,7 @@ unit cgcpu;
            (procdef.procoptions*[po_classmethod, po_staticmethod,
              po_methodpointer, po_interrupt, po_iocheck]<>[]) then
           Internalerror(200006138);
-        if procdef.owner.symtabletype<>objectsymtable then
+        if procdef.owner.symtabletype<>ObjectSymtable then
           Internalerror(200109191);
 
         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
            if push_addr_param for the def is true
          }
-         case p.deftype of
+         case p.typ of
             orddef:
               result:=LOC_REGISTER;
             floatdef:
@@ -151,7 +151,7 @@ unit cpupara;
             result:=true;
             exit;
           end;
-        case def.deftype of
+        case def.typ of
           variantdef,
           formaldef :
             result:=true;
@@ -167,7 +167,7 @@ unit cpupara;
           setdef :
             result:=(tsetdef(def).settype<>smallset);
           stringdef :
-            result:=tstringdef(def).string_typ in [st_shortstring,st_longstring];
+            result:=tstringdef(def).stringtype in [st_shortstring,st_longstring];
           procvardef :
             result:=po_methodpointer in tprocvardef(def).procoptions;
         end;
@@ -208,7 +208,7 @@ unit cpupara;
             exit;
           end;
         { Return in FPU register? }
-        if p.returndef.deftype=floatdef then
+        if p.returndef.typ=floatdef then
           begin
             p.funcretloc[side].loc:=LOC_FPUREGISTER;
             p.funcretloc[side].register:=NR_FPU_RESULT_REG;
@@ -342,7 +342,7 @@ unit cpupara;
             hp.paraloc[side].intsize:=paralen;
 
             if (paralen = 0) then
-              if (paradef.deftype = recorddef) then
+              if (paradef.typ = recorddef) then
                 begin
                   paraloc:=hp.paraloc[side].add_location;
                   paraloc^.loc := LOC_VOID;
@@ -361,7 +361,7 @@ unit cpupara;
 		    //writeln('loc register');
                     paraloc^.loc := loc;
                     { 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);
                     if (paracgsize in [OS_NO,OS_64,OS_S64]) then
                       paraloc^.size := OS_INT

+ 4 - 4
compiler/m68k/n68kadd.pas

@@ -358,12 +358,12 @@ implementation
         otl,ofl : tasmlabel;
       begin
 //        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
         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
         else
            cgsize:=OS_32;

+ 2 - 2
compiler/m68k/ra68kmot.pas

@@ -587,7 +587,7 @@ const
   var expr: string;
       hs, tempstr: string;
       sym : tsym;
-      srsymtable : tsymtable;
+      srsymtable : TSymtable;
       hl : tasmlabel;
       l : longint;
       errorflag: boolean;
@@ -703,7 +703,7 @@ const
                                end;
                              typesym :
                                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);
                                end;
                              else

+ 85 - 85
compiler/nadd.pas

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

+ 2 - 2
compiler/nbas.pas

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

+ 60 - 65
compiler/ncal.pas

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

+ 3 - 3
compiler/ncgadd.pas

@@ -232,9 +232,9 @@ interface
     procedure tcgaddnode.second_opsmallset;
       begin
         { 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
-           ((right.resultdef.deftype=setdef) and
+           ((right.resultdef.typ=setdef) and
             (tsetdef(right.resultdef).settype<>smallset)) then
           internalerror(200203301);
 
@@ -738,7 +738,7 @@ interface
 
     procedure tcgaddnode.pass_generate_code;
       begin
-        case left.resultdef.deftype of
+        case left.resultdef.typ of
           orddef :
             begin
               { handling boolean expressions }

+ 1 - 1
compiler/ncgbas.pas

@@ -382,7 +382,7 @@ interface
           end
         else if tempinfo^.may_be_in_reg then
           begin
-            if tempinfo^.typedef.deftype=floatdef then
+            if tempinfo^.typedef.typ=floatdef then
               begin
 {$ifdef x86}
                 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);
 
         { 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
 {$ifdef i386}
            if tempcgpara.location^.loc<>LOC_REFERENCE then
@@ -398,7 +398,7 @@ implementation
                  { don't push a node that already generated a pointer type
                    by address for implicit hidden parameters }
                  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,
                          aktcallnode.procdefinition.proccalloption)) then
                    push_addr_para
@@ -406,7 +406,7 @@ implementation
                    push_value_para;
                end
              { formal def }
-             else if (parasym.vardef.deftype=formaldef) then
+             else if (parasym.vardef.typ=formaldef) then
                begin
                   { allow passing of a constant to a const formaldef }
                   if (parasym.varspez=vs_const) and
@@ -421,7 +421,7 @@ implementation
                    by address for implicit hidden parameters }
                  if (not(
                          (vo_is_hidden_para in parasym.varoptions) and
-                         (left.resultdef.deftype in [pointerdef,classrefdef])
+                         (left.resultdef.typ in [pointerdef,classrefdef])
                         ) and
                      paramanager.push_addr_param(parasym.varspez,parasym.vardef,
                          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);
                             end;
 {$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
                               location_force_mem(current_asmdata.CurrAsmList,location);
                             end;
@@ -894,7 +894,7 @@ implementation
                  secondpass(methodpointer);
 
                  { 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)
                  else
                    begin

+ 6 - 6
compiler/ncgcnv.pas

@@ -260,7 +260,7 @@ interface
     procedure tcgtypeconvnode.second_char_to_string;
       begin
          location_reset(location,LOC_REFERENCE,OS_NO);
-         case tstringdef(resultdef).string_typ of
+         case tstringdef(resultdef).stringtype of
            st_shortstring :
              begin
                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
           invalid LOC_FPUREGISTER locations }
         if (
-            (resultdef.deftype=floatdef) and
+            (resultdef.typ=floatdef) and
             (location.loc=LOC_CONSTANT)
            ) or
            (
-            (left.resultdef.deftype=floatdef) xor
-            (resultdef.deftype=floatdef)
+            (left.resultdef.typ=floatdef) xor
+            (resultdef.typ=floatdef)
            ) then
           location_force_mem(current_asmdata.CurrAsmList,location);
 
@@ -548,8 +548,8 @@ interface
 {$ifdef TESTOBJEXT2}
          { Check explicit conversions to objects pointers !! }
          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).options and oo_hasvmt)<>0) and
             (cs_check_range in current_settings.localswitches) then

+ 1 - 1
compiler/ncgcon.pas

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

+ 15 - 10
compiler/ncgflw.pas

@@ -1244,6 +1244,7 @@ implementation
          exceptref,
          href2: treference;
          paraloc1 : tcgpara;
+         exceptvarsym : tlocalvarsym;
       begin
          paraloc1.init;
          location_reset(location,LOC_VOID,OS_NO);
@@ -1265,14 +1266,18 @@ implementation
          { 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);
 
-         { 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
-             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
          else
            begin
@@ -1329,10 +1334,10 @@ implementation
          cg.a_label(current_asmdata.CurrAsmList,doobjectdestroy);
          cleanupobjectstack;
          { clear some stuff }
-         if assigned(exceptsymtable) then
+         if assigned(exceptvarsym) then
            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
          else
            tg.Ungettemp(current_asmdata.CurrAsmList,exceptref);

+ 5 - 5
compiler/ncginl.pas

@@ -263,7 +263,7 @@ implementation
               LOC_CREGISTER,
               LOC_REGISTER :
                 begin
-                  if (left.resultdef.deftype=classrefdef) or
+                  if (left.resultdef.typ=classrefdef) or
                      (po_staticmethod in current_procinfo.procdef.procoptions) then
                     cg.a_load_reg_reg(current_asmdata.CurrAsmList,OS_ADDR,OS_ADDR,left.location.register,hregister)
                   else
@@ -288,7 +288,7 @@ implementation
                   else
                    begin
                      { 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);
                      cg.a_load_ref_reg(current_asmdata.CurrAsmList,OS_ADDR,OS_ADDR,left.location.reference,hregister);
                    end;
@@ -409,7 +409,7 @@ implementation
           secondpass(tcallparanode(left).left);
           cgsize:=def_cgsize(tcallparanode(left).left.resultdef);
           { get addvalue }
-          case tcallparanode(left).left.resultdef.deftype of
+          case tcallparanode(left).left.resultdef.typ of
             orddef,
             enumdef :
                 addvalue:=1;
@@ -534,9 +534,9 @@ implementation
                  (tsetdef(tcallparanode(left).left.resultdef).settype=smallset)
                   and
                    { 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
-                   (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));
 
               { generate code for the element to set }

+ 14 - 14
compiler/ncgld.pas

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

+ 1 - 1
compiler/ncgmat.pas

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

+ 12 - 12
compiler/ncgmem.pas

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

+ 2 - 2
compiler/ncgset.pas

@@ -233,8 +233,8 @@ implementation
          { check if we can use smallset operation using btl which is limited
            to 32 bits, the left side may also not contain higher values !! }
          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 }
          checkgenjumps:=(right.nodetype=setconstn) and

+ 45 - 45
compiler/ncgutil.pas

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

+ 52 - 52
compiler/ncnv.pas

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

+ 4 - 4
compiler/ncon.pas

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

+ 8 - 8
compiler/nflw.pas

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

+ 45 - 45
compiler/ninl.pas

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

+ 13 - 13
compiler/nld.pas

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

+ 34 - 34
compiler/nmat.pas

@@ -132,14 +132,14 @@ implementation
 
             case nodetype of
               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)
                 else
                   t:=genintconstnode(int64(qword(lv) mod qword(rv)));
               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)
                 else
                   t:=genintconstnode(int64(qword(lv) div qword(rv)));
@@ -177,9 +177,9 @@ implementation
            end;
 
          { we need 2 orddefs always }
-         if (left.resultdef.deftype<>orddef) then
+         if (left.resultdef.typ<>orddef) then
            inserttypeconv(right,sinttype);
-         if (right.resultdef.deftype<>orddef) then
+         if (right.resultdef.typ<>orddef) then
            inserttypeconv(right,sinttype);
          if codegenerror then
            exit;
@@ -204,14 +204,14 @@ implementation
          { 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" was > high(int64) (JM)                                                 }
-         if (rd.typ in [u32bit,u64bit]) and
+         if (rd.ordtype in [u32bit,u64bit]) and
             is_constintnode(left) and
             (tordconstnode(left).value >= 0) then
            begin
              inserttypeconv(left,right.resultdef);
              ld:=torddef(left.resultdef);
            end;
-         if (ld.typ in [u32bit,u64bit]) and
+         if (ld.ordtype in [u32bit,u64bit]) and
             is_constintnode(right) and
             (tordconstnode(right).value >= 0) then
           begin
@@ -221,12 +221,12 @@ implementation
 
          { when there is one currency value, everything is done
            using currency }
-         if (ld.typ=scurrency) or
-            (rd.typ=scurrency) then
+         if (ld.ordtype=scurrency) or
+            (rd.ordtype=scurrency) then
            begin
-             if (ld.typ<>scurrency) then
+             if (ld.ordtype<>scurrency) then
               inserttypeconv(left,s64currencytype);
-             if (rd.typ<>scurrency) then
+             if (rd.ordtype<>scurrency) then
               inserttypeconv(right,s64currencytype);
              resultdef:=left.resultdef;
            end
@@ -239,31 +239,31 @@ implementation
            begin
              if is_signed(rd) or is_signed(ld) then
                begin
-                  if (ld.typ<>s64bit) then
+                  if (ld.ordtype<>s64bit) then
                     inserttypeconv(left,s64inttype);
-                  if (rd.typ<>s64bit) then
+                  if (rd.ordtype<>s64bit) then
                     inserttypeconv(right,s64inttype);
                end
              else
                begin
-                  if (ld.typ<>u64bit) then
+                  if (ld.ordtype<>u64bit) then
                     inserttypeconv(left,u64inttype);
-                  if (rd.typ<>u64bit) then
+                  if (rd.ordtype<>u64bit) then
                     inserttypeconv(right,u64inttype);
                end;
              resultdef:=left.resultdef;
            end
          else
           { 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
-             ((ld.typ = u32bit) and
+             ((ld.ordtype = u32bit) and
               is_signed(rd)) then
            begin
               CGMessage(type_w_mixed_signed_unsigned);
-              if (ld.typ<>s64bit) then
+              if (ld.ordtype<>s64bit) then
                 inserttypeconv(left,s64inttype);
-              if (rd.typ<>s64bit) then
+              if (rd.ordtype<>s64bit) then
                 inserttypeconv(right,s64inttype);
               resultdef:=left.resultdef;
            end
@@ -271,9 +271,9 @@ implementation
 {$endif cpu64bit}
            begin
               { 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);
-              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);
               resultdef:=right.resultdef;
            end;
@@ -433,8 +433,8 @@ implementation
 
 {$ifndef cpu64bit}
          { 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
            begin
              result := first_moddiv64bitint;
@@ -511,7 +511,7 @@ implementation
            32 bit for backwards compatibility. That way 'shl 33' is
            the same as 'shl 1'. It's ugly but compatible with delphi/tp/gcc }
          if (not is_64bit(left.resultdef)) and
-            (torddef(left.resultdef).typ<>u32bit) then
+            (torddef(left.resultdef).ordtype<>u32bit) then
            inserttypeconv(left,s32inttype);
 
          inserttypeconv(right,sinttype);
@@ -618,7 +618,7 @@ implementation
            exit;
 
          resultdef:=left.resultdef;
-         if (left.resultdef.deftype=floatdef) then
+         if (left.resultdef.typ=floatdef) then
            begin
            end
 {$ifdef SUPPORT_MMX}
@@ -639,7 +639,7 @@ implementation
            begin
            end
 {$endif cpu64bit}
-         else if (left.resultdef.deftype=orddef) then
+         else if (left.resultdef.typ=orddef) then
            begin
               inserttypeconv(left,sinttype);
               resultdef:=left.resultdef;
@@ -671,11 +671,11 @@ implementation
         if codegenerror then
           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
             if not(target_info.system in system_wince) then
               begin
-                case tfloatdef(resultdef).typ of
+                case tfloatdef(resultdef).floattype of
                   s32real:
                     begin
                       procname:='float32_sub';
@@ -698,7 +698,7 @@ implementation
               end
             else
               begin
-                case tfloatdef(resultdef).typ of
+                case tfloatdef(resultdef).floattype of
                   s32real:
                     procname:='NEGS';
                   s64real:
@@ -722,7 +722,7 @@ implementation
             registersmmx:=left.registersmmx;
 {$endif SUPPORT_MMX}
 
-            if (left.resultdef.deftype=floatdef) then
+            if (left.resultdef.typ=floatdef) then
               begin
                 if (left.expectloc<>LOC_REGISTER) and
                   (registersfpu<1) then
@@ -747,7 +747,7 @@ implementation
                   expectloc:=LOC_REGISTER;
                end
 {$endif cpu64bit}
-             else if (left.resultdef.deftype=orddef) then
+             else if (left.resultdef.typ=orddef) then
                begin
                   if (left.expectloc<>LOC_REGISTER) and
                      (registersint<1) then
@@ -794,7 +794,7 @@ implementation
            { Not of boolean expression. Turn around the operator and remove
              the not. This is not allowed for sets with the gten/lten,
              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
             begin
               result:=left;
@@ -809,7 +809,7 @@ implementation
           begin
              v:=tordconstnode(left).value;
              def:=left.resultdef;
-             case torddef(left.resultdef).typ of
+             case torddef(left.resultdef).ordtype of
                bool8bit,
                bool16bit,
                bool32bit,

+ 13 - 13
compiler/nmem.pas

@@ -149,7 +149,7 @@ implementation
         if codegenerror then
          exit;
 
-        case left.resultdef.deftype of
+        case left.resultdef.typ of
           classrefdef :
             resultdef:=left.resultdef;
           objectdef :
@@ -248,7 +248,7 @@ implementation
                 currpi:=currpi.parent;
                 if not assigned(currpi) then
                   internalerror(2005040602);
-                hsym:=tparavarsym(currpi.procdef.parast.search('parentfp'));
+                hsym:=tparavarsym(currpi.procdef.parast.Find('parentfp'));
                 if not assigned(hsym) then
                   internalerror(2005040601);
                 hsym.varregable:=vr_none;
@@ -359,14 +359,14 @@ implementation
 
         { Handle @proc special, also @procvar in tp-mode needs
           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_mac_procvar in current_settings.modeswitches))
            ) then
           begin
-            isprocvar:=(left.resultdef.deftype=procvardef);
+            isprocvar:=(left.resultdef.typ=procvardef);
 
             if not isprocvar then
               begin
@@ -393,7 +393,7 @@ implementation
                     if isprocvar then
                       begin
                         { 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
                           internalerror(200412041);
                         { Load tmehodpointer(left).proc }
@@ -498,7 +498,7 @@ implementation
          { tp procvar support }
          maybe_call_procvar(left,true);
 
-         if left.resultdef.deftype=pointerdef then
+         if left.resultdef.typ=pointerdef then
           resultdef:=tpointerdef(left.resultdef).pointeddef
          else
           CGMessage(parser_e_invalid_qualifier);
@@ -588,7 +588,7 @@ implementation
         resultdef:=vs.vardef;
 
         // 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
           make_not_regable(left,vr_addr);
       end;
@@ -686,7 +686,7 @@ implementation
                 is_ansistring(left.resultdef) or
                 is_widestring(left.resultdef) or
                 { implicit pointer dereference -> pointer is read }
-                (left.resultdef.deftype = pointerdef);
+                (left.resultdef.typ = pointerdef);
          if valid then
            set_varstate(left,vs_read,[vsf_must_be_valid]);
 {
@@ -702,17 +702,17 @@ implementation
            do not convert enums,booleans,char
            and do not convert range nodes }
          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_boolean(right.resultdef))
              ) or
-             (left.resultdef.deftype <> arraydef) 
+             (left.resultdef.typ <> arraydef) 
             ) then
            begin
              inserttypeconv(right,sinttype);
            end;
 
-         case left.resultdef.deftype of
+         case left.resultdef.typ of
            arraydef :
              begin
                { check type of the index value }
@@ -748,7 +748,7 @@ implementation
              end;
            stringdef :
              begin
-                case tstringdef(left.resultdef).string_typ of
+                case tstringdef(left.resultdef).stringtype of
                   st_widestring :
                     elementdef:=cwidechartype;
                   st_ansistring :

+ 34 - 34
compiler/nobj.pas

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

+ 1 - 1
compiler/node.pas

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

+ 1 - 1
compiler/nopt.pas

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

+ 5 - 5
compiler/nset.pas

@@ -180,7 +180,7 @@ implementation
           i : longint;
         begin
           new(pcs);
-          case psd.elementdef.deftype of
+          case psd.elementdef.typ of
             enumdef :
               begin
                 pes:=tenumsym(tenumdef(psd.elementdef).firstenum);
@@ -216,7 +216,7 @@ implementation
              exit;
           end;
 
-         if right.resultdef.deftype<>setdef then
+         if right.resultdef.typ<>setdef then
            CGMessage(sym_e_set_expected);
 
          if (right.nodetype=typen) then
@@ -243,12 +243,12 @@ implementation
                elements with the in operator.
              }
              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
                  (
-                   (left.resultdef.deftype = enumdef) and
+                   (left.resultdef.typ = enumdef) and
                    (tenumdef(left.resultdef).maxval > 255)
                  )
               then

+ 6 - 6
compiler/nutils.pas

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

+ 1 - 1
compiler/oglx.pas

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

+ 1 - 32
compiler/options.pas

@@ -75,9 +75,6 @@ uses
   cutils,cmsgs,
   comphook,
   symtable,scanner,rabase
-{$ifdef BrowserLog}
-  ,browlog
-{$endif BrowserLog}
   ;
 
 const
@@ -446,35 +443,7 @@ begin
 
            'b' :
              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;
 
            'B' :

+ 7 - 7
compiler/paramgr.pas

@@ -137,14 +137,14 @@ implementation
     { true if uses a parameter as return value }
     function tparamanager.ret_in_param(def : tdef;calloption : tproccalloption) : boolean;
       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 }
-           ((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;
 
 

+ 3 - 31
compiler/parser.pas

@@ -47,12 +47,6 @@ implementation
       aasmbase,aasmtai,aasmdata,
       cgbase,
       script,gendef,
-{$ifdef BrowserCol}
-      browcol,
-{$endif BrowserCol}
-{$ifdef BrowserLog}
-      browlog,
-{$endif BrowserLog}
       comphook,
       scanner,scandir,
       pbase,ptype,psystem,pmodules,psub,
@@ -268,7 +262,7 @@ implementation
           old_block_type : tblock_type;
         { symtable }
           oldsymtablestack,
-          oldmacrosymtablestack : tsymtablestack;
+          oldmacrosymtablestack : TSymtablestack;
           oldaktprocsym    : tprocsym;
         { cg }
           oldparse_only  : boolean;
@@ -328,8 +322,8 @@ implementation
          Message1(parser_i_compiling,filename);
 
        { reset symtable }
-         symtablestack:=tsymtablestack.create;
-         macrosymtablestack:=tsymtablestack.create;
+         symtablestack:=TSymtablestack.create;
+         macrosymtablestack:=TSymtablestack.create;
          systemunit:=nil;
          current_settings.defproccall:=init_settings.defproccall;
          aktexceptblock:=0;
@@ -482,28 +476,6 @@ implementation
                   Message1(exec_i_closing_script,AsmRes.Fn);
                   AsmRes.WriteToDisk;
                 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;
 
            dec(compile_level);

+ 6 - 6
compiler/pbase.pas

@@ -86,10 +86,10 @@ interface
     { reads a list of identifiers into a string list }
     { consume a symbol, if not found give an error and
       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;
 
@@ -184,7 +184,7 @@ implementation
       If this code is changed, it's likly that consume_sym_orgid and factor_read_id
       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
         { first check for identifier }
         if token<>_ID then
@@ -215,7 +215,7 @@ implementation
     { 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
     }
-    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
         { first check for identifier }
         if token<>_ID then
@@ -243,7 +243,7 @@ implementation
         result:=assigned(srsym);
       end;
 
-    function try_consume_unitsym(var srsym:tsym;var srsymtable:tsymtable):boolean;
+    function try_consume_unitsym(var srsym:tsym;var srsymtable:TSymtable):boolean;
       begin
         result:=false;
         if assigned(srsym) and

+ 19 - 19
compiler/pdecl.pas

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

+ 17 - 19
compiler/pdecobj.pas

@@ -30,7 +30,7 @@ interface
       globtype,symtype,symdef;
 
     { 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
 
@@ -50,11 +50,11 @@ implementation
       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 }
       var
          there_is_a_destructor : boolean;
-         classtype : tobjectdeftype;
+         classtype : tobjecttyp;
          pcrd      : tclassrefdef;
          hdef      : tdef;
          old_object_option : tsymoptions;
@@ -169,22 +169,20 @@ implementation
       procedure setinterfacemethodoptions;
 
         var
-          i: longint;
-          defs: TIndexArray;
-          pd: tdef;
+          i   : longint;
+          def : tdef;
         begin
           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
-              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
-                  tprocdef(pd).extnumber:=aktobjectdef.lastvtableindex;
+                  tprocdef(def).extnumber:=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;
@@ -277,7 +275,7 @@ implementation
                         single_type(hdef,typecanbeforward);
 
                         { accept hp1, if is a forward def or a class }
-                        if (hdef.deftype=forwarddef) or
+                        if (hdef.typ=forwarddef) or
                            is_class(hdef) then
                           begin
                              pcrd:=tclassrefdef.create(hdef);
@@ -331,7 +329,7 @@ implementation
                  exit;
               end;
             if aktobjectdef.find_implemented_interface(intfdef)<>nil then
-              Message1(sym_e_duplicate_id,intfdef.name)
+              Message1(sym_e_duplicate_id,intfdef.objname^)
             else
               begin
                 { allocate and prepare the GUID only if the class
@@ -349,7 +347,7 @@ implementation
           while try_to_consume(_COMMA) do
             begin
                id_type(hdef,false);
-               if (hdef.deftype<>objectdef) then
+               if (hdef.typ<>objectdef) then
                  begin
                     Message1(type_e_interface_type_expected,hdef.typename);
                     continue;
@@ -397,7 +395,7 @@ implementation
             begin
               id_type(hdef,false);
               if (not assigned(hdef)) or
-                 (hdef.deftype<>objectdef) then
+                 (hdef.typ<>objectdef) then
                 begin
                   if assigned(hdef) then
                     Message1(type_e_class_type_expected,hdef.typename);
@@ -552,7 +550,7 @@ implementation
              for i:=0 to genericlist.count-1 do
                begin
                  generictype:=ttypesym(genericlist[i]);
-                 if generictype.typedef.deftype=undefineddef then
+                 if generictype.typedef.typ=undefineddef then
                    include(aktobjectdef.defoptions,df_generic)
                  else
                    include(aktobjectdef.defoptions,df_specialization);

文件差異過大導致無法顯示
+ 225 - 221
compiler/pdecsub.pas


+ 30 - 30
compiler/pdecvar.pas

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

+ 1 - 1
compiler/pexports.pas

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

+ 40 - 40
compiler/pexpr.pas

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

+ 12 - 12
compiler/pinline.pas

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

+ 18 - 19
compiler/pmodules.pas

@@ -179,7 +179,7 @@ implementation
         ltvTables.free;
       end;
 
-    procedure AddToThreadvarList(p:tnamedindexitem;arg:pointer);
+    procedure AddToThreadvarList(p:TObject;arg:pointer);
       var
         ltvTable : TAsmList;
       begin
@@ -204,8 +204,8 @@ implementation
            exit;
          ltvTable:=TAsmList.create;
          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
           begin
             s:=make_mangledname('THREADVARLIST',current_module.localsymtable,'');
@@ -468,6 +468,10 @@ implementation
            { create system defines }
            create_intern_symbols;
            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;
          end;
 
@@ -536,7 +540,7 @@ implementation
 
     procedure loadunits;
       var
-         s,sorg  : stringid;
+         s,sorg  : TIDString;
          fn      : string;
          pu      : tused_unit;
          hp2     : tmodule;
@@ -662,28 +666,27 @@ implementation
        end;
 
 
-    procedure free_localsymtables(st:tsymtable);
+    procedure free_localsymtables(st:TSymtable);
       var
+        i   : longint;
         def : tstoreddef;
         pd  : tprocdef;
       begin
-        def:=tstoreddef(st.defindex.first);
-        while assigned(def) do
+        for i:=0 to st.DefList.Count-1 do
           begin
-            if def.deftype=procdef then
+            def:=tstoreddef(st.DefList[i]);
+            if def.typ=procdef then
               begin
                 pd:=tprocdef(def);
                 if assigned(pd.localst) 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
                     free_localsymtables(pd.localst);
                     pd.localst.free;
                     pd.localst:=nil;
                   end;
               end;
-             def:=tstoreddef(def.indexnext);
           end;
       end;
 
@@ -697,10 +700,6 @@ implementation
 
     procedure setupglobalswitches;
       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
           begin
             def_system_macro('FPC_PIC');
@@ -709,7 +708,7 @@ implementation
       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
         ps  : tprocsym;
         pd  : tprocdef;
@@ -764,7 +763,7 @@ implementation
       end;
 
 
-    procedure gen_implicit_initfinal(flag:word;st:tsymtable);
+    procedure gen_implicit_initfinal(flag:word;st:TSymtable);
       var
         pd : tprocdef;
       begin
@@ -791,7 +790,7 @@ implementation
       end;
 
 
-    procedure copy_macro(p:TNamedIndexItem; arg:pointer);
+    procedure copy_macro(p:TObject; arg:pointer);
       begin
         current_module.globalmacrosymtable.insert(tmacro(p).getcopy);
       end;
@@ -948,7 +947,7 @@ implementation
          if (m_mac in current_settings.modeswitches) then
           begin
             current_module.globalmacrosymtable:=tmacrosymtable.create(true);
-            current_module.localmacrosymtable.foreach_static(@copy_macro,nil);
+            current_module.localmacrosymtable.SymList.ForEachCall(@copy_macro,nil);
           end;
 
          { leave when we got an error }

+ 5 - 5
compiler/powerpc/cgcpu.pas

@@ -1,4 +1,4 @@
-{
+    {
     Copyright (c) 1998-2002 by Florian Klaempfl
 
     This unit implements the code generator for the PowerPC
@@ -1990,9 +1990,9 @@ const
          if not(cs_check_overflow in current_settings.localswitches) then
           exit;
          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
            begin
              list.concat(taicpu.op_reg(A_MCRXR,NR_CR7));
@@ -2044,7 +2044,7 @@ const
            (procdef.procoptions*[po_classmethod, po_staticmethod,
              po_methodpointer, po_interrupt, po_iocheck]<>[]) then
           Internalerror(200006138);
-        if procdef.owner.symtabletype<>objectsymtable then
+        if procdef.owner.symtabletype<>ObjectSymtable then
           Internalerror(200109191);
 
         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
            if push_addr_param for the def is true
          }
-         case p.deftype of
+         case p.typ of
             orddef:
               result:=LOC_REGISTER;
             floatdef:
@@ -181,7 +181,7 @@ unit cpupara;
             result:=true;
             exit;
           end;
-        case def.deftype of
+        case def.typ of
           variantdef,
           formaldef :
             result:=true;
@@ -205,7 +205,7 @@ unit cpupara;
           setdef :
             result:=(tsetdef(def).settype<>smallset);
           stringdef :
-            result:=tstringdef(def).string_typ in [st_shortstring,st_longstring];
+            result:=tstringdef(def).stringtype in [st_shortstring,st_longstring];
           procvardef :
             result:=po_methodpointer in tprocvardef(def).procoptions;
         end;
@@ -248,7 +248,7 @@ unit cpupara;
           end;
 
         { Return in FPU register? }
-        if p.returndef.deftype=floatdef then
+        if p.returndef.typ=floatdef then
           begin
             p.funcretloc[side].loc:=LOC_FPUREGISTER;
             p.funcretloc[side].register:=NR_FPU_RESULT_REG;
@@ -381,20 +381,20 @@ unit cpupara;
                     paralen := tcgsize2size[def_cgsize(paradef)];
                   loc := getparaloc(paradef);
                   if (target_info.abi = abi_powerpc_aix) and
-                     (paradef.deftype = recorddef) and
+                     (paradef.typ = recorddef) and
                      (hp.varspez in [vs_value,vs_const]) then
                     begin
                       { if a record has only one field and that field is }
                       { non-composite (not array or record), it must be  }
                       { 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
-                         ((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
-                           (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
                           paradef :=
-                           tabstractvarsym(trecorddef(hp.vardef).symtable.symindex.search(1)).vardef;
+                           tabstractvarsym(trecorddef(hp.vardef).symtable.SymList[0]).vardef;
                           paracgsize:=def_cgsize(paradef);
                         end
                       else
@@ -416,7 +416,7 @@ unit cpupara;
 
               if varargsparas and
                  (target_info.abi = abi_powerpc_aix) and
-                 (paradef.deftype = floatdef) then
+                 (paradef.typ = floatdef) then
                 begin
                   loc := LOC_REGISTER;
                   if paracgsize = OS_F64 then
@@ -429,7 +429,7 @@ unit cpupara;
               hp.paraloc[side].size:=paracgsize;
               hp.paraloc[side].intsize:=paralen;
               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;
 {$ifndef cpu64bit}
               if (target_info.abi=abi_powerpc_sysv) and
@@ -438,7 +438,7 @@ unit cpupara;
                 inc(nextintreg);
 {$endif not cpu64bit}
               if (paralen = 0) then
-                if (paradef.deftype = recorddef) then
+                if (paradef.typ = recorddef) then
                   begin
                     paraloc:=hp.paraloc[side].add_location;
                     paraloc^.loc := LOC_VOID;
@@ -454,7 +454,7 @@ unit cpupara;
                     begin
                       paraloc^.loc := loc;
                       { 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);
                       if (paracgsize in [OS_NO,OS_64,OS_S64]) then
                         paraloc^.size := OS_INT

+ 1 - 1
compiler/powerpc/cpupi.pas

@@ -91,7 +91,7 @@ unit cpupi;
         else
           begin
             locals := 0;
-            current_procinfo.procdef.localst.foreach_static(@count_locals,@locals);
+            current_procinfo.procdef.localst.SymList.ForEachCall(@count_locals,@locals);
             if locals <> 0 then
               begin
                 { 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;
 
         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
           addn :
             begin
@@ -295,7 +295,7 @@ interface
           muln:
             begin
               { 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
                 internalerror(200109051);
               { handled separately }
@@ -751,7 +751,7 @@ interface
       begin
          { to make it more readable, string and set (not smallset!) have their
            own procedures }
-         case left.resultdef.deftype of
+         case left.resultdef.typ of
            orddef :
              begin
                { handling boolean expressions }

+ 3 - 3
compiler/powerpc/nppccnv.pas

@@ -221,7 +221,7 @@ implementation
            location.register,tmpfpureg));
 
          { 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,
              location.register));
        end;
@@ -232,8 +232,8 @@ implementation
           inherited second_real_to_real;
           { work around bug in some powerpc processors where doubles aren't }
           { 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,
               location.register));
        end;

+ 2 - 2
compiler/powerpc/nppcmat.pas

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

+ 11 - 11
compiler/powerpc64/cgcpu.pas

@@ -1273,7 +1273,7 @@ begin
       opsize := OS_S32
     else
       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;
 
   { can we use immediate compares? }
@@ -1305,7 +1305,7 @@ begin
   {$note Commented out below check because of compiler weirdness}
   {
   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
@@ -1443,7 +1443,7 @@ begin
       a_load_reg_ref(list, OS_INT, para.paraloc[calleeside].Location^.size,
         para.paraloc[calleeside].Location^.register, para.localloc.reference);
     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);
     LOC_MMREGISTER, LOC_CMMREGISTER:
       { not supported }
@@ -1455,10 +1455,10 @@ procedure tcgppc.profilecode_restorepara(para : tparavarsym; list : TAsmList);
 begin
   case (para.paraloc[calleeside].Location^.loc) of
     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);
     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);
     LOC_MMREGISTER, LOC_CMMREGISTER:
       { not supported }
@@ -1556,7 +1556,7 @@ begin
 
   { determine whether we need to save the link register }
   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
     ((cs_opt_size in current_settings.optimizerswitches) and ((fprcount > 0) or (gprcount > 0))) or
     ([cs_lineinfo, cs_debuginfo] * current_settings.moduleswitches <> []);
@@ -1695,7 +1695,7 @@ begin
 
   { determine whether we need to restore the link register }
   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
     ((cs_opt_size in current_settings.optimizerswitches) and ((fprcount > 0) or (gprcount > 0))) or
     ([cs_lineinfo, cs_debuginfo] * current_settings.moduleswitches <> []);
@@ -1976,9 +1976,9 @@ begin
   if not (cs_check_overflow in current_settings.localswitches) then
     exit;
   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
   begin
     { ... instructions setting overflow flag ...
@@ -2046,7 +2046,7 @@ begin
     (procdef.procoptions * [po_classmethod, po_staticmethod,
     po_methodpointer, po_interrupt, po_iocheck] <> []) then
     Internalerror(200006138);
-  if procdef.owner.symtabletype <> objectsymtable then
+  if procdef.owner.symtabletype <> ObjectSymtable then
     Internalerror(200109191);
 
   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
     if push_addr_param for the def is true
   }
-  case p.deftype of
+  case p.typ of
     orddef:
       result := LOC_REGISTER;
     floatdef:
@@ -167,7 +167,7 @@ begin
     result := true;
     exit;
   end;
-  case def.deftype of
+  case def.typ of
     variantdef,
     formaldef:
       result := true;
@@ -189,7 +189,7 @@ begin
     setdef:
       result := (tsetdef(def).settype <> smallset);
     stringdef:
-      result := tstringdef(def).string_typ in [st_shortstring, st_longstring];
+      result := tstringdef(def).stringtype in [st_shortstring, st_longstring];
     procvardef:
       result := po_methodpointer in tprocvardef(def).procoptions;
   end;
@@ -225,7 +225,7 @@ begin
   end;
 
   { 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].register := NR_FPU_RESULT_REG;
     p.funcretloc[side].size := retcgsize;
@@ -323,16 +323,16 @@ begin
         paralen := paradef.size
       else
         paralen := tcgsize2size[def_cgsize(paradef)];
-      if (paradef.deftype = recorddef) and
+      if (paradef.typ = recorddef) and
         (hp.varspez in [vs_value, vs_const]) then begin
         { if a record has only one field and that field is }
         { non-composite (not array or record), it must be  }
         { 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
-          (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 :=
-            tabstractvarsym(trecorddef(hp.vardef).symtable.symindex.search(1)).vardef;
+            tabstractvarsym(trecorddef(hp.vardef).symtable.SymList[0]).vardef;
           loc := getparaloc(paradef);
           paracgsize := def_cgsize(paradef);
         end else begin
@@ -355,7 +355,7 @@ begin
     { patch FPU values into integer registers if we currently have
      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;
       if paracgsize = OS_F64 then
         paracgsize := OS_64
@@ -367,7 +367,7 @@ begin
     hp.paraloc[side].size := paracgsize;
     hp.paraloc[side].intsize := paralen;
     if (paralen = 0) then
-      if (paradef.deftype = recorddef) then begin
+      if (paradef.typ = recorddef) then begin
         paraloc := hp.paraloc[side].add_location;
         paraloc^.loc := LOC_VOID;
       end else
@@ -381,7 +381,7 @@ begin
         paraloc^.shiftval := parashift;
 
         { 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);
         if (paracgsize = OS_NO) then
           paraloc^.size := OS_INT

+ 1 - 1
compiler/powerpc64/cpupi.pas

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

+ 1 - 1
compiler/powerpc64/nppcadd.pas

@@ -153,7 +153,7 @@ var
 begin
   { to make it more readable, string and set (not smallset!) have their
     own procedures }
-  case left.resultdef.deftype of
+  case left.resultdef.typ of
     orddef:
       begin
         { 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
     // integer - because the int_to_real conversion is faster for 64 bit
     // 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);
     end;
   end;

+ 2 - 2
compiler/powerpc64/nppcmat.pas

@@ -286,7 +286,7 @@ begin
         end;
       LOC_REFERENCE, LOC_CREFERENCE:
         begin
-          if (left.resultdef.deftype = floatdef) then begin
+          if (left.resultdef.typ = floatdef) then begin
             src1 := cg.getfpuregister(current_asmdata.CurrAsmList,
               def_cgsize(left.resultdef));
             location.register := src1;
@@ -302,7 +302,7 @@ begin
         end;
     end;
     { 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
         op := A_NEG
       else

+ 9 - 9
compiler/ppcgen/ngppcadd.pas

@@ -69,7 +69,7 @@ implementation
       begin
         typecheckpass(left);
         if (nodetype in [equaln,unequaln]) and
-           (left.resultdef.deftype = orddef) and
+           (left.resultdef.typ = orddef) and
            is_64bit(left.resultdef) then
           begin
             result := nil;
@@ -136,7 +136,7 @@ implementation
 
     function tgenppcaddnode.getresflags : tresflags;
       begin
-        if (left.resultdef.deftype <> floatdef) then
+        if (left.resultdef.typ <> floatdef) then
           result.cr := RS_CR0
         else
           result.cr := RS_CR1;
@@ -178,12 +178,12 @@ implementation
         firstcomplex(self);
 
         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
         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
         else
            cgsize:=OS_32;
@@ -301,7 +301,7 @@ implementation
         pass_left_and_right;
 
         cmpop:=false;
-        singleprec:=tfloatdef(left.resultdef).typ=s32real;
+        singleprec:=tfloatdef(left.resultdef).floattype=s32real;
         case nodetype of
           addn :
             if singleprec then
@@ -383,9 +383,9 @@ implementation
         pass_left_and_right;
 
         { 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
-           ((right.resultdef.deftype=setdef) and
+           ((right.resultdef.typ=setdef) and
             (tsetdef(right.resultdef).settype<>smallset)) then
          internalerror(200203301);
 

+ 7 - 7
compiler/ppu.pas

@@ -43,7 +43,7 @@ type
 {$endif Test_Double_checksum}
 
 const
-  CurrentPPUVersion=67;
+  CurrentPPUVersion=68;
 
 { buffer sizes }
   maxentrysize = 1024;
@@ -60,7 +60,7 @@ const
   ibendsyms           = 251;
   ibendinterface      = 252;
   ibendimplementation = 253;
-  ibendbrowser        = 254;
+//  ibendbrowser        = 254;
   ibend               = 255;
   {general}
   ibmodulename           = 1;
@@ -76,8 +76,8 @@ const
   ibImportSymbols        = 11;
   ibsymref               = 12;
   ibdefref               = 13;
-  ibendsymtablebrowser   = 14;
-  ibbeginsymtablebrowser = 15;
+//  ibendsymtablebrowser   = 14;
+//  ibbeginsymtablebrowser = 15;
 {$IFDEF MACRO_DIFF_HINT}
   ibusedmacros           = 16;
 {$ENDIF}
@@ -94,7 +94,7 @@ const
   ibabsolutevarsym = 26;
   ibpropertysym    = 27;
   ibfieldvarsym    = 28;
-  ibunitsym        = 29;  { needed for browser }
+  ibunitsym        = 29;
   iblabelsym       = 30;
   ibsyssym         = 31;
   ibrttisym        = 32;
@@ -129,12 +129,12 @@ const
   uf_init          = $1;
   uf_finalize      = $2;
   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_smart_linked  = $40;     { the ppu can be smartlinked }
   uf_static_linked = $80;     { the ppu can be linked static }
   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
                                 external linking! }
   uf_has_resourcestrings = $800;    { unit has resource string section }

+ 33 - 28
compiler/pstatmnt.pas

@@ -126,7 +126,7 @@ implementation
          { determines result type }
          do_typecheckpass(caseexpr);
          { 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
              caseexpr:=ctypeconvnode.create_internal(caseexpr,sinttype);
              do_typecheckpass(caseexpr);
@@ -329,7 +329,7 @@ implementation
                 (
                  (m_tp7 in current_settings.modeswitches) 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))
                 ) or
                 { constant array index }
@@ -441,7 +441,7 @@ implementation
       var
          p   : tnode;
          i   : longint;
-         st  : tsymtable;
+         st  : TSymtable;
          newblock : tblocknode;
          newstatement : tstatementnode;
          calltempnode,
@@ -460,7 +460,7 @@ implementation
            pushobjchild(obj.childof);
            { keep the original tobjectdef as owner, because that is used for
              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);
            withsymtablelist.add(st);
          end;
@@ -473,7 +473,7 @@ implementation
             (nf_memseg in p.flags) then
            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
             newblock:=nil;
             valuenode:=nil;
@@ -546,19 +546,19 @@ implementation
               end;
 
             withsymtablelist:=TFPObjectList.create(true);
-            case p.resultdef.deftype of
+            case p.resultdef.typ of
               objectdef :
                 begin
                    { push symtables of all parents in reverse order }
                    pushobjchild(tobjectdef(p.resultdef).childof);
                    { 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);
                    withsymtablelist.add(st);
                  end;
               recorddef :
                 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);
                    withsymtablelist.add(st);
                 end;
@@ -579,7 +579,7 @@ implementation
 
             { remove symtables in reverse order from the stack }
             for i:=withsymtablelist.count-1 downto 0 do
-              symtablestack.pop(tsymtable(withsymtablelist[i]));
+              symtablestack.pop(TSymtable(withsymtablelist[i]));
             withsymtablelist.free;
 
 //            p:=cwithnode.create(right,twithsymtable(withsymtable),levelcount,refnode);
@@ -664,10 +664,10 @@ implementation
          ot : tDef;
          sym : tlocalvarsym;
          old_block_type : tblock_type;
-         exceptsymtable : tsymtable;
-         objname,objrealname : stringid;
+         excepTSymtable : TSymtable;
+         objname,objrealname : TIDString;
          srsym : tsym;
-         srsymtable : tsymtable;
+         srsymtable : TSymtable;
          oldaktexceptblock: integer;
 
       begin
@@ -748,9 +748,9 @@ implementation
                                     else
                                       Message1(type_e_class_type_expected,ot.typename);
                                  end;
-                               exceptsymtable:=tstt_exceptsymtable.create;
-                               exceptsymtable.insert(sym);
-                               symtablestack.push(exceptsymtable);
+                               excepTSymtable:=tstt_excepTSymtable.create;
+                               excepTSymtable.insert(sym);
+                               symtablestack.push(excepTSymtable);
                             end
                           else
                             begin
@@ -786,14 +786,14 @@ implementation
                                     else
                                       Message1(type_e_class_type_expected,ot.typename);
                                  end;
-                               exceptsymtable:=nil;
+                               excepTSymtable:=nil;
                             end;
                        end
                      else
                        consume(_ID);
                      consume(_DO);
                      hp:=connode.create(nil,statement);
-                     if ot.deftype=errordef then
+                     if ot.typ=errordef then
                        begin
                           hp.free;
                           hp:=cerrornode.create;
@@ -814,14 +814,14 @@ implementation
                      if last.nodetype = onn then
                        begin
                          tonnode(last).excepttype:=tobjectdef(ot);
-                         tonnode(last).exceptsymtable:=exceptsymtable;
+                         tonnode(last).excepTSymtable:=excepTSymtable;
                        end;
                      { remove exception symtable }
-                     if assigned(exceptsymtable) then
+                     if assigned(excepTSymtable) then
                        begin
-                         symtablestack.pop(exceptsymtable);
+                         symtablestack.pop(excepTSymtable);
                          if last.nodetype <> onn then
-                           exceptsymtable.free;
+                           excepTSymtable.free;
                        end;
                      if not try_to_consume(_SEMICOLON) then
                         break;
@@ -920,8 +920,8 @@ implementation
          code    : tnode;
          filepos : tfileposinfo;
          srsym   : tsym;
-         srsymtable : tsymtable;
-         s       : stringid;
+         srsymtable : TSymtable;
+         s       : TIDString;
       begin
          filepos:=current_tokenpos;
          case token of
@@ -1134,10 +1134,15 @@ implementation
       var
         p : tnode;
         locals : longint;
+        srsym : tsym;
       begin
          { Rename the funcret so that recursive calls are possible }
          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 }
          if (m_delphi in current_settings.modeswitches) and
@@ -1164,12 +1169,12 @@ implementation
                  (vm, i386, vm only currently)
              }
              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
-                (current_procinfo.procdef.owner.symtabletype<>objectsymtable) and
+                (current_procinfo.procdef.owner.symtabletype<>ObjectSymtable) and
                 (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
                begin
                  { Only need to set the framepointer, the locals will

+ 34 - 38
compiler/psub.pas

@@ -118,7 +118,7 @@ implementation
                       PROCEDURE/FUNCTION BODY PARSING
 ****************************************************************************}
 
-    procedure initializevars(p:tnamedindexitem;arg:pointer);
+    procedure initializevars(p:TObject;arg:pointer);
       var
         b : tblocknode;
       begin
@@ -139,7 +139,7 @@ implementation
       end;
 
 
-    procedure check_finalize_paras(p : tnamedindexitem;arg:pointer);
+    procedure check_finalize_paras(p:TObject;arg:pointer);
       begin
         if (tsym(p).typ=paravarsym) and
            (tparavarsym(p).varspez=vs_value) and
@@ -149,7 +149,7 @@ implementation
       end;
 
 
-    procedure check_finalize_locals(p : tnamedindexitem;arg:pointer);
+    procedure check_finalize_locals(p:TObject;arg:pointer);
       begin
         if (tsym(p).typ=localvarsym) and
            (tlocalvarsym(p).refs>0) and
@@ -231,7 +231,7 @@ implementation
             begin
                block:=statement_block(_BEGIN);
                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;
 
@@ -459,7 +459,7 @@ implementation
         if assigned(current_procinfo.procdef._class) and
            (current_procinfo.procdef.proctypeoption=potype_constructor) then
           begin
-            pd:=current_procinfo.procdef._class.searchdestructor;
+            pd:=current_procinfo.procdef._class.Finddestructor;
             if assigned(pd) then
               begin
                 { if vmt<>0 then call destructor }
@@ -600,7 +600,7 @@ implementation
       end;
 
 
-    procedure clearrefs(p : tnamedindexitem;arg:pointer);
+    procedure clearrefs(p:TObject;arg:pointer);
       begin
          if (tsym(p).typ in [localvarsym,paravarsym,globalvarsym]) then
            if tabstractvarsym(p).refs>1 then
@@ -608,7 +608,7 @@ implementation
       end;
 
 
-    procedure translate_registers(p : tnamedindexitem;list:pointer);
+    procedure translate_registers(p:TObject;list:pointer);
       begin
          if (tsym(p).typ in [localvarsym,paravarsym,globalvarsym]) and
             (tabstractnormalvarsym(p).localloc.loc in [LOC_REGISTER,LOC_CREGISTER,LOC_MMREGISTER,
@@ -623,7 +623,7 @@ implementation
       end;
 
 
-    procedure check_for_stack(p : tnamedindexitem;arg:pointer);
+    procedure check_for_stack(p:TObject;arg:pointer);
       begin
          if tsym(p).typ=paravarsym then
            begin
@@ -642,7 +642,7 @@ implementation
     function tcgprocinfo.stack_tainting_parameter : boolean;
       begin
         result:=false;
-        procdef.parast.foreach_static(@check_for_stack,@result);
+        procdef.parast.SymList.ForEachCall(@check_for_stack,@result);
       end;
 
 
@@ -710,8 +710,8 @@ implementation
           cg.t_times:=100;
 
         { 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 }
         if (procdef.localst.symtablelevel=main_program_level) and
@@ -719,8 +719,8 @@ implementation
           include(flags,pi_do_call);
 
         { 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 }
         flowcontrol:=[];
@@ -921,8 +921,8 @@ implementation
               this is necessary for debuginfo and verbose assembler output
               when SSA will be implented, this will be more complicated because we've to
               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 }
             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, }
             { 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
-                (currpara.vardef.deftype=formaldef)) or
+                (currpara.vardef.typ=formaldef)) or
                is_special_array(currpara.vardef)  then
               exit;
           end;
@@ -1119,7 +1119,7 @@ implementation
       var
          oldprocinfo : tprocinfo;
          oldblock_type : tblock_type;
-         st : tsymtable;
+         st : TSymtable;
       begin
          oldprocinfo:=current_procinfo;
          oldblock_type:=block_type;
@@ -1146,10 +1146,6 @@ implementation
          { allocate the symbol for this procedure }
          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_to_symtablestack;
 
@@ -1175,7 +1171,7 @@ implementation
              { Give a warning for accesses in the static symtable that aren't visible
                outside the current unit }
              st:=procdef.owner;
-             while (st.symtabletype=objectsymtable) do
+             while (st.symtabletype=ObjectSymtable) do
                st:=st.defowner.owner;
              if (pi_uses_static_symtable in flags) and
                 (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
         if tsym(p).typ<>paravarsym then
          exit;
@@ -1324,7 +1320,7 @@ implementation
         { check if there are para's which require initing -> set }
         { pi_do_call (if not yet set)                            }
         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 }
         if (pd.proctypeoption=potype_constructor) then
@@ -1550,10 +1546,10 @@ implementation
 ****************************************************************************}
 
     { search in symtablestack for not complete classes }
-    procedure check_forward_class(p : tnamedindexitem;arg:pointer);
+    procedure check_forward_class(p:TObject;arg:pointer);
       begin
         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
           MessagePos1(tsym(p).fileinfo,sym_e_forward_type_not_resolved,tsym(p).realname);
       end;
@@ -1627,7 +1623,7 @@ implementation
          { check for incomplete class definitions, this is only required
            for fpc modes }
          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;
 
 
@@ -1668,7 +1664,7 @@ implementation
          { check for incomplete class definitions, this is only required
            for fpc modes }
          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;
 
 
@@ -1677,25 +1673,26 @@ implementation
 ****************************************************************************}
 
 
-    procedure specialize_objectdefs(p:tnamedindexitem;arg:pointer);
+    procedure specialize_objectdefs(p:TObject;arg:pointer);
       var
+        i  : longint;
         hp : tdef;
         oldcurrent_filepos : tfileposinfo;
       begin
         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)
               ) then
           exit;
 
         { 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
                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
                  begin
                    oldcurrent_filepos:=current_filepos;
@@ -1708,7 +1705,6 @@ implementation
                else
                  MessagePos1(tprocdef(tprocdef(hp).genericdef).fileinfo,sym_e_forward_not_resolved,tprocdef(tprocdef(hp).genericdef).fullprocname(false));
              end;
-           hp:=tdef(hp.indexnext);
          end;
       end;
 
@@ -1716,11 +1712,11 @@ implementation
     procedure generate_specialization_procs;
       begin
         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
           begin
             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);
           end;
       end;

+ 18 - 12
compiler/ptconst.pas

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

+ 20 - 20
compiler/ptype.pas

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

+ 3 - 3
compiler/raatt.pas

@@ -178,7 +178,7 @@ unit raatt;
       var
         len : longint;
         srsym : tsym;
-        srsymtable : tsymtable;
+        srsymtable : TSymtable;
       begin
         { save old token and reset new token }
         prevasmtoken:=actasmtoken;
@@ -1203,7 +1203,7 @@ unit raatt;
         errorflag : boolean;
         prevtok : tasmtoken;
         sym : tsym;
-        srsymtable : tsymtable;
+        srsymtable : TSymtable;
         hl  : tasmlabel;
       Begin
         asmsym:='';
@@ -1418,7 +1418,7 @@ unit raatt;
                                end;
                            typesym :
                              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);
                              end;
                            else

+ 26 - 26
compiler/rautils.pas

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

部分文件因文件數量過多而無法顯示