浏览代码

* moved bitmask constants to sets
* some other type/const renamings

peter 26 年之前
父节点
当前提交
ed8eb13d59
共有 50 个文件被更改,包括 2502 次插入1480 次删除
  1. 364 50
      compiler/browcol.pas
  2. 9 5
      compiler/browlog.pas
  3. 8 4
      compiler/cg386add.pas
  4. 78 64
      compiler/cg386cal.pas
  5. 10 6
      compiler/cg386cnv.pas
  6. 6 2
      compiler/cg386con.pas
  7. 7 3
      compiler/cg386flw.pas
  8. 11 7
      compiler/cg386inl.pas
  9. 13 9
      compiler/cg386ld.pas
  10. 6 2
      compiler/cg386mat.pas
  11. 9 5
      compiler/cg386mem.pas
  12. 7 3
      compiler/cg386set.pas
  13. 33 29
      compiler/cgai386.pas
  14. 40 31
      compiler/hcgdata.pas
  15. 21 12
      compiler/htypechk.pas
  16. 11 2
      compiler/lin_targ.pas
  17. 13 9
      compiler/pass_2.pas
  18. 203 112
      compiler/pdecl.pas
  19. 9 5
      compiler/pexports.pas
  20. 51 44
      compiler/pexpr.pas
  21. 11 7
      compiler/pmodules.pas
  22. 40 34
      compiler/pstatmnt.pas
  23. 336 203
      compiler/psub.pas
  24. 12 8
      compiler/psystem.pas
  25. 17 31
      compiler/ptconst.pas
  26. 6 2
      compiler/ra386att.pas
  27. 10 6
      compiler/ra386dir.pas
  28. 19 14
      compiler/rautils.pas
  29. 116 90
      compiler/symconst.inc
  30. 187 0
      compiler/symconst.pas
  31. 251 221
      compiler/symdef.inc
  32. 125 137
      compiler/symdefh.inc
  33. 20 24
      compiler/symppu.inc
  34. 107 53
      compiler/symsym.inc
  35. 43 46
      compiler/symsymh.inc
  36. 35 36
      compiler/symtable.pas
  37. 37 31
      compiler/systems.pas
  38. 18 14
      compiler/tcadd.pas
  39. 33 17
      compiler/tccal.pas
  40. 13 9
      compiler/tccnv.pas
  41. 6 2
      compiler/tccon.pas
  42. 11 8
      compiler/tcflw.pas
  43. 9 5
      compiler/tcinl.pas
  44. 35 20
      compiler/tcld.pas
  45. 11 7
      compiler/tcmat.pas
  46. 18 9
      compiler/tcmem.pas
  47. 6 2
      compiler/tcset.pas
  48. 7 1
      compiler/tokens.pas
  49. 7 2
      compiler/tree.pas
  50. 47 37
      compiler/types.pas

+ 364 - 50
compiler/browcol.pas

@@ -37,6 +37,7 @@ const
     sfRecord        = $00000001;
     sfRecord        = $00000001;
     sfObject        = $00000002;
     sfObject        = $00000002;
     sfClass         = $00000004;
     sfClass         = $00000004;
+    sfHasMemInfo    = $80000000;
 
 
 type
 type
     TStoreCollection = object(TStringCollection)
     TStoreCollection = object(TStringCollection)
@@ -62,6 +63,8 @@ type
       constructor Init(AFileName: PString; ALine, AColumn: Sw_integer);
       constructor Init(AFileName: PString; ALine, AColumn: Sw_integer);
       function    GetFileName: string;
       function    GetFileName: string;
       destructor  Done; virtual;
       destructor  Done; virtual;
+      constructor Load(var S: TStream);
+      procedure   Store(var S: TStream);
     end;
     end;
 
 
     PSymbolMemInfo = ^TSymbolMemInfo;
     PSymbolMemInfo = ^TSymbolMemInfo;
@@ -96,6 +99,8 @@ type
       function    GetText: string;
       function    GetText: string;
       function    GetTypeName: string;
       function    GetTypeName: string;
       destructor  Done; virtual;
       destructor  Done; virtual;
+      constructor Load(var S: TStream);
+      procedure   Store(var S: TStream);
     end;
     end;
 
 
     PObjectSymbolCollection = ^TObjectSymbolCollection;
     PObjectSymbolCollection = ^TObjectSymbolCollection;
@@ -112,6 +117,8 @@ type
       function    GetDescendant(Index: sw_integer): PObjectSymbol;
       function    GetDescendant(Index: sw_integer): PObjectSymbol;
       procedure   AddDescendant(P: PObjectSymbol);
       procedure   AddDescendant(P: PObjectSymbol);
       destructor  Done; virtual;
       destructor  Done; virtual;
+      constructor Load(var S: TStream);
+      procedure   Store(S: TStream);
     private
     private
       Name: PString;
       Name: PString;
       Descendants: PObjectSymbolCollection;
       Descendants: PObjectSymbolCollection;
@@ -159,16 +166,83 @@ procedure CreateBrowserCol;
 procedure InitBrowserCol;
 procedure InitBrowserCol;
 procedure DoneBrowserCol;
 procedure DoneBrowserCol;
 
 
+function  LoadBrowserCol(S: PStream): boolean;
+procedure StoreBrowserCol(S: PStream);
+
 procedure BuildObjectInfo;
 procedure BuildObjectInfo;
 
 
 function SearchObjectForSymbol(O: PSymbol): PObjectSymbol;
 function SearchObjectForSymbol(O: PSymbol): PObjectSymbol;
 
 
+procedure RegisterSymbols;
+
 implementation
 implementation
 
 
 uses
 uses
-  Verbose,
+  Drivers,Views,App,
   aasm,globtype,globals,files,comphook;
   aasm,globtype,globals,files,comphook;
 
 
+const
+  RModuleNameCollection: TStreamRec = (
+     ObjType: 3001;
+     VmtLink: Ofs(TypeOf(TModuleNameCollection)^);
+     Load:    @TModuleNameCollection.Load;
+     Store:   @TModuleNameCollection.Store
+  );
+  RTypeNameCollection: TStreamRec = (
+     ObjType: 3002;
+     VmtLink: Ofs(TypeOf(TTypeNameCollection)^);
+     Load:    @TTypeNameCollection.Load;
+     Store:   @TTypeNameCollection.Store
+  );
+  RReference: TStreamRec = (
+     ObjType: 3003;
+     VmtLink: Ofs(TypeOf(TReference)^);
+     Load:    @TReference.Load;
+     Store:   @TReference.Store
+  );
+  RSymbol: TStreamRec = (
+     ObjType: 3004;
+     VmtLink: Ofs(TypeOf(TSymbol)^);
+     Load:    @TSymbol.Load;
+     Store:   @TSymbol.Store
+  );
+  RObjectSymbol: TStreamRec = (
+     ObjType: 3005;
+     VmtLink: Ofs(TypeOf(TObjectSymbol)^);
+     Load:    @TObjectSymbol.Load;
+     Store:   @TObjectSymbol.Store
+  );
+  RSymbolCollection: TStreamRec = (
+     ObjType: 3006;
+     VmtLink: Ofs(TypeOf(TSymbolCollection)^);
+     Load:    @TSymbolCollection.Load;
+     Store:   @TSymbolCollection.Store
+  );
+  RSortedSymbolCollection: TStreamRec = (
+     ObjType: 3007;
+     VmtLink: Ofs(TypeOf(TSortedSymbolCollection)^);
+     Load:    @TSortedSymbolCollection.Load;
+     Store:   @TSortedSymbolCollection.Store
+  );
+  RIDSortedSymbolCollection: TStreamRec = (
+     ObjType: 3008;
+     VmtLink: Ofs(TypeOf(TIDSortedSymbolCollection)^);
+     Load:    @TIDSortedSymbolCollection.Load;
+     Store:   @TIDSortedSymbolCollection.Store
+  );
+  RObjectSymbolCollection: TStreamRec = (
+     ObjType: 3009;
+     VmtLink: Ofs(TypeOf(TObjectSymbolCollection)^);
+     Load:    @TObjectSymbolCollection.Load;
+     Store:   @TObjectSymbolCollection.Store
+  );
+  RReferenceCollection: TStreamRec = (
+     ObjType: 3010;
+     VmtLink: Ofs(TypeOf(TReferenceCollection)^);
+     Load:    @TReferenceCollection.Load;
+     Store:   @TReferenceCollection.Store
+  );
+
 {****************************************************************************
 {****************************************************************************
                                    Helpers
                                    Helpers
 ****************************************************************************}
 ****************************************************************************}
@@ -273,13 +347,7 @@ begin
   S2:=Upper(K2^.GetName);
   S2:=Upper(K2^.GetName);
   if S1<S2 then R:=-1 else
   if S1<S2 then R:=-1 else
   if S1>S2 then R:=1 else
   if S1>S2 then R:=1 else
-    begin
-      S1:=K1^.GetName;
-      S2:=K2^.GetName;
-      if S1<S2 then R:=-1 else
-      if S1>S2 then R:=1 else
-       R:=0;
-    end;
+  R:=0;
   Compare:=R;
   Compare:=R;
 end;
 end;
 
 
@@ -306,12 +374,11 @@ begin
       OLI:=Left; ORI:=Right;
       OLI:=Left; ORI:=Right;
       Mid:=Left+(Right-Left) div 2;
       Mid:=Left+(Right-Left) div 2;
       LeftP:=At(Left); RightP:=At(Right); MidP:=At(Mid);
       LeftP:=At(Left); RightP:=At(Right); MidP:=At(Mid);
-      LeftS:=Upper(LeftP^.GetName);
-      MidS:=Upper(MidP^.GetName);
+      LeftS:=Upper(LeftP^.GetName); MidS:=Upper(MidP^.GetName);
       RightS:=Upper(RightP^.GetName);
       RightS:=Upper(RightP^.GetName);
       if copy(MidS,1,length(UpS))=UpS then
       if copy(MidS,1,length(UpS))=UpS then
         begin
         begin
-          Idx:=Mid; FoundS:=UpS{copy(MidS,1,length(S)) same and easier };
+          Idx:=Mid; FoundS:=copy(MidS,1,length(S));
         end;
         end;
 {      else}
 {      else}
         if UpS<MidS then
         if UpS<MidS then
@@ -375,13 +442,7 @@ begin
   S2:=Upper(K2^.GetName);
   S2:=Upper(K2^.GetName);
   if S1<S2 then R:=-1 else
   if S1<S2 then R:=-1 else
   if S1>S2 then R:=1 else
   if S1>S2 then R:=1 else
-    begin
-      S1:=K1^.GetName;
-      S2:=K2^.GetName;
-      if S1<S2 then R:=-1 else
-      if S1>S2 then R:=1 else
-       R:=0;
-    end;
+  R:=0;
   Compare:=R;
   Compare:=R;
 end;
 end;
 
 
@@ -403,12 +464,11 @@ begin
       OLI:=Left; ORI:=Right;
       OLI:=Left; ORI:=Right;
       Mid:=Left+(Right-Left) div 2;
       Mid:=Left+(Right-Left) div 2;
       LeftP:=At(Left); RightP:=At(Right); MidP:=At(Mid);
       LeftP:=At(Left); RightP:=At(Right); MidP:=At(Mid);
-      LeftS:=Upper(LeftP^.GetName);
-      MidS:=Upper(MidP^.GetName);
+      LeftS:=Upper(LeftP^.GetName); MidS:=Upper(MidP^.GetName);
       RightS:=Upper(RightP^.GetName);
       RightS:=Upper(RightP^.GetName);
       if copy(MidS,1,length(UpS))=UpS then
       if copy(MidS,1,length(UpS))=UpS then
         begin
         begin
-          Idx:=Mid; FoundS:=UpS;
+          Idx:=Mid; FoundS:=copy(MidS,1,length(S));
         end;
         end;
 {      else}
 {      else}
         if UpS<MidS then
         if UpS<MidS then
@@ -444,6 +504,21 @@ begin
   inherited Done;
   inherited Done;
 end;
 end;
 
 
+constructor TReference.Load(var S: TStream);
+begin
+  S.Read(Position, SizeOf(Position));
+
+  { --- items needing fixup --- }
+  S.Read(FileName, SizeOf(FileName)); { ->ModulesNames^.Item }
+end;
+
+procedure TReference.Store(var S: TStream);
+begin
+  S.Write(Position, SizeOf(Position));
+
+  { --- items needing fixup --- }
+  S.Write(FileName, SizeOf(FileName));
+end;
 
 
 {****************************************************************************
 {****************************************************************************
                                    TSymbol
                                    TSymbol
@@ -466,6 +541,7 @@ procedure TSymbol.SetMemInfo(const AMemInfo: TSymbolMemInfo);
 begin
 begin
   if MemInfo=nil then New(MemInfo);
   if MemInfo=nil then New(MemInfo);
   Move(AMemInfo,MemInfo^,SizeOf(MemInfo^));
   Move(AMemInfo,MemInfo^,SizeOf(MemInfo^));
+  Flags:=Flags or sfHasMemInfo;
 end;
 end;
 
 
 function TSymbol.GetReferenceCount: Sw_integer;
 function TSymbol.GetReferenceCount: Sw_integer;
@@ -586,6 +662,63 @@ begin
     DisposeStr(Ancestor);}
     DisposeStr(Ancestor);}
 end;
 end;
 
 
+constructor TSymbol.Load(var S: TStream);
+var MI: TSymbolMemInfo;
+    W: word;
+begin
+  TObject.Init;
+
+  S.Read(Typ,SizeOf(Typ));
+  S.Read(ObjectID, SizeOf(ObjectID));
+  S.Read(AncestorID, SizeOf(AncestorID));
+  S.Read(Flags, SizeOf(Flags));
+  Name:=S.ReadStr;
+  Params:=S.ReadStr;
+  if (Flags and sfHasMemInfo)<>0 then
+    begin
+      S.Read(MI,SizeOf(MI));
+      SetMemInfo(MI);
+    end;
+
+  W:=0;
+  S.Read(W,SizeOf(W));
+  if (W and 1)<>0 then
+    New(References, Load(S));
+  if (W and 2)<>0 then
+    New(Items, Load(S));
+
+  { --- items needing fixup --- }
+  S.Read(DType, SizeOf(DType));
+  S.Read(VType, SizeOf(VType));
+  S.Read(Ancestor, SizeOf(Ancestor));
+end;
+
+procedure TSymbol.Store(var S: TStream);
+var W: word;
+begin
+  S.Write(Typ,SizeOf(Typ));
+  S.Write(ObjectID, SizeOf(ObjectID));
+  S.Write(AncestorID, SizeOf(AncestorID));
+  S.Write(Flags, SizeOf(Flags));
+  S.WriteStr(Name);
+  S.WriteStr(Params);
+
+  if (Flags and sfHasMemInfo)<>0 then
+    S.Write(MemInfo^,SizeOf(MemInfo^));
+
+  W:=0;
+  if Assigned(References) then W:=W or 1;
+  if Assigned(Items) then W:=W or 2;
+  S.Write(W,SizeOf(W));
+  if Assigned(References) then References^.Store(S);
+  if Assigned(Items) then Items^.Store(S);
+
+  { --- items needing fixup --- }
+  S.Write(DType, SizeOf(DType));
+  S.Write(VType, SizeOf(VType));
+  S.Write(Ancestor, SizeOf(Ancestor));
+end;
+
 
 
 constructor TObjectSymbol.Init(AParent: PObjectSymbol; ASymbol: PSymbol);
 constructor TObjectSymbol.Init(AParent: PObjectSymbol; ASymbol: PSymbol);
 begin
 begin
@@ -635,6 +768,15 @@ begin
   inherited Done;
   inherited Done;
 end;
 end;
 
 
+constructor TObjectSymbol.Load(var S: TStream);
+begin
+end;
+
+procedure TObjectSymbol.Store(S: TStream);
+begin
+end;
+
+
 {*****************************************************************************
 {*****************************************************************************
                               Main Routines
                               Main Routines
 *****************************************************************************}
 *****************************************************************************}
@@ -990,12 +1132,6 @@ procedure CreateBrowserCol;
             begin
             begin
               with pprocsym(sym)^ do
               with pprocsym(sym)^ do
               if assigned(definition) then
               if assigned(definition) then
-               if assigned(definition^.nextoverloaded) then
-                begin
-                  { Several overloaded functions } 
-                  Symbol^.Params:=TypeNames^.Add('...');
-                end
-               else
               begin
               begin
                 if cs_local_browser in aktmoduleswitches then
                 if cs_local_browser in aktmoduleswitches then
                   ProcessSymTable(Symbol,Symbol^.Items,definition^.parast);
                   ProcessSymTable(Symbol,Symbol^.Items,definition^.parast);
@@ -1067,15 +1203,7 @@ procedure CreateBrowserCol;
             Ref:=Ref^.nextref;
             Ref:=Ref^.nextref;
           end;
           end;
         if Assigned(Symbol) then
         if Assigned(Symbol) then
-          begin
-             If Not Owner^.Search(Symbol,i) then
-               Owner^.Insert(Symbol)
-             else
-               begin
-                 Comment(V_Warning,sym^.name+' already in SymbolCollection '+sym^.owner^.name^);
-                 dispose(Symbol,Done);
-               end;
-          end;
+          Owner^.Insert(Symbol);
         sym:=psym(sym^.next);
         sym:=psym(sym^.next);
       end;
       end;
   end;
   end;
@@ -1249,8 +1377,205 @@ end;
 procedure DoneBrowserCol;
 procedure DoneBrowserCol;
 begin
 begin
   { nothing, the collections are freed in the exitproc }
   { nothing, the collections are freed in the exitproc }
+  { nothing? then why do we've this routine? IMHO, either we should remove this,
+    or it should destroy the browser info when it's called. - Gabor }
+end;
+
+type
+     PPointerXRef = ^TPointerXRef;
+     TPointerXRef = record
+       PtrValue : pointer;
+       DataPtr  : pointer;
+     end;
+
+     PPointerDictionary = ^TPointerDictionary;
+     TPointerDictionary = object(TSortedCollection)
+       function  At(Index: sw_Integer): PPointerXRef;
+       function  Compare(Key1, Key2: Pointer): sw_Integer; virtual;
+       procedure FreeItem(Item: Pointer); virtual;
+       function  SearchXRef(PtrValue: pointer): PPointerXRef;
+       function  AddPtr(PtrValue, DataPtr: pointer): PPointerXRef;
+       procedure Resolve(var P);
+     end;
+
+function NewPointerXRef(APtrValue, ADataPtr: pointer): PPointerXRef;
+var P: PPointerXRef;
+begin
+  New(P); FillChar(P^,SizeOf(P^),0);
+  with P^ do begin PtrValue:=APtrValue; DataPtr:=ADataPtr; end;
+  NewPointerXRef:=P;
+end;
+
+procedure DisposePointerXRef(P: PPointerXRef);
+begin
+  if Assigned(P) then Dispose(P);
+end;
+
+function TPointerDictionary.At(Index: sw_Integer): PPointerXRef;
+begin
+  At:=inherited At(Index);
+end;
+
+function TPointerDictionary.Compare(Key1, Key2: Pointer): sw_Integer;
+var K1: PPointerXRef absolute Key1;
+    K2: PPointerXRef absolute Key2;
+    R: integer;
+begin
+  if longint(K1^.PtrValue)<longint(K2^.PtrValue) then R:=-1 else
+  if longint(K1^.PtrValue)>longint(K2^.PtrValue) then R:= 1 else
+  R:=0;
+  Compare:=R;
+end;
+
+procedure TPointerDictionary.FreeItem(Item: Pointer);
+begin
+  if Assigned(Item) then DisposePointerXRef(Item);
+end;
+
+function TPointerDictionary.SearchXRef(PtrValue: pointer): PPointerXRef;
+var P: PPointerXRef;
+    T: TPointerXRef;
+    Index: sw_integer;
+begin
+  T.PtrValue:=PtrValue;
+  if Search(@T,Index)=false then P:=nil else
+    P:=At(Index);
+  SearchXRef:=P;
+end;
+
+function TPointerDictionary.AddPtr(PtrValue, DataPtr: pointer): PPointerXRef;
+var P: PPointerXRef;
+begin
+  P:=NewPointerXRef(PtrValue,DataPtr);
+  Insert(P);
+  AddPtr:=P;
 end;
 end;
 
 
+procedure TPointerDictionary.Resolve(var P);
+var X: PPointerXRef;
+    V: pointer;
+begin
+  Move(P,V,SizeOf(V));
+  X:=SearchXRef(V);
+  if X=nil then V:=nil else
+    V:=X^.DataPtr;
+  Move(V,P,SizeOf(V));
+end;
+
+procedure ReadPointers(S: PStream; C: PCollection; D: PPointerDictionary);
+var W,I: sw_integer;
+    P: pointer;
+begin
+  S^.Read(W,SizeOf(W));
+  for I:=0 to W-1 do
+  begin
+    S^.Read(P,SizeOf(P));
+    D^.AddPtr(P,C^.At(I));
+  end;
+end;
+
+function LoadBrowserCol(S: PStream): boolean;
+var PD: PPointerDictionary;
+procedure FixupPointers;
+procedure FixupReference(P: PReference); {$ifndef FPC}far;{$endif}
+begin
+  PD^.Resolve(P^.FileName);
+end;
+procedure FixupSymbol(P: PSymbol); {$ifndef FPC}far;{$endif}
+var I: sw_integer;
+begin
+  PD^.Resolve(P^.DType);
+  PD^.Resolve(P^.VType);
+  PD^.Resolve(P^.Ancestor);
+  if Assigned(P^.References) then
+    with P^.References^ do
+     for I:=0 to Count-1 do
+       FixupReference(At(I));
+  if Assigned(P^.Items) then
+    with P^.Items^ do
+     for I:=0 to Count-1 do
+       FixupSymbol(At(I));
+end;
+begin
+  Modules^.ForEach(@FixupSymbol);
+end;
+procedure ReadSymbolPointers(P: PSymbol); {$ifndef FPC}far;{$endif}
+var I: sw_integer;
+    PV: pointer;
+begin
+  S^.Read(PV, SizeOf(PV));
+  PD^.AddPtr(PV,P);
+  if Assigned(P^.Items) then
+    with P^.Items^ do
+     for I:=0 to Count-1 do
+       ReadSymbolPointers(At(I));
+end;
+begin
+  DisposeBrowserCol;
+
+  New(ModuleNames, Load(S^));
+  New(TypeNames, Load(S^));
+  New(Modules, Load(S^));
+
+  New(PD, Init(4000,1000));
+  ReadPointers(S,ModuleNames,PD);
+  ReadPointers(S,TypeNames,PD);
+  ReadPointers(S,Modules,PD);
+  Modules^.ForEach(@ReadSymbolPointers);
+  FixupPointers;
+  Dispose(PD, Done);
+
+  BuildObjectInfo;
+end;
+
+procedure StorePointers(S: PStream; C: PCollection);
+var W,I: sw_integer;
+    P: pointer;
+begin
+  W:=C^.Count;
+  S^.Write(W,SizeOf(W));
+  for I:=0 to W-1 do
+  begin
+    P:=C^.At(I);
+    S^.Write(P,SizeOf(P));
+  end;
+end;
+
+procedure StoreBrowserCol(S: PStream);
+procedure WriteSymbolPointers(P: PSymbol); {$ifndef FPC}far;{$endif}
+var I: sw_integer;
+begin
+  S^.Write(P, SizeOf(P));
+  if Assigned(P^.Items) then
+    with P^.Items^ do
+     for I:=0 to Count-1 do
+       WriteSymbolPointers(At(I));
+end;
+var W: sw_integer;
+begin
+  ModuleNames^.Store(S^);
+  TypeNames^.Store(S^);
+  Modules^.Store(S^);
+
+  StorePointers(S,ModuleNames);
+  StorePointers(S,TypeNames);
+  StorePointers(S,Modules);
+  Modules^.ForEach(@WriteSymbolPointers);
+end;
+
+procedure RegisterSymbols;
+begin
+  RegisterType(RModuleNameCollection);
+  RegisterType(RTypeNameCollection);
+  RegisterType(RReference);
+  RegisterType(RSymbol);
+  RegisterType(RObjectSymbol);
+  RegisterType(RSymbolCollection);
+  RegisterType(RSortedSymbolCollection);
+  RegisterType(RIDSortedSymbolCollection);
+  RegisterType(RObjectSymbolCollection);
+  RegisterType(RReferenceCollection);
+end;
 
 
 begin
 begin
   oldexit:=exitproc;
   oldexit:=exitproc;
@@ -1258,20 +1583,9 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.19  1999-07-15 08:42:22  michael
-  + Removed TV stuff from brwosercol
-
-  Revision 1.18  1999/06/25 00:27:41  pierre
-   merged from fixes-0_99_12
-
-  Revision 1.16.2.1  1999/06/25 00:22:23  pierre
-    * avoid problem with lowercase symbols
-      (compare returns zero only if excat match,
-       ordering is first done case unsensitive
-       for a correct browser order)
-      this solves memory leaks :
-      TV and FV do not delete not inserted items in
-      a sorted collection without duplicates (is this a bug or a feature ?)
+  Revision 1.20  1999-08-03 22:02:29  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
 
 
   Revision 1.17  1999/06/22 16:24:39  pierre
   Revision 1.17  1999/06/22 16:24:39  pierre
    * local browser stuff corrected
    * local browser stuff corrected

+ 9 - 5
compiler/browlog.pas

@@ -346,9 +346,9 @@ implementation
                      if ptypesym(sym)^.definition^.deftype in [recorddef,objectdef] then
                      if ptypesym(sym)^.definition^.deftype in [recorddef,objectdef] then
                        begin
                        begin
                           if ptypesym(sym)^.definition^.deftype=recorddef then
                           if ptypesym(sym)^.definition^.deftype=recorddef then
-                            symt:=precdef(ptypesym(sym)^.definition)^.symtable
+                            symt:=precorddef(ptypesym(sym)^.definition)^.symtable
                           else
                           else
-                            symt:=pobjectdef(ptypesym(sym)^.definition)^.publicsyms;
+                            symt:=pobjectdef(ptypesym(sym)^.definition)^.symtable;
                           sym:=symt^.search(ss);
                           sym:=symt^.search(ss);
                           if sym=nil then
                           if sym=nil then
                             sym:=symt^.search(upper(ss));
                             sym:=symt^.search(upper(ss));
@@ -359,9 +359,9 @@ implementation
                      if pvarsym(sym)^.definition^.deftype in [recorddef,objectdef] then
                      if pvarsym(sym)^.definition^.deftype in [recorddef,objectdef] then
                        begin
                        begin
                           if pvarsym(sym)^.definition^.deftype=recorddef then
                           if pvarsym(sym)^.definition^.deftype=recorddef then
-                            symt:=precdef(pvarsym(sym)^.definition)^.symtable
+                            symt:=precorddef(pvarsym(sym)^.definition)^.symtable
                           else
                           else
-                            symt:=pobjectdef(pvarsym(sym)^.definition)^.publicsyms;
+                            symt:=pobjectdef(pvarsym(sym)^.definition)^.symtable;
                           sym:=symt^.search(ss);
                           sym:=symt^.search(ss);
                           if sym=nil then
                           if sym=nil then
                             sym:=symt^.search(upper(ss));
                             sym:=symt^.search(upper(ss));
@@ -448,7 +448,11 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.1  1999-01-12 14:25:24  peter
+  Revision 1.2  1999-08-03 22:02:30  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.1  1999/01/12 14:25:24  peter
     + BrowserLog for browser.log generation
     + BrowserLog for browser.log generation
     + BrowserCol for browser info in TCollections
     + BrowserCol for browser info in TCollections
     * released all other UseBrowser
     * released all other UseBrowser

+ 8 - 4
compiler/cg386add.pas

@@ -35,7 +35,7 @@ implementation
     uses
     uses
       globtype,systems,
       globtype,systems,
       cobjects,verbose,globals,
       cobjects,verbose,globals,
-      symtable,aasm,types,
+      symconst,symtable,aasm,types,
       hcodegen,temp_gen,pass_2,
       hcodegen,temp_gen,pass_2,
       i386base,i386asm,
       i386base,i386asm,
       cgai386,tgeni386;
       cgai386,tgeni386;
@@ -815,9 +815,9 @@ implementation
                  (p^.right^.resulttype^.deftype=pointerdef) or
                  (p^.right^.resulttype^.deftype=pointerdef) or
 
 
                  ((p^.right^.resulttype^.deftype=objectdef) and
                  ((p^.right^.resulttype^.deftype=objectdef) and
-                  pobjectdef(p^.right^.resulttype)^.isclass and
+                  pobjectdef(p^.right^.resulttype)^.is_class and
                  (p^.left^.resulttype^.deftype=objectdef) and
                  (p^.left^.resulttype^.deftype=objectdef) and
-                  pobjectdef(p^.left^.resulttype)^.isclass
+                  pobjectdef(p^.left^.resulttype)^.is_class
                  ) or
                  ) or
 
 
                  (p^.left^.resulttype^.deftype=classrefdef) or
                  (p^.left^.resulttype^.deftype=classrefdef) or
@@ -2091,7 +2091,11 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.69  1999-07-05 20:13:06  peter
+  Revision 1.70  1999-08-03 22:02:31  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.69  1999/07/05 20:13:06  peter
     * removed temp defines
     * removed temp defines
 
 
   Revision 1.68  1999/07/02 12:18:46  jonas
   Revision 1.68  1999/07/02 12:18:46  jonas

+ 78 - 64
compiler/cg386cal.pas

@@ -39,7 +39,7 @@ implementation
     uses
     uses
       globtype,systems,
       globtype,systems,
       cobjects,verbose,globals,
       cobjects,verbose,globals,
-      aasm,types,
+      symconst,aasm,types,
 {$ifdef GDB}
 {$ifdef GDB}
       gdb,
       gdb,
 {$endif GDB}
 {$endif GDB}
@@ -244,7 +244,7 @@ implementation
 
 
          if not assigned(p^.procdefinition) then
          if not assigned(p^.procdefinition) then
           exit;
           exit;
-         if (p^.procdefinition^.options and poinline)<>0 then
+         if (pocall_inline in p^.procdefinition^.proccalloptions) then
            begin
            begin
               inlined:=true;
               inlined:=true;
               inlinecode:=p^.right;
               inlinecode:=p^.right;
@@ -265,20 +265,23 @@ implementation
               p^.right:=nil;
               p^.right:=nil;
               { disable further inlining of the same proc
               { disable further inlining of the same proc
                 in the args }
                 in the args }
-              p^.procdefinition^.options:=p^.procdefinition^.options and (not poinline);
+{$ifdef INCLUDEOK}
+              exclude(p^.procdefinition^.proccalloptions,pocall_inline);
+{$else}
+              p^.procdefinition^.proccalloptions:=p^.procdefinition^.proccalloptions-[pocall_inline];
+{$endif}
            end;
            end;
          { only if no proc var }
          { only if no proc var }
          if not(assigned(p^.right)) then
          if not(assigned(p^.right)) then
-           is_con_or_destructor:=((p^.procdefinition^.options and poconstructor)<>0)
-             or ((p^.procdefinition^.options and podestructor)<>0);
+           is_con_or_destructor:=(p^.procdefinition^.proctypeoption in [potype_constructor,potype_destructor]);
          { proc variables destroy all registers }
          { proc variables destroy all registers }
          if (p^.right=nil) and
          if (p^.right=nil) and
             { virtual methods too }
             { virtual methods too }
-            ((p^.procdefinition^.options and povirtualmethod)=0) then
+            not(po_virtualmethod in p^.procdefinition^.procoptions) then
            begin
            begin
-              if ((p^.procdefinition^.options and poiocheck)<>0) and
-                 ((aktprocsym^.definition^.options and poiocheck)=0) and
-                 (cs_check_io in aktlocalswitches) then
+              if (cs_check_io in aktlocalswitches) and
+                 (po_iocheck in p^.procdefinition^.procoptions) and
+                 not(po_iocheck in aktprocsym^.definition^.procoptions) then
                 begin
                 begin
                    getlabel(iolabel);
                    getlabel(iolabel);
                    emitlab(iolabel);
                    emitlab(iolabel);
@@ -361,12 +364,18 @@ implementation
                 para_offset:=0;
                 para_offset:=0;
               if assigned(p^.right) then
               if assigned(p^.right) then
                 secondcallparan(p^.left,pabstractprocdef(p^.right^.resulttype)^.para1,
                 secondcallparan(p^.left,pabstractprocdef(p^.right^.resulttype)^.para1,
-                  (p^.procdefinition^.options and poleftright)<>0,
-                  inlined,(p^.procdefinition^.options and (pocdecl or postdcall))<>0,para_offset)
+                  (pocall_leftright in p^.procdefinition^.proccalloptions),
+                  inlined,
+                  (pocall_cdecl in p^.procdefinition^.proccalloptions) or
+                   (pocall_stdcall in p^.procdefinition^.proccalloptions),
+                  para_offset)
               else
               else
                 secondcallparan(p^.left,p^.procdefinition^.para1,
                 secondcallparan(p^.left,p^.procdefinition^.para1,
-                  (p^.procdefinition^.options and poleftright)<>0,
-                  inlined,(p^.procdefinition^.options and (pocdecl or postdcall))<>0,para_offset);
+                  (pocall_leftright in p^.procdefinition^.proccalloptions),
+                  inlined,
+                  (pocall_cdecl in p^.procdefinition^.proccalloptions) or
+                   (pocall_stdcall in p^.procdefinition^.proccalloptions),
+                  para_offset);
            end;
            end;
          params:=p^.left;
          params:=p^.left;
          p^.left:=nil;
          p^.left:=nil;
@@ -420,7 +429,7 @@ implementation
                      end; }
                      end; }
                    r^:=ptree(pwithsymtable(p^.symtable)^.withnode)^.withreference^;
                    r^:=ptree(pwithsymtable(p^.symtable)^.withnode)^.withreference^;
                    if (not pwithsymtable(p^.symtable)^.direct_with) or
                    if (not pwithsymtable(p^.symtable)^.direct_with) or
-                      pobjectdef(p^.methodpointer^.resulttype)^.isclass then
+                      pobjectdef(p^.methodpointer^.resulttype)^.is_class then
                      exprasmlist^.concat(new(pai386,op_ref_reg(A_MOV,S_L,r,R_ESI)))
                      exprasmlist^.concat(new(pai386,op_ref_reg(A_MOV,S_L,r,R_ESI)))
                    else
                    else
                      exprasmlist^.concat(new(pai386,op_ref_reg(A_LEA,S_L,r,R_ESI)));
                      exprasmlist^.concat(new(pai386,op_ref_reg(A_LEA,S_L,r,R_ESI)));
@@ -447,7 +456,7 @@ implementation
                                typen:
                                typen:
                                  begin
                                  begin
                                     { direct call to inherited method }
                                     { direct call to inherited method }
-                                    if (p^.procdefinition^.options and poabstractmethod)<>0 then
+                                    if (po_abstractmethod in p^.procdefinition^.procoptions) then
                                       begin
                                       begin
                                          CGMessage(cg_e_cant_call_abstract_method);
                                          CGMessage(cg_e_cant_call_abstract_method);
                                          goto dont_call;
                                          goto dont_call;
@@ -455,20 +464,20 @@ implementation
                                     { generate no virtual call }
                                     { generate no virtual call }
                                     no_virtual_call:=true;
                                     no_virtual_call:=true;
 
 
-                                    if (p^.symtableprocentry^.properties and sp_static)<>0 then
+                                    if (sp_static in p^.symtableprocentry^.symoptions) then
                                       begin
                                       begin
                                          { well lets put the VMT address directly into ESI }
                                          { well lets put the VMT address directly into ESI }
                                          { it is kind of dirty but that is the simplest    }
                                          { it is kind of dirty but that is the simplest    }
                                          { way to accept virtual static functions (PM)     }
                                          { way to accept virtual static functions (PM)     }
                                          loadesi:=true;
                                          loadesi:=true;
                                          { if no VMT just use $0 bug0214 PM }
                                          { if no VMT just use $0 bug0214 PM }
-                                         if (pobjectdef(p^.methodpointer^.resulttype)^.options and oo_hasvmt)=0 then
+                                         if not(oo_has_vmt in pobjectdef(p^.methodpointer^.resulttype)^.objectoptions) then
                                            exprasmlist^.concat(new(pai386,op_const_reg(A_MOV,S_L,0,R_ESI)))
                                            exprasmlist^.concat(new(pai386,op_const_reg(A_MOV,S_L,0,R_ESI)))
                                          else
                                          else
                                            begin
                                            begin
                                              exprasmlist^.concat(new(pai386,op_sym_ofs_reg(A_MOV,S_L,
                                              exprasmlist^.concat(new(pai386,op_sym_ofs_reg(A_MOV,S_L,
-                                               newasmsymbol(pobjectdef(
-                                               p^.methodpointer^.resulttype)^.vmt_mangledname),0,R_ESI)));
+                                               newasmsymbol(pobjectdef(p^.methodpointer^.resulttype)^.vmt_mangledname),
+                                               0,R_ESI)));
                                            end;
                                            end;
                                          { exprasmlist^.concat(new(pai386,op_reg(A_PUSH,S_L,R_ESI)));
                                          { exprasmlist^.concat(new(pai386,op_reg(A_PUSH,S_L,R_ESI)));
                                            this is done below !! }
                                            this is done below !! }
@@ -478,19 +487,18 @@ implementation
                                       loadesi:=false;
                                       loadesi:=false;
 
 
                                     { a class destructor needs a flag }
                                     { a class destructor needs a flag }
-                                    if pobjectdef(p^.methodpointer^.resulttype)^.isclass and
-                                        assigned(aktprocsym) and
-                                        ((aktprocsym^.definition^.options and
-                                        (podestructor))<>0) then
-                                        begin
-                                           push_int(0);
-                                           exprasmlist^.concat(new(pai386,op_reg(A_PUSH,S_L,R_ESI)));
-                                        end;
+                                    if pobjectdef(p^.methodpointer^.resulttype)^.is_class and
+                                       assigned(aktprocsym) and
+                                       (aktprocsym^.definition^.proctypeoption=potype_destructor) then
+                                      begin
+                                        push_int(0);
+                                        exprasmlist^.concat(new(pai386,op_reg(A_PUSH,S_L,R_ESI)));
+                                      end;
 
 
                                     if not(is_con_or_destructor and
                                     if not(is_con_or_destructor and
-                                           pobjectdef(p^.methodpointer^.resulttype)^.isclass and
+                                           pobjectdef(p^.methodpointer^.resulttype)^.is_class and
                                            assigned(aktprocsym) and
                                            assigned(aktprocsym) and
-                                           ((aktprocsym^.definition^.options and (poconstructor or podestructor))<>0)
+                                           (aktprocsym^.definition^.proctypeoption in [potype_constructor,potype_destructor])
                                           ) then
                                           ) then
                                       exprasmlist^.concat(new(pai386,op_reg(A_PUSH,S_L,R_ESI)));
                                       exprasmlist^.concat(new(pai386,op_reg(A_PUSH,S_L,R_ESI)));
                                     { if an inherited con- or destructor should be  }
                                     { if an inherited con- or destructor should be  }
@@ -498,20 +506,18 @@ implementation
                                     { will be made                                }
                                     { will be made                                }
                                     { con- and destructors need a pointer to the vmt }
                                     { con- and destructors need a pointer to the vmt }
                                     if is_con_or_destructor and
                                     if is_con_or_destructor and
-                                    not(pobjectdef(p^.methodpointer^.resulttype)^.isclass) and
+                                    not(pobjectdef(p^.methodpointer^.resulttype)^.is_class) and
                                     assigned(aktprocsym) then
                                     assigned(aktprocsym) then
                                       begin
                                       begin
-                                         if not ((aktprocsym^.definition^.options
-                                           and (poconstructor or podestructor))<>0) then
-
+                                         if not(aktprocsym^.definition^.proctypeoption in
+                                                [potype_constructor,potype_destructor]) then
                                           CGMessage(cg_w_member_cd_call_from_method);
                                           CGMessage(cg_w_member_cd_call_from_method);
                                       end;
                                       end;
                                     { class destructors get there flag below }
                                     { class destructors get there flag below }
                                     if is_con_or_destructor and
                                     if is_con_or_destructor and
-                                        not(pobjectdef(p^.methodpointer^.resulttype)^.isclass and
+                                        not(pobjectdef(p^.methodpointer^.resulttype)^.is_class and
                                         assigned(aktprocsym) and
                                         assigned(aktprocsym) and
-                                        ((aktprocsym^.definition^.options and
-                                        (podestructor))<>0)) then
+                                        (aktprocsym^.definition^.proctypeoption=potype_destructor)) then
                                       push_int(0);
                                       push_int(0);
                                  end;
                                  end;
                                hnewn:
                                hnewn:
@@ -555,7 +561,7 @@ implementation
                                               begin
                                               begin
                                                  if (p^.methodpointer^.resulttype^.deftype=classrefdef) or
                                                  if (p^.methodpointer^.resulttype^.deftype=classrefdef) or
                                                     ((p^.methodpointer^.resulttype^.deftype=objectdef) and
                                                     ((p^.methodpointer^.resulttype^.deftype=objectdef) and
-                                                   pobjectdef(p^.methodpointer^.resulttype)^.isclass) then
+                                                   pobjectdef(p^.methodpointer^.resulttype)^.is_class) then
                                                    exprasmlist^.concat(new(pai386,op_ref_reg(A_MOV,S_L,
                                                    exprasmlist^.concat(new(pai386,op_ref_reg(A_MOV,S_L,
                                                      newreference(p^.methodpointer^.location.reference),R_ESI)))
                                                      newreference(p^.methodpointer^.location.reference),R_ESI)))
                                                  else
                                                  else
@@ -567,10 +573,10 @@ implementation
                                       end;
                                       end;
                                     { when calling a class method, we have to load ESI with the VMT !
                                     { when calling a class method, we have to load ESI with the VMT !
                                       But, not for a class method via self }
                                       But, not for a class method via self }
-                                    if ((p^.procdefinition^.options and pocontainsself)=0) then
+                                    if not(po_containsself in p^.procdefinition^.procoptions) then
                                       begin
                                       begin
-                                        if ((p^.procdefinition^.options and poclassmethod)<>0)
-                                           and not(p^.methodpointer^.resulttype^.deftype=classrefdef) then
+                                        if (po_classmethod in p^.procdefinition^.procoptions) and
+                                           not(p^.methodpointer^.resulttype^.deftype=classrefdef) then
                                           begin
                                           begin
                                              { class method needs current VMT }
                                              { class method needs current VMT }
                                              new(r);
                                              new(r);
@@ -581,15 +587,15 @@ implementation
                                           end;
                                           end;
 
 
                                         { direct call to destructor: don't remove data! }
                                         { direct call to destructor: don't remove data! }
-                                        if ((p^.procdefinition^.options and podestructor)<>0) and
-                                          (p^.methodpointer^.resulttype^.deftype=objectdef) and
-                                          (pobjectdef(p^.methodpointer^.resulttype)^.isclass) then
+                                        if (p^.procdefinition^.proctypeoption=potype_destructor) and
+                                           (p^.methodpointer^.resulttype^.deftype=objectdef) and
+                                           (pobjectdef(p^.methodpointer^.resulttype)^.is_class) then
                                           exprasmlist^.concat(new(pai386,op_const(A_PUSH,S_L,1)));
                                           exprasmlist^.concat(new(pai386,op_const(A_PUSH,S_L,1)));
 
 
                                         { direct call to class constructor, don't allocate memory }
                                         { direct call to class constructor, don't allocate memory }
-                                        if ((p^.procdefinition^.options and poconstructor)<>0) and
-                                          (p^.methodpointer^.resulttype^.deftype=objectdef) and
-                                          (pobjectdef(p^.methodpointer^.resulttype)^.isclass) then
+                                        if (p^.procdefinition^.proctypeoption=potype_constructor) and
+                                           (p^.methodpointer^.resulttype^.deftype=objectdef) and
+                                           (pobjectdef(p^.methodpointer^.resulttype)^.is_class) then
                                           exprasmlist^.concat(new(pai386,op_const(A_PUSH,S_L,0)))
                                           exprasmlist^.concat(new(pai386,op_const(A_PUSH,S_L,0)))
                                         else
                                         else
                                           exprasmlist^.concat(new(pai386,op_reg(A_PUSH,S_L,R_ESI)));
                                           exprasmlist^.concat(new(pai386,op_reg(A_PUSH,S_L,R_ESI)));
@@ -599,9 +605,9 @@ implementation
                                       begin
                                       begin
                                          { classes don't get a VMT pointer pushed }
                                          { classes don't get a VMT pointer pushed }
                                          if (p^.methodpointer^.resulttype^.deftype=objectdef) and
                                          if (p^.methodpointer^.resulttype^.deftype=objectdef) and
-                                           not(pobjectdef(p^.methodpointer^.resulttype)^.isclass) then
+                                           not(pobjectdef(p^.methodpointer^.resulttype)^.is_class) then
                                            begin
                                            begin
-                                              if ((p^.procdefinition^.options and poconstructor)<>0) then
+                                              if (p^.procdefinition^.proctypeoption=potype_constructor) then
                                                 begin
                                                 begin
                                                    { it's no bad idea, to insert the VMT }
                                                    { it's no bad idea, to insert the VMT }
                                                    exprasmlist^.concat(new(pai386,op_sym(A_PUSH,S_L,newasmsymbol(
                                                    exprasmlist^.concat(new(pai386,op_sym(A_PUSH,S_L,newasmsymbol(
@@ -619,10 +625,10 @@ implementation
                      end
                      end
                    else
                    else
                      begin
                      begin
-                        if ((p^.procdefinition^.options and poclassmethod)<>0) and
+                        if (po_classmethod in p^.procdefinition^.procoptions) and
                           not(
                           not(
                             assigned(aktprocsym) and
                             assigned(aktprocsym) and
-                            ((aktprocsym^.definition^.options and poclassmethod)<>0)
+                            (po_classmethod in aktprocsym^.definition^.procoptions)
                           ) then
                           ) then
                           begin
                           begin
                              { class method needs current VMT }
                              { class method needs current VMT }
@@ -701,7 +707,7 @@ implementation
                      internalerror(25000);
                      internalerror(25000);
                 end;
                 end;
 
 
-              if ((p^.procdefinition^.options and povirtualmethod)<>0) and
+              if (po_virtualmethod in p^.procdefinition^.procoptions) and
                  not(no_virtual_call) then
                  not(no_virtual_call) then
                 begin
                 begin
                    { static functions contain the vmt_address in ESI }
                    { static functions contain the vmt_address in ESI }
@@ -710,14 +716,14 @@ implementation
                    { on the methodpointer                        PM }
                    { on the methodpointer                        PM }
                    if assigned(aktprocsym) then
                    if assigned(aktprocsym) then
                      begin
                      begin
-                       if ((((aktprocsym^.properties and sp_static)<>0) or
-                        ((aktprocsym^.definition^.options and poclassmethod)<>0)) and
+                       if (((sp_static in aktprocsym^.symoptions) or
+                        (po_classmethod in aktprocsym^.definition^.procoptions)) and
                         ((p^.methodpointer=nil) or (p^.methodpointer^.treetype=typen)))
                         ((p^.methodpointer=nil) or (p^.methodpointer^.treetype=typen)))
                         or
                         or
-                        ((p^.procdefinition^.options and postaticmethod)<>0) or
-                        ((p^.procdefinition^.options and poconstructor)<>0) or
+                        (po_staticmethod in p^.procdefinition^.procoptions) or
+                        (p^.procdefinition^.proctypeoption=potype_constructor) or
                         { ESI is loaded earlier }
                         { ESI is loaded earlier }
-                        ((p^.procdefinition^.options and poclassmethod)<>0)then
+                        (po_classmethod in p^.procdefinition^.procoptions) then
                          begin
                          begin
                             new(r);
                             new(r);
                             reset_reference(r^);
                             reset_reference(r^);
@@ -751,7 +757,7 @@ implementation
                      end;
                      end;
                    }
                    }
                    if pprocdef(p^.procdefinition)^.extnumber=-1 then
                    if pprocdef(p^.procdefinition)^.extnumber=-1 then
-                        internalerror($Da);
+                     internalerror(44584);
                    r^.offset:=pprocdef(p^.procdefinition)^.extnumber*4+12;
                    r^.offset:=pprocdef(p^.procdefinition)^.extnumber*4+12;
 {$ifndef TESTOBJEXT}
 {$ifndef TESTOBJEXT}
                    if (cs_check_range in aktlocalswitches) then
                    if (cs_check_range in aktlocalswitches) then
@@ -776,7 +782,11 @@ implementation
                 { inlined code is in inlinecode }
                 { inlined code is in inlinecode }
                 begin
                 begin
                    { set poinline again }
                    { set poinline again }
-                   p^.procdefinition^.options:=p^.procdefinition^.options or poinline;
+{$ifdef INCLUDEOK}
+                   include(p^.procdefinition^.proccalloptions,pocall_inline);
+{$else}
+                   p^.procdefinition^.proccalloptions:=p^.procdefinition^.proccalloptions+[pocall_inline];
+{$endif}
                    { process the inlinecode }
                    { process the inlinecode }
                    secondpass(inlinecode);
                    secondpass(inlinecode);
                    { free the args }
                    { free the args }
@@ -788,7 +798,7 @@ implementation
            begin
            begin
               secondpass(p^.right);
               secondpass(p^.right);
               { method pointer ? }
               { method pointer ? }
-              if (p^.procdefinition^.options and pomethodpointer)<>0 then
+              if (po_methodpointer in p^.procdefinition^.procoptions) then
                 begin
                 begin
                    { method pointer can't be in a register }
                    { method pointer can't be in a register }
                    hregister:=R_NO;
                    hregister:=R_NO;
@@ -806,7 +816,7 @@ implementation
                      end;
                      end;
 
 
 
 
-                   if ((p^.procdefinition^.options and pocontainsself)=0) then
+                   if (po_containsself in p^.procdefinition^.procoptions) then
                      begin
                      begin
                        { load ESI }
                        { load ESI }
                        inc(p^.right^.location.reference.offset,4);
                        inc(p^.right^.location.reference.offset,4);
@@ -842,7 +852,7 @@ implementation
            { this was only for normal functions
            { this was only for normal functions
              displaced here so we also get
              displaced here so we also get
              it to work for procvars PM }
              it to work for procvars PM }
-           if (not inlined) and ((p^.procdefinition^.options and poclearstack)<>0) then
+           if (not inlined) and (pocall_clearstack in p^.procdefinition^.proccalloptions) then
              begin
              begin
                 { consider the alignment with the rest (PM) }
                 { consider the alignment with the rest (PM) }
                 inc(pushedparasize,pop_size);
                 inc(pushedparasize,pop_size);
@@ -883,7 +893,7 @@ implementation
            begin
            begin
               { a contructor could be a function with boolean result }
               { a contructor could be a function with boolean result }
               if (p^.right=nil) and
               if (p^.right=nil) and
-                 ((p^.procdefinition^.options and poconstructor)<>0) and
+                 (p^.procdefinition^.proctypeoption=potype_constructor) and
                  { quick'n'dirty check if it is a class or an object }
                  { quick'n'dirty check if it is a class or an object }
                  (p^.resulttype^.deftype=orddef) then
                  (p^.resulttype^.deftype=orddef) then
                 begin
                 begin
@@ -1077,7 +1087,7 @@ implementation
                    { data which must be finalized ? }
                    { data which must be finalized ? }
                    if (p^.resulttype^.needs_inittable) and
                    if (p^.resulttype^.needs_inittable) and
                      ( (p^.resulttype^.deftype<>objectdef) or
                      ( (p^.resulttype^.deftype<>objectdef) or
-                       not(pobjectdef(p^.resulttype)^.isclass)) then
+                       not(pobjectdef(p^.resulttype)^.is_class)) then
                       finalize(p^.resulttype,p^.location.reference,ret_in_param(p^.resulttype));
                       finalize(p^.resulttype,p^.location.reference,ret_in_param(p^.resulttype));
                    { release unused temp }
                    { release unused temp }
                    ungetiftemp(p^.location.reference)
                    ungetiftemp(p^.location.reference)
@@ -1166,7 +1176,11 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.94  1999-07-06 21:48:09  florian
+  Revision 1.95  1999-08-03 22:02:34  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.94  1999/07/06 21:48:09  florian
     * a lot bug fixes:
     * a lot bug fixes:
        - po_external isn't any longer necessary for procedure compatibility
        - po_external isn't any longer necessary for procedure compatibility
        - m_tp_procvar is in -Sd now available
        - m_tp_procvar is in -Sd now available

+ 10 - 6
compiler/cg386cnv.pas

@@ -42,7 +42,7 @@ implementation
 
 
    uses
    uses
       cobjects,verbose,globtype,globals,systems,
       cobjects,verbose,globtype,globals,systems,
-      symtable,aasm,types,
+      symconst,symtable,aasm,types,
       hcodegen,temp_gen,pass_2,pass_1,
       hcodegen,temp_gen,pass_2,pass_1,
       i386base,i386asm,
       i386base,i386asm,
       cgai386,tgeni386;
       cgai386,tgeni386;
@@ -339,7 +339,7 @@ implementation
               begin
               begin
                  exprasmlist^.concat(new(pai386,op_reg_reg(A_XOR,S_L,
                  exprasmlist^.concat(new(pai386,op_reg_reg(A_XOR,S_L,
                    hregister2,hregister2)));
                    hregister2,hregister2)));
-                 if (porddef(pto^.resulttype)^.typ=s64bitint) and
+                 if (porddef(pto^.resulttype)^.typ=s64bit) and
                    is_signed(pfrom^.resulttype) then
                    is_signed(pfrom^.resulttype) then
                    begin
                    begin
                       getlabel(l);
                       getlabel(l);
@@ -683,7 +683,7 @@ implementation
                  u16bit : exprasmlist^.concat(new(pai386,op_reg_reg(A_MOVZX,S_WL,pfrom^.location.register,R_EDI)));
                  u16bit : exprasmlist^.concat(new(pai386,op_reg_reg(A_MOVZX,S_WL,pfrom^.location.register,R_EDI)));
                  u32bit,s32bit:
                  u32bit,s32bit:
                    hregister:=pfrom^.location.register;
                    hregister:=pfrom^.location.register;
-                 u64bit,s64bitint:
+                 u64bit,s64bit:
                    begin
                    begin
                       exprasmlist^.concat(new(pai386,op_reg(A_PUSH,S_L,pfrom^.location.registerhigh)));
                       exprasmlist^.concat(new(pai386,op_reg(A_PUSH,S_L,pfrom^.location.registerhigh)));
                       hregister:=pfrom^.location.registerlow;
                       hregister:=pfrom^.location.registerlow;
@@ -705,7 +705,7 @@ implementation
                    exprasmlist^.concat(new(pai386,op_ref_reg(A_MOVZX,S_WL,r,R_EDI)));
                    exprasmlist^.concat(new(pai386,op_ref_reg(A_MOVZX,S_WL,r,R_EDI)));
                  u32bit,s32bit:
                  u32bit,s32bit:
                    exprasmlist^.concat(new(pai386,op_ref_reg(A_MOV,S_L,r,R_EDI)));
                    exprasmlist^.concat(new(pai386,op_ref_reg(A_MOV,S_L,r,R_EDI)));
-                 u64bit,s64bitint:
+                 u64bit,s64bit:
                    begin
                    begin
                       inc(r^.offset,4);
                       inc(r^.offset,4);
                       exprasmlist^.concat(new(pai386,op_ref_reg(A_MOV,S_L,r,R_EDI)));
                       exprasmlist^.concat(new(pai386,op_ref_reg(A_MOV,S_L,r,R_EDI)));
@@ -726,7 +726,7 @@ implementation
                 exprasmlist^.concat(new(pai386,op_ref(A_FILD,S_IQ,r)));
                 exprasmlist^.concat(new(pai386,op_ref(A_FILD,S_IQ,r)));
                 exprasmlist^.concat(new(pai386,op_const_reg(A_ADD,S_L,8,R_ESP)));
                 exprasmlist^.concat(new(pai386,op_const_reg(A_ADD,S_L,8,R_ESP)));
              end;
              end;
-           s64bitint:
+           s64bit:
              begin
              begin
                 exprasmlist^.concat(new(pai386,op_ref(A_FILD,S_IQ,r)));
                 exprasmlist^.concat(new(pai386,op_ref(A_FILD,S_IQ,r)));
                 exprasmlist^.concat(new(pai386,op_const_reg(A_ADD,S_L,8,R_ESP)));
                 exprasmlist^.concat(new(pai386,op_const_reg(A_ADD,S_L,8,R_ESP)));
@@ -1463,7 +1463,11 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.80  1999-08-01 23:36:38  florian
+  Revision 1.81  1999-08-03 22:02:36  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.80  1999/08/01 23:36:38  florian
     * some changes to compile the new code generator
     * some changes to compile the new code generator
 
 
   Revision 1.79  1999/07/22 09:37:34  florian
   Revision 1.79  1999/07/22 09:37:34  florian

+ 6 - 2
compiler/cg386con.pas

@@ -39,7 +39,7 @@ implementation
     uses
     uses
       globtype,systems,
       globtype,systems,
       cobjects,verbose,globals,
       cobjects,verbose,globals,
-      symtable,aasm,types,
+      symconst,symtable,aasm,types,
       hcodegen,temp_gen,pass_2,
       hcodegen,temp_gen,pass_2,
       i386base,i386asm,
       i386base,i386asm,
       cgai386,tgeni386;
       cgai386,tgeni386;
@@ -401,7 +401,11 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.37  1999-07-05 20:13:08  peter
+  Revision 1.38  1999-08-03 22:02:38  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.37  1999/07/05 20:13:08  peter
     * removed temp defines
     * removed temp defines
 
 
   Revision 1.36  1999/05/27 19:44:10  peter
   Revision 1.36  1999/05/27 19:44:10  peter

+ 7 - 3
compiler/cg386flw.pas

@@ -45,7 +45,7 @@ implementation
 
 
     uses
     uses
       cobjects,verbose,globals,systems,
       cobjects,verbose,globals,systems,
-      symtable,aasm,types,
+      symconst,symtable,aasm,types,
       hcodegen,temp_gen,pass_2,
       hcodegen,temp_gen,pass_2,
       i386base,i386asm,
       i386base,i386asm,
       cgai386,tgeni386;
       cgai386,tgeni386;
@@ -233,7 +233,7 @@ implementation
                  concatcopy(p^.right^.location.reference,temp1,hs,false,false);
                  concatcopy(p^.right^.location.reference,temp1,hs,false,false);
            end
            end
          else
          else
-	   temptovalue:=false;
+           temptovalue:=false;
 
 
          { produce start assignment }
          { produce start assignment }
          cleartempgen;
          cleartempgen;
@@ -772,7 +772,11 @@ do_jmp:
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.43  1999-07-26 12:13:45  florian
+  Revision 1.44  1999-08-03 22:02:39  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.43  1999/07/26 12:13:45  florian
     * exit in try..finally blocks needed a second fix
     * exit in try..finally blocks needed a second fix
     * a raise in a try..finally lead into a endless loop, fixed
     * a raise in a try..finally lead into a endless loop, fixed
 
 

+ 11 - 7
compiler/cg386inl.pas

@@ -34,7 +34,7 @@ implementation
     uses
     uses
       globtype,systems,
       globtype,systems,
       cobjects,verbose,globals,files,
       cobjects,verbose,globals,files,
-      symtable,aasm,types,
+      symconst,symtable,aasm,types,
       hcodegen,temp_gen,pass_1,pass_2,
       hcodegen,temp_gen,pass_1,pass_2,
       i386base,i386asm,
       i386base,i386asm,
       cgai386,tgeni386,cg386cal;
       cgai386,tgeni386,cg386cal;
@@ -93,7 +93,7 @@ implementation
             floatstore(PFloatDef(dest^.resulttype)^.typ,dest^.location.reference);
             floatstore(PFloatDef(dest^.resulttype)^.typ,dest^.location.reference);
           orddef:
           orddef:
             begin
             begin
-              if porddef(dest^.resulttype)^.typ in [u64bit,s64bitint] then
+              if porddef(dest^.resulttype)^.typ in [u64bit,s64bit] then
                 begin
                 begin
                    emit_movq_reg_loc(R_EDX,R_EAX,dest^.location);
                    emit_movq_reg_loc(R_EDX,R_EAX,dest^.location);
                 end
                 end
@@ -207,7 +207,7 @@ implementation
            dummycoll.register:=R_NO;
            dummycoll.register:=R_NO;
            { I/O check }
            { I/O check }
            if (cs_check_io in aktlocalswitches) and
            if (cs_check_io in aktlocalswitches) and
-              ((aktprocsym^.definition^.options and poiocheck)=0) then
+              not(po_iocheck in aktprocsym^.definition^.procoptions) then
              begin
              begin
                 getlabel(iolabel);
                 getlabel(iolabel);
                 emitlab(iolabel);
                 emitlab(iolabel);
@@ -426,7 +426,7 @@ implementation
                                     emitcall(rdwrprefix[doread]+'UINT');
                                     emitcall(rdwrprefix[doread]+'UINT');
                                   uchar :
                                   uchar :
                                     emitcall(rdwrprefix[doread]+'CHAR');
                                     emitcall(rdwrprefix[doread]+'CHAR');
-                                  s64bitint:
+                                  s64bit :
                                     emitcall(rdwrprefix[doread]+'INT64');
                                     emitcall(rdwrprefix[doread]+'INT64');
                                   u64bit :
                                   u64bit :
                                     emitcall(rdwrprefix[doread]+'QWORD');
                                     emitcall(rdwrprefix[doread]+'QWORD');
@@ -609,7 +609,7 @@ implementation
                 u64bit:
                 u64bit:
                   emitcall(procedureprefix+'QWORD');
                   emitcall(procedureprefix+'QWORD');
 
 
-                s64bitint:
+                s64bit:
                   emitcall(procedureprefix+'INT64');
                   emitcall(procedureprefix+'INT64');
 
 
                 else
                 else
@@ -784,7 +784,7 @@ implementation
                  u32bit,s32bit:
                  u32bit,s32bit:
                    exprasmlist^.concat(new(pai386,op_reg_ref(A_MOV, S_L,
                    exprasmlist^.concat(new(pai386,op_reg_ref(A_MOV, S_L,
                      hreg,newreference(hr2))));
                      hreg,newreference(hr2))));
-                 u64bit,s64bitint:
+                 u64bit,s64bit:
                    begin
                    begin
                       exprasmlist^.concat(new(pai386,op_reg_ref(A_MOV, S_L,
                       exprasmlist^.concat(new(pai386,op_reg_ref(A_MOV, S_L,
                         hreg,newreference(hr2))));
                         hreg,newreference(hr2))));
@@ -1313,7 +1313,11 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.63  1999-07-23 16:05:18  peter
+  Revision 1.64  1999-08-03 22:02:42  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.63  1999/07/23 16:05:18  peter
     * alignment is now saved in the symtable
     * alignment is now saved in the symtable
     * C alignment added for records
     * C alignment added for records
     * PPU version increased to solve .12 <-> .13 probs
     * PPU version increased to solve .12 <-> .13 probs

+ 13 - 9
compiler/cg386ld.pas

@@ -37,7 +37,7 @@ implementation
     uses
     uses
       globtype,systems,
       globtype,systems,
       cobjects,verbose,globals,
       cobjects,verbose,globals,
-      symtable,aasm,types,
+      symconst,symtable,aasm,types,
       hcodegen,temp_gen,pass_2,
       hcodegen,temp_gen,pass_2,
       i386base,i386asm,
       i386base,i386asm,
       cgai386,tgeni386,cg386cnv,cresstr;
       cgai386,tgeni386,cg386cnv,cresstr;
@@ -102,12 +102,12 @@ implementation
                  begin
                  begin
                     hregister:=R_NO;
                     hregister:=R_NO;
                     { C variable }
                     { C variable }
-                    if (pvarsym(p^.symtableentry)^.var_options and vo_is_C_var)<>0 then
+                    if (vo_is_C_var in pvarsym(p^.symtableentry)^.varoptions) then
                       begin
                       begin
                          p^.location.reference.symbol:=newasmsymbol(p^.symtableentry^.mangledname);
                          p^.location.reference.symbol:=newasmsymbol(p^.symtableentry^.mangledname);
                       end
                       end
                     { DLL variable }
                     { DLL variable }
-                    else if (pvarsym(p^.symtableentry)^.var_options and vo_is_dll_var)<>0 then
+                    else if (vo_is_dll_var in pvarsym(p^.symtableentry)^.varoptions) then
                       begin
                       begin
                          hregister:=getregister32;
                          hregister:=getregister32;
                          p^.location.reference.symbol:=newasmsymbol(p^.symtableentry^.mangledname);
                          p^.location.reference.symbol:=newasmsymbol(p^.symtableentry^.mangledname);
@@ -116,12 +116,12 @@ implementation
                          p^.location.reference.base:=hregister;
                          p^.location.reference.base:=hregister;
                       end
                       end
                     { external variable }
                     { external variable }
-                    else if (pvarsym(p^.symtableentry)^.var_options and vo_is_external)<>0 then
+                    else if (vo_is_external in pvarsym(p^.symtableentry)^.varoptions) then
                       begin
                       begin
                          p^.location.reference.symbol:=newasmsymbol(p^.symtableentry^.mangledname);
                          p^.location.reference.symbol:=newasmsymbol(p^.symtableentry^.mangledname);
                       end
                       end
                     { thread variable }
                     { thread variable }
-                    else if (pvarsym(p^.symtableentry)^.var_options and vo_is_thread_var)<>0 then
+                    else if (vo_is_thread_var in pvarsym(p^.symtableentry)^.varoptions) then
                       begin
                       begin
                          popeax:=not(R_EAX in unused);
                          popeax:=not(R_EAX in unused);
                          if popeax then
                          if popeax then
@@ -196,7 +196,7 @@ implementation
                                      end;
                                      end;
                                    objectsymtable:
                                    objectsymtable:
                                      begin
                                      begin
-                                        if (pvarsym(p^.symtableentry)^.properties and sp_static)<>0 then
+                                        if (sp_static in pvarsym(p^.symtableentry)^.symoptions) then
                                           begin
                                           begin
                                              p^.location.reference.symbol:=newasmsymbol(p^.symtableentry^.mangledname);
                                              p^.location.reference.symbol:=newasmsymbol(p^.symtableentry^.mangledname);
                                           end
                                           end
@@ -301,7 +301,7 @@ implementation
                            hregister,hp)));
                            hregister,hp)));
 
 
                          { virtual method ? }
                          { virtual method ? }
-                         if (pprocsym(p^.symtableentry)^.definition^.options and povirtualmethod)<>0 then
+                         if (po_virtualmethod in pprocsym(p^.symtableentry)^.definition^.procoptions) then
                            begin
                            begin
                               new(hp);
                               new(hp);
                               reset_reference(hp^);
                               reset_reference(hp^);
@@ -530,7 +530,7 @@ implementation
                            begin
                            begin
                               if (p^.right^.resulttype^.needs_inittable) and
                               if (p^.right^.resulttype^.needs_inittable) and
                                 ( (p^.right^.resulttype^.deftype<>objectdef) or
                                 ( (p^.right^.resulttype^.deftype<>objectdef) or
-                                  not(pobjectdef(p^.right^.resulttype)^.isclass)) then
+                                  not(pobjectdef(p^.right^.resulttype)^.is_class)) then
                                 begin
                                 begin
                                    { this would be a problem }
                                    { this would be a problem }
                                    if not(p^.left^.resulttype^.needs_inittable) then
                                    if not(p^.left^.resulttype^.needs_inittable) then
@@ -875,7 +875,11 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.67  1999-07-27 23:36:36  peter
+  Revision 1.68  1999-08-03 22:02:43  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.67  1999/07/27 23:36:36  peter
     * try to determine the fpu type needed in assignment
     * try to determine the fpu type needed in assignment
 
 
   Revision 1.66  1999/07/24 15:12:56  michael
   Revision 1.66  1999/07/24 15:12:56  michael

+ 6 - 2
compiler/cg386mat.pas

@@ -37,7 +37,7 @@ implementation
     uses
     uses
       globtype,systems,
       globtype,systems,
       cobjects,verbose,globals,
       cobjects,verbose,globals,
-      symtable,aasm,types,
+      symconst,symtable,aasm,types,
       hcodegen,temp_gen,pass_2,
       hcodegen,temp_gen,pass_2,
       i386base,i386asm,
       i386base,i386asm,
 {$ifdef dummy}
 {$ifdef dummy}
@@ -930,7 +930,11 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.27  1999-06-28 22:29:14  florian
+  Revision 1.28  1999-08-03 22:02:45  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.27  1999/06/28 22:29:14  florian
     * qword division fixed
     * qword division fixed
     + code for qword/int64 type casting added:
     + code for qword/int64 type casting added:
       range checking isn't implemented yet
       range checking isn't implemented yet

+ 9 - 5
compiler/cg386mem.pas

@@ -45,7 +45,7 @@ implementation
     uses
     uses
       globtype,systems,
       globtype,systems,
       cobjects,verbose,globals,
       cobjects,verbose,globals,
-      symtable,aasm,types,
+      symconst,symtable,aasm,types,
       hcodegen,temp_gen,pass_2,pass_1,
       hcodegen,temp_gen,pass_2,pass_1,
       i386base,i386asm,
       i386base,i386asm,
       cgai386,tgeni386;
       cgai386,tgeni386;
@@ -332,7 +332,7 @@ implementation
            exit;
            exit;
          { classes must be dereferenced implicit }
          { classes must be dereferenced implicit }
          if (p^.left^.resulttype^.deftype=objectdef) and
          if (p^.left^.resulttype^.deftype=objectdef) and
-           pobjectdef(p^.left^.resulttype)^.isclass then
+           pobjectdef(p^.left^.resulttype)^.is_class then
            begin
            begin
              reset_reference(p^.location.reference);
              reset_reference(p^.location.reference);
              case p^.left^.location.loc of
              case p^.left^.location.loc of
@@ -775,7 +775,7 @@ implementation
          reset_reference(p^.location.reference);
          reset_reference(p^.location.reference);
          if (p^.resulttype^.deftype=classrefdef) or
          if (p^.resulttype^.deftype=classrefdef) or
            ((p^.resulttype^.deftype=objectdef)
            ((p^.resulttype^.deftype=objectdef)
-             and pobjectdef(p^.resulttype)^.isclass
+             and pobjectdef(p^.resulttype)^.is_class
            ) then
            ) then
            p^.location.register:=R_ESI
            p^.location.register:=R_ESI
          else
          else
@@ -809,7 +809,7 @@ implementation
                  end
                  end
                else
                else
                 if (p^.left^.resulttype^.deftype=objectdef) and
                 if (p^.left^.resulttype^.deftype=objectdef) and
-                   pobjectdef(p^.left^.resulttype)^.isclass then
+                   pobjectdef(p^.left^.resulttype)^.is_class then
                  begin
                  begin
                     exprasmlist^.concat(new(pai386,op_ref_reg(A_MOV,S_L,
                     exprasmlist^.concat(new(pai386,op_ref_reg(A_MOV,S_L,
                       newreference(p^.left^.location.reference),R_EDI)));
                       newreference(p^.left^.location.reference),R_EDI)));
@@ -849,7 +849,11 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.47  1999-06-02 10:11:45  florian
+  Revision 1.48  1999-08-03 22:02:47  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.47  1999/06/02 10:11:45  florian
     * make cycle fixed i.e. compilation with 0.99.10
     * make cycle fixed i.e. compilation with 0.99.10
     * some fixes for qword
     * some fixes for qword
     * start of register calling conventions
     * start of register calling conventions

+ 7 - 3
compiler/cg386set.pas

@@ -36,7 +36,7 @@ implementation
     uses
     uses
       globtype,systems,
       globtype,systems,
       cobjects,verbose,globals,
       cobjects,verbose,globals,
-      symtable,aasm,types,
+      symconst,symtable,aasm,types,
       hcodegen,temp_gen,pass_2,
       hcodegen,temp_gen,pass_2,
       i386base,i386asm,
       i386base,i386asm,
       cgai386,tgeni386;
       cgai386,tgeni386;
@@ -411,7 +411,7 @@ implementation
                   p^.location.resflags:=F_C;
                   p^.location.resflags:=F_C;
                   getlabel(l);
                   getlabel(l);
                   getlabel(l2);
                   getlabel(l2);
-                  
+
                   { Is this treated in firstpass ?? }
                   { Is this treated in firstpass ?? }
                   if p^.left^.treetype=ordconstn then
                   if p^.left^.treetype=ordconstn then
                     begin
                     begin
@@ -918,7 +918,11 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.35  1999-07-18 14:01:16  florian
+  Revision 1.36  1999-08-03 22:02:48  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.35  1999/07/18 14:01:16  florian
     * handling of integer and shortint in case was wrong, if a case
     * handling of integer and shortint in case was wrong, if a case
       label was negative and a jump table was generated
       label was negative and a jump table was generated
 
 

+ 33 - 29
compiler/cgai386.pas

@@ -30,7 +30,7 @@ unit cgai386;
 {$ifdef dummy}
 {$ifdef dummy}
        end { to get correct syntax highlighting }
        end { to get correct syntax highlighting }
 {$endif dummy}
 {$endif dummy}
-       aasm,symtable,win_targ;
+       symconst,symtable,aasm,win_targ;
 
 
 {$define TESTGETTEMP to store const that
 {$define TESTGETTEMP to store const that
  are written into temps for later release PM }
  are written into temps for later release PM }
@@ -1401,7 +1401,7 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
                                is_open_array(p^.resulttype)))
                                is_open_array(p^.resulttype)))
                             ) or
                             ) or
                             ((p^.resulttype^.deftype=objectdef) and
                             ((p^.resulttype^.deftype=objectdef) and
-                             pobjectdef(p^.resulttype)^.isclass) then
+                             pobjectdef(p^.resulttype)^.is_class) then
                            begin
                            begin
                               inc(pushedparasize,4);
                               inc(pushedparasize,4);
                               if inlined then
                               if inlined then
@@ -2132,7 +2132,7 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
     var
     var
       pl : pasmlabel;
       pl : pasmlabel;
     begin
     begin
-      if (aktprocsym^.definition^.options and poassembler)<>0 then
+      if (po_assembler in aktprocsym^.definition^.procoptions) then
        exit;
        exit;
       case target_info.target of
       case target_info.target of
          target_i386_linux:
          target_i386_linux:
@@ -2203,7 +2203,7 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
 
 
     begin
     begin
        if (psym(p)^.typ=varsym) and
        if (psym(p)^.typ=varsym) and
-         ((pvarsym(p)^.var_options and vo_is_thread_var)<>0) then
+          (vo_is_thread_var in pvarsym(p)^.varoptions) then
          begin
          begin
             exprasmlist^.concat(new(pai386,op_const(A_PUSH,S_L,pvarsym(p)^.getsize)));
             exprasmlist^.concat(new(pai386,op_const(A_PUSH,S_L,pvarsym(p)^.getsize)));
             reset_reference(hr);
             reset_reference(hr);
@@ -2283,7 +2283,7 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
        if (psym(p)^.typ=varsym) and
        if (psym(p)^.typ=varsym) and
           assigned(pvarsym(p)^.definition) and
           assigned(pvarsym(p)^.definition) and
           not((pvarsym(p)^.definition^.deftype=objectdef) and
           not((pvarsym(p)^.definition^.deftype=objectdef) and
-            pobjectdef(pvarsym(p)^.definition)^.isclass) and
+            pobjectdef(pvarsym(p)^.definition)^.is_class) and
           pvarsym(p)^.definition^.needs_inittable then
           pvarsym(p)^.definition^.needs_inittable then
          begin
          begin
             procinfo.flags:=procinfo.flags or pi_needs_implicit_finally;
             procinfo.flags:=procinfo.flags or pi_needs_implicit_finally;
@@ -2310,7 +2310,7 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
     begin
     begin
        if (psym(p)^.typ=varsym) and
        if (psym(p)^.typ=varsym) and
           not((pvarsym(p)^.definition^.deftype=objectdef) and
           not((pvarsym(p)^.definition^.deftype=objectdef) and
-            pobjectdef(pvarsym(p)^.definition)^.isclass) and
+            pobjectdef(pvarsym(p)^.definition)^.is_class) and
           pvarsym(p)^.definition^.needs_inittable and
           pvarsym(p)^.definition^.needs_inittable and
           ((pvarsym(p)^.varspez=vs_value) {or
           ((pvarsym(p)^.varspez=vs_value) {or
            (pvarsym(p)^.varspez=vs_const) and
            (pvarsym(p)^.varspez=vs_const) and
@@ -2342,7 +2342,7 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
        if (psym(p)^.typ=varsym) and
        if (psym(p)^.typ=varsym) and
           assigned(pvarsym(p)^.definition) and
           assigned(pvarsym(p)^.definition) and
           not((pvarsym(p)^.definition^.deftype=objectdef) and
           not((pvarsym(p)^.definition^.deftype=objectdef) and
-          pobjectdef(pvarsym(p)^.definition)^.isclass) and
+          pobjectdef(pvarsym(p)^.definition)^.is_class) and
           pvarsym(p)^.definition^.needs_inittable then
           pvarsym(p)^.definition^.needs_inittable then
          begin
          begin
             { not all kind of parameters need to be finalized  }
             { not all kind of parameters need to be finalized  }
@@ -2603,7 +2603,7 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
     begin
     begin
        oldexprasmlist:=exprasmlist;
        oldexprasmlist:=exprasmlist;
        exprasmlist:=alist;
        exprasmlist:=alist;
-       if (not inlined) and ((aktprocsym^.definition^.options and poproginit)<>0) then
+       if (not inlined) and (aktprocsym^.definition^.proctypeoption=potype_proginit) then
            begin
            begin
               exprasmlist^.insert(new(pai386,
               exprasmlist^.insert(new(pai386,
                 op_sym(A_CALL,S_NO,newasmsymbol('FPC_INITIALIZEUNITS'))));
                 op_sym(A_CALL,S_NO,newasmsymbol('FPC_INITIALIZEUNITS'))));
@@ -2634,9 +2634,9 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
            end;
            end;
 
 
       { a constructor needs a help procedure }
       { a constructor needs a help procedure }
-      if (aktprocsym^.definition^.options and poconstructor)<>0 then
+      if (aktprocsym^.definition^.proctypeoption=potype_constructor) then
         begin
         begin
-          if procinfo._class^.isclass then
+          if procinfo._class^.is_class then
             begin
             begin
               exprasmlist^.insert(new(pai386,op_cond_sym(A_Jcc,C_Z,S_NO,quickexitlabel)));
               exprasmlist^.insert(new(pai386,op_cond_sym(A_Jcc,C_Z,S_NO,quickexitlabel)));
               exprasmlist^.insert(new(pai386,op_sym(A_CALL,S_NO,newasmsymbol('FPC_NEW_CLASS'))));
               exprasmlist^.insert(new(pai386,op_sym(A_CALL,S_NO,newasmsymbol('FPC_NEW_CLASS'))));
@@ -2653,7 +2653,7 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
 
 
       { When message method contains self as a parameter,
       { When message method contains self as a parameter,
         we must load it into ESI }
         we must load it into ESI }
-      If ((aktprocsym^.definition^.options and pocontainsself)<>0) then
+      If (po_containsself in aktprocsym^.definition^.procoptions) then
         begin
         begin
            new(hr);
            new(hr);
            reset_reference(hr^);
            reset_reference(hr^);
@@ -2661,8 +2661,8 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
            hr^.base:=procinfo.framepointer;
            hr^.base:=procinfo.framepointer;
            exprasmlist^.insert(new(pai386,op_ref_reg(A_MOV,S_L,hr,R_ESI)));
            exprasmlist^.insert(new(pai386,op_ref_reg(A_MOV,S_L,hr,R_ESI)));
         end;
         end;
-      { should we save edi ? }
-      if ((aktprocsym^.definition^.options and posavestdregs)<>0) then
+      { should we save edi,esi,ebx like C ? }
+      if (po_savestdregs in aktprocsym^.definition^.procoptions) then
        begin
        begin
          if (aktprocsym^.definition^.usedregisters and ($80 shr byte(R_EBX)))<>0 then
          if (aktprocsym^.definition^.usedregisters and ($80 shr byte(R_EBX)))<>0 then
            exprasmlist^.insert(new(pai386,op_reg(A_PUSH,S_L,R_EBX)));
            exprasmlist^.insert(new(pai386,op_reg(A_PUSH,S_L,R_EBX)));
@@ -2677,14 +2677,14 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
           begin
           begin
               CGMessage(cg_d_stackframe_omited);
               CGMessage(cg_d_stackframe_omited);
               nostackframe:=true;
               nostackframe:=true;
-              if (aktprocsym^.definition^.options and (pounitinit or poproginit or pounitfinalize)<>0) then
+              if (aktprocsym^.definition^.proctypeoption in [potype_unitinit,potype_proginit,potype_unitfinalize]) then
                 parasize:=0
                 parasize:=0
               else
               else
                 parasize:=aktprocsym^.definition^.parast^.datasize+procinfo.call_offset-4;
                 parasize:=aktprocsym^.definition^.parast^.datasize+procinfo.call_offset-4;
           end
           end
       else
       else
           begin
           begin
-              if (aktprocsym^.definition^.options and (pounitinit or poproginit or pounitfinalize)<>0) then
+              if (aktprocsym^.definition^.proctypeoption in [potype_unitinit,potype_proginit,potype_unitfinalize]) then
                 parasize:=0
                 parasize:=0
               else
               else
                 parasize:=aktprocsym^.definition^.parast^.datasize+procinfo.call_offset-8;
                 parasize:=aktprocsym^.definition^.parast^.datasize+procinfo.call_offset-8;
@@ -2771,14 +2771,14 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
                  end;
                  end;
           end;
           end;
 
 
-      if (aktprocsym^.definition^.options and pointerrupt)<>0 then
+      if (po_interrupt in aktprocsym^.definition^.procoptions) then
           generate_interrupt_stackframe_entry;
           generate_interrupt_stackframe_entry;
 
 
       { initialize return value }
       { initialize return value }
       if (procinfo.retdef<>pdef(voiddef)) and
       if (procinfo.retdef<>pdef(voiddef)) and
         (procinfo.retdef^.needs_inittable) and
         (procinfo.retdef^.needs_inittable) and
         ((procinfo.retdef^.deftype<>objectdef) or
         ((procinfo.retdef^.deftype<>objectdef) or
-        not(pobjectdef(procinfo.retdef)^.isclass)) then
+        not(pobjectdef(procinfo.retdef)^.is_class)) then
         begin
         begin
            procinfo.flags:=procinfo.flags or pi_needs_implicit_finally;
            procinfo.flags:=procinfo.flags or pi_needs_implicit_finally;
            reset_reference(r);
            reset_reference(r);
@@ -2788,7 +2788,7 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
         end;
         end;
 
 
       { generate copies of call by value parameters }
       { generate copies of call by value parameters }
-      if (aktprocsym^.definition^.options and poassembler=0) then
+      if not(po_assembler in aktprocsym^.definition^.procoptions) then
         aktprocsym^.definition^.parast^.foreach({$ifndef TP}@{$endif}copyvalueparas);
         aktprocsym^.definition^.parast^.foreach({$ifndef TP}@{$endif}copyvalueparas);
 
 
       { initialisizes local data }
       { initialisizes local data }
@@ -2947,9 +2947,9 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
         exprasmlist^.insert(new(pai_label,init(aktexitlabel)));
         exprasmlist^.insert(new(pai_label,init(aktexitlabel)));
 
 
       { call the destructor help procedure }
       { call the destructor help procedure }
-      if (aktprocsym^.definition^.options and podestructor)<>0 then
+      if (aktprocsym^.definition^.proctypeoption=potype_destructor) then
         begin
         begin
-          if procinfo._class^.isclass then
+          if procinfo._class^.is_class then
             begin
             begin
               exprasmlist^.insert(new(pai386,op_sym(A_CALL,S_NO,
               exprasmlist^.insert(new(pai386,op_sym(A_CALL,S_NO,
                 newasmsymbol('FPC_DISPOSE_CLASS'))));
                 newasmsymbol('FPC_DISPOSE_CLASS'))));
@@ -2987,7 +2987,7 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
            if (procinfo.retdef<>pdef(voiddef)) and
            if (procinfo.retdef<>pdef(voiddef)) and
              (procinfo.retdef^.needs_inittable) and
              (procinfo.retdef^.needs_inittable) and
              ((procinfo.retdef^.deftype<>objectdef) or
              ((procinfo.retdef^.deftype<>objectdef) or
-             not(pobjectdef(procinfo.retdef)^.isclass)) then
+             not(pobjectdef(procinfo.retdef)^.is_class)) then
              begin
              begin
                 reset_reference(hr);
                 reset_reference(hr);
                 hr.offset:=procinfo.retoffset;
                 hr.offset:=procinfo.retoffset;
@@ -3001,14 +3001,14 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
         end;
         end;
 
 
       { call __EXIT for main program }
       { call __EXIT for main program }
-      if (not DLLsource) and (not inlined) and ((aktprocsym^.definition^.options and poproginit)<>0) then
+      if (not DLLsource) and (not inlined) and (aktprocsym^.definition^.proctypeoption=potype_proginit) then
        begin
        begin
          exprasmlist^.concat(new(pai386,op_sym(A_CALL,S_NO,newasmsymbol('FPC_DO_EXIT'))));
          exprasmlist^.concat(new(pai386,op_sym(A_CALL,S_NO,newasmsymbol('FPC_DO_EXIT'))));
        end;
        end;
 
 
       { handle return value }
       { handle return value }
-      if (aktprocsym^.definition^.options and poassembler)=0 then
-          if (aktprocsym^.definition^.options and poconstructor)=0 then
+      if not(po_assembler in aktprocsym^.definition^.procoptions) then
+          if (aktprocsym^.definition^.proctypeoption<>potype_constructor) then
             handle_return_value(inlined)
             handle_return_value(inlined)
           else
           else
               begin
               begin
@@ -3029,7 +3029,7 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
 
 
       { should we restore edi ? }
       { should we restore edi ? }
       { for all i386 gcc implementations }
       { for all i386 gcc implementations }
-      if ((aktprocsym^.definition^.options and posavestdregs)<>0) then
+      if (po_savestdregs in aktprocsym^.definition^.procoptions) then
         begin
         begin
           if (aktprocsym^.definition^.usedregisters and ($80 shr byte(R_EBX)))<>0 then
           if (aktprocsym^.definition^.usedregisters and ($80 shr byte(R_EBX)))<>0 then
            exprasmlist^.concat(new(pai386,op_reg(A_POP,S_L,R_EBX)));
            exprasmlist^.concat(new(pai386,op_reg(A_POP,S_L,R_EBX)));
@@ -3048,19 +3048,19 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
           exprasmlist^.concat(new(pai386,op_none(A_LEAVE,S_NO)));
           exprasmlist^.concat(new(pai386,op_none(A_LEAVE,S_NO)));
       { parameters are limited to 65535 bytes because }
       { parameters are limited to 65535 bytes because }
       { ret allows only imm16                    }
       { ret allows only imm16                    }
-      if (parasize>65535) and not(aktprocsym^.definition^.options and poclearstack<>0) then
+      if (parasize>65535) and not(pocall_clearstack in aktprocsym^.definition^.proccalloptions) then
        CGMessage(cg_e_parasize_too_big);
        CGMessage(cg_e_parasize_too_big);
 
 
       { at last, the return is generated }
       { at last, the return is generated }
 
 
       if not inlined then
       if not inlined then
-      if (aktprocsym^.definition^.options and pointerrupt)<>0 then
+      if (po_interrupt in aktprocsym^.definition^.procoptions) then
           generate_interrupt_stackframe_exit
           generate_interrupt_stackframe_exit
       else
       else
        begin
        begin
        {Routines with the poclearstack flag set use only a ret.}
        {Routines with the poclearstack flag set use only a ret.}
        { also routines with parasize=0     }
        { also routines with parasize=0     }
-         if (parasize=0) or (aktprocsym^.definition^.options and poclearstack<>0) then
+         if (parasize=0) or (pocall_clearstack in aktprocsym^.definition^.proccalloptions) then
           exprasmlist^.concat(new(pai386,op_none(A_RET,S_NO)))
           exprasmlist^.concat(new(pai386,op_none(A_RET,S_NO)))
          else
          else
           exprasmlist^.concat(new(pai386,op_const(A_RET,S_NO,parasize)));
           exprasmlist^.concat(new(pai386,op_const(A_RET,S_NO,parasize)));
@@ -3140,7 +3140,11 @@ procedure mov_reg_to_dest(p : ptree; s : topsize; reg : tregister);
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.22  1999-08-01 23:36:39  florian
+  Revision 1.23  1999-08-03 22:02:49  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.22  1999/08/01 23:36:39  florian
     * some changes to compile the new code generator
     * some changes to compile the new code generator
 
 
   Revision 1.21  1999/08/01 17:32:31  florian
   Revision 1.21  1999/08/01 17:32:31  florian

+ 40 - 31
compiler/hcgdata.pas

@@ -40,7 +40,7 @@ implementation
     uses
     uses
        strings,cobjects,
        strings,cobjects,
        globtype,globals,verbose,
        globtype,globals,verbose,
-       types,
+       symconst,types,
        hcodegen;
        hcodegen;
 
 
 
 
@@ -105,7 +105,7 @@ implementation
               hp:=pprocsym(p)^.definition;
               hp:=pprocsym(p)^.definition;
               while assigned(hp) do
               while assigned(hp) do
                 begin
                 begin
-                   if (hp^.options and pomsgstr)<>0 then
+                   if (po_msgstr in hp^.procoptions) then
                      begin
                      begin
                         new(pt);
                         new(pt);
                         pt^.p:=hp;
                         pt^.p:=hp;
@@ -149,7 +149,7 @@ implementation
               hp:=pprocsym(p)^.definition;
               hp:=pprocsym(p)^.definition;
               while assigned(hp) do
               while assigned(hp) do
                 begin
                 begin
-                   if (hp^.options and pomsgint)<>0 then
+                   if (po_msgint in hp^.procoptions) then
                      begin
                      begin
                         new(pt);
                         new(pt);
                         pt^.p:=hp;
                         pt^.p:=hp;
@@ -199,7 +199,7 @@ implementation
          root:=nil;
          root:=nil;
          count:=0;
          count:=0;
          { insert all message handlers into a tree, sorted by name }
          { insert all message handlers into a tree, sorted by name }
-         _class^.publicsyms^.foreach({$ifndef TP}@{$endif}insertmsgstr);
+         _class^.symtable^.foreach({$ifndef TP}@{$endif}insertmsgstr);
 
 
          { write all names }
          { write all names }
          if assigned(root) then
          if assigned(root) then
@@ -241,7 +241,7 @@ implementation
          root:=nil;
          root:=nil;
          count:=0;
          count:=0;
          { insert all message handlers into a tree, sorted by name }
          { insert all message handlers into a tree, sorted by name }
-         _class^.publicsyms^.foreach({$ifndef TP}@{$endif}insertmsgint);
+         _class^.symtable^.foreach({$ifndef TP}@{$endif}insertmsgint);
 
 
          { now start writing of the message string table }
          { now start writing of the message string table }
          getdatalabel(r);
          getdatalabel(r);
@@ -312,7 +312,7 @@ implementation
                 symcoll^.data:=procdefcoll;
                 symcoll^.data:=procdefcoll;
 
 
                 { if it's a virtual method }
                 { if it's a virtual method }
-                if (hp^.options and povirtualmethod)<>0 then
+                if (po_virtualmethod in hp^.procoptions) then
                   begin
                   begin
                      { then it gets a number ... }
                      { then it gets a number ... }
                      hp^.extnumber:=nextvirtnumber;
                      hp^.extnumber:=nextvirtnumber;
@@ -321,11 +321,11 @@ implementation
                      has_virtual_method:=true;
                      has_virtual_method:=true;
                   end;
                   end;
 
 
-                if (hp^.options and poconstructor)<>0 then
+                if (hp^.proctypeoption=potype_constructor) then
                   has_constructor:=true;
                   has_constructor:=true;
 
 
                 { check, if a method should be overridden }
                 { check, if a method should be overridden }
-                if (hp^.options and pooverridingmethod)<>0 then
+                if (po_overridingmethod in hp^.procoptions) then
                   Message1(parser_e_nothing_to_be_overridden,_c^.objname^+'.'+_name);
                   Message1(parser_e_nothing_to_be_overridden,_c^.objname^+'.'+_name);
                 { next overloaded method }
                 { next overloaded method }
                 hp:=hp^.nextoverloaded;
                 hp:=hp^.nextoverloaded;
@@ -355,18 +355,18 @@ implementation
                                   { compare parameters }
                                   { compare parameters }
                                   if equal_paras(procdefcoll^.data^.para1,hp^.para1,false) and
                                   if equal_paras(procdefcoll^.data^.para1,hp^.para1,false) and
                                      (
                                      (
-                                       ((procdefcoll^.data^.options and povirtualmethod)<>0) or
-                                       ((hp^.options and povirtualmethod)<>0)
+                                       (po_virtualmethod in procdefcoll^.data^.procoptions) or
+                                       (po_virtualmethod in hp^.procoptions)
                                      ) then
                                      ) then
                                     begin { same parameters }
                                     begin { same parameters }
                                        { wenn sie gleich sind }
                                        { wenn sie gleich sind }
                                        { und eine davon virtual deklariert ist }
                                        { und eine davon virtual deklariert ist }
                                        { Fehler falls nur eine VIRTUAL }
                                        { Fehler falls nur eine VIRTUAL }
-                                       if (procdefcoll^.data^.options and povirtualmethod)<>
-                                          (hp^.options and povirtualmethod) then
+                                       if (po_virtualmethod in procdefcoll^.data^.procoptions)<>
+                                          (po_virtualmethod in hp^.procoptions) then
                                          begin
                                          begin
                                             { in classes, we hide the old method }
                                             { in classes, we hide the old method }
-                                            if _c^.isclass then
+                                            if _c^.is_class then
                                               begin
                                               begin
                                                  { warn only if it is the first time,
                                                  { warn only if it is the first time,
                                                    we hide the method }
                                                    we hide the method }
@@ -378,7 +378,7 @@ implementation
                                             else
                                             else
                                               if _c=hp^._class then
                                               if _c=hp^._class then
                                                 begin
                                                 begin
-                                                   if (procdefcoll^.data^.options and povirtualmethod)<>0 then
+                                                   if (po_virtualmethod in procdefcoll^.data^.procoptions) then
                                                      Message1(parser_w_overloaded_are_not_both_virtual,_c^.objname^+'.'+_name)
                                                      Message1(parser_w_overloaded_are_not_both_virtual,_c^.objname^+'.'+_name)
                                                    else
                                                    else
                                                      Message1(parser_w_overloaded_are_not_both_non_virtual,
                                                      Message1(parser_w_overloaded_are_not_both_non_virtual,
@@ -391,16 +391,18 @@ implementation
                                        { the flags have to match      }
                                        { the flags have to match      }
                                        { except abstract and override }
                                        { except abstract and override }
                                        { only if both are virtual !!  }
                                        { only if both are virtual !!  }
-                                       if (procdefcoll^.data^.options and not(poabstractmethod or pooverridingmethod))<>
-                                         (hp^.options and not(poabstractmethod or pooverridingmethod)) then
-                                            Message1(parser_e_header_dont_match_forward,_c^.objname^+'.'+_name);
+                                       if (procdefcoll^.data^.proccalloptions<>hp^.proccalloptions) or
+                                          (procdefcoll^.data^.proctypeoption<>hp^.proctypeoption) or
+                                          ((procdefcoll^.data^.procoptions-[po_abstractmethod,po_overridingmethod])<>
+                                           (hp^.procoptions-[po_abstractmethod,po_overridingmethod])) then
+                                         Message1(parser_e_header_dont_match_forward,_c^.objname^+'.'+_name);
 
 
                                        { check, if the overridden directive is set }
                                        { check, if the overridden directive is set }
                                        { (povirtualmethod is set! }
                                        { (povirtualmethod is set! }
 
 
                                        { class ? }
                                        { class ? }
-                                       if _c^.isclass and
-                                         ((hp^.options and pooverridingmethod)=0) then
+                                       if _c^.is_class and
+                                          not(po_overridingmethod in hp^.procoptions) then
                                          begin
                                          begin
                                             { warn only if it is the first time,
                                             { warn only if it is the first time,
                                               we hide the method }
                                               we hide the method }
@@ -414,9 +416,9 @@ implementation
                                        if not(is_equal(procdefcoll^.data^.retdef,hp^.retdef)) and
                                        if not(is_equal(procdefcoll^.data^.retdef,hp^.retdef)) and
                                          not((procdefcoll^.data^.retdef^.deftype=objectdef) and
                                          not((procdefcoll^.data^.retdef^.deftype=objectdef) and
                                            (hp^.retdef^.deftype=objectdef) and
                                            (hp^.retdef^.deftype=objectdef) and
-                                           (pobjectdef(procdefcoll^.data^.retdef)^.isclass) and
-                                           (pobjectdef(hp^.retdef)^.isclass) and
-                                           (pobjectdef(hp^.retdef)^.isrelated(pobjectdef(procdefcoll^.data^.retdef)))) then
+                                           (pobjectdef(procdefcoll^.data^.retdef)^.is_class) and
+                                           (pobjectdef(hp^.retdef)^.is_class) and
+                                           (pobjectdef(hp^.retdef)^.is_related(pobjectdef(procdefcoll^.data^.retdef)))) then
                                          Message1(parser_e_overloaded_methodes_not_same_ret,_c^.objname^+'.'+_name);
                                          Message1(parser_e_overloaded_methodes_not_same_ret,_c^.objname^+'.'+_name);
 
 
 
 
@@ -437,14 +439,14 @@ implementation
                                   procdefcoll^.next:=symcoll^.data;
                                   procdefcoll^.next:=symcoll^.data;
                                   symcoll^.data:=procdefcoll;
                                   symcoll^.data:=procdefcoll;
                                   { if the method is virtual ... }
                                   { if the method is virtual ... }
-                                  if (hp^.options and povirtualmethod)<>0 then
+                                  if (po_virtualmethod in hp^.procoptions) then
                                     begin
                                     begin
                                        { ... it will get a number }
                                        { ... it will get a number }
                                        hp^.extnumber:=nextvirtnumber;
                                        hp^.extnumber:=nextvirtnumber;
                                        inc(nextvirtnumber);
                                        inc(nextvirtnumber);
                                     end;
                                     end;
                                   { check, if a method should be overridden }
                                   { check, if a method should be overridden }
-                                  if (hp^.options and pooverridingmethod)<>0 then
+                                  if (po_overridingmethod in hp^.procoptions) then
                                    Message1(parser_e_nothing_to_be_overridden,_c^.objname^+'.'+_name);
                                    Message1(parser_e_nothing_to_be_overridden,_c^.objname^+'.'+_name);
                                end;
                                end;
                              hp:=hp^.nextoverloaded;
                              hp:=hp^.nextoverloaded;
@@ -471,7 +473,7 @@ implementation
            {_c:=_class;}
            {_c:=_class;}
            _c:=p;
            _c:=p;
            { Florian, please check if you agree (PM) }
            { Florian, please check if you agree (PM) }
-           p^.publicsyms^.foreach({$ifndef TP}@{$endif}eachsym);
+           p^.symtable^.foreach({$ifndef TP}@{$endif}eachsym);
         end;
         end;
 
 
       var
       var
@@ -513,16 +515,19 @@ implementation
                         { but only this which are declared as virtual }
                         { but only this which are declared as virtual }
                         if procdefcoll^.data^.extnumber=i then
                         if procdefcoll^.data^.extnumber=i then
                           begin
                           begin
-                             if (procdefcoll^.data^.options and povirtualmethod)<>0 then
+                             if (po_virtualmethod in procdefcoll^.data^.procoptions) then
                                begin
                                begin
                                   { if a method is abstract, then is also the }
                                   { if a method is abstract, then is also the }
                                   { class abstract and it's not allow to      }
                                   { class abstract and it's not allow to      }
                                   { generates an instance                     }
                                   { generates an instance                     }
-                                  if (procdefcoll^.data^.options and poabstractmethod)<>0 then
+                                  if (po_abstractmethod in procdefcoll^.data^.procoptions) then
                                     begin
                                     begin
-                                       _class^.options:=_class^.options or oo_is_abstract;
-                                       datasegment^.concat(new(pai_const_symbol,
-                                         initname('FPC_ABSTRACTERROR')));
+{$ifdef INCLUDEOK}
+                                       include(_class^.objectoptions,oo_has_abstract);
+{$else}
+                                       _class^.objectoptions:=_class^.objectoptions+[oo_has_abstract];
+{$endif}
+                                       datasegment^.concat(new(pai_const_symbol,initname('FPC_ABSTRACTERROR')));
                                     end
                                     end
                                   else
                                   else
                                     begin
                                     begin
@@ -558,7 +563,11 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.13  1999-07-11 20:10:23  peter
+  Revision 1.14  1999-08-03 22:02:52  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.13  1999/07/11 20:10:23  peter
     * merged
     * merged
 
 
   Revision 1.12  1999/07/08 10:40:37  peter
   Revision 1.12  1999/07/08 10:40:37  peter

+ 21 - 12
compiler/htypechk.pas

@@ -58,6 +58,7 @@ implementation
     uses
     uses
        globtype,systems,tokens,
        globtype,systems,tokens,
        cobjects,verbose,globals,
        cobjects,verbose,globals,
+       symconst,
        types,
        types,
        hcodegen;
        hcodegen;
 
 
@@ -304,7 +305,7 @@ implementation
                      if (
                      if (
                          (ppointerdef(def_from)^.definition^.deftype=objectdef) and
                          (ppointerdef(def_from)^.definition^.deftype=objectdef) and
                          (ppointerdef(def_to)^.definition^.deftype=objectdef) and
                          (ppointerdef(def_to)^.definition^.deftype=objectdef) and
-                         pobjectdef(ppointerdef(def_from)^.definition)^.isrelated(
+                         pobjectdef(ppointerdef(def_from)^.definition)^.is_related(
                            pobjectdef(ppointerdef(def_to)^.definition))
                            pobjectdef(ppointerdef(def_to)^.definition))
                         ) or
                         ) or
                         { all pointers can be assigned to void-pointer }
                         { all pointers can be assigned to void-pointer }
@@ -335,7 +336,7 @@ implementation
                      { class types and class reference type
                      { class types and class reference type
                        can be assigned to void pointers      }
                        can be assigned to void pointers      }
                      if (
                      if (
-                         ((def_from^.deftype=objectdef) and pobjectdef(def_from)^.isclass) or
+                         ((def_from^.deftype=objectdef) and pobjectdef(def_from)^.is_class) or
                          (def_from^.deftype=classrefdef)
                          (def_from^.deftype=classrefdef)
                         ) and
                         ) and
                         (ppointerdef(def_to)^.definition^.deftype=orddef) and
                         (ppointerdef(def_to)^.definition^.deftype=orddef) and
@@ -394,12 +395,12 @@ implementation
                   pobjectdef(def_from)^.isclass and pobjectdef(def_to)^.isclass }then
                   pobjectdef(def_from)^.isclass and pobjectdef(def_to)^.isclass }then
                 begin
                 begin
                   doconv:=tc_equal;
                   doconv:=tc_equal;
-                  if pobjectdef(def_from)^.isrelated(pobjectdef(def_to)) then
+                  if pobjectdef(def_from)^.is_related(pobjectdef(def_to)) then
                    b:=1;
                    b:=1;
                 end
                 end
                else
                else
                 { nil is compatible with class instances }
                 { nil is compatible with class instances }
-                if (fromtreetype=niln) and (pobjectdef(def_to)^.isclass) then
+                if (fromtreetype=niln) and (pobjectdef(def_to)^.is_class) then
                  begin
                  begin
                    doconv:=tc_equal;
                    doconv:=tc_equal;
                    b:=1;
                    b:=1;
@@ -412,7 +413,7 @@ implementation
                if (def_from^.deftype=classrefdef) then
                if (def_from^.deftype=classrefdef) then
                 begin
                 begin
                   doconv:=tc_equal;
                   doconv:=tc_equal;
-                  if pobjectdef(pclassrefdef(def_from)^.definition)^.isrelated(
+                  if pobjectdef(pclassrefdef(def_from)^.definition)^.is_related(
                        pobjectdef(pclassrefdef(def_to)^.definition)) then
                        pobjectdef(pclassrefdef(def_to)^.definition)) then
                    b:=1;
                    b:=1;
                 end
                 end
@@ -484,8 +485,11 @@ implementation
               make_not_regable(p^.left);
               make_not_regable(p^.left);
             loadn :
             loadn :
               if p^.symtableentry^.typ=varsym then
               if p^.symtableentry^.typ=varsym then
-                pvarsym(p^.symtableentry)^.var_options :=
-                  pvarsym(p^.symtableentry)^.var_options and not vo_regable;
+{$ifdef INCLUDEOK}
+                exclude(pvarsym(p^.symtableentry)^.varoptions,vo_regable);
+{$else}
+                pvarsym(p^.symtableentry)^.varoptions:=pvarsym(p^.symtableentry)^.varoptions-[vo_regable];
+{$endif}
          end;
          end;
       end;
       end;
 
 
@@ -567,10 +571,11 @@ implementation
 
 
     procedure test_protected_sym(sym : psym);
     procedure test_protected_sym(sym : psym);
       begin
       begin
-         if ((sym^.properties and sp_protected)<>0) and
-           ((sym^.owner^.symtabletype=unitsymtable) or
-            ((sym^.owner^.symtabletype=objectsymtable) and
-           (pobjectdef(sym^.owner^.defowner)^.owner^.symtabletype=unitsymtable))) then
+         if (sp_protected in sym^.symoptions) and
+            ((sym^.owner^.symtabletype=unitsymtable) or
+             ((sym^.owner^.symtabletype=objectsymtable) and
+             (pobjectdef(sym^.owner^.defowner)^.owner^.symtabletype=unitsymtable))
+            ) then
           CGMessage(parser_e_cant_access_protected_member);
           CGMessage(parser_e_cant_access_protected_member);
       end;
       end;
 
 
@@ -666,7 +671,11 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.31  1999-07-16 10:04:32  peter
+  Revision 1.32  1999-08-03 22:02:53  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.31  1999/07/16 10:04:32  peter
     * merged
     * merged
 
 
   Revision 1.30  1999/06/28 16:02:30  peter
   Revision 1.30  1999/06/28 16:02:30  peter

+ 11 - 2
compiler/lin_targ.pas

@@ -40,6 +40,7 @@ implementation
 
 
   uses
   uses
     verbose,strings,cobjects,systems,globtype,globals,
     verbose,strings,cobjects,systems,globtype,globals,
+    symconst,
     files,aasm,symtable;
     files,aasm,symtable;
 
 
 
 
@@ -66,7 +67,11 @@ implementation
         current_module^.linkothersharedlibs.insert(SplitName(module),link_allways);
         current_module^.linkothersharedlibs.insert(SplitName(module),link_allways);
         { reset the mangledname and turn off the dll_var option }
         { reset the mangledname and turn off the dll_var option }
         aktvarsym^.setmangledname(name);
         aktvarsym^.setmangledname(name);
-        aktvarsym^.var_options:=aktvarsym^.var_options and (not vo_is_dll_var);
+{$ifdef INCLUDEOK}
+        exclude(aktvarsym^.varoptions,vo_is_dll_var);
+{$else}
+        aktvarsym^.varoptions:=aktvarsym^.varoptions-[vo_is_dll_var];
+{$endif}
       end;
       end;
 
 
 
 
@@ -78,7 +83,11 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.4  1999-07-03 00:29:50  peter
+  Revision 1.5  1999-08-03 22:02:54  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.4  1999/07/03 00:29:50  peter
     * new link writing to the ppu, one .ppu is needed for all link types,
     * new link writing to the ppu, one .ppu is needed for all link types,
       static (.o) is now always created also when smartlinking is used
       static (.o) is now always created also when smartlinking is used
 
 

+ 13 - 9
compiler/pass_2.pas

@@ -43,7 +43,7 @@ implementation
    uses
    uses
      globtype,systems,
      globtype,systems,
      cobjects,comphook,verbose,globals,files,
      cobjects,comphook,verbose,globals,files,
-     symtable,types,aasm,scanner,
+     symconst,symtable,types,aasm,scanner,
      pass_1,hcodegen,temp_gen
      pass_1,hcodegen,temp_gen
 {$ifdef GDB}
 {$ifdef GDB}
      ,gdb
      ,gdb
@@ -124,7 +124,7 @@ implementation
         i : longint;
         i : longint;
         r : preference;
         r : preference;
       begin
       begin
-         if (aktprocsym^.definition^.options and poinline)<>0 then
+         if (pocall_inline in aktprocsym^.definition^.proccalloptions) then
            begin
            begin
              localfixup:=aktprocsym^.definition^.localst^.address_fixup;
              localfixup:=aktprocsym^.definition^.localst^.address_fixup;
              parafixup:=aktprocsym^.definition^.parast^.address_fixup;
              parafixup:=aktprocsym^.definition^.parast^.address_fixup;
@@ -304,7 +304,7 @@ implementation
       var
       var
          i,j,k : longint;
          i,j,k : longint;
       begin
       begin
-         if (psym(p)^.typ=varsym) and ((pvarsym(p)^.var_options and vo_regable)<>0) then
+         if (psym(p)^.typ=varsym) and (vo_regable in pvarsym(p)^.varoptions) then
            begin
            begin
               { walk through all momentary register variables }
               { walk through all momentary register variables }
               for i:=1 to maxvarregs do
               for i:=1 to maxvarregs do
@@ -382,10 +382,10 @@ implementation
                    }
                    }
                    if assigned(aktprocsym) then
                    if assigned(aktprocsym) then
                      begin
                      begin
-                       if (aktprocsym^.definition^.options and
-                        (poconstructor+podestructor{+poinline}+pointerrupt)=0) and
-                        ((procinfo.flags and pi_do_call)=0) and
-                        (lexlevel>=normal_function_level) then
+                       if not(aktprocsym^.definition^.proctypeoption in [potype_constructor,potype_destructor]) and
+                          not(po_interrupt in aktprocsym^.definition^.procoptions) and
+                          ((procinfo.flags and pi_do_call)=0) and
+                          (lexlevel>=normal_function_level) then
                        begin
                        begin
                          { use ESP as frame pointer }
                          { use ESP as frame pointer }
                          procinfo.framepointer:=stack_pointer;
                          procinfo.framepointer:=stack_pointer;
@@ -522,7 +522,7 @@ implementation
                      end;
                      end;
                 end;
                 end;
               if assigned(aktprocsym) and
               if assigned(aktprocsym) and
-                 ((aktprocsym^.definition^.options and poinline)<>0) then
+                 (pocall_inline in aktprocsym^.definition^.proccalloptions) then
                 make_const_global:=true;
                 make_const_global:=true;
               do_secondpass(p);
               do_secondpass(p);
 
 
@@ -539,7 +539,11 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.26  1999-06-02 22:44:08  pierre
+  Revision 1.27  1999-08-03 22:02:55  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.26  1999/06/02 22:44:08  pierre
    * previous wrong log corrected
    * previous wrong log corrected
 
 
   Revision 1.25  1999/06/02 22:25:41  pierre
   Revision 1.25  1999/06/02 22:25:41  pierre

+ 203 - 112
compiler/pdecl.pas

@@ -56,7 +56,8 @@ unit pdecl;
   implementation
   implementation
 
 
     uses
     uses
-       cobjects,scanner,aasm,tree,pass_1,strings,
+       cobjects,scanner,
+       symconst,aasm,tree,pass_1,strings,
        files,types,verbose,systems,import
        files,types,verbose,systems,import
 {$ifndef newcg}
 {$ifndef newcg}
        ,tccnv
        ,tccnv
@@ -87,7 +88,7 @@ unit pdecl;
       begin
       begin
          if not(psym(p)^.typ=typesym) then
          if not(psym(p)^.typ=typesym) then
           exit;
           exit;
-         if ((psym(p)^.properties and sp_forwarddef)<>0) then
+         if (sp_forwarddef in psym(p)^.symoptions) then
            begin
            begin
              oldaktfilepos:=aktfilepos;
              oldaktfilepos:=aktfilepos;
              aktfilepos:=psym(p)^.fileinfo;
              aktfilepos:=psym(p)^.fileinfo;
@@ -95,15 +96,19 @@ unit pdecl;
              aktfilepos:=oldaktfilepos;
              aktfilepos:=oldaktfilepos;
              { try to recover }
              { try to recover }
              ptypesym(p)^.definition:=generrordef;
              ptypesym(p)^.definition:=generrordef;
-             psym(p)^.properties:=psym(p)^.properties and (not sp_forwarddef);
+{$ifdef INCLUDEOK}
+             exclude(psym(p)^.symoptions,sp_forwarddef);
+{$else}
+             psym(p)^.symoptions:=psym(p)^.symoptions-[sp_forwarddef];
+{$endif}
            end
            end
          else
          else
           if (ptypesym(p)^.definition^.deftype in [recorddef,objectdef]) then
           if (ptypesym(p)^.definition^.deftype in [recorddef,objectdef]) then
            begin
            begin
              if (ptypesym(p)^.definition^.deftype=recorddef) then
              if (ptypesym(p)^.definition^.deftype=recorddef) then
-               reaktvarsymtable:=precdef(ptypesym(p)^.definition)^.symtable
+               reaktvarsymtable:=precorddef(ptypesym(p)^.definition)^.symtable
              else
              else
-               reaktvarsymtable:=pobjectdef(ptypesym(p)^.definition)^.publicsyms;
+               reaktvarsymtable:=pobjectdef(ptypesym(p)^.definition)^.symtable;
              reaktvarsymtable^.foreach({$ifndef TP}@{$endif}testforward_type);
              reaktvarsymtable^.foreach({$ifndef TP}@{$endif}testforward_type);
            end;
            end;
       end;
       end;
@@ -281,11 +286,15 @@ unit pdecl;
                 else
                 else
                  ss:=new(pvarsym,init(s,def));
                  ss:=new(pvarsym,init(s,def));
                 if is_threadvar then
                 if is_threadvar then
-                  ss^.var_options:=ss^.var_options or vo_is_thread_var;
+{$ifdef INCLUDEOK}
+                  include(ss^.varoptions,vo_is_thread_var);
+{$else}
+                  ss^.varoptions:=ss^.varoptions+[vo_is_thread_var];
+{$endif}
                 st^.insert(ss);
                 st^.insert(ss);
                 { static data fields are inserted in the globalsymtable }
                 { static data fields are inserted in the globalsymtable }
                 if (st^.symtabletype=objectsymtable) and
                 if (st^.symtabletype=objectsymtable) and
-                   ((current_object_option and sp_static)<>0) then
+                   (sp_static in current_object_option) then
                   begin
                   begin
                      s:=lower(st^.name^)+'_'+s;
                      s:=lower(st^.name^)+'_'+s;
                      st^.defowner^.owner^.insert(new(pvarsym,init(s,def)));
                      st^.defowner^.owner^.insert(new(pvarsym,init(s,def)));
@@ -361,7 +370,11 @@ unit pdecl;
                    Message(parser_e_absolute_only_one_var);
                    Message(parser_e_absolute_only_one_var);
                   dispose(sc,done);
                   dispose(sc,done);
                   aktvarsym:=new(pvarsym,init_C(s,target_os.Cprefix+C_name,p));
                   aktvarsym:=new(pvarsym,init_C(s,target_os.Cprefix+C_name,p));
-                  aktvarsym^.var_options:=aktvarsym^.var_options or vo_is_external;
+{$ifdef INCLUDEOK}
+                  include(aktvarsym^.varoptions,vo_is_external);
+{$else}
+                  aktvarsym^.varoptions:=aktvarsym^.varoptions+[vo_is_external];
+{$endif}
                   symtablestack^.insert(aktvarsym);
                   symtablestack^.insert(aktvarsym);
                   tokenpos:=storetokenpos;
                   tokenpos:=storetokenpos;
                   symdone:=true;
                   symdone:=true;
@@ -550,7 +563,11 @@ unit pdecl;
                    if export_aktvarsym then
                    if export_aktvarsym then
                     inc(aktvarsym^.refs);
                     inc(aktvarsym^.refs);
                    if extern_aktvarsym then
                    if extern_aktvarsym then
-                    aktvarsym^.var_options:=aktvarsym^.var_options or vo_is_external;
+{$ifdef INCLUDEOK}
+                    include(aktvarsym^.varoptions,vo_is_external);
+{$else}
+                    aktvarsym^.varoptions:=aktvarsym^.varoptions+[vo_is_external];
+{$endif}
                    { insert in the stack/datasegment }
                    { insert in the stack/datasegment }
                    symtablestack^.insert(aktvarsym);
                    symtablestack^.insert(aktvarsym);
                    tokenpos:=storetokenpos;
                    tokenpos:=storetokenpos;
@@ -573,12 +590,20 @@ unit pdecl;
                 else
                 else
                  if (is_object) and (cs_static_keyword in aktmoduleswitches) and (idtoken=_STATIC) then
                  if (is_object) and (cs_static_keyword in aktmoduleswitches) and (idtoken=_STATIC) then
                   begin
                   begin
-                    current_object_option:=current_object_option or sp_static;
+{$ifdef INCLUDEOK}
+                    include(current_object_option,sp_static);
+{$else}
+                    current_object_option:=current_object_option+[sp_static];
+{$endif}
                     if assigned(readtypesym) then
                     if assigned(readtypesym) then
                      insert_syms(symtablestack,sc,nil,readtypesym,false)
                      insert_syms(symtablestack,sc,nil,readtypesym,false)
                     else
                     else
                      insert_syms(symtablestack,sc,p,nil,false);
                      insert_syms(symtablestack,sc,p,nil,false);
-                    current_object_option:=current_object_option - sp_static;
+{$ifdef INCLUDEOK}
+                    exclude(current_object_option,sp_static);
+{$else}
+                    current_object_option:=current_object_option-[sp_static];
+{$endif}
                     consume(_STATIC);
                     consume(_STATIC);
                     consume(SEMICOLON);
                     consume(SEMICOLON);
                     symdone:=true;
                     symdone:=true;
@@ -587,8 +612,8 @@ unit pdecl;
              { insert it in the symtable, if not done yet }
              { insert it in the symtable, if not done yet }
              if not symdone then
              if not symdone then
                begin
                begin
-                  if (current_object_option=sp_published) and
-                    (not((p^.deftype=objectdef) and (pobjectdef(p)^.isclass))) then
+                  if (sp_published in current_object_option) and
+                    (not((p^.deftype=objectdef) and (pobjectdef(p)^.is_class))) then
                     Message(parser_e_cant_publish_that);
                     Message(parser_e_cant_publish_that);
                   if assigned(readtypesym) then
                   if assigned(readtypesym) then
                    insert_syms(symtablestack,sc,nil,readtypesym,is_threadvar)
                    insert_syms(symtablestack,sc,nil,readtypesym,is_threadvar)
@@ -703,7 +728,7 @@ unit pdecl;
          s:=pattern;
          s:=pattern;
          consume(ID);
          consume(ID);
          { classes can be used also in classes }
          { classes can be used also in classes }
-         if (curobjectname=pattern) and aktobjectdef^.isclass then
+         if (curobjectname=pattern) and aktobjectdef^.is_class then
            begin
            begin
               id_type:=aktobjectdef;
               id_type:=aktobjectdef;
               exit;
               exit;
@@ -789,7 +814,7 @@ unit pdecl;
     function object_dec(const n : stringid;fd : pobjectdef) : pdef;
     function object_dec(const n : stringid;fd : pobjectdef) : pdef;
     { this function parses an object or class declaration }
     { this function parses an object or class declaration }
       var
       var
-         actmembertype : symprop;
+         actmembertype : tsymoptions;
          there_is_a_destructor : boolean;
          there_is_a_destructor : boolean;
          is_a_class : boolean;
          is_a_class : boolean;
          childof : pobjectdef;
          childof : pobjectdef;
@@ -801,16 +826,20 @@ unit pdecl;
            consume(_CONSTRUCTOR);
            consume(_CONSTRUCTOR);
            { must be at same level as in implementation }
            { must be at same level as in implementation }
            inc(lexlevel);
            inc(lexlevel);
-           parse_proc_head(poconstructor);
+           parse_proc_head(potype_constructor);
            dec(lexlevel);
            dec(lexlevel);
 
 
            if (cs_constructor_name in aktglobalswitches) and (aktprocsym^.name<>'INIT') then
            if (cs_constructor_name in aktglobalswitches) and (aktprocsym^.name<>'INIT') then
             Message(parser_e_constructorname_must_be_init);
             Message(parser_e_constructorname_must_be_init);
 
 
-           aktclass^.options:=aktclass^.options or oo_hasconstructor;
+{$ifdef INCLUDEOK}
+           include(aktclass^.objectoptions,oo_has_constructor);
+{$else}
+           aktclass^.objectoptions:=aktclass^.objectoptions+[oo_has_constructor];
+{$endif}
            consume(SEMICOLON);
            consume(SEMICOLON);
              begin
              begin
-                if (aktclass^.options and oo_is_class)<>0 then
+                if (aktclass^.is_class) then
                   begin
                   begin
                      { CLASS constructors return the created instance }
                      { CLASS constructors return the created instance }
                      aktprocsym^.definition^.retdef:=aktclass;
                      aktprocsym^.definition^.retdef:=aktclass;
@@ -872,7 +901,7 @@ unit pdecl;
 
 
         begin
         begin
            { check for a class }
            { check for a class }
-           if (aktclass^.options and oo_is_class=0) then
+           if not(aktclass^.is_class) then
             Message(parser_e_syntax_error);
             Message(parser_e_syntax_error);
            consume(_PROPERTY);
            consume(_PROPERTY);
            propertyparas:=nil;
            propertyparas:=nil;
@@ -885,7 +914,7 @@ unit pdecl;
                 { property parameters ? }
                 { property parameters ? }
                 if token=LECKKLAMMER then
                 if token=LECKKLAMMER then
                   begin
                   begin
-                     if current_object_option=sp_published then
+                     if (sp_published in current_object_option) then
                        Message(parser_e_cant_publish_that_property);
                        Message(parser_e_cant_publish_that_property);
 
 
                      { create a list of the parameters in propertyparas }
                      { create a list of the parameters in propertyparas }
@@ -955,7 +984,11 @@ unit pdecl;
                      if (idtoken=_INDEX) then
                      if (idtoken=_INDEX) then
                        begin
                        begin
                           consume(_INDEX);
                           consume(_INDEX);
-                          p^.options:=p^.options or ppo_indexed;
+{$ifdef INCLUDEOK}
+                          include(p^.propoptions,ppo_indexed);
+{$else}
+                          p^.propoptions:=p^.propoptions+[ppo_indexed];
+{$endif}
                           if token=INTCONST then
                           if token=INTCONST then
                             val(pattern,p^.index,code);
                             val(pattern,p^.index,code);
                           consume(INTCONST);
                           consume(INTCONST);
@@ -974,7 +1007,7 @@ unit pdecl;
                      if assigned(overriden) and (overriden^.typ=propertysym) then
                      if assigned(overriden) and (overriden^.typ=propertysym) then
                        begin
                        begin
                           { take the whole info: }
                           { take the whole info: }
-                          p^.options:=ppropertysym(overriden)^.options;
+                          p^.propoptions:=ppropertysym(overriden)^.propoptions;
                           p^.index:=ppropertysym(overriden)^.index;
                           p^.index:=ppropertysym(overriden)^.index;
                           p^.proptype:=ppropertysym(overriden)^.proptype;
                           p^.proptype:=ppropertysym(overriden)^.proptype;
                           p^.writeaccesssym:=ppropertysym(overriden)^.writeaccesssym;
                           p^.writeaccesssym:=ppropertysym(overriden)^.writeaccesssym;
@@ -992,8 +1025,8 @@ unit pdecl;
                        end;
                        end;
                   end;
                   end;
 
 
-                if (current_object_option=sp_published) and
-                  not(p^.proptype^.is_publishable) then
+                if (sp_published in current_object_option) and
+                   not(p^.proptype^.is_publishable) then
                   Message(parser_e_cant_publish_that_property);
                   Message(parser_e_cant_publish_that_property);
 
 
                 { create data defcoll to allow correct parameter checks }
                 { create data defcoll to allow correct parameter checks }
@@ -1018,7 +1051,7 @@ unit pdecl;
                              ((sym^.typ=varsym) and (pvarsym(sym)^.definition^.deftype=recorddef)) then
                              ((sym^.typ=varsym) and (pvarsym(sym)^.definition^.deftype=recorddef)) then
                            begin
                            begin
                              consume(POINT);
                              consume(POINT);
-                             getsymonlyin(precdef(pvarsym(sym)^.definition)^.symtable,pattern);
+                             getsymonlyin(precorddef(pvarsym(sym)^.definition)^.symtable,pattern);
                              if not assigned(srsym) then
                              if not assigned(srsym) then
                                Message1(sym_e_illegal_field,pattern);
                                Message1(sym_e_illegal_field,pattern);
                              sym:=srsym;
                              sym:=srsym;
@@ -1072,7 +1105,7 @@ unit pdecl;
                              ((sym^.typ=varsym) and (pvarsym(sym)^.definition^.deftype=recorddef)) then
                              ((sym^.typ=varsym) and (pvarsym(sym)^.definition^.deftype=recorddef)) then
                            begin
                            begin
                              consume(POINT);
                              consume(POINT);
-                             getsymonlyin(precdef(pvarsym(sym)^.definition)^.symtable,pattern);
+                             getsymonlyin(precorddef(pvarsym(sym)^.definition)^.symtable,pattern);
                              if not assigned(srsym) then
                              if not assigned(srsym) then
                                Message1(sym_e_illegal_field,pattern);
                                Message1(sym_e_illegal_field,pattern);
                              sym:=srsym;
                              sym:=srsym;
@@ -1166,7 +1199,11 @@ unit pdecl;
                          pobjectdef(p2^.owner^.defowner)^.objname^)
                          pobjectdef(p2^.owner^.defowner)^.objname^)
                      else
                      else
                        begin
                        begin
-                          p^.options:=p^.options or ppo_defaultproperty;
+{$ifdef INCLUDEOK}
+                          include(p^.propoptions,ppo_defaultproperty);
+{$else}
+                          p^.propoptions:=p^.propoptions+[ppo_defaultproperty];
+{$endif}
                           if not(assigned(propertyparas)) then
                           if not(assigned(propertyparas)) then
                             message(parser_e_property_need_paras);
                             message(parser_e_property_need_paras);
                        end;
                        end;
@@ -1189,11 +1226,15 @@ unit pdecl;
         begin
         begin
            consume(_DESTRUCTOR);
            consume(_DESTRUCTOR);
            inc(lexlevel);
            inc(lexlevel);
-           parse_proc_head(podestructor);
+           parse_proc_head(potype_destructor);
            dec(lexlevel);
            dec(lexlevel);
            if (cs_constructor_name in aktglobalswitches) and (aktprocsym^.name<>'DONE') then
            if (cs_constructor_name in aktglobalswitches) and (aktprocsym^.name<>'DONE') then
             Message(parser_e_destructorname_must_be_done);
             Message(parser_e_destructorname_must_be_done);
-           aktclass^.options:=aktclass^.options or oo_hasdestructor;
+{$ifdef INCLUDEOK}
+           include(aktclass^.objectoptions,oo_has_destructor);
+{$else}
+           aktclass^.objectoptions:=aktclass^.objectoptions+[oo_has_destructor];
+{$endif}
            consume(SEMICOLON);
            consume(SEMICOLON);
            if assigned(aktprocsym^.definition^.para1) then
            if assigned(aktprocsym^.definition^.para1) then
             Message(parser_e_no_paras_for_destructor);
             Message(parser_e_no_paras_for_destructor);
@@ -1216,10 +1257,13 @@ unit pdecl;
          oldprocsym:=aktprocsym;
          oldprocsym:=aktprocsym;
          { forward is resolved }
          { forward is resolved }
          if assigned(fd) then
          if assigned(fd) then
-           fd^.options:=fd^.options and not(oo_isforward);
-
+{$ifdef INCLUDEOK}
+           exclude(fd^.objectoptions,oo_is_forward);
+{$else}
+           fd^.objectoptions:=fd^.objectoptions-[oo_is_forward];
+{$endif}
          there_is_a_destructor:=false;
          there_is_a_destructor:=false;
-         actmembertype:=sp_public;
+         actmembertype:=[sp_public];
 
 
          { objects and class types can't be declared local }
          { objects and class types can't be declared local }
          if (symtablestack^.symtabletype<>globalsymtable) and
          if (symtablestack^.symtabletype<>globalsymtable) and
@@ -1250,18 +1294,17 @@ unit pdecl;
                    hp1:=single_type(hs);
                    hp1:=single_type(hs);
 
 
                    { accept hp1, if is a forward def ...}
                    { accept hp1, if is a forward def ...}
-                   if ((lasttypesym<>nil)
-                       and ((lasttypesym^.properties and sp_forwarddef)<>0)) or
+                   if ((lasttypesym<>nil) and
+                       (sp_forwarddef in lasttypesym^.symoptions)) or
                    { or a class
                    { or a class
                      (if the foward defined type is a class is checked, when
                      (if the foward defined type is a class is checked, when
                       the forward is resolved)
                       the forward is resolved)
                    }
                    }
-                     ((hp1^.deftype=objectdef) and (
-                     (pobjectdef(hp1)^.options and oo_is_class)<>0)) then
+                     ((hp1^.deftype=objectdef) and pobjectdef(hp1)^.is_class) then
                      begin
                      begin
                         pcrd:=new(pclassrefdef,init(hp1));
                         pcrd:=new(pclassrefdef,init(hp1));
                         object_dec:=pcrd;
                         object_dec:=pcrd;
-                        if assigned(lasttypesym) and ((lasttypesym^.properties and sp_forwarddef)<>0) then
+                        if assigned(lasttypesym) and (sp_forwarddef in lasttypesym^.symoptions) then
                          lasttypesym^.addforwardpointer(ppointerdef(pcrd));
                          lasttypesym^.addforwardpointer(ppointerdef(pcrd));
                         forwardsallowed:=false;
                         forwardsallowed:=false;
                      end
                      end
@@ -1288,9 +1331,9 @@ unit pdecl;
                      end
                      end
                    else
                    else
                      aktclass:=new(pobjectdef,init(n,nil));
                      aktclass:=new(pobjectdef,init(n,nil));
-                   aktclass^.options:=aktclass^.options or oo_is_class or oo_isforward;
+                   aktclass^.objectoptions:=aktclass^.objectoptions+[oo_is_class,oo_is_forward];
                    { all classes must have a vmt !!  at offset zero }
                    { all classes must have a vmt !!  at offset zero }
-                   if (aktclass^.options and oo_hasvmt)=0 then
+                   if not(oo_has_vmt in aktclass^.objectoptions) then
                      aktclass^.insertvmt;
                      aktclass^.insertvmt;
 
 
                    object_dec:=aktclass;
                    object_dec:=aktclass;
@@ -1320,8 +1363,8 @@ unit pdecl;
               else
               else
                begin
                begin
                  { a mix of class and object isn't allowed }
                  { a mix of class and object isn't allowed }
-                 if (((childof^.options and oo_is_class)<>0) and not is_a_class) or
-                    (((childof^.options and oo_is_class)=0) and is_a_class) then
+                 if (childof^.is_class and not is_a_class) or
+                    (not childof^.is_class and is_a_class) then
                   Message(parser_e_mix_of_classes_and_objects);
                   Message(parser_e_mix_of_classes_and_objects);
                end;
                end;
               if assigned(fd) then
               if assigned(fd) then
@@ -1329,7 +1372,7 @@ unit pdecl;
                    { the forward of the child must be resolved to get
                    { the forward of the child must be resolved to get
                      correct field addresses
                      correct field addresses
                    }
                    }
-                   if (childof^.options and oo_isforward)<>0 then
+                   if (oo_is_forward in childof^.objectoptions) then
                      Message1(parser_e_forward_declaration_must_be_resolved,childof^.objname^);
                      Message1(parser_e_forward_declaration_must_be_resolved,childof^.objname^);
                    aktclass:=fd;
                    aktclass:=fd;
                    { we must inherit several options !!
                    { we must inherit several options !!
@@ -1363,7 +1406,7 @@ unit pdecl;
                         { the forward of the child must be resolved to get
                         { the forward of the child must be resolved to get
                           correct field addresses
                           correct field addresses
                         }
                         }
-                        if (childof^.options and oo_isforward)<>0 then
+                        if (oo_is_forward in childof^.objectoptions) then
                           Message1(parser_e_forward_declaration_must_be_resolved,childof^.objname^);
                           Message1(parser_e_forward_declaration_must_be_resolved,childof^.objname^);
                         aktclass:=fd;
                         aktclass:=fd;
                         aktclass^.set_parent(childof);
                         aktclass^.set_parent(childof);
@@ -1381,21 +1424,27 @@ unit pdecl;
          { set the class attribute }
          { set the class attribute }
          if is_a_class then
          if is_a_class then
            begin
            begin
-              aktclass^.options:=aktclass^.options or oo_is_class;
-
+{$ifdef INCLUDEOK}
+              include(aktclass^.objectoptions,oo_is_class);
+{$else}
+              aktclass^.objectoptions:=aktclass^.objectoptions+[oo_is_class];
+{$endif}
               if (cs_generate_rtti in aktlocalswitches) or
               if (cs_generate_rtti in aktlocalswitches) or
                   (assigned(aktclass^.childof) and
                   (assigned(aktclass^.childof) and
-                   ((aktclass^.childof^.options and oo_can_have_published)<>0)
-                  ) then
-                aktclass^.options:=aktclass^.options or oo_can_have_published;
+                   (oo_can_have_published in aktclass^.childof^.objectoptions)) then
+{$ifdef INCLUDEOK}
+                include(aktclass^.objectoptions,oo_can_have_published);
+{$else}
+                aktclass^.objectoptions:=aktclass^.objectoptions+[oo_can_have_published];
+{$endif}
            end;
            end;
 
 
          aktobjectdef:=aktclass;
          aktobjectdef:=aktclass;
 
 
          { default access is public }
          { default access is public }
-         actmembertype:=sp_public;
-         aktclass^.publicsyms^.next:=symtablestack;
-         symtablestack:=aktclass^.publicsyms;
+         actmembertype:=[sp_public];
+         aktclass^.symtable^.next:=symtablestack;
+         symtablestack:=aktclass^.symtable;
          procinfo._class:=aktclass;
          procinfo._class:=aktclass;
          testcurobject:=1;
          testcurobject:=1;
          curobjectname:=n;
          curobjectname:=n;
@@ -1405,34 +1454,42 @@ unit pdecl;
           begin
           begin
           { Parse componenten }
           { Parse componenten }
             repeat
             repeat
-              if actmembertype=sp_private then
-                aktclass^.options:=aktclass^.options or oo_hasprivate;
-              if actmembertype=sp_protected then
-                aktclass^.options:=aktclass^.options or oo_hasprotected;
+              if (sp_private in actmembertype) then
+{$ifdef INCLUDEOK}
+                include(aktclass^.objectoptions,oo_has_private);
+{$else}
+                aktclass^.objectoptions:=aktclass^.objectoptions+[oo_has_private];
+{$endif}
+              if (sp_protected in actmembertype) then
+{$ifdef INCLUDEOK}
+                include(aktclass^.objectoptions,oo_has_protected);
+{$else}
+                aktclass^.objectoptions:=aktclass^.objectoptions+[oo_has_protected];
+{$endif}
               case token of
               case token of
                ID : begin
                ID : begin
                       case idtoken of
                       case idtoken of
                        _PRIVATE : begin
                        _PRIVATE : begin
                                     consume(_PRIVATE);
                                     consume(_PRIVATE);
-                                    actmembertype:=sp_private;
-                                    current_object_option:=sp_private;
+                                    actmembertype:=[sp_private];
+                                    current_object_option:=[sp_private];
                                   end;
                                   end;
                      _PROTECTED : begin
                      _PROTECTED : begin
                                     consume(_PROTECTED);
                                     consume(_PROTECTED);
-                                    current_object_option:=sp_protected;
-                                    actmembertype:=sp_protected;
+                                    current_object_option:=[sp_protected];
+                                    actmembertype:=[sp_protected];
                                   end;
                                   end;
                         _PUBLIC : begin
                         _PUBLIC : begin
                                     consume(_PUBLIC);
                                     consume(_PUBLIC);
-                                    current_object_option:=sp_public;
-                                    actmembertype:=sp_public;
+                                    current_object_option:=[sp_public];
+                                    actmembertype:=[sp_public];
                                   end;
                                   end;
                      _PUBLISHED : begin
                      _PUBLISHED : begin
-                                    if (aktclass^.options and oo_can_have_published)=0 then
+                                    if not(oo_can_have_published in aktclass^.objectoptions) then
                                      Message(parser_e_cant_have_published);
                                      Message(parser_e_cant_have_published);
                                     consume(_PUBLISHED);
                                     consume(_PUBLISHED);
-                                    current_object_option:=sp_published;
-                                    actmembertype:=sp_published;
+                                    current_object_option:=[sp_published];
+                                    actmembertype:=[sp_published];
                                   end;
                                   end;
                       else
                       else
                         read_var_decs(false,true,false);
                         read_var_decs(false,true,false);
@@ -1448,16 +1505,28 @@ unit pdecl;
 {$ifndef newcg}
 {$ifndef newcg}
                       parse_object_proc_directives(aktprocsym);
                       parse_object_proc_directives(aktprocsym);
 {$endif newcg}
 {$endif newcg}
-                      if (aktprocsym^.definition^.options and pomsgint)<>0 then
-                                aktclass^.options:=aktclass^.options or oo_hasmsgint;
-                      if (aktprocsym^.definition^.options and pomsgstr)<>0 then
-                        aktclass^.options:=aktclass^.options or oo_hasmsgstr;
-                                if (aktprocsym^.definition^.options and povirtualmethod)<>0 then
-                        aktclass^.options:=aktclass^.options or oo_hasvirtual;
+                      if (po_msgint in aktprocsym^.definition^.procoptions) then
+{$ifdef INCLUDEOK}
+                        include(aktclass^.objectoptions,oo_has_msgint);
+{$else}
+                        aktclass^.objectoptions:=aktclass^.objectoptions+[oo_has_msgint];
+{$endif}
+                      if (po_msgstr in aktprocsym^.definition^.procoptions) then
+{$ifdef INCLUDEOK}
+                        include(aktclass^.objectoptions,oo_has_msgstr);
+{$else}
+                        aktclass^.objectoptions:=aktclass^.objectoptions+[oo_has_msgstr];
+{$endif}
+                      if (po_virtualmethod in aktprocsym^.definition^.procoptions) then
+{$ifdef INCLUDEOK}
+                        include(aktclass^.objectoptions,oo_has_virtual);
+{$else}
+                        aktclass^.objectoptions:=aktclass^.objectoptions+[oo_has_virtual];
+{$endif}
                       parse_only:=oldparse_only;
                       parse_only:=oldparse_only;
                     end;
                     end;
      _CONSTRUCTOR : begin
      _CONSTRUCTOR : begin
-                      if actmembertype<>sp_public then
+                      if not(sp_public in actmembertype) then
                         Message(parser_w_constructor_should_be_public);
                         Message(parser_w_constructor_should_be_public);
                       oldparse_only:=parse_only;
                       oldparse_only:=parse_only;
                       parse_only:=true;
                       parse_only:=true;
@@ -1465,15 +1534,19 @@ unit pdecl;
 {$ifndef newcg}
 {$ifndef newcg}
                       parse_object_proc_directives(aktprocsym);
                       parse_object_proc_directives(aktprocsym);
 {$endif newcg}
 {$endif newcg}
-                      if (aktprocsym^.definition^.options and povirtualmethod)<>0 then
-                        aktclass^.options:=aktclass^.options or oo_hasvirtual;
+                      if (po_virtualmethod in aktprocsym^.definition^.procoptions) then
+{$ifdef INCLUDEOK}
+                        include(aktclass^.objectoptions,oo_has_virtual);
+{$else}
+                        aktclass^.objectoptions:=aktclass^.objectoptions+[oo_has_virtual];
+{$endif}
                       parse_only:=oldparse_only;
                       parse_only:=oldparse_only;
                     end;
                     end;
       _DESTRUCTOR : begin
       _DESTRUCTOR : begin
                       if there_is_a_destructor then
                       if there_is_a_destructor then
                         Message(parser_n_only_one_destructor);
                         Message(parser_n_only_one_destructor);
                       there_is_a_destructor:=true;
                       there_is_a_destructor:=true;
-                      if actmembertype<>sp_public then
+                      if not(sp_public in actmembertype) then
                         Message(parser_w_destructor_should_be_public);
                         Message(parser_w_destructor_should_be_public);
                       oldparse_only:=parse_only;
                       oldparse_only:=parse_only;
                       parse_only:=true;
                       parse_only:=true;
@@ -1481,8 +1554,12 @@ unit pdecl;
 {$ifndef newcg}
 {$ifndef newcg}
                       parse_object_proc_directives(aktprocsym);
                       parse_object_proc_directives(aktprocsym);
 {$endif newcg}
 {$endif newcg}
-                      if (aktprocsym^.definition^.options and povirtualmethod)<>0 then
-                        aktclass^.options:=aktclass^.options or oo_hasvirtual;
+                      if (po_virtualmethod in aktprocsym^.definition^.procoptions) then
+{$ifdef INCLUDEOK}
+                        include(aktclass^.objectoptions,oo_has_virtual);
+{$else}
+                        aktclass^.objectoptions:=aktclass^.objectoptions+[oo_has_virtual];
+{$endif}
                       parse_only:=oldparse_only;
                       parse_only:=oldparse_only;
                     end;
                     end;
              _END : begin
              _END : begin
@@ -1493,25 +1570,22 @@ unit pdecl;
                consume(ID); { Give a ident expected message, like tp7 }
                consume(ID); { Give a ident expected message, like tp7 }
               end;
               end;
             until false;
             until false;
-            current_object_option:=sp_public;
+            current_object_option:=[sp_public];
           end;
           end;
          testcurobject:=0;
          testcurobject:=0;
          curobjectname:='';
          curobjectname:='';
          typecanbeforward:=storetypeforwardsallowed;
          typecanbeforward:=storetypeforwardsallowed;
 
 
          { generate vmt space if needed }
          { generate vmt space if needed }
-         if ((aktclass^.options and
-             (oo_hasvirtual or oo_hasconstructor or
-              oo_hasdestructor or oo_is_class))<>0) and
-            ((aktclass^.options and
-              oo_hasvmt)=0) then
-          aktclass^.insertvmt;
+         if not(oo_has_vmt in aktclass^.objectoptions) and
+            ([oo_has_virtual,oo_has_constructor,oo_has_destructor,oo_is_class]*aktclass^.objectoptions<>[]) then
+           aktclass^.insertvmt;
          if (cs_smartlink in aktmoduleswitches) then
          if (cs_smartlink in aktmoduleswitches) then
            datasegment^.concat(new(pai_cut,init));
            datasegment^.concat(new(pai_cut,init));
          { write extended info for classes }
          { write extended info for classes }
          if is_a_class then
          if is_a_class then
            begin
            begin
-              if (aktclass^.options and oo_can_have_published)<>0 then
+              if (oo_can_have_published in aktclass^.objectoptions) then
                 aktclass^.generate_rtti;
                 aktclass^.generate_rtti;
               { write class name }
               { write class name }
               getdatalabel(classnamelabel);
               getdatalabel(classnamelabel);
@@ -1520,16 +1594,15 @@ unit pdecl;
               datasegment^.concat(new(pai_string,init(aktclass^.objname^)));
               datasegment^.concat(new(pai_string,init(aktclass^.objname^)));
 
 
               { generate message and dynamic tables }
               { generate message and dynamic tables }
-              if (aktclass^.options and oo_hasmsgstr)<>0 then
+              if (oo_has_msgstr in aktclass^.objectoptions) then
                 strmessagetable:=genstrmsgtab(aktclass);
                 strmessagetable:=genstrmsgtab(aktclass);
-              if (aktclass^.options and oo_hasmsgint)<>0 then
+              if (oo_has_msgint in aktclass^.objectoptions) then
                 intmessagetable:=genintmsgtab(aktclass)
                 intmessagetable:=genintmsgtab(aktclass)
               else
               else
                 datasegment^.concat(new(pai_const,init_32bit(0)));
                 datasegment^.concat(new(pai_const,init_32bit(0)));
 
 
-
               { table for string messages }
               { table for string messages }
-              if (aktclass^.options and oo_hasmsgstr)<>0 then
+              if (oo_has_msgstr in aktclass^.objectoptions) then
                 datasegment^.concat(new(pai_const_symbol,init(strmessagetable)))
                 datasegment^.concat(new(pai_const_symbol,init(strmessagetable)))
               else
               else
                 datasegment^.concat(new(pai_const,init_32bit(0)));
                 datasegment^.concat(new(pai_const,init_32bit(0)));
@@ -1547,7 +1620,7 @@ unit pdecl;
                 datasegment^.concat(new(pai_const,init_32bit(0)));
                 datasegment^.concat(new(pai_const,init_32bit(0)));
 
 
               { pointer to type info of published section }
               { pointer to type info of published section }
-              if (aktclass^.options and oo_can_have_published)<>0 then
+              if (oo_can_have_published in aktclass^.objectoptions) then
                 datasegment^.concat(new(pai_const_symbol,initname(aktclass^.rtti_name)))
                 datasegment^.concat(new(pai_const_symbol,initname(aktclass^.rtti_name)))
               else
               else
                 datasegment^.concat(new(pai_const,init_32bit(0)));
                 datasegment^.concat(new(pai_const,init_32bit(0)));
@@ -1558,7 +1631,7 @@ unit pdecl;
               datasegment^.concat(new(pai_const,init_32bit(0)));
               datasegment^.concat(new(pai_const,init_32bit(0)));
 
 
               { pointer to dynamic table }
               { pointer to dynamic table }
-              if (aktclass^.options and oo_hasmsgint)<>0 then
+              if (oo_has_msgint in aktclass^.objectoptions) then
                 datasegment^.concat(new(pai_const_symbol,init(intmessagetable)))
                 datasegment^.concat(new(pai_const_symbol,init(intmessagetable)))
               else
               else
                 datasegment^.concat(new(pai_const,init_32bit(0)));
                 datasegment^.concat(new(pai_const,init_32bit(0)));
@@ -1571,7 +1644,7 @@ unit pdecl;
 {$ifdef GDB}
 {$ifdef GDB}
          { generate the VMT }
          { generate the VMT }
          if (cs_debuginfo in aktmoduleswitches) and
          if (cs_debuginfo in aktmoduleswitches) and
-            ((aktclass^.options and oo_hasvmt)<>0) then
+            (oo_has_vmt in aktclass^.objectoptions) then
            begin
            begin
               do_count_dbx:=true;
               do_count_dbx:=true;
               if assigned(aktclass^.owner) and assigned(aktclass^.owner^.name) then
               if assigned(aktclass^.owner) and assigned(aktclass^.owner^.name) then
@@ -1579,24 +1652,22 @@ unit pdecl;
                 typeglobalnumber('__vtbl_ptr_type')+'",'+tostr(N_STSYM)+',0,0,'+aktclass^.vmt_mangledname))));
                 typeglobalnumber('__vtbl_ptr_type')+'",'+tostr(N_STSYM)+',0,0,'+aktclass^.vmt_mangledname))));
            end;
            end;
 {$endif GDB}
 {$endif GDB}
-         if ((aktclass^.options and oo_hasvmt)<>0) then
+         if (oo_has_vmt in aktclass^.objectoptions) then
            begin
            begin
               datasegment^.concat(new(pai_symbol,initname_global(aktclass^.vmt_mangledname,0)));
               datasegment^.concat(new(pai_symbol,initname_global(aktclass^.vmt_mangledname,0)));
 
 
-              { determine the size with publicsyms^.datasize, because }
+              { determine the size with symtable^.datasize, because }
               { size gives back 4 for classes                    }
               { size gives back 4 for classes                    }
-              datasegment^.concat(new(pai_const,init_32bit(aktclass^.publicsyms^.datasize)));
-              datasegment^.concat(new(pai_const,init_32bit(-aktclass^.publicsyms^.datasize)));
+              datasegment^.concat(new(pai_const,init_32bit(aktclass^.symtable^.datasize)));
+              datasegment^.concat(new(pai_const,init_32bit(-aktclass^.symtable^.datasize)));
 
 
               { write pointer to parent VMT, this isn't implemented in TP }
               { write pointer to parent VMT, this isn't implemented in TP }
               { but this is not used in FPC ? (PM) }
               { but this is not used in FPC ? (PM) }
               { it's not used yet, but the delphi-operators as and is need it (FK) }
               { it's not used yet, but the delphi-operators as and is need it (FK) }
               { it is not written for parents that don't have any vmt !! }
               { it is not written for parents that don't have any vmt !! }
               if assigned(aktclass^.childof) and
               if assigned(aktclass^.childof) and
-                 ((aktclass^.childof^.options and oo_hasvmt)<>0) then
-                begin
-                   datasegment^.concat(new(pai_const_symbol,initname(aktclass^.childof^.vmt_mangledname)));
-                end
+                 (oo_has_vmt in aktclass^.childof^.objectoptions) then
+                datasegment^.concat(new(pai_const_symbol,initname(aktclass^.childof^.vmt_mangledname)))
               else
               else
                 datasegment^.concat(new(pai_const,init_32bit(0)));
                 datasegment^.concat(new(pai_const,init_32bit(0)));
 
 
@@ -1627,7 +1698,7 @@ unit pdecl;
       begin
       begin
          { create recdef }
          { create recdef }
          symtable:=new(psymtable,init(recordsymtable));
          symtable:=new(psymtable,init(recordsymtable));
-         record_dec:=new(precdef,init(symtable));
+         record_dec:=new(precorddef,init(symtable));
          { update symtable stack }
          { update symtable stack }
          symtable^.next:=symtablestack;
          symtable^.next:=symtablestack;
          symtablestack:=symtable;
          symtablestack:=symtable;
@@ -1673,7 +1744,11 @@ unit pdecl;
                   { self method ? }
                   { self method ? }
                   if idtoken=_SELF then
                   if idtoken=_SELF then
                    begin
                    begin
-                     procvardef^.options:=procvardef^.options or pocontainsself;
+{$ifdef INCLUDEOK}
+                     include(procvardef^.procoptions,po_containsself);
+{$else}
+                     procvardef^.procoptions:=procvardef^.procoptions+[po_containsself];
+{$endif}
                      consume(idtoken);
                      consume(idtoken);
                      consume(COLON);
                      consume(COLON);
                      p:=single_type(hs1);
                      p:=single_type(hs1);
@@ -1986,7 +2061,7 @@ unit pdecl;
                   forwardsallowed:=true;
                   forwardsallowed:=true;
                 hp1:=single_type(hs);
                 hp1:=single_type(hs);
                 p:=new(ppointerdef,init(hp1));
                 p:=new(ppointerdef,init(hp1));
-                if (lasttypesym<>nil) and ((lasttypesym^.properties and sp_forwarddef)<>0) then
+                if (lasttypesym<>nil) and (sp_forwarddef in lasttypesym^.symoptions) then
                   lasttypesym^.addforwardpointer(ppointerdef(p));
                   lasttypesym^.addforwardpointer(ppointerdef(p));
                 forwardsallowed:=false;
                 forwardsallowed:=false;
                 readtypesym:=nil;
                 readtypesym:=nil;
@@ -2027,7 +2102,11 @@ unit pdecl;
                   begin
                   begin
                     consume(_OF);
                     consume(_OF);
                     consume(_OBJECT);
                     consume(_OBJECT);
-                    pprocvardef(p)^.options:=pprocvardef(p)^.options or pomethodpointer;
+{$ifdef INCLUDEOK}
+                    include(pprocvardef(p)^.procoptions,po_methodpointer);
+{$else}
+                    pprocvardef(p)^.procoptions:=pprocvardef(p)^.procoptions+[po_methodpointer];
+{$endif}
                   end;
                   end;
                 readtypesym:=nil;
                 readtypesym:=nil;
               end;
               end;
@@ -2039,9 +2118,13 @@ unit pdecl;
                 pprocvardef(p)^.retdef:=single_type(hs);
                 pprocvardef(p)^.retdef:=single_type(hs);
                 if token=_OF then
                 if token=_OF then
                   begin
                   begin
-                     consume(_OF);
-                     consume(_OBJECT);
-                     pprocvardef(p)^.options:=pprocvardef(p)^.options or pomethodpointer;
+                    consume(_OF);
+                    consume(_OBJECT);
+{$ifdef INCLUDEOK}
+                    include(pprocvardef(p)^.procoptions,po_methodpointer);
+{$else}
+                    pprocvardef(p)^.procoptions:=pprocvardef(p)^.procoptions+[po_methodpointer];
+{$endif}
                   end;
                   end;
                 readtypesym:=nil;
                 readtypesym:=nil;
               end;
               end;
@@ -2101,8 +2184,8 @@ unit pdecl;
                       if (token=_CLASS) and
                       if (token=_CLASS) and
                          (assigned(ptypesym(sym)^.definition)) and
                          (assigned(ptypesym(sym)^.definition)) and
                          (ptypesym(sym)^.definition^.deftype=objectdef) and
                          (ptypesym(sym)^.definition^.deftype=objectdef) and
-                         ((pobjectdef(ptypesym(sym)^.definition)^.options and oo_isforward)<>0) and
-                         ((pobjectdef(ptypesym(sym)^.definition)^.options and oo_is_class)<>0) then
+                         pobjectdef(ptypesym(sym)^.definition)^.is_class and
+                         (oo_is_forward in pobjectdef(ptypesym(sym)^.definition)^.objectoptions) then
                        begin
                        begin
                          { we can ignore the result   }
                          { we can ignore the result   }
                          { the definition is modified }
                          { the definition is modified }
@@ -2110,7 +2193,7 @@ unit pdecl;
                          newtype:=ptypesym(sym);
                          newtype:=ptypesym(sym);
                        end
                        end
                       else
                       else
-                       if sym^.properties=sp_forwarddef then
+                       if (sp_forwarddef in sym^.symoptions) then
                         begin
                         begin
                           ptypesym(sym)^.updateforwarddef(read_type(typename));
                           ptypesym(sym)^.updateforwarddef(read_type(typename));
                           newtype:=ptypesym(sym);
                           newtype:=ptypesym(sym);
@@ -2217,11 +2300,15 @@ unit pdecl;
 
 
       begin
       begin
          if assigned(aktprocsym) and
          if assigned(aktprocsym) and
-            ((aktprocsym^.definition^.options and poinline)<>0) then
+            (pocall_inline in aktprocsym^.definition^.proccalloptions) then
            Begin
            Begin
               Message1(parser_w_not_supported_for_inline,tokenstring(t));
               Message1(parser_w_not_supported_for_inline,tokenstring(t));
               Message(parser_w_inlining_disabled);
               Message(parser_w_inlining_disabled);
-              aktprocsym^.definition^.options:= aktprocsym^.definition^.options and not poinline;
+{$ifdef INCLUDEOK}
+              exclude(aktprocsym^.definition^.proccalloptions,pocall_inline);
+{$else}
+              aktprocsym^.definition^.proccalloptions:=aktprocsym^.definition^.proccalloptions-[pocall_inline];
+{$endif}
            End;
            End;
       end;
       end;
 
 
@@ -2303,7 +2390,11 @@ unit pdecl;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.138  1999-08-01 18:28:11  florian
+  Revision 1.139  1999-08-03 22:02:56  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.138  1999/08/01 18:28:11  florian
     * modifications for the new code generator
     * modifications for the new code generator
 
 
   Revision 1.137  1999/07/29 20:54:02  peter
   Revision 1.137  1999/07/29 20:54:02  peter

+ 9 - 5
compiler/pexports.pas

@@ -32,7 +32,7 @@ unit pexports;
     uses
     uses
       globtype,systems,tokens,
       globtype,systems,tokens,
       strings,cobjects,globals,verbose,
       strings,cobjects,globals,verbose,
-      scanner,symtable,pbase,
+      scanner,symconst,symtable,pbase,
       export,GenDef;
       export,GenDef;
 
 
     procedure read_exports;
     procedure read_exports;
@@ -64,9 +64,9 @@ unit pexports;
                      begin
                      begin
                         hp^.sym:=srsym;
                         hp^.sym:=srsym;
                         if ((srsym^.typ<>procsym) or
                         if ((srsym^.typ<>procsym) or
-                          ((pprocdef(pprocsym(srsym)^.definition)^.options and poexports)=0)) and
-                          (srsym^.typ<>varsym) and (srsym^.typ<>typedconstsym) then
-                          Message(parser_e_illegal_symbol_exported)
+                            not(po_exports in pprocdef(pprocsym(srsym)^.definition)^.procoptions)) and
+                           (srsym^.typ<>varsym) and (srsym^.typ<>typedconstsym) then
+                         Message(parser_e_illegal_symbol_exported)
                         else
                         else
                          begin
                          begin
                           ProcName:=hp^.sym^.name;
                           ProcName:=hp^.sym^.name;
@@ -120,7 +120,11 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.9  1999-05-04 21:44:56  florian
+  Revision 1.10  1999-08-03 22:02:58  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.9  1999/05/04 21:44:56  florian
     * changes to compile it with Delphi 4.0
     * changes to compile it with Delphi 4.0
 
 
   Revision 1.8  1999/03/26 00:05:35  peter
   Revision 1.8  1999/03/26 00:05:35  peter

+ 51 - 44
compiler/pexpr.pas

@@ -47,11 +47,13 @@ unit pexpr;
 
 
     uses
     uses
        globtype,systems,tokens,
        globtype,systems,tokens,
-       cobjects,globals,scanner,aasm,pass_1,
-       hcodegen,types,verbose,strings
+       cobjects,globals,scanner,
+       symconst,aasm,
+       hcodegen,types,verbose,strings,
 {$ifndef newcg}
 {$ifndef newcg}
-       ,tccal
+       tccal,
 {$endif newcg}
 {$endif newcg}
+       pass_1
        { parser specific stuff }
        { parser specific stuff }
        ,pbase,pdecl
        ,pbase,pdecl
        { processor specific stuff }
        { processor specific stuff }
@@ -252,7 +254,7 @@ unit pexpr;
                  Must_be_valid:=false;
                  Must_be_valid:=false;
                  do_firstpass(p1);
                  do_firstpass(p1);
                  if ((p1^.resulttype^.deftype=objectdef) and
                  if ((p1^.resulttype^.deftype=objectdef) and
-                     ((pobjectdef(p1^.resulttype)^.options and oo_hasconstructor)<>0)) or
+                     (oo_has_constructor in pobjectdef(p1^.resulttype)^.objectoptions)) or
                     is_open_array(p1^.resulttype) or
                     is_open_array(p1^.resulttype) or
                     is_open_string(p1^.resulttype) then
                     is_open_string(p1^.resulttype) then
                   statement_syssym:=geninlinenode(in_sizeof_x,false,p1)
                   statement_syssym:=geninlinenode(in_sizeof_x,false,p1)
@@ -276,7 +278,7 @@ unit pexpr;
            pointerdef,
            pointerdef,
            procvardef,
            procvardef,
           classrefdef : ;
           classrefdef : ;
-            objectdef : if not(pobjectdef(p1^.resulttype)^.isclass) then
+            objectdef : if not(pobjectdef(p1^.resulttype)^.is_class) then
                          Message(parser_e_illegal_parameter_list);
                          Message(parser_e_illegal_parameter_list);
               else
               else
                 Message(parser_e_illegal_parameter_list);
                 Message(parser_e_illegal_parameter_list);
@@ -583,7 +585,7 @@ unit pexpr;
         hp:=nil;
         hp:=nil;
         if (proc_to_procvar_equal(pprocsym(t^.symtableentry)^.definition,procvar)) then
         if (proc_to_procvar_equal(pprocsym(t^.symtableentry)^.definition,procvar)) then
          begin
          begin
-           if ((procvar^.options and pomethodpointer)<>0) then
+           if (po_methodpointer in procvar^.procoptions) then
              hp:=genloadmethodcallnode(pprocsym(t^.symtableprocentry),t^.symtable,getcopy(t^.methodpointer))
              hp:=genloadmethodcallnode(pprocsym(t^.symtableprocentry),t^.symtable,getcopy(t^.methodpointer))
            else
            else
              hp:=genloadcallnode(pprocsym(t^.symtableprocentry),t^.symtable);
              hp:=genloadcallnode(pprocsym(t^.symtableprocentry),t^.symtable);
@@ -613,7 +615,7 @@ unit pexpr;
               consume(RECKKLAMMER);
               consume(RECKKLAMMER);
            end;
            end;
          { indexed property }
          { indexed property }
-         if (ppropertysym(sym)^.options and ppo_indexed)<>0 then
+         if (ppo_indexed in ppropertysym(sym)^.propoptions) then
            begin
            begin
               p2:=genordinalconstnode(ppropertysym(sym)^.index,s32bitdef);
               p2:=genordinalconstnode(ppropertysym(sym)^.index,s32bitdef);
               paras:=gencallparanode(p2,paras);
               paras:=gencallparanode(p2,paras);
@@ -744,20 +746,19 @@ unit pexpr;
            begin
            begin
               isclassref:=pd^.deftype=classrefdef;
               isclassref:=pd^.deftype=classrefdef;
 
 
-              { check protected and private members     }
+              { check protected and private members        }
               { please leave this code as it is,           }
               { please leave this code as it is,           }
               { it has now the same behaviaor as TP/Delphi }
               { it has now the same behaviaor as TP/Delphi }
-              if ((sym^.properties and sp_private)<>0) and
-                (pobjectdef(pd)^.owner^.symtabletype=unitsymtable) then
+              if (sp_private in sym^.symoptions) and
+                 (pobjectdef(pd)^.owner^.symtabletype=unitsymtable) then
                Message(parser_e_cant_access_private_member);
                Message(parser_e_cant_access_private_member);
 
 
-              if ((sym^.properties and sp_protected)<>0) and
+              if (sp_protected in sym^.symoptions) and
                  (pobjectdef(pd)^.owner^.symtabletype=unitsymtable) then
                  (pobjectdef(pd)^.owner^.symtabletype=unitsymtable) then
                 begin
                 begin
                   if assigned(aktprocsym^.definition^._class) then
                   if assigned(aktprocsym^.definition^._class) then
                     begin
                     begin
-                       if not aktprocsym^.definition^._class^.isrelated(
-                          pobjectdef(sym^.owner^.defowner)) then
+                       if not aktprocsym^.definition^._class^.is_related(pobjectdef(sym^.owner^.defowner)) then
                          Message(parser_e_cant_access_protected_member);
                          Message(parser_e_cant_access_protected_member);
                     end
                     end
                   else
                   else
@@ -777,14 +778,16 @@ unit pexpr;
                         ,again,p1,pd);
                         ,again,p1,pd);
                       { now we know the real method e.g. we can check for }
                       { now we know the real method e.g. we can check for }
                       { a class method                              }
                       { a class method                              }
-                      if isclassref and ((p1^.procdefinition^.options and (poclassmethod or poconstructor))=0) then
+                      if isclassref and
+                         not(po_classmethod in p1^.procdefinition^.procoptions) and
+                         not(p1^.procdefinition^.proctypeoption=potype_constructor) then
                         Message(parser_e_only_class_methods_via_class_ref);
                         Message(parser_e_only_class_methods_via_class_ref);
                    end;
                    end;
                  varsym:
                  varsym:
                    begin
                    begin
                       if isclassref then
                       if isclassref then
                         Message(parser_e_only_class_methods_via_class_ref);
                         Message(parser_e_only_class_methods_via_class_ref);
-                      if (sym^.properties and sp_static)<>0 then
+                      if (sp_static in sym^.symoptions) then
                         begin
                         begin
                            { static_name:=lower(srsymtable^.name^)+'_'+sym^.name;
                            { static_name:=lower(srsymtable^.name^)+'_'+sym^.name;
                              this is wrong for static field in with symtable (PM) }
                              this is wrong for static field in with symtable (PM) }
@@ -941,7 +944,7 @@ unit pexpr;
                      if (srsym^.typ in [propertysym,procsym,varsym]) and
                      if (srsym^.typ in [propertysym,procsym,varsym]) and
                         (srsymtable^.symtabletype=objectsymtable) then
                         (srsymtable^.symtabletype=objectsymtable) then
                       begin
                       begin
-                         if ((srsym^.properties and sp_private)<>0) and
+                         if (sp_private in srsym^.symoptions) and
                             (pobjectdef(srsym^.owner^.defowner)^.owner^.symtabletype=unitsymtable) then
                             (pobjectdef(srsym^.owner^.defowner)^.owner^.symtabletype=unitsymtable) then
                             Message(parser_e_cant_access_private_member);
                             Message(parser_e_cant_access_private_member);
                       end;
                       end;
@@ -954,19 +957,19 @@ unit pexpr;
                               { are we in a class method ? }
                               { are we in a class method ? }
                               if (srsymtable^.symtabletype=objectsymtable) and
                               if (srsymtable^.symtabletype=objectsymtable) and
                                  assigned(aktprocsym) and
                                  assigned(aktprocsym) and
-                                 ((aktprocsym^.definition^.options and poclassmethod)<>0) then
+                                 (po_classmethod in aktprocsym^.definition^.procoptions) then
                                 Message(parser_e_only_class_methods);
                                 Message(parser_e_only_class_methods);
-                              if (srsym^.properties and sp_static)<>0 then
+                              if (sp_static in srsym^.symoptions) then
                                begin
                                begin
                                  static_name:=lower(srsym^.owner^.name^)+'_'+srsym^.name;
                                  static_name:=lower(srsym^.owner^.name^)+'_'+srsym^.name;
                                  getsym(static_name,true);
                                  getsym(static_name,true);
                                end;
                                end;
                               p1:=genloadnode(pvarsym(srsym),srsymtable);
                               p1:=genloadnode(pvarsym(srsym),srsymtable);
-                              if pvarsym(srsym)^.is_valid=0 then
+                              if pvarsym(srsym)^.varstate=vs_declared then
                                begin
                                begin
                                  p1^.is_first := true;
                                  p1^.is_first := true;
                                  { set special between first loaded until checked in firstpass }
                                  { set special between first loaded until checked in firstpass }
-                                 pvarsym(srsym)^.is_valid:=2;
+                                 pvarsym(srsym)^.varstate:=vs_declared2;
                                end;
                                end;
                               pd:=pvarsym(srsym)^.definition;
                               pd:=pvarsym(srsym)^.definition;
                             end;
                             end;
@@ -1014,22 +1017,22 @@ unit pexpr;
                                     else { not LKLAMMER}
                                     else { not LKLAMMER}
                                      if (token=POINT) and
                                      if (token=POINT) and
                                         (pd^.deftype=objectdef) and
                                         (pd^.deftype=objectdef) and
-                                        not(pobjectdef(pd)^.isclass) then
+                                        not(pobjectdef(pd)^.is_class) then
                                        begin
                                        begin
                                          consume(POINT);
                                          consume(POINT);
                                          if assigned(procinfo._class) then
                                          if assigned(procinfo._class) then
                                           begin
                                           begin
-                                            if procinfo._class^.isrelated(pobjectdef(pd)) then
+                                            if procinfo._class^.is_related(pobjectdef(pd)) then
                                              begin
                                              begin
                                                p1:=gentypenode(pd,ptypesym(srsym));
                                                p1:=gentypenode(pd,ptypesym(srsym));
                                                p1^.resulttype:=pd;
                                                p1^.resulttype:=pd;
-                                               srsymtable:=pobjectdef(pd)^.publicsyms;
+                                               srsymtable:=pobjectdef(pd)^.symtable;
                                                sym:=pvarsym(srsymtable^.search(pattern));
                                                sym:=pvarsym(srsymtable^.search(pattern));
                                                { search also in inherited methods }
                                                { search also in inherited methods }
                                                while sym=nil do
                                                while sym=nil do
                                                 begin
                                                 begin
                                                   pd:=pobjectdef(pd)^.childof;
                                                   pd:=pobjectdef(pd)^.childof;
-                                                  srsymtable:=pobjectdef(pd)^.publicsyms;
+                                                  srsymtable:=pobjectdef(pd)^.symtable;
                                                   sym:=pvarsym(srsymtable^.search(pattern));
                                                   sym:=pvarsym(srsymtable^.search(pattern));
                                                 end;
                                                 end;
                                                consume(ID);
                                                consume(ID);
@@ -1048,7 +1051,7 @@ unit pexpr;
                                             { also allows static methods and variables }
                                             { also allows static methods and variables }
                                             p1:=genzeronode(typen);
                                             p1:=genzeronode(typen);
                                             p1^.resulttype:=pd;
                                             p1^.resulttype:=pd;
-                                            { srsymtable:=pobjectdef(pd)^.publicsyms;
+                                            { srsymtable:=pobjectdef(pd)^.symtable;
                                               sym:=pvarsym(srsymtable^.search(pattern)); }
                                               sym:=pvarsym(srsymtable^.search(pattern)); }
 
 
                                             { TP allows also @TMenu.Load if Load is only }
                                             { TP allows also @TMenu.Load if Load is only }
@@ -1056,7 +1059,7 @@ unit pexpr;
                                             sym:=pvarsym(search_class_member(pobjectdef(pd),pattern));
                                             sym:=pvarsym(search_class_member(pobjectdef(pd),pattern));
                                             if not assigned(sym) then
                                             if not assigned(sym) then
                                               Message1(sym_e_id_no_member,pattern)
                                               Message1(sym_e_id_no_member,pattern)
-                                            else if not(getaddr) and ((sym^.properties and sp_static)=0) then
+                                            else if not(getaddr) and not(sp_static in sym^.symoptions) then
                                               Message(sym_e_only_static_in_static)
                                               Message(sym_e_only_static_in_static)
                                             else
                                             else
                                              begin
                                              begin
@@ -1069,7 +1072,7 @@ unit pexpr;
                                        begin
                                        begin
                                           { class reference ? }
                                           { class reference ? }
                                           if (pd^.deftype=objectdef)
                                           if (pd^.deftype=objectdef)
-                                            and pobjectdef(pd)^.isclass then
+                                            and pobjectdef(pd)^.is_class then
                                             begin
                                             begin
                                                p1:=gentypenode(pd,nil);
                                                p1:=gentypenode(pd,nil);
                                                p1^.resulttype:=pd;
                                                p1^.resulttype:=pd;
@@ -1139,7 +1142,7 @@ unit pexpr;
                               { are we in a class method ? }
                               { are we in a class method ? }
                               possible_error:=(srsymtable^.symtabletype=objectsymtable) and
                               possible_error:=(srsymtable^.symtabletype=objectsymtable) and
                                               assigned(aktprocsym) and
                                               assigned(aktprocsym) and
-                                              ((aktprocsym^.definition^.options and poclassmethod)<>0);
+                                              (po_classmethod in aktprocsym^.definition^.procoptions);
                               p1:=gencallnode(pprocsym(srsym),srsymtable);
                               p1:=gencallnode(pprocsym(srsym),srsymtable);
                               p1^.unit_specific:=unit_specific;
                               p1^.unit_specific:=unit_specific;
                               do_proc_call(getaddr or
                               do_proc_call(getaddr or
@@ -1148,7 +1151,7 @@ unit pexpr;
                                  proc_to_procvar_equal(pprocsym(srsym)^.definition,getprocvardef)),
                                  proc_to_procvar_equal(pprocsym(srsym)^.definition,getprocvardef)),
                                 again,p1,pd);
                                 again,p1,pd);
                               if possible_error and
                               if possible_error and
-                                 ((p1^.procdefinition^.options and poclassmethod)=0) then
+                                 not(po_classmethod in p1^.procdefinition^.procoptions) then
                                 Message(parser_e_only_class_methods);
                                 Message(parser_e_only_class_methods);
                             end;
                             end;
               propertysym : begin
               propertysym : begin
@@ -1156,7 +1159,7 @@ unit pexpr;
                               { are we in a class method ? }
                               { are we in a class method ? }
                               if (srsymtable^.symtabletype=objectsymtable) and
                               if (srsymtable^.symtabletype=objectsymtable) and
                                  assigned(aktprocsym) and
                                  assigned(aktprocsym) and
-                                 ((aktprocsym^.definition^.options and poclassmethod)<>0) then
+                                 (po_classmethod in aktprocsym^.definition^.procoptions) then
                                Message(parser_e_only_class_methods);
                                Message(parser_e_only_class_methods);
                               { no method pointer }
                               { no method pointer }
                               p1:=nil;
                               p1:=nil;
@@ -1312,7 +1315,7 @@ unit pexpr;
 
 
                 LECKKLAMMER:
                 LECKKLAMMER:
                   begin
                   begin
-                    if (pd^.deftype=objectdef) and pobjectdef(pd)^.isclass then
+                    if (pd^.deftype=objectdef) and pobjectdef(pd)^.is_class then
                       begin
                       begin
                         { default property }
                         { default property }
                         propsym:=search_default_property(pobjectdef(pd));
                         propsym:=search_default_property(pobjectdef(pd));
@@ -1402,7 +1405,7 @@ unit pexpr;
                     case pd^.deftype of
                     case pd^.deftype of
                        recorddef:
                        recorddef:
                          begin
                          begin
-                            sym:=pvarsym(precdef(pd)^.symtable^.search(pattern));
+                            sym:=pvarsym(precorddef(pd)^.symtable^.search(pattern));
                             if sym=nil then
                             if sym=nil then
                               begin
                               begin
                                 Message1(sym_e_illegal_field,pattern);
                                 Message1(sym_e_illegal_field,pattern);
@@ -1423,8 +1426,8 @@ unit pexpr;
                              sym:=nil;
                              sym:=nil;
                              while assigned(classh) do
                              while assigned(classh) do
                               begin
                               begin
-                                sym:=pvarsym(classh^.publicsyms^.search(pattern));
-                                srsymtable:=classh^.publicsyms;
+                                sym:=pvarsym(classh^.symtable^.search(pattern));
+                                srsymtable:=classh^.symtable;
                                 if assigned(sym) then
                                 if assigned(sym) then
                                  break;
                                  break;
                                 classh:=classh^.childof;
                                 classh:=classh^.childof;
@@ -1441,8 +1444,8 @@ unit pexpr;
                              allow_only_static:=false;
                              allow_only_static:=false;
                              while assigned(classh) do
                              while assigned(classh) do
                               begin
                               begin
-                                sym:=pvarsym(classh^.publicsyms^.search(pattern));
-                                srsymtable:=classh^.publicsyms;
+                                sym:=pvarsym(classh^.symtable^.search(pattern));
+                                srsymtable:=classh^.symtable;
                                 if assigned(sym) then
                                 if assigned(sym) then
                                  break;
                                  break;
                                 classh:=classh^.childof;
                                 classh:=classh^.childof;
@@ -1559,7 +1562,7 @@ unit pexpr;
                        token=RKLAMMER then
                        token=RKLAMMER then
                   begin
                   begin
                     if (ppointerdef(pd)^.definition^.deftype=objectdef) and
                     if (ppointerdef(pd)^.definition^.deftype=objectdef) and
-                       ((pobjectdef(ppointerdef(pd)^.definition)^.options and oo_hasvmt) <> 0)  then
+                       (oo_has_vmt in pobjectdef(ppointerdef(pd)^.definition)^.objectoptions)  then
                      Message(parser_w_use_extended_syntax_for_objects);
                      Message(parser_w_use_extended_syntax_for_objects);
                     p1:=gensinglenode(newn,nil);
                     p1:=gensinglenode(newn,nil);
                     p1^.resulttype:=pd2;
                     p1^.resulttype:=pd2;
@@ -1590,7 +1593,7 @@ unit pexpr;
                     { determines the current object defintion }
                     { determines the current object defintion }
                     classh:=pobjectdef(ppointerdef(pd)^.definition);
                     classh:=pobjectdef(ppointerdef(pd)^.definition);
                     { check for an abstract class }
                     { check for an abstract class }
-                    if (classh^.options and oo_is_abstract)<>0 then
+                    if (oo_has_abstract in classh^.objectoptions) then
                       Message(sym_e_no_instance_of_abstract_object);
                       Message(sym_e_no_instance_of_abstract_object);
 
 
                     { search the constructor also in the symbol tables of
                     { search the constructor also in the symbol tables of
@@ -1600,8 +1603,8 @@ unit pexpr;
                     sym:=nil;
                     sym:=nil;
                     while assigned(classh) do
                     while assigned(classh) do
                      begin
                      begin
-                       sym:=pvarsym(classh^.publicsyms^.search(pattern));
-                       srsymtable:=classh^.publicsyms;
+                       sym:=pvarsym(classh^.symtable^.search(pattern));
+                       srsymtable:=classh^.symtable;
                        if assigned(sym) then
                        if assigned(sym) then
                         break;
                         break;
                        classh:=classh^.childof;
                        classh:=classh^.childof;
@@ -1611,7 +1614,7 @@ unit pexpr;
                     do_member_read(false,sym,p1,pd,again);
                     do_member_read(false,sym,p1,pd,again);
                     if (p1^.treetype<>calln) or
                     if (p1^.treetype<>calln) or
                        (assigned(p1^.procdefinition) and
                        (assigned(p1^.procdefinition) and
-                       ((p1^.procdefinition^.options and poconstructor)=0)) then
+                       (p1^.procdefinition^.proctypeoption<>potype_constructor)) then
                       Message(parser_e_expr_have_to_be_constructor_call);
                       Message(parser_e_expr_have_to_be_constructor_call);
                     p1:=gensinglenode(newn,p1);
                     p1:=gensinglenode(newn,p1);
                     { set the resulttype }
                     { set the resulttype }
@@ -1631,7 +1634,7 @@ unit pexpr;
                   end
                   end
                  else
                  else
                   begin
                   begin
-                    if (aktprocsym^.definition^.options and poclassmethod)<>0 then
+                    if (po_classmethod in aktprocsym^.definition^.procoptions) then
                      begin
                      begin
                        { self in class methods is a class reference type }
                        { self in class methods is a class reference type }
                        pd:=new(pclassrefdef,init(procinfo._class));
                        pd:=new(pclassrefdef,init(procinfo._class));
@@ -1655,7 +1658,7 @@ unit pexpr;
                     classh:=procinfo._class^.childof;
                     classh:=procinfo._class^.childof;
                     while assigned(classh) do
                     while assigned(classh) do
                      begin
                      begin
-                       srsymtable:=pobjectdef(classh)^.publicsyms;
+                       srsymtable:=pobjectdef(classh)^.symtable;
                        sym:=pvarsym(srsymtable^.search(pattern));
                        sym:=pvarsym(srsymtable^.search(pattern));
                        if assigned(sym) then
                        if assigned(sym) then
                         begin
                         begin
@@ -2067,7 +2070,11 @@ unit pexpr;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.128  1999-08-03 13:50:17  michael
+  Revision 1.129  1999-08-03 22:02:59  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.128  1999/08/03 13:50:17  michael
   + Changes for alpha
   + Changes for alpha
 
 
   Revision 1.127  1999/08/01 18:28:13  florian
   Revision 1.127  1999/08/01 18:28:13  florian

+ 11 - 7
compiler/pmodules.pas

@@ -35,7 +35,7 @@ unit pmodules;
     uses
     uses
        globtype,version,systems,tokens,
        globtype,version,systems,tokens,
        cobjects,comphook,globals,verbose,files,
        cobjects,comphook,globals,verbose,files,
-       symtable,aasm,hcodegen,
+       symconst,symtable,aasm,hcodegen,
        link,assemble,import,export,gendef,ppu,comprsrc,
        link,assemble,import,export,gendef,ppu,comprsrc,
        cresstr
        cresstr
 {$ifdef i386}
 {$ifdef i386}
@@ -769,7 +769,7 @@ unit pmodules;
       end;
       end;
 
 
 
 
-    procedure gen_main_procsym(const name:string;options:longint;st:psymtable);
+    procedure gen_main_procsym(const name:string;options:tproctypeoption;st:psymtable);
       var
       var
         stt : psymtable;
         stt : psymtable;
       begin
       begin
@@ -781,7 +781,7 @@ unit pmodules;
         symtablestack:=st;
         symtablestack:=st;
         aktprocsym^.definition:=new(Pprocdef,init);
         aktprocsym^.definition:=new(Pprocdef,init);
         symtablestack:=stt;
         symtablestack:=stt;
-        aktprocsym^.definition^.options:=aktprocsym^.definition^.options or options;
+        aktprocsym^.definition^.proctypeoption:=options;
         aktprocsym^.definition^.setmangledname(target_os.cprefix+name);
         aktprocsym^.definition^.setmangledname(target_os.cprefix+name);
         aktprocsym^.definition^.forwarddef:=false;
         aktprocsym^.definition^.forwarddef:=false;
         make_ref:=true;
         make_ref:=true;
@@ -1034,7 +1034,7 @@ unit pmodules;
 {$endif Splitheap}
 {$endif Splitheap}
 
 
          { Generate a procsym }
          { Generate a procsym }
-         gen_main_procsym(current_module^.modulename^+'_init',pounitinit,st);
+         gen_main_procsym(current_module^.modulename^+'_init',potype_unitinit,st);
 
 
          { Compile the unit }
          { Compile the unit }
          codegen_newprocedure;
          codegen_newprocedure;
@@ -1055,7 +1055,7 @@ unit pmodules;
               current_module^.flags:=current_module^.flags or uf_finalize;
               current_module^.flags:=current_module^.flags or uf_finalize;
 
 
               { Generate a procsym }
               { Generate a procsym }
-              gen_main_procsym(current_module^.modulename^+'_finalize',pounitfinalize,st);
+              gen_main_procsym(current_module^.modulename^+'_finalize',potype_unitfinalize,st);
 
 
               { Compile the finalize }
               { Compile the finalize }
               codegen_newprocedure;
               codegen_newprocedure;
@@ -1267,7 +1267,7 @@ unit pmodules;
          constsymtable:=st;
          constsymtable:=st;
 
 
          { Generate a procsym for main }
          { Generate a procsym for main }
-         gen_main_procsym('main',poproginit,st);
+         gen_main_procsym('main',potype_proginit,st);
 
 
          { reset }
          { reset }
          procprefix:='';
          procprefix:='';
@@ -1364,7 +1364,11 @@ unit pmodules;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.137  1999-08-03 17:09:38  florian
+  Revision 1.138  1999-08-03 22:03:02  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.137  1999/08/03 17:09:38  florian
     * the alpha compiler can be compiled now
     * the alpha compiler can be compiled now
 
 
   Revision 1.136  1999/08/02 17:17:10  florian
   Revision 1.136  1999/08/02 17:17:10  florian

+ 40 - 34
compiler/pstatmnt.pas

@@ -41,7 +41,7 @@ unit pstatmnt;
     uses
     uses
        globtype,systems,tokens,
        globtype,systems,tokens,
        strings,cobjects,globals,files,verbose,
        strings,cobjects,globals,files,verbose,
-       symtable,aasm,pass_1,types,scanner,hcodegen,ppu
+       symconst,symtable,aasm,pass_1,types,scanner,hcodegen,ppu
        ,pbase,pexpr,pdecl
        ,pbase,pexpr,pdecl
 {$ifdef i386}
 {$ifdef i386}
        ,i386base,i386asm
        ,i386base,i386asm
@@ -373,7 +373,7 @@ unit pstatmnt;
              objectdef : begin
              objectdef : begin
                            obj:=pobjectdef(p^.resulttype);
                            obj:=pobjectdef(p^.resulttype);
                            withsymtable:=new(pwithsymtable,init);
                            withsymtable:=new(pwithsymtable,init);
-                           withsymtable^.symsearch:=obj^.publicsyms^.symsearch;
+                           withsymtable^.symsearch:=obj^.symtable^.symsearch;
                            withsymtable^.defowner:=obj;
                            withsymtable^.defowner:=obj;
                            symtab:=withsymtable;
                            symtab:=withsymtable;
                            if (p^.treetype=loadn) and
                            if (p^.treetype=loadn) and
@@ -387,7 +387,7 @@ unit pstatmnt;
                             begin
                             begin
                               symtab^.next:=new(pwithsymtable,init);
                               symtab^.next:=new(pwithsymtable,init);
                               symtab:=symtab^.next;
                               symtab:=symtab^.next;
-                              symtab^.symsearch:=obj^.publicsyms^.symsearch;
+                              symtab^.symsearch:=obj^.symtable^.symsearch;
                               if (p^.treetype=loadn) and
                               if (p^.treetype=loadn) and
                                  (p^.symtable=aktprocsym^.definition^.localst) then
                                  (p^.symtable=aktprocsym^.definition^.localst) then
                                 pwithsymtable(symtab)^.direct_with:=true;
                                 pwithsymtable(symtab)^.direct_with:=true;
@@ -401,7 +401,7 @@ unit pstatmnt;
                            symtablestack:=withsymtable;
                            symtablestack:=withsymtable;
                          end;
                          end;
              recorddef : begin
              recorddef : begin
-                           symtab:=precdef(p^.resulttype)^.symtable;
+                           symtab:=precorddef(p^.resulttype)^.symtable;
                            levelcount:=1;
                            levelcount:=1;
                            withsymtable:=new(pwithsymtable,init);
                            withsymtable:=new(pwithsymtable,init);
                            withsymtable^.symsearch:=symtab^.symsearch;
                            withsymtable^.symsearch:=symtab^.symsearch;
@@ -572,7 +572,7 @@ unit pstatmnt;
                                  end;
                                  end;
                                if (srsym^.typ=typesym) and
                                if (srsym^.typ=typesym) and
                                  (ptypesym(srsym)^.definition^.deftype=objectdef) and
                                  (ptypesym(srsym)^.definition^.deftype=objectdef) and
-                                 pobjectdef(ptypesym(srsym)^.definition)^.isclass then
+                                 pobjectdef(ptypesym(srsym)^.definition)^.is_class then
                                  ot:=pobjectdef(ptypesym(srsym)^.definition)
                                  ot:=pobjectdef(ptypesym(srsym)^.definition)
                                else
                                else
                                  begin
                                  begin
@@ -597,7 +597,7 @@ unit pstatmnt;
                                  end;
                                  end;
                                if (srsym^.typ=typesym) and
                                if (srsym^.typ=typesym) and
                                  (ptypesym(srsym)^.definition^.deftype=objectdef) and
                                  (ptypesym(srsym)^.definition^.deftype=objectdef) and
-                                 pobjectdef(ptypesym(srsym)^.definition)^.isclass then
+                                 pobjectdef(ptypesym(srsym)^.definition)^.is_class then
                                  ot:=pobjectdef(ptypesym(srsym)^.definition)
                                  ot:=pobjectdef(ptypesym(srsym)^.definition)
                                else
                                else
                                  begin
                                  begin
@@ -708,11 +708,15 @@ unit pstatmnt;
              begin
              begin
                if not target_asm.allowdirect then
                if not target_asm.allowdirect then
                  Message(parser_f_direct_assembler_not_allowed);
                  Message(parser_f_direct_assembler_not_allowed);
-               if (aktprocsym^.definition^.options and poinline)<>0 then
+               if (pocall_inline in aktprocsym^.definition^.proccalloptions) then
                  Begin
                  Begin
                     Message1(parser_w_not_supported_for_inline,'direct asm');
                     Message1(parser_w_not_supported_for_inline,'direct asm');
                     Message(parser_w_inlining_disabled);
                     Message(parser_w_inlining_disabled);
-                    aktprocsym^.definition^.options:= aktprocsym^.definition^.options and not poinline;
+{$ifdef INCLUDEOK}
+                    exclude(aktprocsym^.definition^.proccalloptions,pocall_inline);
+{$else}
+                    aktprocsym^.definition^.proccalloptions:=aktprocsym^.definition^.proccalloptions-[pocall_inline];
+{$endif}
                  End;
                  End;
                asmstat:=ra386dir.assemble;
                asmstat:=ra386dir.assemble;
              end;
              end;
@@ -865,16 +869,14 @@ unit pstatmnt;
                      end;
                      end;
                    { check, if the first parameter is a pointer to a _class_ }
                    { check, if the first parameter is a pointer to a _class_ }
                    classh:=pobjectdef(ppointerdef(pd)^.definition);
                    classh:=pobjectdef(ppointerdef(pd)^.definition);
-                   if (classh^.options and oo_is_class)<>0 then
-                         begin
-                            Message(parser_e_no_new_or_dispose_for_classes);
-                            new_dispose_statement:=factor(false);
-                            { while token<>RKLAMMER do
-                                  consume(token); }
-                            consume_all_until(RKLAMMER);
-                            consume(RKLAMMER);
-                            exit;
-                         end;
+                   if classh^.is_class then
+                     begin
+                        Message(parser_e_no_new_or_dispose_for_classes);
+                        new_dispose_statement:=factor(false);
+                        consume_all_until(RKLAMMER);
+                        consume(RKLAMMER);
+                        exit;
+                     end;
                    { search cons-/destructor, also in parent classes }
                    { search cons-/destructor, also in parent classes }
                    sym:=search_class_member(classh,pattern);
                    sym:=search_class_member(classh,pattern);
                    { the second parameter of new/dispose must be a call }
                    { the second parameter of new/dispose must be a call }
@@ -903,9 +905,9 @@ unit pstatmnt;
 
 
                            if not codegenerror then
                            if not codegenerror then
                             begin
                             begin
-                              if (ht=_NEW) and ((p2^.procdefinition^.options and poconstructor)=0) then
+                              if (ht=_NEW) and (p2^.procdefinition^.proctypeoption<>potype_constructor) then
                                 Message(parser_e_expr_have_to_be_constructor_call);
                                 Message(parser_e_expr_have_to_be_constructor_call);
-                              if (ht=_DISPOSE) and ((p2^.procdefinition^.options and podestructor)=0) then
+                              if (ht=_DISPOSE) and (p2^.procdefinition^.proctypeoption<>potype_destructor) then
                                 Message(parser_e_expr_have_to_be_destructor_call);
                                 Message(parser_e_expr_have_to_be_destructor_call);
 
 
                               if ht=_NEW then
                               if ht=_NEW then
@@ -927,7 +929,7 @@ unit pstatmnt;
                else
                else
                  begin
                  begin
                     if (ppointerdef(p^.resulttype)^.definition^.deftype=objectdef) and
                     if (ppointerdef(p^.resulttype)^.definition^.deftype=objectdef) and
-                       ((pobjectdef(ppointerdef(p^.resulttype)^.definition)^.options and oo_hasvmt) <> 0)  then
+                       (oo_has_vmt in pobjectdef(ppointerdef(p^.resulttype)^.definition)^.objectoptions) then
                       Message(parser_w_use_extended_syntax_for_objects);
                       Message(parser_w_use_extended_syntax_for_objects);
                     if (ppointerdef(p^.resulttype)^.definition^.deftype=orddef) and
                     if (ppointerdef(p^.resulttype)^.definition^.deftype=orddef) and
                        (porddef(ppointerdef(p^.resulttype)^.definition)^.typ=uvoid) then
                        (porddef(ppointerdef(p^.resulttype)^.definition)^.typ=uvoid) then
@@ -1056,7 +1058,7 @@ unit pstatmnt;
               code:=genzeronode(niln);
               code:=genzeronode(niln);
             _FAIL : begin
             _FAIL : begin
                        { internalerror(100); }
                        { internalerror(100); }
-                       if (aktprocsym^.definition^.options and poconstructor)=0 then
+                       if (aktprocsym^.definition^.proctypeoption<>potype_constructor) then
                         Message(parser_e_fail_only_in_constructor);
                         Message(parser_e_fail_only_in_constructor);
                        consume(_FAIL);
                        consume(_FAIL);
                        code:=genzeronode(failn);
                        code:=genzeronode(failn);
@@ -1127,7 +1129,7 @@ unit pstatmnt;
 
 
       var
       var
          funcretsym : pfuncretsym;
          funcretsym : pfuncretsym;
-         storepos : tfileposinfo; 
+         storepos : tfileposinfo;
 
 
       begin
       begin
          if procinfo.retdef<>pdef(voiddef) then
          if procinfo.retdef<>pdef(voiddef) then
@@ -1265,16 +1267,16 @@ unit pstatmnt;
            { set the framepointer to esp for assembler functions }
            { set the framepointer to esp for assembler functions }
            { but only if the are no local variables           }
            { but only if the are no local variables           }
            { added no parameter also (PM)                       }
            { added no parameter also (PM)                       }
-           if ((aktprocsym^.definition^.options and poassembler)<>0) and
-               (aktprocsym^.definition^.localst^.datasize=0) and
-               (aktprocsym^.definition^.parast^.datasize=0) and
-               not(ret_in_param(aktprocsym^.definition^.retdef)) then
-               begin
-                  procinfo.framepointer:=stack_pointer;
-                  { set the right value for parameters }
-                  dec(aktprocsym^.definition^.parast^.address_fixup,target_os.size_of_pointer);
-                  dec(procinfo.call_offset,target_os.size_of_pointer);
-              end;
+           if (po_assembler in aktprocsym^.definition^.procoptions) and
+              (aktprocsym^.definition^.localst^.datasize=0) and
+              (aktprocsym^.definition^.parast^.datasize=0) and
+              not(ret_in_param(aktprocsym^.definition^.retdef)) then
+             begin
+               procinfo.framepointer:=stack_pointer;
+               { set the right value for parameters }
+               dec(aktprocsym^.definition^.parast^.address_fixup,target_os.size_of_pointer);
+               dec(procinfo.call_offset,target_os.size_of_pointer);
+             end;
           { force the asm statement }
           { force the asm statement }
             if token<>_ASM then
             if token<>_ASM then
              consume(_ASM);
              consume(_ASM);
@@ -1288,7 +1290,11 @@ unit pstatmnt;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.94  1999-08-03 17:09:39  florian
+  Revision 1.95  1999-08-03 22:03:03  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.94  1999/08/03 17:09:39  florian
     * the alpha compiler can be compiled now
     * the alpha compiler can be compiled now
 
 
   Revision 1.93  1999/08/02 21:28:59  florian
   Revision 1.93  1999/08/02 21:28:59  florian

文件差异内容过多而无法显示
+ 336 - 203
compiler/psub.pas


+ 12 - 8
compiler/psystem.pas

@@ -33,7 +33,7 @@ procedure createconstdefs;
 implementation
 implementation
 
 
 uses
 uses
-  globtype,globals,tree;
+  globtype,globals,symconst,tree;
 
 
 procedure insertinternsyms(p : psymtable);
 procedure insertinternsyms(p : psymtable);
 {
 {
@@ -74,7 +74,7 @@ procedure insert_intern_types(p : psymtable);
 }
 }
 var
 var
   { several defs to simulate more or less C++ objects for GDB }
   { several defs to simulate more or less C++ objects for GDB }
-  vmtdef      : precdef;
+  vmtdef      : precorddef;
   pvmtdef     : ppointerdef;
   pvmtdef     : ppointerdef;
   vmtarraydef : parraydef;
   vmtarraydef : parraydef;
   vmtsymtable : psymtable;
   vmtsymtable : psymtable;
@@ -87,7 +87,7 @@ begin
   p^.insert(new(ptypesym,init('ulong',u32bitdef)));
   p^.insert(new(ptypesym,init('ulong',u32bitdef)));
   p^.insert(new(ptypesym,init('longint',s32bitdef)));
   p^.insert(new(ptypesym,init('longint',s32bitdef)));
   p^.insert(new(ptypesym,init('qword',cu64bitdef)));
   p^.insert(new(ptypesym,init('qword',cu64bitdef)));
-  p^.insert(new(ptypesym,init('int64',cs64bitintdef)));
+  p^.insert(new(ptypesym,init('int64',cs64bitdef)));
   p^.insert(new(ptypesym,init('char',cchardef)));
   p^.insert(new(ptypesym,init('char',cchardef)));
   p^.insert(new(ptypesym,init('shortstring',cshortstringdef)));
   p^.insert(new(ptypesym,init('shortstring',cshortstringdef)));
   p^.insert(new(ptypesym,init('longstring',clongstringdef)));
   p^.insert(new(ptypesym,init('longstring',clongstringdef)));
@@ -107,7 +107,7 @@ begin
   { Add a type for virtual method tables in lowercase }
   { Add a type for virtual method tables in lowercase }
   { so it isn't reachable!                            }
   { so it isn't reachable!                            }
   vmtsymtable:=new(psymtable,init(recordsymtable));
   vmtsymtable:=new(psymtable,init(recordsymtable));
-  vmtdef:=new(precdef,init(vmtsymtable));
+  vmtdef:=new(precorddef,init(vmtsymtable));
   pvmtdef:=new(ppointerdef,init(vmtdef));
   pvmtdef:=new(ppointerdef,init(vmtdef));
   vmtsymtable^.insert(new(pvarsym,init('parent',pvmtdef)));
   vmtsymtable^.insert(new(pvarsym,init('parent',pvmtdef)));
   vmtsymtable^.insert(new(pvarsym,init('length',globaldef('longint'))));
   vmtsymtable^.insert(new(pvarsym,init('length',globaldef('longint'))));
@@ -146,7 +146,7 @@ begin
   p^.insert(new(ptypesym,init('FIXED',new(pfloatdef,init(f32bit)))));
   p^.insert(new(ptypesym,init('FIXED',new(pfloatdef,init(f32bit)))));
   p^.insert(new(ptypesym,init('FIXED16',new(pfloatdef,init(f16bit)))));
   p^.insert(new(ptypesym,init('FIXED16',new(pfloatdef,init(f16bit)))));
   p^.insert(new(ptypesym,init('QWORD',cu64bitdef)));
   p^.insert(new(ptypesym,init('QWORD',cu64bitdef)));
-  p^.insert(new(ptypesym,init('INT64',cs64bitintdef)));
+  p^.insert(new(ptypesym,init('INT64',cs64bitdef)));
   p^.insert(new(ptypesym,init('TYPEDFILE',new(pfiledef,init(ft_typed,voiddef)))));
   p^.insert(new(ptypesym,init('TYPEDFILE',new(pfiledef,init(ft_typed,voiddef)))));
 end;
 end;
 
 
@@ -161,7 +161,7 @@ begin
   u32bitdef:=porddef(globaldef('ulong'));
   u32bitdef:=porddef(globaldef('ulong'));
   s32bitdef:=porddef(globaldef('longint'));
   s32bitdef:=porddef(globaldef('longint'));
   cu64bitdef:=porddef(globaldef('qword'));
   cu64bitdef:=porddef(globaldef('qword'));
-  cs64bitintdef:=porddef(globaldef('int64'));
+  cs64bitdef:=porddef(globaldef('int64'));
   cformaldef:=pformaldef(globaldef('formal'));
   cformaldef:=pformaldef(globaldef('formal'));
   voiddef:=porddef(globaldef('void'));
   voiddef:=porddef(globaldef('void'));
   cchardef:=porddef(globaldef('char'));
   cchardef:=porddef(globaldef('char'));
@@ -200,7 +200,7 @@ begin
   u32bitdef:=new(porddef,init(u32bit,0,$ffffffff));
   u32bitdef:=new(porddef,init(u32bit,0,$ffffffff));
   s32bitdef:=new(porddef,init(s32bit,$80000000,$7fffffff));
   s32bitdef:=new(porddef,init(s32bit,$80000000,$7fffffff));
   cu64bitdef:=new(porddef,init(u64bit,0,0));
   cu64bitdef:=new(porddef,init(u64bit,0,0));
-  cs64bitintdef:=new(porddef,init(s64bitint,0,0));
+  cs64bitdef:=new(porddef,init(s64bit,0,0));
   booldef:=new(porddef,init(bool8bit,0,1));
   booldef:=new(porddef,init(bool8bit,0,1));
   cchardef:=new(porddef,init(uchar,0,255));
   cchardef:=new(porddef,init(uchar,0,255));
   cshortstringdef:=new(pstringdef,shortinit(255));
   cshortstringdef:=new(pstringdef,shortinit(255));
@@ -238,7 +238,11 @@ end;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.25  1999-07-05 20:13:17  peter
+  Revision 1.26  1999-08-03 22:03:07  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.25  1999/07/05 20:13:17  peter
     * removed temp defines
     * removed temp defines
 
 
   Revision 1.24  1999/07/01 15:49:20  florian
   Revision 1.24  1999/07/01 15:49:20  florian

+ 17 - 31
compiler/ptconst.pas

@@ -35,8 +35,9 @@ unit ptconst;
 
 
     uses
     uses
        globtype,systems,tokens,
        globtype,systems,tokens,
-       cobjects,globals,scanner,aasm,tree,pass_1,
-       types,verbose
+       cobjects,globals,scanner,
+       symconst,aasm,types,verbose,
+       tree,pass_1
        { parser specific stuff }
        { parser specific stuff }
        ,pbase,pexpr
        ,pbase,pexpr
        { processor specific stuff }
        { processor specific stuff }
@@ -85,12 +86,12 @@ unit ptconst;
              end;
              end;
         end;
         end;
 
 
-      function is_po_equal(o1,o2:longint):boolean;
+(*      function is_po_equal(o1,o2:longint):boolean;
         begin
         begin
         { assembler does not affect }
         { assembler does not affect }
           is_po_equal:=(o1 and not(poassembler))=
           is_po_equal:=(o1 and not(poassembler))=
                        (o2 and not(poassembler));
                        (o2 and not(poassembler));
-        end;
+        end; *)
 
 
 {$R-}  {Range check creates problem with init_8bit(-1) !!}
 {$R-}  {Range check creates problem with init_8bit(-1) !!}
       begin
       begin
@@ -157,7 +158,7 @@ unit ptconst;
                                 curconstsegment^.concat(new(pai_const,init_16bit(p^.value)));
                                 curconstsegment^.concat(new(pai_const,init_16bit(p^.value)));
                                 check_range;
                                 check_range;
                             end;
                             end;
-                    s64bitint,
+                    s64bit,
                     u64bit:
                     u64bit:
                       begin
                       begin
                          if not is_constintnode(p) then
                          if not is_constintnode(p) then
@@ -581,27 +582,8 @@ unit ptconst;
                    pd:=pprocsym(srsym)^.definition;
                    pd:=pprocsym(srsym)^.definition;
                    if assigned(pd^.nextoverloaded) then
                    if assigned(pd^.nextoverloaded) then
                      Message(parser_e_no_overloaded_procvars);
                      Message(parser_e_no_overloaded_procvars);
-                   if is_po_equal(pprocvardef(def)^.options,pd^.options) and
-                      is_equal(pprocvardef(def)^.retdef,pd^.retdef) then
-                     begin
-                       hp1:=pprocvardef(def)^.para1;
-                       hp2:=pd^.para1;
-                       while assigned(hp1) and assigned(hp2) do
-                        begin
-                          if not(is_equal(hp1^.data,hp2^.data)) or
-                             not(hp1^.paratyp=hp2^.paratyp) then
-                            begin
-                              Message(type_e_mismatch);
-                              break;
-                            end;
-                           hp1:=hp1^.next;
-                           hp2:=hp2^.next;
-                         end;
-                        if not((hp1=nil) and (hp2=nil)) then
-                          Message(type_e_mismatch);
-                     end
-                   else
-                     Message(type_e_mismatch);
+                   if not proc_to_procvar_equal(pd,pprocvardef(def)) then
+                     Message2(type_e_incompatible_types,pd^.typename,pprocvardef(def)^.typename);
                    curconstsegment^.concat(new(pai_const_symbol,initname(pd^.mangledname)));
                    curconstsegment^.concat(new(pai_const_symbol,initname(pd^.mangledname)));
                 end;
                 end;
            end;
            end;
@@ -615,7 +597,7 @@ unit ptconst;
                    s:=pattern;
                    s:=pattern;
                    consume(ID);
                    consume(ID);
                    consume(COLON);
                    consume(COLON);
-                   srsym:=precdef(def)^.symtable^.search(s);
+                   srsym:=precorddef(def)^.symtable^.search(s);
                    if srsym=nil then
                    if srsym=nil then
                      begin
                      begin
                         Message1(sym_e_id_not_found,s);
                         Message1(sym_e_id_not_found,s);
@@ -650,7 +632,7 @@ unit ptconst;
          { reads a typed object }
          { reads a typed object }
          objectdef:
          objectdef:
            begin
            begin
-              if (pobjectdef(def)^.options and (oo_hasvmt or oo_is_class))<>0 then
+              if ([oo_has_vmt,oo_is_class]*pobjectdef(def)^.objectoptions)<>[] then
                 begin
                 begin
                    Message(parser_e_type_const_not_possible);
                    Message(parser_e_type_const_not_possible);
                    consume_all_until(RKLAMMER);
                    consume_all_until(RKLAMMER);
@@ -666,14 +648,14 @@ unit ptconst;
                         consume(COLON);
                         consume(COLON);
                         srsym:=nil;
                         srsym:=nil;
                         obj:=pobjectdef(def);
                         obj:=pobjectdef(def);
-                        symt:=obj^.publicsyms;
+                        symt:=obj^.symtable;
                         while (srsym=nil) and assigned(symt) do
                         while (srsym=nil) and assigned(symt) do
                           begin
                           begin
                              srsym:=symt^.search(s);
                              srsym:=symt^.search(s);
                              if assigned(obj) then
                              if assigned(obj) then
                                obj:=obj^.childof;
                                obj:=obj^.childof;
                              if assigned(obj) then
                              if assigned(obj) then
-                               symt:=obj^.publicsyms
+                               symt:=obj^.symtable
                              else
                              else
                                symt:=nil;
                                symt:=nil;
                           end;
                           end;
@@ -725,7 +707,11 @@ unit ptconst;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.48  1999-07-23 16:05:26  peter
+  Revision 1.49  1999-08-03 22:03:08  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.48  1999/07/23 16:05:26  peter
     * alignment is now saved in the symtable
     * alignment is now saved in the symtable
     * C alignment added for records
     * C alignment added for records
     * PPU version increased to solve .12 <-> .13 probs
     * PPU version increased to solve .12 <-> .13 probs

+ 6 - 2
compiler/ra386att.pas

@@ -37,7 +37,7 @@ Implementation
 Uses
 Uses
   globtype,
   globtype,
   strings,cobjects,systems,verbose,globals,
   strings,cobjects,systems,verbose,globals,
-  files,aasm,types,symtable,scanner,hcodegen
+  files,aasm,types,symconst,symtable,scanner,hcodegen
   ,i386base
   ,i386base
   ,rautils,ra386;
   ,rautils,ra386;
 
 
@@ -1955,7 +1955,11 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.54  1999-07-24 11:17:12  peter
+  Revision 1.55  1999-08-03 22:03:09  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.54  1999/07/24 11:17:12  peter
     * suffix parsing for at&t fixed for things like movsbl
     * suffix parsing for at&t fixed for things like movsbl
     * string constants are now handle correctly and also allowed in
     * string constants are now handle correctly and also allowed in
       constant expressions
       constant expressions

+ 10 - 6
compiler/ra386dir.pas

@@ -34,7 +34,7 @@ unit Ra386dir;
      uses
      uses
         files,hcodegen,globals,scanner,aasm
         files,hcodegen,globals,scanner,aasm
         ,i386base,i386asm
         ,i386base,i386asm
-        ,cobjects,symtable,types,verbose,
+        ,cobjects,symconst,symtable,types,verbose,
         rautils,ra386;
         rautils,ra386;
 
 
     function assemble : ptree;
     function assemble : ptree;
@@ -161,11 +161,11 @@ unit Ra386dir;
                                              {variables set are after a comma }
                                              {variables set are after a comma }
                                              {like in movl %eax,I }
                                              {like in movl %eax,I }
                                              if pos(',',s) > 0 then
                                              if pos(',',s) > 0 then
-                                               pvarsym(sym)^.is_valid:=1
+                                               pvarsym(sym)^.varstate:=vs_used
                                              else
                                              else
-                                             if (pos('MOV',upper(s)) > 0) and (pvarsym(sym)^.is_valid=0) then
+                                             if (pos('MOV',upper(s)) > 0) and (pvarsym(sym)^.varstate=vs_declared) then
                                               Message1(sym_n_uninitialized_local_variable,hs);
                                               Message1(sym_n_uninitialized_local_variable,hs);
-                                             if ((pvarsym(sym)^.var_options and vo_is_external)<>0) then
+                                             if (vo_is_external in pvarsym(sym)^.varoptions) then
                                                hs:=pvarsym(sym)^.mangledname
                                                hs:=pvarsym(sym)^.mangledname
                                              else
                                              else
                                                hs:='-'+tostr(pvarsym(sym)^.address)+'('+att_reg2str[procinfo.framepointer]+')';
                                                hs:='-'+tostr(pvarsym(sym)^.address)+'('+att_reg2str[procinfo.framepointer]+')';
@@ -193,7 +193,7 @@ unit Ra386dir;
                                                      inc(l,aktprocsym^.definition^.parast^.address_fixup);
                                                      inc(l,aktprocsym^.definition^.parast^.address_fixup);
                                                      hs:=tostr(l)+'('+att_reg2str[procinfo.framepointer]+')';
                                                      hs:=tostr(l)+'('+att_reg2str[procinfo.framepointer]+')';
                                                      if pos(',',s) > 0 then
                                                      if pos(',',s) > 0 then
-                                                       pvarsym(sym)^.is_valid:=1;
+                                                       pvarsym(sym)^.varstate:=vs_used;
                                                   end;
                                                   end;
                                              end
                                              end
                                       { I added that but it creates a problem in line.ppi
                                       { I added that but it creates a problem in line.ppi
@@ -291,7 +291,11 @@ unit Ra386dir;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.21  1999-05-27 19:44:57  peter
+  Revision 1.22  1999-08-03 22:03:11  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.21  1999/05/27 19:44:57  peter
     * removed oldasm
     * removed oldasm
     * plabel -> pasmlabel
     * plabel -> pasmlabel
     * -a switches to source writing automaticly
     * -a switches to source writing automaticly

+ 19 - 14
compiler/rautils.pas

@@ -24,9 +24,10 @@ Unit RAUtils;
 Interface
 Interface
 
 
 Uses
 Uses
-  globtype,systems,
-  symtable,aasm,hcodegen,verbose,globals,files,strings,
-  cobjects
+  strings,
+  cobjects,
+  globtype,systems,verbose,globals,files,
+  symconst,symtable,aasm,hcodegen
 {$ifdef i386}
 {$ifdef i386}
   ,i386base,i386asm
   ,i386base,i386asm
 {$endif}
 {$endif}
@@ -737,7 +738,7 @@ Begin
       begin
       begin
         { we always assume in asm statements that     }
         { we always assume in asm statements that     }
         { that the variable is valid.                 }
         { that the variable is valid.                 }
-        pvarsym(sym)^.is_valid:=1;
+        pvarsym(sym)^.varstate:=vs_used;
         inc(pvarsym(sym)^.refs);
         inc(pvarsym(sym)^.refs);
         case pvarsym(sym)^.owner^.symtabletype of
         case pvarsym(sym)^.owner^.symtabletype of
           unitsymtable,
           unitsymtable,
@@ -753,7 +754,7 @@ Begin
             end;
             end;
           localsymtable :
           localsymtable :
             begin
             begin
-              if (pvarsym(sym)^.var_options and vo_is_external)<>0 then
+              if (vo_is_external in pvarsym(sym)^.varoptions) then
                 opr.ref.symbol:=newasmsymbol(pvarsym(sym)^.mangledname)
                 opr.ref.symbol:=newasmsymbol(pvarsym(sym)^.mangledname)
               else
               else
                 begin
                 begin
@@ -1138,27 +1139,27 @@ Begin
       begin
       begin
         case pvarsym(sym)^.definition^.deftype of
         case pvarsym(sym)^.definition^.deftype of
           recorddef :
           recorddef :
-            st:=precdef(pvarsym(sym)^.definition)^.symtable;
+            st:=precorddef(pvarsym(sym)^.definition)^.symtable;
           objectdef :
           objectdef :
-            st:=pobjectdef(pvarsym(sym)^.definition)^.publicsyms;
+            st:=pobjectdef(pvarsym(sym)^.definition)^.symtable;
         end;
         end;
       end;
       end;
     typesym :
     typesym :
       begin
       begin
         case ptypesym(sym)^.definition^.deftype of
         case ptypesym(sym)^.definition^.deftype of
           recorddef :
           recorddef :
-            st:=precdef(ptypesym(sym)^.definition)^.symtable;
+            st:=precorddef(ptypesym(sym)^.definition)^.symtable;
           objectdef :
           objectdef :
-            st:=pobjectdef(ptypesym(sym)^.definition)^.publicsyms;
+            st:=pobjectdef(ptypesym(sym)^.definition)^.symtable;
         end;
         end;
       end;
       end;
     typedconstsym :
     typedconstsym :
       begin
       begin
         case pvarsym(sym)^.definition^.deftype of
         case pvarsym(sym)^.definition^.deftype of
           recorddef :
           recorddef :
-            st:=precdef(ptypedconstsym(sym)^.definition)^.symtable;
+            st:=precorddef(ptypedconstsym(sym)^.definition)^.symtable;
           objectdef :
           objectdef :
-            st:=pobjectdef(ptypedconstsym(sym)^.definition)^.publicsyms;
+            st:=pobjectdef(ptypedconstsym(sym)^.definition)^.symtable;
         end;
         end;
       end;
       end;
   end;
   end;
@@ -1180,9 +1181,9 @@ Begin
            Size:=PVarsym(sym)^.getsize;
            Size:=PVarsym(sym)^.getsize;
            case pvarsym(sym)^.definition^.deftype of
            case pvarsym(sym)^.definition^.deftype of
              recorddef :
              recorddef :
-               st:=precdef(pvarsym(sym)^.definition)^.symtable;
+               st:=precorddef(pvarsym(sym)^.definition)^.symtable;
              objectdef :
              objectdef :
-               st:=pobjectdef(pvarsym(sym)^.definition)^.publicsyms;
+               st:=pobjectdef(pvarsym(sym)^.definition)^.symtable;
            end;
            end;
          end;
          end;
      end;
      end;
@@ -1383,7 +1384,11 @@ end;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.20  1999-07-29 20:54:06  peter
+  Revision 1.21  1999-08-03 22:03:12  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.20  1999/07/29 20:54:06  peter
     * write .size also
     * write .size also
 
 
   Revision 1.19  1999/06/02 22:44:17  pierre
   Revision 1.19  1999/06/02 22:44:17  pierre

+ 116 - 90
compiler/symconst.inc

@@ -19,99 +19,125 @@
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  ****************************************************************************
  ****************************************************************************
 }
 }
-
-    const
-       def_alignment = 4;
-
-       { symbol options }
-       { this is only for object/class }
-       sp_public     = $1;
-       sp_private    = $2;
-       sp_published  = $4;
-       sp_protected  = $8;
-       sp_forwarddef = $10;
-       sp_static     = $20;
-       { this is for typesym }
-       { to know who is the primary symbol of a def }
-       sp_primary_typesym = $40;
-
-       { flags for a definition }
-       df_needsrtti = $1;           { the definitions needs rtti }
-       df_hasrtti   = $2;           { the rtti is generated      }
-
-       { options for tprocdef and tprocvardef }
-       poexceptions     = $1;        { unused }
-       povirtualmethod  = $2;        { Procedure is a virtual method }
-       poclearstack     = $4;        { Use IBM flat calling convention. (Used by GCC.) }
-       poconstructor    = $8;        { Procedure is a constructor }
-       podestructor     = $10;       { Procedure is a destructor }
-       pointernproc     = $20;       { Procedure has compiler magic}
-       poexports        = $40;       { Procedure is exported }
-       poiocheck        = $80;       { IO checking should be done after a call to the procedure }
-       poabstractmethod = $100;      { Procedure is an abstract method }
-       pointerrupt      = $200;      { Procedure is an interrupt handler }
-       poinline         = $400;      { Procedure is an assembler macro }
-       poassembler      = $800;      { Procedure is written in assembler }
-       pooperator       = $1000;     { Procedure defines an operator }
-       poexternal       = $2000;     { Procedure is external (in other object or lib)}
-       poleftright      = $4000;     { Push parameters from left to right }
-       poproginit       = $8000;     { Program initialization }
-       postaticmethod   = $10000;    { static method }
-       pooverridingmethod=$20000;    { method with override directive }
-       poclassmethod    = $40000;    { class method }
-       pounitinit       = $80000;    { unit initialization }
-       pomethodpointer  = $100000;   { method pointer, only in procvardef, also used for 'with object do' }
-       pocdecl          = $200000;   { procedure uses C styled calling }
-       popalmossyscall  = $400000;   { procedure is a PalmOS system call }
-       pointernconst    = $800000;   { procedure has constant evaluator intern }
-       poregister       = $1000000;  { procedure uses register (fastcall) calling }
-       pounitfinalize   = $2000000;  { unit finalization }
-       postdcall        = $4000000;  { procedure uses stdcall call }
-       pomsgstr         = $8000000;  { method for string message handling }
-       pomsgint         = $10000000; { method for int message handling }
-       posavestdregs    = $20000000; { save std regs cdecl and stdcall need that ! }
-       pocontainsself   = $40000000; { self is passed explicit to the compiler }
-       posafecall       = $80000000; { safe call calling conventions }
-
-       { relevant options for assigning a proc or a procvar to a procvar }
-       po_compatibility_options = $7FFFFFFF-
-         (poassembler+pomsgstr+pomsgint+
-          povirtualmethod+pooverridingmethod+poexternal);
-
-       { options for objects and classes }
-       oo_is_abstract  = $1;         { true, if the object/class has an abstract }
-                                     { method => no instances can be created     }
-       oo_is_class     = $2;
-       oo_hasvirtual   = $4;         { true, if the object/class has virtual methods }
-       oo_hasprivate   = $8;
-       oo_hasprotected = $10;
-       oo_isforward    = $20;        { true, if the class is only a forward declared yet }
-       oo_can_have_published = $40;  { true, if the class has rtti, i.e. you             }
-                                     { can publish properties                            }
-       oo_hasconstructor = $80;      { true, if the object/class has a constructor }
-       oo_hasdestructor = $100;      { true, if the object/class has a destructor }
-       oo_hasvmt        = $200;      { true, if the object/class has a vmt }
-       oo_hasmsgstr     = $400;
-       oo_hasmsgint     = $800;
-       oo_cppvmt        = $1000;     { true, if the object/class uses an C++ compatible }
-                                     { vmt, all members of the same class tree          }
-                                     { must use then a C++ compatible vmt               }
-
-       { options for properties }
-       ppo_indexed = $1;
-       ppo_defaultproperty = $2;
-       ppo_stored = $4;
-
-       { options for variables }
-       vo_regable     = $1;
-       vo_is_C_var    = $2;
-       vo_is_external = $4;
-       vo_is_dll_var  = $8;
-       vo_is_thread_var = $10;
+unit symconst;
+interface
+
+type
+  { calling convention for tprocdef and tprocvardef }
+  pocalloption=(pocall_none,
+    pocall_clearstack,    { Use IBM flat calling convention. (Used by GCC.) }
+    pocall_leftright,     { Push parameters from left to right }
+    pocall_cdecl,         { procedure uses C styled calling }
+    pocall_register,      { procedure uses register (fastcall) calling }
+    pocall_stdcall,       { procedure uses stdcall call }
+    pocall_safecall,      { safe call calling conventions }
+    pocall_palmossyscall  { procedure is a PalmOS system call }
+  );
+
+  { basic type for tprocdef and tprocvardef }
+  potypeoption=(potype_none,
+    potype_proginit,     { Program initialization }
+    potype_unitinit,     { unit initialization }
+    potype_unitfinalize, { unit finalization }
+    potype_constructor,  { Procedure is a constructor }
+    potype_destructor,   { Procedure is a destructor }
+    potype_internproc,   { Procedure has compiler magic}
+    potype_internconst,  { procedure has constant evaluator intern }
+    potype_operator      { Procedure defines an operator }
+  );
+
+  { other options for tprocdef and tprocvardef }
+  pooption=(po_none,
+    po_classmethod,       { class method }
+    po_virtualmethod,     { Procedure is a virtual method }
+    po_abstractmethod,    { Procedure is an abstract method }
+    po_staticmethod,      { static method }
+    po_overridingmethod,  { method with override directive }
+    po_inline,            { Procedure is an assembler macro }
+    po_methodpointer,     { method pointer, only in procvardef, also used for 'with object do' }
+    po_containsself,      { self is passed explicit to the compiler }
+    po_interrupt,         { Procedure is an interrupt handler }
+    po_iocheck,           { IO checking should be done after a call to the procedure }
+    po_assembler,         { Procedure is written in assembler }
+    po_msgstr,            { method for string message handling }
+    po_msgint,            { method for int message handling }
+    po_exports,           { Procedure has export directive (needed for OS/2) }
+    po_external,          { Procedure is external (in other object or lib)}
+    po_savestdregs,       { save std regs cdecl and stdcall need that ! }
+    po_saveregisters      { save all registers }
+  );
+  pooptions=set of pooption;
+
+  { symbol options }
+  spoption=(sp_none,
+    sp_public,
+    sp_private,
+    sp_published,
+    sp_protected,
+    sp_forwarddef,
+    sp_static
+    sp_primary_typesym; { this is for typesym, to know who is the primary symbol of a def }
+  );
+  spoptions=set of spoption;
+
+  { options for objects and classes }
+  oooption=(
+    oo_is_class,
+    oo_is_forward,         { the class is only a forward declared yet }
+    oo_has_virtual,        { the object/class has virtual methods }
+    oo_has_private,
+    oo_has_protected,
+    oo_has_constructor,    { the object/class has a constructor }
+    oo_has_destructor,     { the object/class has a destructor }
+    oo_has_vmt,            { the object/class has a vmt }
+    oo_has_msgstr,
+    oo_has_msgint,
+    oo_has_abstract,       { the object/class has an abstract method => no instances can be created }
+    oo_can_have_published, { the class has rtti, i.e. you can publish properties }
+    oo_cppvmt,             { the object/class uses an C++ compatible }
+                           { vmt, all members of the same class tree }
+                           { must use then a C++ compatible vmt      }
+  );
+  oooptions=set of oooption;
+
+const
+  def_alignment = 4;
+
+  { flags for a definition }
+  df_needsrtti = $1;           { the definitions needs rtti }
+  df_hasrtti   = $2;           { the rtti is generated      }
+
+  { relevant options for assigning a proc or a procvar to a procvar }
+  po_compatibility_options = [
+    po_classmethod,
+    po_staticmethod,
+    po_inline,
+    po_methodpointer,
+    po_containsself,
+    po_interrupt,
+    po_iocheck,
+    po_exports,
+  ];
+
+  { options for properties }
+  ppo_indexed = $1;
+  ppo_defaultproperty = $2;
+  ppo_stored = $4;
+
+  { options for variables }
+  vo_regable     = $1;
+  vo_is_C_var    = $2;
+  vo_is_external = $4;
+  vo_is_dll_var  = $8;
+  vo_is_thread_var = $10;
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.12  1999-07-06 21:48:26  florian
+  Revision 1.13  1999-08-03 22:03:13  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.12  1999/07/06 21:48:26  florian
     * a lot bug fixes:
     * a lot bug fixes:
        - po_external isn't any longer necessary for procedure compatibility
        - po_external isn't any longer necessary for procedure compatibility
        - m_tp_procvar is in -Sd now available
        - m_tp_procvar is in -Sd now available

+ 187 - 0
compiler/symconst.pas

@@ -0,0 +1,187 @@
+{
+    $Id$
+    Copyright (c) 1993-98 by Florian Klaempfl, Pierre Muller
+
+    Symbol table constants
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ ****************************************************************************
+}
+unit symconst;
+interface
+
+const
+  def_alignment = 4;
+
+type
+  { symbol options }
+  tsymoption=(sp_none,
+    sp_public,
+    sp_private,
+    sp_published,
+    sp_protected,
+    sp_forwarddef,
+    sp_static,
+    sp_primary_typesym    { this is for typesym, to know who is the primary symbol of a def }
+  );
+  tsymoptions=set of tsymoption;
+
+  { flags for a definition }
+  tdefoption=(df_none,
+    df_need_rtti,          { the definitions needs rtti }
+    df_has_rtti            { the rtti is generated      }
+  );
+  tdefoptions=set of tdefoption;
+
+  { base types for orddef }
+  tbasetype = (
+    uauto,uvoid,uchar,
+    u8bit,u16bit,u32bit,
+    s8bit,s16bit,s32bit,
+    bool8bit,bool16bit,bool32bit,
+    u64bit,s64bit
+  );
+
+  { float types }
+  tfloattype = (
+    s32real,s64real,s80real,
+    s64comp,
+    f16bit,f32bit
+  );
+
+  { string types }
+  tstringtype = (
+    st_shortstring, st_longstring, st_ansistring, st_widestring
+  );
+
+  { set types }
+  tsettype = (
+    normset,smallset,varset
+  );
+
+  { calling convention for tprocdef and tprocvardef }
+  tproccalloption=(pocall_none,
+    pocall_clearstack,    { Use IBM flat calling convention. (Used by GCC.) }
+    pocall_leftright,     { Push parameters from left to right }
+    pocall_cdecl,         { procedure uses C styled calling }
+    pocall_register,      { procedure uses register (fastcall) calling }
+    pocall_stdcall,       { procedure uses stdcall call }
+    pocall_safecall,      { safe call calling conventions }
+    pocall_palmossyscall, { procedure is a PalmOS system call }
+    pocall_system,
+    pocall_inline,        { Procedure is an assembler macro }
+    pocall_internproc,    { Procedure has compiler magic}
+    pocall_internconst    { procedure has constant evaluator intern }
+  );
+  tproccalloptions=set of tproccalloption;
+
+  { basic type for tprocdef and tprocvardef }
+  tproctypeoption=(potype_none,
+    potype_proginit,     { Program initialization }
+    potype_unitinit,     { unit initialization }
+    potype_unitfinalize, { unit finalization }
+    potype_constructor,  { Procedure is a constructor }
+    potype_destructor,   { Procedure is a destructor }
+    potype_operator      { Procedure defines an operator }
+  );
+  tproctypeoptions=set of tproctypeoption;
+
+  { other options for tprocdef and tprocvardef }
+  tprocoption=(po_none,
+    po_classmethod,       { class method }
+    po_virtualmethod,     { Procedure is a virtual method }
+    po_abstractmethod,    { Procedure is an abstract method }
+    po_staticmethod,      { static method }
+    po_overridingmethod,  { method with override directive }
+    po_methodpointer,     { method pointer, only in procvardef, also used for 'with object do' }
+    po_containsself,      { self is passed explicit to the compiler }
+    po_interrupt,         { Procedure is an interrupt handler }
+    po_iocheck,           { IO checking should be done after a call to the procedure }
+    po_assembler,         { Procedure is written in assembler }
+    po_msgstr,            { method for string message handling }
+    po_msgint,            { method for int message handling }
+    po_exports,           { Procedure has export directive (needed for OS/2) }
+    po_external,          { Procedure is external (in other object or lib)}
+    po_savestdregs,       { save std regs cdecl and stdcall need that ! }
+    po_saveregisters      { save all registers }
+  );
+  tprocoptions=set of tprocoption;
+
+  { options for objects and classes }
+  tobjectoption=(oo_none,
+    oo_is_class,
+    oo_is_forward,         { the class is only a forward declared yet }
+    oo_has_virtual,        { the object/class has virtual methods }
+    oo_has_private,
+    oo_has_protected,
+    oo_has_constructor,    { the object/class has a constructor }
+    oo_has_destructor,     { the object/class has a destructor }
+    oo_has_vmt,            { the object/class has a vmt }
+    oo_has_msgstr,
+    oo_has_msgint,
+    oo_has_abstract,       { the object/class has an abstract method => no instances can be created }
+    oo_can_have_published, { the class has rtti, i.e. you can publish properties }
+    oo_cppvmt              { the object/class uses an C++ compatible }
+                           { vmt, all members of the same class tree }
+                           { must use then a C++ compatible vmt      }
+  );
+  tobjectoptions=set of tobjectoption;
+
+  { options for properties }
+  tpropertyoption=(ppo_none,
+    ppo_indexed,
+    ppo_defaultproperty,
+    ppo_stored
+  );
+  tpropertyoptions=set of tpropertyoption;
+
+  { options for variables }
+  tvaroption=(vo_none,
+    vo_regable,
+    vo_is_C_var,
+    vo_is_external,
+    vo_is_dll_var,
+    vo_is_thread_var
+  );
+  tvaroptions=set of tvaroption;
+
+  { State of the variable, if it's declared, assigned or used }
+  tvarstate=(vs_none,
+    vs_declared,vs_declared2,vs_assigned,vs_used
+  );
+
+const
+  { relevant options for assigning a proc or a procvar to a procvar }
+  po_compatibility_options = [
+    po_classmethod,
+    po_staticmethod,
+    po_methodpointer,
+    po_containsself,
+    po_interrupt,
+    po_iocheck,
+    po_exports
+  ];
+
+implementation
+
+end.
+{
+  $Log$
+  Revision 1.1  1999-08-03 22:03:14  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+}
+

+ 251 - 221
compiler/symdef.inc

@@ -995,7 +995,7 @@
                 bool32bit:
                 bool32bit:
                   savesize:=4;
                   savesize:=4;
 
 
-                u64bit,s64bitint:
+                u64bit,s64bit:
                   savesize:=8;
                   savesize:=8;
              else
              else
                savesize:=0;
                savesize:=0;
@@ -1072,7 +1072,7 @@
         bool16bit : stabstring := strpnew('-22;');
         bool16bit : stabstring := strpnew('-22;');
         bool32bit : stabstring := strpnew('-23;');
         bool32bit : stabstring := strpnew('-23;');
         u64bit    : stabstring := strpnew('-32;');
         u64bit    : stabstring := strpnew('-32;');
-        s64bitint : stabstring := strpnew('-31;');
+        s64bit    : stabstring := strpnew('-31;');
 {$endif not Use_integer_types_for_boolean}
 {$endif not Use_integer_types_for_boolean}
          { u32bit : stabstring := strpnew('r'+
          { u32bit : stabstring := strpnew('r'+
               s32bitdef^.numberstring+';0;-1;'); }
               s32bitdef^.numberstring+';0;-1;'); }
@@ -1570,7 +1570,12 @@
 {$ifdef GDB}
 {$ifdef GDB}
     function tsetdef.stabstring : pchar;
     function tsetdef.stabstring : pchar;
       begin
       begin
-         stabstring := strpnew('S'+setof^.numberstring);
+         { For small sets write a longint, which can at least be seen
+           in the current GDB's (PFV) }
+         if settype=smallset then
+           stabstring := strpnew('r'+s32bitdef^.numberstring+';0;0xffffffff;')
+         else
+           stabstring := strpnew('S'+setof^.numberstring);
       end;
       end;
 
 
 
 
@@ -1842,10 +1847,10 @@
       end;
       end;
 
 
 {***************************************************************************
 {***************************************************************************
-                                  TRECDEF
+                                  trecorddef
 ***************************************************************************}
 ***************************************************************************}
 
 
-    constructor trecdef.init(p : psymtable);
+    constructor trecorddef.init(p : psymtable);
       begin
       begin
          inherited init;
          inherited init;
          deftype:=recorddef;
          deftype:=recorddef;
@@ -1855,7 +1860,7 @@
       end;
       end;
 
 
 
 
-    constructor trecdef.load;
+    constructor trecorddef.load;
       var
       var
          oldread_member : boolean;
          oldread_member : boolean;
       begin
       begin
@@ -1870,7 +1875,7 @@
       end;
       end;
 
 
 
 
-    destructor trecdef.done;
+    destructor trecorddef.done;
       begin
       begin
          if assigned(symtable) then
          if assigned(symtable) then
            dispose(symtable,done);
            dispose(symtable,done);
@@ -1886,12 +1891,12 @@
       begin
       begin
          if (psym(s)^.typ=varsym) and
          if (psym(s)^.typ=varsym) and
             ((pvarsym(s)^.definition^.deftype<>objectdef) or
             ((pvarsym(s)^.definition^.deftype<>objectdef) or
-             not(pobjectdef(pvarsym(s)^.definition)^.isclass)) then
+             not(pobjectdef(pvarsym(s)^.definition)^.is_class)) then
             binittable:=pvarsym(s)^.definition^.needs_inittable;
             binittable:=pvarsym(s)^.definition^.needs_inittable;
       end;
       end;
 
 
 
 
-    function trecdef.needs_inittable : boolean;
+    function trecorddef.needs_inittable : boolean;
       var
       var
          oldb : boolean;
          oldb : boolean;
       begin
       begin
@@ -1907,7 +1912,7 @@
       end;
       end;
 
 
 
 
-    procedure trecdef.deref;
+    procedure trecorddef.deref;
       var
       var
          oldrecsyms : psymtable;
          oldrecsyms : psymtable;
       begin
       begin
@@ -1919,7 +1924,7 @@
       end;
       end;
 
 
 
 
-    procedure trecdef.write;
+    procedure trecorddef.write;
       var
       var
          oldread_member : boolean;
          oldread_member : boolean;
       begin
       begin
@@ -1932,13 +1937,13 @@
          read_member:=oldread_member;
          read_member:=oldread_member;
       end;
       end;
 
 
-    function trecdef.size:longint;
+    function trecorddef.size:longint;
       begin
       begin
         size:=symtable^.datasize;
         size:=symtable^.datasize;
       end;
       end;
 
 
 
 
-    function trecdef.alignment:longint;
+    function trecorddef.alignment:longint;
       begin
       begin
         alignment:=symtable^.dataalignment;
         alignment:=symtable^.dataalignment;
       end;
       end;
@@ -1955,11 +1960,11 @@
       size : longint;
       size : longint;
     begin
     begin
     { static variables from objects are like global objects }
     { static variables from objects are like global objects }
-    if ((psym(p)^.properties and sp_static)<>0) then
+    if (sp_static in psym(p)^.symoptions) then
       exit;
       exit;
-    if ((psym(p)^.properties and sp_protected)<>0) then
+    if (sp_protected in psym(p)^.symoptions) then
       spec:='/1'
       spec:='/1'
-    else if ((psym(p)^.properties and sp_private)<>0) then
+    else if (sp_private in psym(p)^.symoptions) then
       spec:='/0'
       spec:='/0'
     else
     else
       spec:='';
       spec:='';
@@ -1989,7 +1994,7 @@
     end;
     end;
 
 
 
 
-    function trecdef.stabstring : pchar;
+    function trecorddef.stabstring : pchar;
       Var oldrec : pchar;
       Var oldrec : pchar;
           oldsize : longint;
           oldsize : longint;
       begin
       begin
@@ -2010,7 +2015,7 @@
       end;
       end;
 
 
 
 
-    procedure trecdef.concatstabto(asmlist : paasmoutput);
+    procedure trecorddef.concatstabto(asmlist : paasmoutput);
       begin
       begin
         if (not assigned(sym) or sym^.isusedinstab or (cs_gdb_dbx in aktglobalswitches)) and
         if (not assigned(sym) or sym^.isusedinstab or (cs_gdb_dbx in aktglobalswitches)) and
            (not is_def_stab_written) then
            (not is_def_stab_written) then
@@ -2068,19 +2073,19 @@
       end;
       end;
 
 
 
 
-    procedure trecdef.write_child_rtti_data;
+    procedure trecorddef.write_child_rtti_data;
       begin
       begin
          symtable^.foreach({$ifndef TP}@{$endif}generate_child_rtti);
          symtable^.foreach({$ifndef TP}@{$endif}generate_child_rtti);
       end;
       end;
 
 
 
 
-    procedure trecdef.write_child_init_data;
+    procedure trecorddef.write_child_init_data;
       begin
       begin
          symtable^.foreach({$ifndef TP}@{$endif}generate_child_inittable);
          symtable^.foreach({$ifndef TP}@{$endif}generate_child_inittable);
       end;
       end;
 
 
 
 
-    procedure trecdef.write_rtti_data;
+    procedure trecorddef.write_rtti_data;
       begin
       begin
          rttilist^.concat(new(pai_const,init_8bit(tkrecord)));
          rttilist^.concat(new(pai_const,init_8bit(tkrecord)));
          write_rtti_name;
          write_rtti_name;
@@ -2092,7 +2097,7 @@
       end;
       end;
 
 
 
 
-    procedure trecdef.write_init_data;
+    procedure trecorddef.write_init_data;
       begin
       begin
          rttilist^.concat(new(pai_const,init_8bit(14)));
          rttilist^.concat(new(pai_const,init_8bit(14)));
          write_rtti_name;
          write_rtti_name;
@@ -2103,7 +2108,7 @@
          symtable^.foreach({$ifndef TP}@{$endif}write_field_inittable);
          symtable^.foreach({$ifndef TP}@{$endif}write_field_inittable);
       end;
       end;
 
 
-    function trecdef.gettypename : string;
+    function trecorddef.gettypename : string;
 
 
       begin
       begin
          gettypename:='<record type>'
          gettypename:='<record type>'
@@ -2114,17 +2119,6 @@
                        TABSTRACTPROCDEF
                        TABSTRACTPROCDEF
 ***************************************************************************}
 ***************************************************************************}
 
 
-    constructor tabstractprocdef.init;
-      begin
-         inherited init;
-         para1:=nil;
-         fpu_used:=0;
-         options:=0;
-         retdef:=voiddef;
-         savesize:=target_os.size_of_pointer;
-      end;
-
-
     procedure disposepdefcoll(var para1 : pdefcoll);
     procedure disposepdefcoll(var para1 : pdefcoll);
       var
       var
          hp : pdefcoll;
          hp : pdefcoll;
@@ -2138,6 +2132,20 @@
            end;
            end;
       end;
       end;
 
 
+
+    constructor tabstractprocdef.init;
+      begin
+         inherited init;
+         para1:=nil;
+         fpu_used:=0;
+         proctypeoption:=potype_none;
+         proccalloptions:=[];
+         procoptions:=[];
+         retdef:=voiddef;
+         savesize:=target_os.size_of_pointer;
+      end;
+
+
     destructor tabstractprocdef.done;
     destructor tabstractprocdef.done;
       begin
       begin
          disposepdefcoll(para1);
          disposepdefcoll(para1);
@@ -2158,6 +2166,7 @@
          para1:=hp;
          para1:=hp;
       end;
       end;
 
 
+
     procedure tabstractprocdef.concattypesym(p : ptypesym;vsp : tvarspez);
     procedure tabstractprocdef.concattypesym(p : ptypesym;vsp : tvarspez);
       var
       var
          hp : pdefcoll;
          hp : pdefcoll;
@@ -2171,6 +2180,7 @@
          para1:=hp;
          para1:=hp;
       end;
       end;
 
 
+
     { all functions returning in FPU are
     { all functions returning in FPU are
       assume to use 2 FPU registers
       assume to use 2 FPU registers
       until the function implementation
       until the function implementation
@@ -2211,7 +2221,9 @@
          inherited load;
          inherited load;
          retdef:=readdefref;
          retdef:=readdefref;
          fpu_used:=readbyte;
          fpu_used:=readbyte;
-         options:=readlong;
+         proctypeoption:=tproctypeoption(readlong);
+         readsmallset(proccalloptions);
+         readsmallset(procoptions);
          count:=readword;
          count:=readword;
          para1:=nil;
          para1:=nil;
          savesize:=target_os.size_of_pointer;
          savesize:=target_os.size_of_pointer;
@@ -2233,29 +2245,6 @@
       end;
       end;
 
 
 
 
-    function tabstractprocdef.para_size : longint;
-      var
-         pdc : pdefcoll;
-         l : longint;
-      begin
-         l:=0;
-         pdc:=para1;
-         while assigned(pdc) do
-          begin
-            case pdc^.paratyp of
-              vs_var   : inc(l,target_os.size_of_pointer);
-              vs_value,
-              vs_const : if push_addr_param(pdc^.data) then
-                          inc(l,target_os.size_of_pointer)
-                         else
-                          inc(l,align(pdc^.data^.size,target_os.stackalignment));
-            end;
-            pdc:=pdc^.next;
-          end;
-         para_size:=l;
-      end;
-
-
     procedure tabstractprocdef.write;
     procedure tabstractprocdef.write;
       var
       var
          count : word;
          count : word;
@@ -2265,7 +2254,9 @@
          writedefref(retdef);
          writedefref(retdef);
          current_ppu^.do_interface_crc:=false;
          current_ppu^.do_interface_crc:=false;
          writebyte(fpu_used);
          writebyte(fpu_used);
-         writelong(options);
+         writelong(ord(proctypeoption));
+         writesmallset(proccalloptions);
+         writesmallset(procoptions);
          hp:=para1;
          hp:=para1;
          count:=0;
          count:=0;
          while assigned(hp) do
          while assigned(hp) do
@@ -2294,6 +2285,29 @@
       end;
       end;
 
 
 
 
+    function tabstractprocdef.para_size : longint;
+      var
+         pdc : pdefcoll;
+         l : longint;
+      begin
+         l:=0;
+         pdc:=para1;
+         while assigned(pdc) do
+          begin
+            case pdc^.paratyp of
+              vs_var   : inc(l,target_os.size_of_pointer);
+              vs_value,
+              vs_const : if push_addr_param(pdc^.data) then
+                          inc(l,target_os.size_of_pointer)
+                         else
+                          inc(l,align(pdc^.data^.size,target_os.stackalignment));
+            end;
+            pdc:=pdc^.next;
+          end;
+         para_size:=l;
+      end;
+
+
     function tabstractprocdef.demangled_paras : string;
     function tabstractprocdef.demangled_paras : string;
 
 
       var s : string;
       var s : string;
@@ -2428,7 +2442,9 @@
          _class := pobjectdef(readdefref);
          _class := pobjectdef(readdefref);
          readposinfo(fileinfo);
          readposinfo(fileinfo);
 
 
-         if (cs_link_deffile in aktglobalswitches) and ((options and poexports)<>0) then
+         if (cs_link_deffile in aktglobalswitches) and
+            (tf_need_export in target_info.flags) and
+            (po_exports in procoptions) then
            deffile.AddExport(mangledname);
            deffile.AddExport(mangledname);
 
 
          parast:=nil;
          parast:=nil;
@@ -2526,9 +2542,9 @@ Const local_symtable_index : longint = $8001;
              if (owner^.symtabletype<>localsymtable) then
              if (owner^.symtabletype<>localsymtable) then
                while assigned(pdo) do
                while assigned(pdo) do
                  begin
                  begin
-                    if pdo^.publicsyms<>aktrecordsymtable then
+                    if pdo^.symtable<>aktrecordsymtable then
                       begin
                       begin
-                         pdo^.publicsyms^.unitid:=local_symtable_index;
+                         pdo^.symtable^.unitid:=local_symtable_index;
                          inc(local_symtable_index);
                          inc(local_symtable_index);
                       end;
                       end;
                     pdo:=pdo^.childof;
                     pdo:=pdo^.childof;
@@ -2554,7 +2570,7 @@ Const local_symtable_index : longint = $8001;
              if (owner^.symtabletype<>localsymtable) then
              if (owner^.symtabletype<>localsymtable) then
                while assigned(pdo) do
                while assigned(pdo) do
                  begin
                  begin
-                    if pdo^.publicsyms<>aktrecordsymtable then
+                    if pdo^.symtable<>aktrecordsymtable then
                       dec(local_symtable_index);
                       dec(local_symtable_index);
                     pdo:=pdo^.childof;
                     pdo:=pdo^.childof;
                  end;
                  end;
@@ -2590,9 +2606,9 @@ Const local_symtable_index : longint = $8001;
            dispose(parast,done);
            dispose(parast,done);
          if assigned(localst) and (localst^.symtabletype<>staticsymtable) then
          if assigned(localst) and (localst^.symtabletype<>staticsymtable) then
            dispose(localst,done);
            dispose(localst,done);
-         if ((options and poinline) <> 0) and assigned(code) then
+         if (pocall_inline in proccalloptions) and assigned(code) then
            disposetree(ptree(code));
            disposetree(ptree(code));
-         if (options and pomsgstr)<>0 then
+         if (po_msgstr in procoptions) then
            strdispose(messageinf.str);
            strdispose(messageinf.str);
          if
          if
 {$ifdef tp}
 {$ifdef tp}
@@ -2625,7 +2641,7 @@ Const local_symtable_index : longint = $8001;
          writestring(mangledname);
          writestring(mangledname);
          current_ppu^.do_interface_crc:=true;
          current_ppu^.do_interface_crc:=true;
          writelong(extnumber);
          writelong(extnumber);
-         if (options and pooperator) = 0 then
+         if (proctypeoption<>potype_operator) then
            writedefref(nextoverloaded)
            writedefref(nextoverloaded)
          else
          else
            begin
            begin
@@ -2638,7 +2654,7 @@ Const local_symtable_index : longint = $8001;
            end;
            end;
          writedefref(_class);
          writedefref(_class);
          writeposinfo(fileinfo);
          writeposinfo(fileinfo);
-         if (options and poinline) <> 0 then
+         if (pocall_inline in proccalloptions) then
            begin
            begin
               { we need to save
               { we need to save
                 - the para and the local symtable
                 - the para and the local symtable
@@ -2830,10 +2846,10 @@ Const local_symtable_index : longint = $8001;
 
 
     function tprocvardef.size : longint;
     function tprocvardef.size : longint;
       begin
       begin
-         if (options and pomethodpointer)=0 then
-           size:=target_os.size_of_pointer
+         if (po_methodpointer in procoptions) then
+           size:=2*target_os.size_of_pointer
          else
          else
-           size:=2*target_os.size_of_pointer;
+           size:=target_os.size_of_pointer;
       end;
       end;
 
 
 
 
@@ -2904,9 +2920,10 @@ Const local_symtable_index : longint = $8001;
 
 
     function tprocvardef.is_publishable : boolean;
     function tprocvardef.is_publishable : boolean;
       begin
       begin
-         is_publishable:=(options and pomethodpointer)<>0;
+         is_publishable:=(po_methodpointer in procoptions);
       end;
       end;
 
 
+
     function tprocvardef.gettypename : string;
     function tprocvardef.gettypename : string;
 
 
       begin
       begin
@@ -2931,52 +2948,20 @@ Const local_symtable_index : longint = $8001;
      begin
      begin
         tdef.init;
         tdef.init;
         deftype:=objectdef;
         deftype:=objectdef;
-        options:=0;
+        objectoptions:=[];
         childof:=nil;
         childof:=nil;
-        publicsyms:=new(psymtable,init(objectsymtable));
-        publicsyms^.name := stringdup(n);
+        symtable:=new(psymtable,init(objectsymtable));
+        symtable^.name := stringdup(n);
         { create space for vmt !! }
         { create space for vmt !! }
-        options:=0;
         vmt_offset:=0;
         vmt_offset:=0;
-        publicsyms^.datasize:=0;
-        publicsyms^.defowner:=@self;
-        publicsyms^.dataalignment:=packrecordalignment[aktpackrecords];
+        symtable^.datasize:=0;
+        symtable^.defowner:=@self;
+        symtable^.dataalignment:=packrecordalignment[aktpackrecords];
         set_parent(c);
         set_parent(c);
         objname:=stringdup(n);
         objname:=stringdup(n);
      end;
      end;
 
 
 
 
-    procedure tobjectdef.set_parent( c : pobjectdef);
-      begin
-        { nothing to do if the parent was not forward !}
-        if assigned(childof) then
-          exit;
-        childof:=c;
-        { some options are inherited !! }
-        if assigned(c) then
-          begin
-             options:= options or (c^.options and
-                    (oo_hasvirtual or oo_hasprivate or
-                     oo_hasprotected or
-                     oo_hasconstructor or oo_hasdestructor
-                     ));
-             { add the data of the anchestor class }
-             publicsyms^.datasize:=publicsyms^.datasize
-               +childof^.publicsyms^.datasize;
-             if ((options and oo_hasvmt)<>0) and
-                ((c^.options and oo_hasvmt)<>0) then
-               publicsyms^.datasize:=publicsyms^.datasize-target_os.size_of_pointer;
-             { if parent has a vmt field then
-               the offset is the same for the child PM }
-             if ((c^.options and oo_hasvmt)<>0) or isclass then
-               begin
-                  vmt_offset:=c^.vmt_offset;
-                  options:=options or oo_hasvmt;
-               end;
-          end;
-        savesize := publicsyms^.datasize;
-      end;
-
     constructor tobjectdef.load;
     constructor tobjectdef.load;
       var
       var
          oldread_member : boolean;
          oldread_member : boolean;
@@ -2987,73 +2972,146 @@ Const local_symtable_index : longint = $8001;
          vmt_offset:=readlong;
          vmt_offset:=readlong;
          objname:=stringdup(readstring);
          objname:=stringdup(readstring);
          childof:=pobjectdef(readdefref);
          childof:=pobjectdef(readdefref);
-         options:=readlong;
+         readsmallset(objectoptions);
          oldread_member:=read_member;
          oldread_member:=read_member;
          read_member:=true;
          read_member:=true;
-         publicsyms:=new(psymtable,loadas(objectsymtable));
+         symtable:=new(psymtable,loadas(objectsymtable));
          read_member:=oldread_member;
          read_member:=oldread_member;
-         publicsyms^.defowner:=@self;
-         publicsyms^.name := stringdup(objname^);
+         symtable^.defowner:=@self;
+         symtable^.name := stringdup(objname^);
 
 
          { handles the predefined class tobject  }
          { handles the predefined class tobject  }
          { the last TOBJECT which is loaded gets }
          { the last TOBJECT which is loaded gets }
          { it !                                  }
          { it !                                  }
-         if (objname^='TOBJECT') and
-           isclass and (childof=nil) then
+         if (childof=nil) and
+            is_class and
+            (objname^='TOBJECT') then
            class_tobject:=@self;
            class_tobject:=@self;
          has_rtti:=true;
          has_rtti:=true;
        end;
        end;
 
 
 
 
+   destructor tobjectdef.done;
+     begin
+        if assigned(symtable) then
+          dispose(symtable,done);
+        if (oo_is_forward in objectoptions) then
+          Message1(sym_e_class_forward_not_resolved,objname^);
+        stringdispose(objname);
+        tdef.done;
+     end;
+
+
+    procedure tobjectdef.write;
+      var
+         oldread_member : boolean;
+      begin
+         tdef.write;
+         writelong(size);
+         writelong(vmt_offset);
+         writestring(objname^);
+         writedefref(childof);
+         writesmallset(objectoptions);
+         current_ppu^.writeentry(ibobjectdef);
+
+         oldread_member:=read_member;
+         read_member:=true;
+         symtable^.writeas;
+         read_member:=oldread_member;
+      end;
+
+
+    procedure tobjectdef.deref;
+      var
+         oldrecsyms : psymtable;
+      begin
+         resolvedef(pdef(childof));
+         oldrecsyms:=aktrecordsymtable;
+         aktrecordsymtable:=symtable;
+         symtable^.deref;
+         aktrecordsymtable:=oldrecsyms;
+      end;
+
+
+    procedure tobjectdef.set_parent( c : pobjectdef);
+      begin
+        { nothing to do if the parent was not forward !}
+        if assigned(childof) then
+          exit;
+        childof:=c;
+        { some options are inherited !! }
+        if assigned(c) then
+          begin
+             objectoptions:=objectoptions+(c^.objectoptions*
+               [oo_has_virtual,oo_has_private,oo_has_protected,oo_has_constructor,oo_has_destructor]);
+             { add the data of the anchestor class }
+             inc(symtable^.datasize,c^.symtable^.datasize);
+             if (oo_has_vmt in objectoptions) and
+                (oo_has_vmt in c^.objectoptions) then
+               dec(symtable^.datasize,target_os.size_of_pointer);
+             { if parent has a vmt field then
+               the offset is the same for the child PM }
+             if (oo_has_vmt in c^.objectoptions) or is_class then
+               begin
+                  vmt_offset:=c^.vmt_offset;
+{$ifdef INCLUDEOK}
+                  include(objectoptions,oo_has_vmt);
+{$else}
+                  objectoptions:=objectoptions+[oo_has_vmt];
+{$endif}
+               end;
+          end;
+        savesize := symtable^.datasize;
+      end;
+
+
    procedure tobjectdef.insertvmt;
    procedure tobjectdef.insertvmt;
      begin
      begin
-        if (options and oo_hasvmt)<>0 then
+        if (oo_has_vmt in objectoptions) then
           internalerror(12345)
           internalerror(12345)
         else
         else
           begin
           begin
              { first round up to multiple of 4 }
              { first round up to multiple of 4 }
-             if (publicsyms^.dataalignment=2) then
+             if (symtable^.dataalignment=2) then
                begin
                begin
-                 if (publicsyms^.datasize and 1)<>0 then
-                   inc(publicsyms^.datasize);
+                 if (symtable^.datasize and 1)<>0 then
+                   inc(symtable^.datasize);
                end
                end
              else
              else
-              if (publicsyms^.dataalignment>=4) then
+              if (symtable^.dataalignment>=4) then
                begin
                begin
-                 if (publicsyms^.datasize mod 4) <> 0 then
-                   publicsyms^.datasize:=publicsyms^.datasize+4-(publicsyms^.datasize mod 4);
+                 if (symtable^.datasize mod 4) <> 0 then
+                   inc(symtable^.datasize,4-(symtable^.datasize mod 4));
                end;
                end;
-             vmt_offset:=publicsyms^.datasize;
-             publicsyms^.datasize:=publicsyms^.datasize+target_os.size_of_pointer;
-             options:=options or oo_hasvmt;
+             vmt_offset:=symtable^.datasize;
+             inc(symtable^.datasize,target_os.size_of_pointer);
+{$ifdef INCLUDEOK}
+             include(objectoptions,oo_has_vmt);
+{$else}
+             objectoptions:=objectoptions+[oo_has_vmt];
+{$endif}
           end;
           end;
      end;
      end;
 
 
+
    procedure tobjectdef.check_forwards;
    procedure tobjectdef.check_forwards;
      begin
      begin
-        publicsyms^.check_forwards;
-        if (options and oo_isforward)<>0 then
+        symtable^.check_forwards;
+        if (oo_is_forward in objectoptions) then
           begin
           begin
              { ok, in future, the forward can be resolved }
              { ok, in future, the forward can be resolved }
              Message1(sym_e_class_forward_not_resolved,objname^);
              Message1(sym_e_class_forward_not_resolved,objname^);
-             options:=options and not(oo_isforward);
+{$ifdef INCLUDEOK}
+             exclude(objectoptions,oo_is_forward);
+{$else}
+             objectoptions:=objectoptions-[oo_is_forward];
+{$endif}
           end;
           end;
      end;
      end;
 
 
 
 
-   destructor tobjectdef.done;
-     begin
-        if assigned(publicsyms) then
-          dispose(publicsyms,done);
-        if (options and oo_isforward)<>0 then
-         Message1(sym_e_class_forward_not_resolved,objname^);
-        stringdispose(objname);
-        tdef.done;
-     end;
-
-
    { true, if self inherits from d (or if they are equal) }
    { true, if self inherits from d (or if they are equal) }
-   function tobjectdef.isrelated(d : pobjectdef) : boolean;
+   function tobjectdef.is_related(d : pobjectdef) : boolean;
      var
      var
         hp : pobjectdef;
         hp : pobjectdef;
      begin
      begin
@@ -3062,39 +3120,27 @@ Const local_symtable_index : longint = $8001;
           begin
           begin
              if hp=d then
              if hp=d then
                begin
                begin
-                  isrelated:=true;
+                  is_related:=true;
                   exit;
                   exit;
                end;
                end;
              hp:=hp^.childof;
              hp:=hp^.childof;
           end;
           end;
-        isrelated:=false;
+        is_related:=false;
      end;
      end;
 
 
 
 
     function tobjectdef.size : longint;
     function tobjectdef.size : longint;
       begin
       begin
-        if (options and oo_is_class)<>0 then
+        if (oo_is_class in objectoptions) then
           size:=target_os.size_of_pointer
           size:=target_os.size_of_pointer
         else
         else
-          size:=publicsyms^.datasize;
+          size:=symtable^.datasize;
       end;
       end;
 
 
 
 
     function tobjectdef.alignment:longint;
     function tobjectdef.alignment:longint;
       begin
       begin
-        alignment:=publicsyms^.dataalignment;
-      end;
-
-
-    procedure tobjectdef.deref;
-      var
-         oldrecsyms : psymtable;
-      begin
-         resolvedef(pdef(childof));
-         oldrecsyms:=aktrecordsymtable;
-         aktrecordsymtable:=publicsyms;
-         publicsyms^.deref;
-         aktrecordsymtable:=oldrecsyms;
+        alignment:=symtable^.dataalignment;
       end;
       end;
 
 
 
 
@@ -3105,17 +3151,16 @@ Const local_symtable_index : longint = $8001;
     var
     var
       s1,s2:string;
       s1,s2:string;
     begin
     begin
-        if (options and oo_hasvmt)=0 then
-          {internalerror(12346);}
+        if not(oo_has_vmt in objectoptions) then
           Message1(parser_object_has_no_vmt,objname^);
           Message1(parser_object_has_no_vmt,objname^);
         if owner^.name=nil then
         if owner^.name=nil then
-            s1:=''
+          s1:=''
         else
         else
-            s1:=owner^.name^;
+          s1:=owner^.name^;
         if objname=nil then
         if objname=nil then
-            s2:=''
+          s2:=''
         else
         else
-            s2:=objname^;
+          s2:=objname^;
         vmt_mangledname:='VMT_'+s1+'$_'+s2;
         vmt_mangledname:='VMT_'+s1+'$_'+s2;
     end;
     end;
 
 
@@ -3136,28 +3181,9 @@ Const local_symtable_index : longint = $8001;
     end;
     end;
 
 
 
 
-    function tobjectdef.isclass : boolean;
+    function tobjectdef.is_class : boolean;
       begin
       begin
-         isclass:=(options and oo_is_class)<>0;
-      end;
-
-
-    procedure tobjectdef.write;
-      var
-         oldread_member : boolean;
-      begin
-         tdef.write;
-         writelong(size);
-         writelong(vmt_offset);
-         writestring(objname^);
-         writedefref(childof);
-         writelong(options);
-         current_ppu^.writeentry(ibobjectdef);
-
-         oldread_member:=read_member;
-         read_member:=true;
-         publicsyms^.writeas;
-         read_member:=oldread_member;
+         is_class:=(oo_is_class in objectoptions);
       end;
       end;
 
 
 
 
@@ -3179,7 +3205,7 @@ Const local_symtable_index : longint = $8001;
                 not yet done }
                 not yet done }
                 ipd := pd;
                 ipd := pd;
                 while assigned(ipd^.nextoverloaded) do ipd := ipd^.nextoverloaded;
                 while assigned(ipd^.nextoverloaded) do ipd := ipd^.nextoverloaded;
-                if (pd^.options and povirtualmethod) <> 0 then
+                if (po_virtualmethod in pd^.procoptions) then
                    begin
                    begin
                    lindex := pd^.extnumber;
                    lindex := pd^.extnumber;
                    {doesnt seem to be necessary
                    {doesnt seem to be necessary
@@ -3190,9 +3216,9 @@ Const local_symtable_index : longint = $8001;
                 {we don't need another definition}
                 {we don't need another definition}
                  para := pd^.para1;
                  para := pd^.para1;
                  { used by gdbpas to recognize constructor and destructors }
                  { used by gdbpas to recognize constructor and destructors }
-                 if (pd^.options and poconstructor) <> 0 then
+                 if (pd^.proctypeoption=potype_constructor) then
                    argnames:='__ct__'
                    argnames:='__ct__'
-                 else if (pd^.options and podestructor) <> 0 then
+                 else if (pd^.proctypeoption=potype_destructor) then
                    argnames:='__dt__'
                    argnames:='__dt__'
                  else
                  else
                    argnames := '';
                    argnames := '';
@@ -3225,8 +3251,8 @@ Const local_symtable_index : longint = $8001;
                 ipd^.is_def_stab_written := true;
                 ipd^.is_def_stab_written := true;
                 { here 2A must be changed for private and protected }
                 { here 2A must be changed for private and protected }
                 { 0 is private 1 protected and 2 public }
                 { 0 is private 1 protected and 2 public }
-                if (psym(p)^.properties and sp_private)<>0 then sp:='0'
-                else if (psym(p)^.properties and sp_protected)<>0 then sp:='1'
+                if (sp_private in psym(p)^.symoptions) then sp:='0'
+                else if (sp_protected in psym(p)^.symoptions) then sp:='1'
                 else sp:='2';
                 else sp:='2';
                 newrec := strpnew(p^.name+'::'+ipd^.numberstring
                 newrec := strpnew(p^.name+'::'+ipd^.numberstring
                      +'=##'+pd^.retdef^.numberstring+';:'+argnames+';'+sp+'A'
                      +'=##'+pd^.retdef^.numberstring+';:'+argnames+';'+sp+'A'
@@ -3266,18 +3292,18 @@ Const local_symtable_index : longint = $8001;
           strpcopy(strend(stabrecstring),'!1,020,'+childof^.numberstring+';');
           strpcopy(strend(stabrecstring),'!1,020,'+childof^.numberstring+';');
         {virtual table to implement yet}
         {virtual table to implement yet}
         RecOffset := 0;
         RecOffset := 0;
-        publicsyms^.foreach({$ifndef TP}@{$endif}addname);
-      if (options and oo_hasvmt) <> 0 then
-        if not assigned(childof) or ((childof^.options and oo_hasvmt) = 0) then
+        symtable^.foreach({$ifndef TP}@{$endif}addname);
+      if (oo_has_vmt in objectoptions) then
+        if not assigned(childof) or not(oo_has_vmt in childof^.objectoptions) then
            begin
            begin
               strpcopy(strend(stabrecstring),'$vf'+numberstring+':'+typeglobalnumber('vtblarray')
               strpcopy(strend(stabrecstring),'$vf'+numberstring+':'+typeglobalnumber('vtblarray')
                 +','+tostr(vmt_offset*8)+';');
                 +','+tostr(vmt_offset*8)+';');
            end;
            end;
-        publicsyms^.foreach({$ifndef TP}@{$endif}addprocname);
-        if (options and oo_hasvmt) <> 0  then
+        symtable^.foreach({$ifndef TP}@{$endif}addprocname);
+        if (oo_has_vmt in objectoptions) then
           begin
           begin
              anc := @self;
              anc := @self;
-             while assigned(anc^.childof) and ((anc^.childof^.options and oo_hasvmt) <> 0) do
+             while assigned(anc^.childof) and (oo_has_vmt in anc^.childof^.objectoptions) do
                anc := anc^.childof;
                anc := anc^.childof;
              str_end:=';~%'+anc^.numberstring+';';
              str_end:=';~%'+anc^.numberstring+';';
           end
           end
@@ -3294,13 +3320,13 @@ Const local_symtable_index : longint = $8001;
 
 
     procedure tobjectdef.write_child_init_data;
     procedure tobjectdef.write_child_init_data;
       begin
       begin
-         publicsyms^.foreach({$ifndef TP}@{$endif}generate_child_inittable);
+         symtable^.foreach({$ifndef TP}@{$endif}generate_child_inittable);
       end;
       end;
 
 
 
 
     procedure tobjectdef.write_init_data;
     procedure tobjectdef.write_init_data;
       begin
       begin
-         if isclass then
+         if is_class then
            rttilist^.concat(new(pai_const,init_8bit(tkclass)))
            rttilist^.concat(new(pai_const,init_8bit(tkclass)))
          else
          else
            rttilist^.concat(new(pai_const,init_8bit(tkobject)));
            rttilist^.concat(new(pai_const,init_8bit(tkobject)));
@@ -3311,9 +3337,9 @@ Const local_symtable_index : longint = $8001;
 
 
          rttilist^.concat(new(pai_const,init_32bit(size)));
          rttilist^.concat(new(pai_const,init_32bit(size)));
          count:=0;
          count:=0;
-         publicsyms^.foreach({$ifndef TP}@{$endif}count_inittable_fields);
+         symtable^.foreach({$ifndef TP}@{$endif}count_inittable_fields);
          rttilist^.concat(new(pai_const,init_32bit(count)));
          rttilist^.concat(new(pai_const,init_32bit(count)));
-         publicsyms^.foreach({$ifndef TP}@{$endif}write_field_inittable);
+         symtable^.foreach({$ifndef TP}@{$endif}write_field_inittable);
       end;
       end;
 
 
 
 
@@ -3327,7 +3353,7 @@ Const local_symtable_index : longint = $8001;
          { procedure of needs_rtti !                              }
          { procedure of needs_rtti !                              }
          oldb:=binittable;
          oldb:=binittable;
          binittable:=false;
          binittable:=false;
-         publicsyms^.foreach({$ifndef TP}@{$endif}check_rec_inittable);
+         symtable^.foreach({$ifndef TP}@{$endif}check_rec_inittable);
          needs_inittable:=binittable;
          needs_inittable:=binittable;
          binittable:=oldb;
          binittable:=oldb;
       end;
       end;
@@ -3336,7 +3362,8 @@ Const local_symtable_index : longint = $8001;
     procedure count_published_properties(sym:pnamedindexobject);
     procedure count_published_properties(sym:pnamedindexobject);
       {$ifndef fpc}far;{$endif}
       {$ifndef fpc}far;{$endif}
       begin
       begin
-         if (psym(sym)^.typ=propertysym) and ((psym(sym)^.properties and sp_published)<>0) then
+         if (psym(sym)^.typ=propertysym) and
+            (sp_published in psym(sym)^.symoptions) then
            inc(count);
            inc(count);
       end;
       end;
 
 
@@ -3362,7 +3389,7 @@ Const local_symtable_index : longint = $8001;
              end
              end
            else
            else
              begin
              begin
-                if (pprocdef(def)^.options and povirtualmethod)=0 then
+                if not(po_virtualmethod in pprocdef(def)^.procoptions) then
                   begin
                   begin
                      rttilist^.concat(new(pai_const_symbol,initname(pprocdef(def)^.mangledname)));
                      rttilist^.concat(new(pai_const_symbol,initname(pprocdef(def)^.mangledname)));
                      typvalue:=1;
                      typvalue:=1;
@@ -3380,18 +3407,18 @@ Const local_symtable_index : longint = $8001;
       begin
       begin
 
 
          if (psym(sym)^.typ=propertysym) and
          if (psym(sym)^.typ=propertysym) and
-            ((ppropertysym(sym)^.options and ppo_indexed)<>0) then
+            (ppo_indexed in ppropertysym(sym)^.propoptions) then
            proctypesinfo:=$40
            proctypesinfo:=$40
          else
          else
            proctypesinfo:=0;
            proctypesinfo:=0;
          if (psym(sym)^.typ=propertysym) and
          if (psym(sym)^.typ=propertysym) and
-            ((psym(sym)^.properties and sp_published)<>0) then
+            (sp_published in psym(sym)^.symoptions) then
            begin
            begin
               rttilist^.concat(new(pai_const_symbol,initname(ppropertysym(sym)^.proptype^.get_rtti_label)));
               rttilist^.concat(new(pai_const_symbol,initname(ppropertysym(sym)^.proptype^.get_rtti_label)));
               writeproc(ppropertysym(sym)^.readaccesssym,ppropertysym(sym)^.readaccessdef,0);
               writeproc(ppropertysym(sym)^.readaccesssym,ppropertysym(sym)^.readaccessdef,0);
               writeproc(ppropertysym(sym)^.writeaccesssym,ppropertysym(sym)^.writeaccessdef,2);
               writeproc(ppropertysym(sym)^.writeaccesssym,ppropertysym(sym)^.writeaccessdef,2);
               { isn't it stored ? }
               { isn't it stored ? }
-              if (ppropertysym(sym)^.options and ppo_stored)=0 then
+              if not(ppo_stored in ppropertysym(sym)^.propoptions) then
                 begin
                 begin
                    rttilist^.concat(new(pai_const,init_32bit(1)));
                    rttilist^.concat(new(pai_const,init_32bit(1)));
                    proctypesinfo:=proctypesinfo or (3 shl 4);
                    proctypesinfo:=proctypesinfo or (3 shl 4);
@@ -3409,18 +3436,17 @@ Const local_symtable_index : longint = $8001;
       end;
       end;
 
 
 
 
-    procedure generate_published_child_rtti(sym : pnamedindexobject);
-      {$ifndef fpc}far;{$endif}
+    procedure generate_published_child_rtti(sym : pnamedindexobject);{$ifndef fpc}far;{$endif}
       begin
       begin
          if (psym(sym)^.typ=propertysym) and
          if (psym(sym)^.typ=propertysym) and
-            ((psym(sym)^.properties and sp_published)<>0) then
+            (sp_published in psym(sym)^.symoptions) then
            ppropertysym(sym)^.proptype^.get_rtti_label;
            ppropertysym(sym)^.proptype^.get_rtti_label;
       end;
       end;
 
 
 
 
     procedure tobjectdef.write_child_rtti_data;
     procedure tobjectdef.write_child_rtti_data;
       begin
       begin
-         publicsyms^.foreach({$ifndef TP}@{$endif}generate_published_child_rtti);
+         symtable^.foreach({$ifndef TP}@{$endif}generate_published_child_rtti);
       end;
       end;
 
 
 
 
@@ -3440,19 +3466,19 @@ Const local_symtable_index : longint = $8001;
       var
       var
          i : longint;
          i : longint;
       begin
       begin
-         if assigned(childof) and ((childof^.options and oo_can_have_published)<>0) then
+         if assigned(childof) and (oo_can_have_published in childof^.objectoptions) then
            i:=childof^.next_free_name_index
            i:=childof^.next_free_name_index
          else
          else
            i:=0;
            i:=0;
          count:=0;
          count:=0;
-         publicsyms^.foreach({$ifndef TP}@{$endif}count_published_properties);
+         symtable^.foreach({$ifndef TP}@{$endif}count_published_properties);
          next_free_name_index:=i+count;
          next_free_name_index:=i+count;
       end;
       end;
 
 
 
 
     procedure tobjectdef.write_rtti_data;
     procedure tobjectdef.write_rtti_data;
       begin
       begin
-         if isclass then
+         if is_class then
            rttilist^.concat(new(pai_const,init_8bit(tkclass)))
            rttilist^.concat(new(pai_const,init_8bit(tkclass)))
          else
          else
            rttilist^.concat(new(pai_const,init_8bit(tkobject)));
            rttilist^.concat(new(pai_const,init_8bit(tkobject)));
@@ -3465,19 +3491,19 @@ Const local_symtable_index : longint = $8001;
          rttilist^.concat(new(pai_const_symbol,initname(vmt_mangledname)));
          rttilist^.concat(new(pai_const_symbol,initname(vmt_mangledname)));
 
 
          { write owner typeinfo }
          { write owner typeinfo }
-         if assigned(childof) and ((childof^.options and oo_can_have_published)<>0) then
+         if assigned(childof) and (oo_can_have_published in childof^.objectoptions) then
            rttilist^.concat(new(pai_const_symbol,initname(childof^.get_rtti_label)))
            rttilist^.concat(new(pai_const_symbol,initname(childof^.get_rtti_label)))
          else
          else
            rttilist^.concat(new(pai_const,init_32bit(0)));
            rttilist^.concat(new(pai_const,init_32bit(0)));
 
 
          { count total number of properties }
          { count total number of properties }
-         if assigned(childof) and ((childof^.options and oo_can_have_published)<>0) then
+         if assigned(childof) and (oo_can_have_published in childof^.objectoptions) then
            count:=childof^.next_free_name_index
            count:=childof^.next_free_name_index
          else
          else
            count:=0;
            count:=0;
 
 
          { write it }
          { write it }
-         publicsyms^.foreach({$ifndef TP}@{$endif}count_published_properties);
+         symtable^.foreach({$ifndef TP}@{$endif}count_published_properties);
          rttilist^.concat(new(pai_const,init_16bit(count)));
          rttilist^.concat(new(pai_const,init_16bit(count)));
 
 
          { write unit name }
          { write unit name }
@@ -3491,24 +3517,24 @@ Const local_symtable_index : longint = $8001;
 
 
          { write published properties count }
          { write published properties count }
          count:=0;
          count:=0;
-         publicsyms^.foreach({$ifndef TP}@{$endif}count_published_properties);
+         symtable^.foreach({$ifndef TP}@{$endif}count_published_properties);
          rttilist^.concat(new(pai_const,init_16bit(count)));
          rttilist^.concat(new(pai_const,init_16bit(count)));
 
 
          { count is used to write nameindex   }
          { count is used to write nameindex   }
          { but we need an offset of the owner }
          { but we need an offset of the owner }
          { to give each property an own slot  }
          { to give each property an own slot  }
-         if assigned(childof) and ((childof^.options and oo_can_have_published)<>0) then
+         if assigned(childof) and (oo_can_have_published in childof^.objectoptions) then
            count:=childof^.next_free_name_index
            count:=childof^.next_free_name_index
          else
          else
            count:=0;
            count:=0;
 
 
-         publicsyms^.foreach({$ifndef TP}@{$endif}write_property_info);
+         symtable^.foreach({$ifndef TP}@{$endif}write_property_info);
       end;
       end;
 
 
 
 
     function tobjectdef.is_publishable : boolean;
     function tobjectdef.is_publishable : boolean;
       begin
       begin
-         is_publishable:=isclass;
+         is_publishable:=is_class;
       end;
       end;
 
 
     function  tobjectdef.get_rtti_label : string;
     function  tobjectdef.get_rtti_label : string;
@@ -3543,7 +3569,11 @@ Const local_symtable_index : longint = $8001;
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.138  1999-08-02 21:29:02  florian
+  Revision 1.139  1999-08-03 22:03:14  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.138  1999/08/02 21:29:02  florian
     * the main branch psub.pas is now used for
     * the main branch psub.pas is now used for
       newcg compiler
       newcg compiler
 
 
@@ -3886,7 +3916,7 @@ Const local_symtable_index : longint = $8001;
     * range checking in units doesn't work if the units are smartlinked, fixed
     * range checking in units doesn't work if the units are smartlinked, fixed
 
 
   Revision 1.51  1998/09/25 12:01:41  florian
   Revision 1.51  1998/09/25 12:01:41  florian
-    * tobjectdef.publicsyms.datasize was set to savesize, this is wrong now
+    * tobjectdef.symtable.datasize was set to savesize, this is wrong now
       because the symtable size is read from the ppu file
       because the symtable size is read from the ppu file
 
 
   Revision 1.50  1998/09/23 15:46:40  florian
   Revision 1.50  1998/09/23 15:46:40  florian

+ 125 - 137
compiler/symdefh.inc

@@ -52,23 +52,25 @@
           constructor init;
           constructor init;
           constructor load;
           constructor load;
           destructor  done;virtual;
           destructor  done;virtual;
-          { registers enumdef inside objects or
-            record directly in the owner symtable !! }
-          procedure correct_owner_symtable;
+          procedure deref;virtual;
+          procedure symderef;virtual;
           function  typename:string;
           function  typename:string;
           procedure write;virtual;
           procedure write;virtual;
           function  size:longint;virtual;
           function  size:longint;virtual;
           function  alignment:longint;virtual;
           function  alignment:longint;virtual;
+          function  gettypename:string;virtual;
+          function  is_publishable : boolean;virtual;
+          function  is_in_current : boolean;
+          procedure correct_owner_symtable; { registers enumdef inside objects or
+                                              record directly in the owner symtable !! }
+          { debug }
 {$ifdef GDB}
 {$ifdef GDB}
+          function  stabstring : pchar;virtual;
+          procedure concatstabto(asmlist : paasmoutput);virtual;
           function  NumberString:string;
           function  NumberString:string;
           procedure set_globalnb;
           procedure set_globalnb;
-          function  stabstring : pchar;virtual;
           function  allstabstring : pchar;
           function  allstabstring : pchar;
-          procedure concatstabto(asmlist : paasmoutput);virtual;
 {$endif GDB}
 {$endif GDB}
-          procedure deref;virtual;
-          procedure symderef;virtual;
-
           { init. tables }
           { init. tables }
           function  needs_inittable : boolean;virtual;
           function  needs_inittable : boolean;virtual;
           procedure generate_inittable;
           procedure generate_inittable;
@@ -77,20 +79,13 @@
           { if init and rtti data is different these procedures }
           { if init and rtti data is different these procedures }
           { must be overloaded                                  }
           { must be overloaded                                  }
           procedure write_init_data;virtual;
           procedure write_init_data;virtual;
-          { writes rtti of child to avoid mixup of rtti }
           procedure write_child_init_data;virtual;
           procedure write_child_init_data;virtual;
-
           { rtti }
           { rtti }
           procedure write_rtti_name;
           procedure write_rtti_name;
           function  get_rtti_label : string;virtual;
           function  get_rtti_label : string;virtual;
           procedure generate_rtti;virtual;
           procedure generate_rtti;virtual;
           procedure write_rtti_data;virtual;
           procedure write_rtti_data;virtual;
           procedure write_child_rtti_data;virtual;
           procedure write_child_rtti_data;virtual;
-
-          { returns true, if the definition can be published }
-          function is_publishable : boolean;virtual;
-          function is_in_current : boolean;
-          function gettypename:string;virtual;
        private
        private
           savesize  : longint;
           savesize  : longint;
        end;
        end;
@@ -120,12 +115,13 @@
           constructor load;
           constructor load;
           procedure write;virtual;
           procedure write;virtual;
           procedure deref;virtual;
           procedure deref;virtual;
+          function  gettypename:string;virtual;
           procedure setsize;
           procedure setsize;
+          { debug }
 {$ifdef GDB}
 {$ifdef GDB}
-          function stabstring : pchar;virtual;
+          function  stabstring : pchar;virtual;
           procedure concatstabto(asmlist : paasmoutput);virtual;
           procedure concatstabto(asmlist : paasmoutput);virtual;
 {$endif GDB}
 {$endif GDB}
-          function gettypename:string;virtual;
        end;
        end;
 
 
        pformaldef = ^tformaldef;
        pformaldef = ^tformaldef;
@@ -133,20 +129,21 @@
           constructor init;
           constructor init;
           constructor load;
           constructor load;
           procedure write;virtual;
           procedure write;virtual;
+          function  gettypename:string;virtual;
 {$ifdef GDB}
 {$ifdef GDB}
-          function stabstring : pchar;virtual;
+          function  stabstring : pchar;virtual;
           procedure concatstabto(asmlist : paasmoutput);virtual;
           procedure concatstabto(asmlist : paasmoutput);virtual;
 {$endif GDB}
 {$endif GDB}
-          function gettypename:string;virtual;
        end;
        end;
 
 
        perrordef = ^terrordef;
        perrordef = ^terrordef;
        terrordef = object(tdef)
        terrordef = object(tdef)
           constructor init;
           constructor init;
+          function  gettypename:string;virtual;
+          { debug }
 {$ifdef GDB}
 {$ifdef GDB}
-          function stabstring : pchar;virtual;
+          function  stabstring : pchar;virtual;
 {$endif GDB}
 {$endif GDB}
-          function gettypename:string;virtual;
        end;
        end;
 
 
        { tpointerdef and tclassrefdef should get a common
        { tpointerdef and tclassrefdef should get a common
@@ -163,66 +160,66 @@
           constructor initfar(def : pdef);
           constructor initfar(def : pdef);
           constructor load;
           constructor load;
           procedure write;virtual;
           procedure write;virtual;
+          procedure deref;virtual;
+          function  gettypename:string;virtual;
+          { debug }
 {$ifdef GDB}
 {$ifdef GDB}
           function  stabstring : pchar;virtual;
           function  stabstring : pchar;virtual;
           procedure concatstabto(asmlist : paasmoutput);virtual;
           procedure concatstabto(asmlist : paasmoutput);virtual;
 {$endif GDB}
 {$endif GDB}
-          procedure deref;virtual;
-          function gettypename:string;virtual;
        end;
        end;
 
 
-
        pobjectdef = ^tobjectdef;
        pobjectdef = ^tobjectdef;
        tobjectdef = object(tdef)
        tobjectdef = object(tdef)
-          childof : pobjectdef;
-          objname : pstring;
-          publicsyms : psymtable;
-          options : longint;
+          childof  : pobjectdef;
+          objname  : pstring;
+          symtable : psymtable;
+          objectoptions : tobjectoptions;
           { to be able to have a variable vmt position }
           { to be able to have a variable vmt position }
           { and no vmt field for objects without virtuals }
           { and no vmt field for objects without virtuals }
           vmt_offset : longint;
           vmt_offset : longint;
           constructor init(const n : string;c : pobjectdef);
           constructor init(const n : string;c : pobjectdef);
-          destructor done;virtual;
-          procedure check_forwards;
-          function isrelated(d : pobjectdef) : boolean;
-          function size : longint;virtual;
-          function alignment:longint;virtual;
           constructor load;
           constructor load;
+          destructor  done;virtual;
           procedure write;virtual;
           procedure write;virtual;
-          function vmt_mangledname : string;
-          function rtti_name : string;
-          function isclass : boolean;
+          procedure deref;virtual;
+          function  size : longint;virtual;
+          function  alignment:longint;virtual;
+          function  is_publishable : boolean;virtual;
+          function  vmt_mangledname : string;
+          function  rtti_name : string;
+          procedure check_forwards;
+          function  is_related(d : pobjectdef) : boolean;
+          function  is_class : boolean;
+          function  next_free_name_index : longint;
           procedure insertvmt;
           procedure insertvmt;
           procedure set_parent(c : pobjectdef);
           procedure set_parent(c : pobjectdef);
+          { debug }
 {$ifdef GDB}
 {$ifdef GDB}
           function stabstring : pchar;virtual;
           function stabstring : pchar;virtual;
 {$endif GDB}
 {$endif GDB}
-          procedure deref;virtual;
-
+          { init/final }
           function  needs_inittable : boolean;virtual;
           function  needs_inittable : boolean;virtual;
           procedure write_init_data;virtual;
           procedure write_init_data;virtual;
           procedure write_child_init_data;virtual;
           procedure write_child_init_data;virtual;
-
           { rtti }
           { rtti }
           function  get_rtti_label : string;virtual;
           function  get_rtti_label : string;virtual;
           procedure generate_rtti;virtual;
           procedure generate_rtti;virtual;
           procedure write_rtti_data;virtual;
           procedure write_rtti_data;virtual;
           procedure write_child_rtti_data;virtual;
           procedure write_child_rtti_data;virtual;
-          function next_free_name_index : longint;
-          function is_publishable : boolean;virtual;
        end;
        end;
 
 
-
        pclassrefdef = ^tclassrefdef;
        pclassrefdef = ^tclassrefdef;
        tclassrefdef = object(tpointerdef)
        tclassrefdef = object(tpointerdef)
           constructor init(def : pdef);
           constructor init(def : pdef);
           constructor load;
           constructor load;
           procedure write;virtual;
           procedure write;virtual;
+          function gettypename:string;virtual;
+          { debug }
 {$ifdef GDB}
 {$ifdef GDB}
           function stabstring : pchar;virtual;
           function stabstring : pchar;virtual;
           procedure concatstabto(asmlist : paasmoutput);virtual;
           procedure concatstabto(asmlist : paasmoutput);virtual;
 {$endif GDB}
 {$endif GDB}
-          function gettypename:string;virtual;
        end;
        end;
 
 
        parraydef = ^tarraydef;
        parraydef = ^tarraydef;
@@ -260,108 +257,95 @@
           procedure write_child_rtti_data;virtual;
           procedure write_child_rtti_data;virtual;
        end;
        end;
 
 
-       precdef = ^trecdef;
-       trecdef = object(tdef)
+       precorddef = ^trecorddef;
+       trecorddef = object(tdef)
           symtable : psymtable;
           symtable : psymtable;
           constructor init(p : psymtable);
           constructor init(p : psymtable);
           constructor load;
           constructor load;
           destructor done;virtual;
           destructor done;virtual;
           procedure write;virtual;
           procedure write;virtual;
-          function size:longint;virtual;
-          function alignment : longint;virtual;
+          procedure deref;virtual;
+          function  size:longint;virtual;
+          function  alignment : longint;virtual;
+          function  gettypename:string;virtual;
+          { debug }
 {$ifdef GDB}
 {$ifdef GDB}
-          function stabstring : pchar;virtual;
+          function  stabstring : pchar;virtual;
           procedure concatstabto(asmlist : paasmoutput);virtual;
           procedure concatstabto(asmlist : paasmoutput);virtual;
 {$endif GDB}
 {$endif GDB}
-          procedure deref;virtual;
+          { init/final }
+          procedure write_init_data;virtual;
+          procedure write_child_init_data;virtual;
           function  needs_inittable : boolean;virtual;
           function  needs_inittable : boolean;virtual;
+          { rtti }
           procedure write_rtti_data;virtual;
           procedure write_rtti_data;virtual;
-          procedure write_init_data;virtual;
           procedure write_child_rtti_data;virtual;
           procedure write_child_rtti_data;virtual;
-          procedure write_child_init_data;virtual;
-          function gettypename:string;virtual;
        end;
        end;
 
 
-       { base types }
-       tbasetype = (uauto,uvoid,uchar,
-                    u8bit,u16bit,u32bit,
-                    s8bit,s16bit,s32bit,
-                    bool8bit,bool16bit,bool32bit { uwchar,bool1bit,bitfield},
-                    u64bit,s64bitint);
-
        porddef = ^torddef;
        porddef = ^torddef;
        torddef = object(tdef)
        torddef = object(tdef)
           low,high : longint;
           low,high : longint;
           rangenr  : longint;
           rangenr  : longint;
           typ      : tbasetype;
           typ      : tbasetype;
-          {
-          bits     : byte;
-          }
           constructor init(t : tbasetype;v,b : longint);
           constructor init(t : tbasetype;v,b : longint);
           constructor load;
           constructor load;
           procedure write;virtual;
           procedure write;virtual;
-{$ifdef GDB}
-          function stabstring : pchar;virtual;
-{$endif GDB}
+          function  is_publishable : boolean;virtual;
+          function  gettypename:string;virtual;
           procedure setsize;
           procedure setsize;
-
           { generates the ranges needed by the asm instruction BOUND }
           { generates the ranges needed by the asm instruction BOUND }
           { or CMP2 (Motorola)                                       }
           { or CMP2 (Motorola)                                       }
           procedure genrangecheck;
           procedure genrangecheck;
-          { returns the label of the range check string }
-          function getrangecheckstring : string;
+          function  getrangecheckstring : string;
+          { debug }
+{$ifdef GDB}
+          function  stabstring : pchar;virtual;
+{$endif GDB}
+          { rtti }
           procedure write_rtti_data;virtual;
           procedure write_rtti_data;virtual;
-          function is_publishable : boolean;virtual;
-          function gettypename:string;virtual;
        end;
        end;
 
 
-       { sextreal is dependant on the cpu, s64bit is also }
-       { dependant on the size (tp = 80bit for both)      }
-       { The EXTENDED format exists on the motorola FPU   }
-       { but it uses 96 bits instead of 80, with some     }
-       { unused bits within the number itself! Pretty     }
-       { complicated to support, so no support for the    }
-       { moment.                                          }
-       { s64 bit is considered as a real because all      }
-       { calculations are done by the fpu.                }
-       tfloattype = (s32real,s64real,s80real,s64comp,f16bit,f32bit);
-
        pfloatdef = ^tfloatdef;
        pfloatdef = ^tfloatdef;
        tfloatdef = object(tdef)
        tfloatdef = object(tdef)
           typ : tfloattype;
           typ : tfloattype;
           constructor init(t : tfloattype);
           constructor init(t : tfloattype);
           constructor load;
           constructor load;
           procedure write;virtual;
           procedure write;virtual;
+          function  gettypename:string;virtual;
+          function  is_publishable : boolean;virtual;
+          procedure setsize;
+          { debug }
 {$ifdef GDB}
 {$ifdef GDB}
           function stabstring : pchar;virtual;
           function stabstring : pchar;virtual;
 {$endif GDB}
 {$endif GDB}
-          procedure setsize;
-          function is_publishable : boolean;virtual;
+          { rtti }
           procedure write_rtti_data;virtual;
           procedure write_rtti_data;virtual;
-          function gettypename:string;virtual;
        end;
        end;
 
 
        pabstractprocdef = ^tabstractprocdef;
        pabstractprocdef = ^tabstractprocdef;
        tabstractprocdef = object(tdef)
        tabstractprocdef = object(tdef)
           { saves a definition to the return type }
           { saves a definition to the return type }
-          retdef   : pdef;
-          fpu_used : byte;    { how many stack fpu must be empty }
-          options  : longint; { save the procedure options }
-          para1    : pdefcoll;
+          retdef          : pdef;
+          proctypeoption  : tproctypeoption;
+          proccalloptions : tproccalloptions;
+          procoptions     : tprocoptions;
+          para1           : pdefcoll;
+          fpu_used        : byte;    { how many stack fpu must be empty }
           constructor init;
           constructor init;
           constructor load;
           constructor load;
           destructor done;virtual;
           destructor done;virtual;
+          procedure  write;virtual;
+          procedure deref;virtual;
           procedure concatdef(p : pdef;vsp : tvarspez);
           procedure concatdef(p : pdef;vsp : tvarspez);
           procedure concattypesym(p : ptypesym;vsp : tvarspez);
           procedure concattypesym(p : ptypesym;vsp : tvarspez);
-          procedure deref;virtual;
-          function para_size : longint;
-          function demangled_paras : string;
+          function  para_size : longint;
+          function  demangled_paras : string;
+          procedure test_if_fpu_result;
+          { debug }
 {$ifdef GDB}
 {$ifdef GDB}
-          function stabstring : pchar;virtual;
+          function  stabstring : pchar;virtual;
           procedure concatstabto(asmlist : paasmoutput);virtual;
           procedure concatstabto(asmlist : paasmoutput);virtual;
 {$endif GDB}
 {$endif GDB}
-          procedure test_if_fpu_result;
-          procedure write;virtual;
        end;
        end;
 
 
        pprocvardef = ^tprocvardef;
        pprocvardef = ^tprocvardef;
@@ -369,15 +353,17 @@
           constructor init;
           constructor init;
           constructor load;
           constructor load;
           procedure write;virtual;
           procedure write;virtual;
-          function size : longint;virtual;
+          function  size : longint;virtual;
+          function gettypename:string;virtual;
+          function is_publishable : boolean;virtual;
+          { debug }
 {$ifdef GDB}
 {$ifdef GDB}
           function stabstring : pchar;virtual;
           function stabstring : pchar;virtual;
           procedure concatstabto(asmlist : paasmoutput); virtual;
           procedure concatstabto(asmlist : paasmoutput); virtual;
 {$endif GDB}
 {$endif GDB}
+          { rtti }
           procedure write_child_rtti_data;virtual;
           procedure write_child_rtti_data;virtual;
-          function is_publishable : boolean;virtual;
           procedure write_rtti_data;virtual;
           procedure write_rtti_data;virtual;
-          function gettypename:string;virtual;
        end;
        end;
 
 
        tmessageinf = record
        tmessageinf = record
@@ -388,7 +374,10 @@
 
 
        pprocdef = ^tprocdef;
        pprocdef = ^tprocdef;
        tprocdef = object(tabstractprocdef)
        tprocdef = object(tabstractprocdef)
-          extnumber : longint;
+       private
+          _mangledname : pchar;
+       public
+          extnumber  : longint;
           messageinf : tmessageinf;
           messageinf : tmessageinf;
           nextoverloaded : pprocdef;
           nextoverloaded : pprocdef;
           { where is this function defined, needed here because there
           { where is this function defined, needed here because there
@@ -405,7 +394,6 @@
           lastwritten : pref;
           lastwritten : pref;
           refcount : longint;
           refcount : longint;
           _class : pobjectdef;
           _class : pobjectdef;
-          _mangledname : pchar;
           { it's a tree, but this not easy to handle }
           { it's a tree, but this not easy to handle }
           { used for inlined procs                   }
           { used for inlined procs                   }
           code : pointer;
           code : pointer;
@@ -417,47 +405,38 @@
           { check the problems of manglednames }
           { check the problems of manglednames }
           count      : boolean;
           count      : boolean;
           is_used    : boolean;
           is_used    : boolean;
-          { set which contains the modified registers }
+          { small set which contains the modified registers }
 {$ifdef newcg}
 {$ifdef newcg}
           usedregisters : tregisterset;
           usedregisters : tregisterset;
 {$else newcg}
 {$else newcg}
-{$ifdef i386}
-          usedregisters : byte;
-{$endif}
-{$ifdef m68k}
-          usedregisters : word;
-{$endif}
-{$ifdef alpha}
-          usedregisters_int : longint;
-          usedregisters_fpu : longint;
-{$endif}
+          usedregisters : longint;
 {$endif newcg}
 {$endif newcg}
           constructor init;
           constructor init;
-          destructor done;virtual;
           constructor load;
           constructor load;
+          destructor  done;virtual;
           procedure write;virtual;
           procedure write;virtual;
-{$ifdef GDB}
-          function cplusplusmangledname : string;
-          function stabstring : pchar;virtual;
-          procedure concatstabto(asmlist : paasmoutput);virtual;
-{$endif GDB}
           procedure deref;virtual;
           procedure deref;virtual;
-          function mangledname : string;
+          function  haspara:boolean;
+          function  mangledname : string;
           procedure setmangledname(const s : string);
           procedure setmangledname(const s : string);
           procedure load_references;
           procedure load_references;
           function  write_references : boolean;
           function  write_references : boolean;
+          { debug }
+{$ifdef GDB}
+          function  cplusplusmangledname : string;
+          function  stabstring : pchar;virtual;
+          procedure concatstabto(asmlist : paasmoutput);virtual;
+{$endif GDB}
+          { browser }
 {$ifdef BrowserLog}
 {$ifdef BrowserLog}
           procedure add_to_browserlog;
           procedure add_to_browserlog;
 {$endif BrowserLog}
 {$endif BrowserLog}
-          function haspara:boolean;
        end;
        end;
 
 
-       tstringtype = (st_shortstring, st_longstring, st_ansistring, st_widestring);
-
        pstringdef = ^tstringdef;
        pstringdef = ^tstringdef;
        tstringdef = object(tdef)
        tstringdef = object(tdef)
           string_typ : tstringtype;
           string_typ : tstringtype;
-          len : longint;
+          len        : longint;
           constructor shortinit(l : byte);
           constructor shortinit(l : byte);
           constructor shortload;
           constructor shortload;
           constructor longinit(l : longint);
           constructor longinit(l : longint);
@@ -466,17 +445,20 @@
           constructor ansiload;
           constructor ansiload;
           constructor wideinit(l : longint);
           constructor wideinit(l : longint);
           constructor wideload;
           constructor wideload;
-          function stringtypname:string;
-          function size : longint;virtual;
+          function  stringtypname:string;
+          function  size : longint;virtual;
           procedure write;virtual;
           procedure write;virtual;
+          function  gettypename:string;virtual;
+          function  is_publishable : boolean;virtual;
+          { debug }
 {$ifdef GDB}
 {$ifdef GDB}
-          function stabstring : pchar;virtual;
+          function  stabstring : pchar;virtual;
           procedure concatstabto(asmlist : paasmoutput);virtual;
           procedure concatstabto(asmlist : paasmoutput);virtual;
 {$endif GDB}
 {$endif GDB}
-          function needs_inittable : boolean;virtual;
+          { init/final }
+          function  needs_inittable : boolean;virtual;
+          { rtti }
           procedure write_rtti_data;virtual;
           procedure write_rtti_data;virtual;
-          function is_publishable : boolean;virtual;
-          function gettypename:string;virtual;
        end;
        end;
 
 
        penumdef = ^tenumdef;
        penumdef = ^tenumdef;
@@ -493,6 +475,8 @@
           destructor done;virtual;
           destructor done;virtual;
           procedure write;virtual;
           procedure write;virtual;
           procedure deref;virtual;
           procedure deref;virtual;
+          function  gettypename:string;virtual;
+          function  is_publishable : boolean;virtual;
           procedure calcsavesize;
           procedure calcsavesize;
           procedure setmax(_max:longint);
           procedure setmax(_max:longint);
           procedure setmin(_min:longint);
           procedure setmin(_min:longint);
@@ -500,38 +484,42 @@
           function  max:longint;
           function  max:longint;
           function  getrangecheckstring:string;
           function  getrangecheckstring:string;
           procedure genrangecheck;
           procedure genrangecheck;
+          { debug }
 {$ifdef GDB}
 {$ifdef GDB}
           function stabstring : pchar;virtual;
           function stabstring : pchar;virtual;
 {$endif GDB}
 {$endif GDB}
+          { rtti }
           procedure write_child_rtti_data;virtual;
           procedure write_child_rtti_data;virtual;
           procedure write_rtti_data;virtual;
           procedure write_rtti_data;virtual;
-          function is_publishable : boolean;virtual;
-          function  gettypename:string;virtual;
        end;
        end;
 
 
-       tsettype = (normset,smallset,varset);
-
        psetdef = ^tsetdef;
        psetdef = ^tsetdef;
        tsetdef = object(tdef)
        tsetdef = object(tdef)
-          setof : pdef;
+          setof   : pdef;
           settype : tsettype;
           settype : tsettype;
           constructor init(s : pdef;high : longint);
           constructor init(s : pdef;high : longint);
           constructor load;
           constructor load;
           procedure write;virtual;
           procedure write;virtual;
+          procedure deref;virtual;
+          function  gettypename:string;virtual;
+          function  is_publishable : boolean;virtual;
+          { debug }
 {$ifdef GDB}
 {$ifdef GDB}
-          function stabstring : pchar;virtual;
+          function  stabstring : pchar;virtual;
           procedure concatstabto(asmlist : paasmoutput);virtual;
           procedure concatstabto(asmlist : paasmoutput);virtual;
 {$endif GDB}
 {$endif GDB}
-          procedure deref;virtual;
-          function is_publishable : boolean;virtual;
+          { rtti }
           procedure write_rtti_data;virtual;
           procedure write_rtti_data;virtual;
           procedure write_child_rtti_data;virtual;
           procedure write_child_rtti_data;virtual;
-          function gettypename:string;virtual;
        end;
        end;
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.36  1999-08-02 21:29:04  florian
+  Revision 1.37  1999-08-03 22:03:16  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.36  1999/08/02 21:29:04  florian
     * the main branch psub.pas is now used for
     * the main branch psub.pas is now used for
       newcg compiler
       newcg compiler
 
 

+ 20 - 24
compiler/symppu.inc

@@ -72,6 +72,12 @@
       end;
       end;
 
 
 
 
+    procedure writesmallset(var s);
+      begin
+        current_ppu^.putdata(s,4);
+      end;
+
+
     procedure writeposinfo(const p:tfileposinfo);
     procedure writeposinfo(const p:tfileposinfo);
       begin
       begin
         current_ppu^.putword(p.fileindex);
         current_ppu^.putword(p.fileindex);
@@ -99,8 +105,6 @@
               current_ppu^.putword(p^.indexnr);
               current_ppu^.putword(p^.indexnr);
             end
             end
            else
            else
-{           else if p^.owner^.unitid>$8000 then
-            current_ppu^.putword(p^.owner^.unitid) }
             begin
             begin
               current_ppu^.putbyte(ord(derefindex));
               current_ppu^.putbyte(ord(derefindex));
               current_ppu^.putword(p^.indexnr);
               current_ppu^.putword(p^.indexnr);
@@ -222,27 +226,6 @@
       end;
       end;
 
 
 
 
-{    procedure writelinkother(var p:tstringcontainer;id:byte;strippath:boolean);
-      var
-        hcontainer : tstringcontainer;
-        s : string;
-      begin
-        hcontainer.init;
-        while not p.empty do
-         begin
-           s:=p.get;
-           if strippath then
-            current_ppu^.putstring(SplitFileName(s))
-           else
-            current_ppu^.putstring(s);
-           hcontainer.insert(s);
-         end;
-        current_ppu^.writeentry(id);
-        p:=hcontainer;
-      end; }
-
-
-
     procedure writeunitas(const s : string;unittable : punitsymtable;only_crc : boolean);
     procedure writeunitas(const s : string;unittable : punitsymtable;only_crc : boolean);
       begin
       begin
          Message1(unit_u_ppu_write,s);
          Message1(unit_u_ppu_write,s);
@@ -321,6 +304,7 @@
 {$endif Test_Double_checksum_write}
 {$endif Test_Double_checksum_write}
       end;
       end;
 
 
+
     procedure closecurrentppu;
     procedure closecurrentppu;
       begin
       begin
 {$ifdef Test_Double_checksum}
 {$ifdef Test_Double_checksum}
@@ -386,6 +370,14 @@
       end;
       end;
 
 
 
 
+    procedure readsmallset(var s);
+      begin
+        current_ppu^.getdata(s,4);
+        if current_ppu^.error then
+         Message(unit_f_ppu_read_error);
+      end;
+
+
     procedure readposinfo(var p:tfileposinfo);
     procedure readposinfo(var p:tfileposinfo);
       begin
       begin
         p.fileindex:=current_ppu^.getword;
         p.fileindex:=current_ppu^.getword;
@@ -614,7 +606,11 @@
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.44  1999-07-14 21:19:12  florian
+  Revision 1.45  1999-08-03 22:03:17  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.44  1999/07/14 21:19:12  florian
     + implemented a better error message if a PPU file isn't found as suggested
     + implemented a better error message if a PPU file isn't found as suggested
       by Lee John
       by Lee John
 
 

+ 107 - 53
compiler/symsym.inc

@@ -28,7 +28,7 @@
       begin
       begin
          inherited initname(n);
          inherited initname(n);
          typ:=abstractsym;
          typ:=abstractsym;
-         properties:=current_object_option;
+         symoptions:=current_object_option;
 {$ifdef GDB}
 {$ifdef GDB}
          isstabwritten := false;
          isstabwritten := false;
 {$endif GDB}
 {$endif GDB}
@@ -51,7 +51,7 @@
          indexnr:=readword;
          indexnr:=readword;
          setname(readstring);
          setname(readstring);
          typ:=abstractsym;
          typ:=abstractsym;
-         properties:=symprop(readbyte);
+         readsmallset(symoptions);
          readposinfo(fileinfo);
          readposinfo(fileinfo);
          lastref:=nil;
          lastref:=nil;
          defref:=nil;
          defref:=nil;
@@ -154,7 +154,7 @@
       begin
       begin
          writeword(indexnr);
          writeword(indexnr);
          writestring(name);
          writestring(name);
-         writebyte(byte(properties));
+         writesmallset(symoptions);
          writeposinfo(fileinfo);
          writeposinfo(fileinfo);
       end;
       end;
 
 
@@ -412,7 +412,7 @@
         last : pprocdef;
         last : pprocdef;
       begin
       begin
          resolvedef(pdef(definition));
          resolvedef(pdef(definition));
-         if (definition^.options and pooperator) <> 0 then
+         if (definition^.proctypeoption=potype_operator) then
            begin
            begin
               last:=definition;
               last:=definition;
               while assigned(last^.nextoverloaded) do
               while assigned(last^.nextoverloaded) do
@@ -532,7 +532,7 @@
 
 
     procedure tprocsym.concatstabto(asmlist : paasmoutput);
     procedure tprocsym.concatstabto(asmlist : paasmoutput);
     begin
     begin
-      if (definition^.options and pointernproc) <> 0 then exit;
+      if (pocall_internproc in definition^.proccalloptions) then exit;
       if not isstabwritten then
       if not isstabwritten then
         asmlist^.concat(new(pai_stabs,init(stabstring)));
         asmlist^.concat(new(pai_stabs,init(stabstring)));
       isstabwritten := true;
       isstabwritten := true;
@@ -573,7 +573,7 @@
       begin
       begin
          inherited init(n);
          inherited init(n);
          typ:=propertysym;
          typ:=propertysym;
-         options:=0;
+         propoptions:=[];
          proptype:=nil;
          proptype:=nil;
          readaccessdef:=nil;
          readaccessdef:=nil;
          writeaccessdef:=nil;
          writeaccessdef:=nil;
@@ -598,7 +598,7 @@
          inherited load;
          inherited load;
          typ:=propertysym;
          typ:=propertysym;
          proptype:=readdefref;
          proptype:=readdefref;
-         options:=readlong;
+         readsmallset(propoptions);
          index:=readlong;
          index:=readlong;
          default:=readlong;
          default:=readlong;
          { it's hack ... }
          { it's hack ... }
@@ -634,7 +634,7 @@
       begin
       begin
          tsym.write;
          tsym.write;
          writedefref(proptype);
          writedefref(proptype);
-         writelong(options);
+         writesmallset(propoptions);
          writelong(index);
          writelong(index);
          writelong(default);
          writelong(default);
          writesymref(readaccesssym);
          writesymref(readaccesssym);
@@ -772,6 +772,8 @@
 
 
 
 
     procedure tabsolutesym.write;
     procedure tabsolutesym.write;
+      var
+        hvo : tvaroptions;
       begin
       begin
          { Note: This needs to write everything of tvarsym.write }
          { Note: This needs to write everything of tvarsym.write }
          tsym.write;
          tsym.write;
@@ -789,7 +791,8 @@
             writedefref(definition);
             writedefref(definition);
             writesymref(nil);
             writesymref(nil);
           end;
           end;
-         writebyte(var_options and (not vo_regable));
+         hvo:=varoptions-[vo_regable];
+         writesmallset(hvo);
          writebyte(byte(abstyp));
          writebyte(byte(abstyp));
          case abstyp of
          case abstyp of
            tovar :
            tovar :
@@ -867,28 +870,48 @@
          islocalcopy:=false;
          islocalcopy:=false;
          localvarsym:=nil;
          localvarsym:=nil;
          refs:=0;
          refs:=0;
-         is_valid := 1;
-         var_options:=0;
+         varstate:=vs_used;
+         varoptions:=[];
          { can we load the value into a register ? }
          { can we load the value into a register ? }
          case p^.deftype of
          case p^.deftype of
            pointerdef,
            pointerdef,
            enumdef,
            enumdef,
            procvardef :
            procvardef :
-             var_options:=var_options or vo_regable;
+{$ifdef INCLUDEOK}
+             include(varoptions,vo_regable);
+{$else}
+             varoptions:=varoptions+[vo_regable];
+{$endif}
            orddef :
            orddef :
              case porddef(p)^.typ of
              case porddef(p)^.typ of
                bool8bit,bool16bit,bool32bit,
                bool8bit,bool16bit,bool32bit,
                u8bit,u16bit,u32bit,
                u8bit,u16bit,u32bit,
                s8bit,s16bit,s32bit :
                s8bit,s16bit,s32bit :
-                 var_options:=var_options or vo_regable;
+{$ifdef INCLUDEOK}
+                 include(varoptions,vo_regable);
+{$else}
+                 varoptions:=varoptions+[vo_regable];
+{$endif}
                else
                else
-                 var_options:=var_options and not vo_regable;
+{$ifdef INCLUDEOK}
+                 exclude(varoptions,vo_regable);
+{$else}
+                 varoptions:=varoptions-[vo_regable];
+{$endif}
              end;
              end;
            setdef:
            setdef:
              if psetdef(p)^.settype=smallset then
              if psetdef(p)^.settype=smallset then
-               var_options:=var_options or vo_regable;
-         else
-           var_options:=var_options and not vo_regable;
+{$ifdef INCLUDEOK}
+                 include(varoptions,vo_regable);
+{$else}
+                 varoptions:=varoptions+[vo_regable];
+{$endif}
+           else
+{$ifdef INCLUDEOK}
+             exclude(varoptions,vo_regable);
+{$else}
+             varoptions:=varoptions-[vo_regable];
+{$endif}
          end;
          end;
          reg:=R_NO;
          reg:=R_NO;
       end;
       end;
@@ -898,7 +921,11 @@
       begin
       begin
       { The tvarsym is necessary for 0.99.5 (PFV) }
       { The tvarsym is necessary for 0.99.5 (PFV) }
          tvarsym.init(n,p);
          tvarsym.init(n,p);
-         var_options:=var_options or vo_is_dll_var;
+{$ifdef INCLUDEOK}
+         include(varoptions,vo_is_dll_var);
+{$else}
+         varoptions:=varoptions+[vo_is_dll_var];
+{$endif}
       end;
       end;
 
 
 
 
@@ -906,7 +933,11 @@
       begin
       begin
       { The tvarsym is necessary for 0.99.5 (PFV) }
       { The tvarsym is necessary for 0.99.5 (PFV) }
          tvarsym.init(n,p);
          tvarsym.init(n,p);
-         var_options:=var_options or vo_is_C_var;
+{$ifdef INCLUDEOK}
+         include(varoptions,vo_is_C_var);
+{$else}
+         varoptions:=varoptions+[vo_is_C_var];
+{$endif}
          setmangledname(mangled);
          setmangledname(mangled);
       end;
       end;
 
 
@@ -939,7 +970,7 @@
          _mangledname:=nil;
          _mangledname:=nil;
          reg:=R_NO;
          reg:=R_NO;
          refs := 0;
          refs := 0;
-         is_valid := 1;
+         varstate:=vs_used;
          varspez:=tvarspez(readbyte);
          varspez:=tvarspez(readbyte);
          if read_member then
          if read_member then
            address:=readlong
            address:=readlong
@@ -949,8 +980,8 @@
          localvarsym:=nil;
          localvarsym:=nil;
          definition:=readdefref;
          definition:=readdefref;
          definitionsym:=ptypesym(readsymref);
          definitionsym:=ptypesym(readsymref);
-         var_options:=readbyte;
-         if (var_options and vo_is_C_var)<>0 then
+         readsmallset(varoptions);
+         if (vo_is_C_var in varoptions) then
            setmangledname(readstring);
            setmangledname(readstring);
       end;
       end;
 
 
@@ -975,6 +1006,8 @@
 
 
 
 
     procedure tvarsym.write;
     procedure tvarsym.write;
+      var
+        hvo : tvaroptions;
       begin
       begin
          tsym.write;
          tsym.write;
          writebyte(byte(varspez));
          writebyte(byte(varspez));
@@ -993,9 +1026,10 @@
           end;
           end;
          { symbols which are load are never candidates for a register,
          { symbols which are load are never candidates for a register,
            turn off the regable }
            turn off the regable }
-         writebyte(var_options and (not vo_regable));
-         if (var_options and vo_is_C_var)<>0 then
-            writestring(mangledname);
+         hvo:=varoptions-[vo_regable];
+         writesmallset(hvo);
+         if (vo_is_C_var in varoptions) then
+           writestring(mangledname);
          current_ppu^.writeentry(ibvarsym);
          current_ppu^.writeentry(ibvarsym);
       end;
       end;
 
 
@@ -1087,16 +1121,20 @@
          l,ali,modulo : longint;
          l,ali,modulo : longint;
          storefilepos : tfileposinfo;
          storefilepos : tfileposinfo;
       begin
       begin
-        if (var_options and vo_is_external)<>0 then
+        if (vo_is_external in varoptions) then
           exit;
           exit;
         { handle static variables of objects especially }
         { handle static variables of objects especially }
         if read_member and (owner^.symtabletype=objectsymtable) and
         if read_member and (owner^.symtabletype=objectsymtable) and
-           ((properties and sp_static)<>0) then
+           (sp_static in symoptions) then
          begin
          begin
             { the data filed is generated in parser.pas
             { the data filed is generated in parser.pas
               with a tobject_FIELDNAME variable }
               with a tobject_FIELDNAME variable }
             { this symbol can't be loaded to a register }
             { this symbol can't be loaded to a register }
-            var_options:=var_options and not vo_regable;
+{$ifdef INCLUDEOK}
+            exclude(varoptions,vo_regable);
+{$else}
+            varoptions:=varoptions-[vo_regable];
+{$endif}
          end
          end
         else
         else
          if not(read_member) then
          if not(read_member) then
@@ -1110,7 +1148,7 @@
              }
              }
              storefilepos:=aktfilepos;
              storefilepos:=aktfilepos;
              aktfilepos:=tokenpos;
              aktfilepos:=tokenpos;
-             if ((var_options and vo_is_thread_var)<>0) then
+             if (vo_is_thread_var in varoptions) then
                l:=4
                l:=4
              else
              else
                l:=getsize;
                l:=getsize;
@@ -1120,7 +1158,7 @@
                  ;
                  ;
                localsymtable :
                localsymtable :
                  begin
                  begin
-                   is_valid := 0;
+                   varstate:=vs_declared;
                    modulo:=owner^.datasize and 3;
                    modulo:=owner^.datasize and 3;
 {$ifdef m68k}
 {$ifdef m68k}
                  { word alignment required for motorola }
                  { word alignment required for motorola }
@@ -1139,16 +1177,12 @@
                staticsymtable :
                staticsymtable :
                  begin
                  begin
                    { enable unitialized warning for local symbols }
                    { enable unitialized warning for local symbols }
-                   is_valid := 0;
+                   varstate:=vs_declared;
                    if (cs_smartlink in aktmoduleswitches) then
                    if (cs_smartlink in aktmoduleswitches) then
                      bsssegment^.concat(new(pai_cut,init));
                      bsssegment^.concat(new(pai_cut,init));
                    ali:=data_align(l);
                    ali:=data_align(l);
                    if ali>1 then
                    if ali>1 then
                      begin
                      begin
-                        (* this is done
-                           either by the assembler or in ag386bin
-
-                        bsssegment^.concat(new(pai_align,init(ali))); *)
                         modulo:=owner^.datasize mod ali;
                         modulo:=owner^.datasize mod ali;
                         if modulo>0 then
                         if modulo>0 then
                           inc(owner^.datasize,ali-modulo);
                           inc(owner^.datasize,ali-modulo);
@@ -1159,14 +1193,18 @@
 {$endif GDB}
 {$endif GDB}
 
 
                    if (cs_smartlink in aktmoduleswitches) or
                    if (cs_smartlink in aktmoduleswitches) or
-                      ((var_options and vo_is_c_var)<>0) then
+                      (vo_is_C_var in varoptions) then
                      bsssegment^.concat(new(pai_datablock,init_global(mangledname,l)))
                      bsssegment^.concat(new(pai_datablock,init_global(mangledname,l)))
                    else
                    else
                      bsssegment^.concat(new(pai_datablock,init(mangledname,l)));
                      bsssegment^.concat(new(pai_datablock,init(mangledname,l)));
                    { increase datasize }
                    { increase datasize }
                    inc(owner^.datasize,l);
                    inc(owner^.datasize,l);
                    { this symbol can't be loaded to a register }
                    { this symbol can't be loaded to a register }
-                   var_options:=var_options and not vo_regable;
+{$ifdef INCLUDEOK}
+                   exclude(varoptions,vo_regable);
+{$else}
+                   varoptions:=varoptions-[vo_regable];
+{$endif}
                  end;
                  end;
                globalsymtable :
                globalsymtable :
                  begin
                  begin
@@ -1186,13 +1224,21 @@
                    bsssegment^.concat(new(pai_datablock,init_global(mangledname,l)));
                    bsssegment^.concat(new(pai_datablock,init_global(mangledname,l)));
                    inc(owner^.datasize,l);
                    inc(owner^.datasize,l);
                    { this symbol can't be loaded to a register }
                    { this symbol can't be loaded to a register }
-                   var_options:=var_options and not vo_regable;
+{$ifdef INCLUDEOK}
+                   exclude(varoptions,vo_regable);
+{$else}
+                   varoptions:=varoptions-[vo_regable];
+{$endif}
                  end;
                  end;
                recordsymtable,
                recordsymtable,
                objectsymtable :
                objectsymtable :
                  begin
                  begin
                  { this symbol can't be loaded to a register }
                  { this symbol can't be loaded to a register }
-                   var_options:=var_options and not vo_regable;
+{$ifdef INCLUDEOK}
+                   exclude(varoptions,vo_regable);
+{$else}
+                   varoptions:=varoptions-[vo_regable];
+{$endif}
                  { get the alignment size }
                  { get the alignment size }
                    if (aktpackrecords=packrecord_C) then
                    if (aktpackrecords=packrecord_C) then
                     begin
                     begin
@@ -1283,7 +1329,7 @@
        st : char;
        st : char;
      begin
      begin
        if (owner^.symtabletype = objectsymtable) and
        if (owner^.symtabletype = objectsymtable) and
-          ((properties and sp_static)<>0) then
+          (sp_static in symoptions) then
          begin
          begin
             if (cs_gdb_gsym in aktglobalswitches) then st := 'G' else st := 'S';
             if (cs_gdb_gsym in aktglobalswitches) then st := 'G' else st := 'S';
 {$ifndef Delphi}
 {$ifndef Delphi}
@@ -1341,7 +1387,7 @@
          else
          else
    {$endif i386}
    {$endif i386}
            { I don't know if this will work (PM) }
            { I don't know if this will work (PM) }
-           if (var_options and vo_is_C_var)<>0 then
+           if (vo_is_C_var in varoptions) then
             stabstring := strpnew('"'+name+':S'
             stabstring := strpnew('"'+name+':S'
                   +definition^.numberstring+'",'+
                   +definition^.numberstring+'",'+
                   tostr(N_LCSYM)+',0,'+tostr(fileinfo.line)+','+mangledname)
                   tostr(N_LCSYM)+',0,'+tostr(fileinfo.line)+','+mangledname)
@@ -1809,7 +1855,11 @@
                begin
                begin
                   definition^.sym:=@self;
                   definition^.sym:=@self;
                   synonym:=nil;
                   synonym:=nil;
-                  properties:=sp_primary_typesym;
+{$ifdef INCLUDEOK}
+                  include(symoptions,sp_primary_typesym);
+{$else}
+                  symoptions:=symoptions+[sp_primary_typesym];
+{$endif}
                end
                end
              else
              else
                begin
                begin
@@ -1863,7 +1913,7 @@
          resolvedef(definition);
          resolvedef(definition);
          if assigned(definition) then
          if assigned(definition) then
           begin
           begin
-            if properties=sp_primary_typesym then
+            if (sp_primary_typesym in symoptions) then
               begin
               begin
                  if definition^.sym<>@self then
                  if definition^.sym<>@self then
                    synonym:=definition^.sym;
                    synonym:=definition^.sym;
@@ -1880,9 +1930,9 @@
                  else
                  else
                    definition^.sym:=@self;
                    definition^.sym:=@self;
               end;
               end;
-            if (definition^.deftype=recorddef) and assigned(precdef(definition)^.symtable) and
+            if (definition^.deftype=recorddef) and assigned(precorddef(definition)^.symtable) and
                (definition^.sym=@self) then
                (definition^.sym=@self) then
-              precdef(definition)^.symtable^.name:=stringdup('record '+name);
+              precorddef(definition)^.symtable^.name:=stringdup('record '+name);
           end;
           end;
       end;
       end;
 
 
@@ -1900,9 +1950,9 @@
       begin
       begin
          inherited load_references;
          inherited load_references;
          if (definition^.deftype=recorddef) then
          if (definition^.deftype=recorddef) then
-           precdef(definition)^.symtable^.load_browser;
+           precorddef(definition)^.symtable^.load_browser;
          if (definition^.deftype=objectdef) then
          if (definition^.deftype=objectdef) then
-           pobjectdef(definition)^.publicsyms^.load_browser;
+           pobjectdef(definition)^.symtable^.load_browser;
       end;
       end;
 
 
 
 
@@ -1920,9 +1970,9 @@
           end;
           end;
          write_references:=true;
          write_references:=true;
          if (definition^.deftype=recorddef) then
          if (definition^.deftype=recorddef) then
-           precdef(definition)^.symtable^.write_browser;
+           precorddef(definition)^.symtable^.write_browser;
          if (definition^.deftype=objectdef) then
          if (definition^.deftype=objectdef) then
-           pobjectdef(definition)^.publicsyms^.write_browser;
+           pobjectdef(definition)^.symtable^.write_browser;
       end;
       end;
 
 
 
 
@@ -1942,7 +1992,7 @@
         lasthfp,hfp : pforwardpointer;
         lasthfp,hfp : pforwardpointer;
       begin
       begin
         definition:=p;
         definition:=p;
-        properties:=current_object_option;
+        symoptions:=current_object_option;
         fileinfo:=tokenpos;
         fileinfo:=tokenpos;
         if assigned(definition) and not(assigned(definition^.sym)) then
         if assigned(definition) and not(assigned(definition^.sym)) then
           definition^.sym:=@self;
           definition^.sym:=@self;
@@ -1963,9 +2013,9 @@
       begin
       begin
          inherited add_to_browserlog;
          inherited add_to_browserlog;
          if (definition^.deftype=recorddef) then
          if (definition^.deftype=recorddef) then
-            precdef(definition)^.symtable^.writebrowserlog;
+            precorddef(definition)^.symtable^.writebrowserlog;
          if (definition^.deftype=objectdef) then
          if (definition^.deftype=objectdef) then
-             pobjectdef(definition)^.publicsyms^.writebrowserlog;
+             pobjectdef(definition)^.symtable^.writebrowserlog;
       end;
       end;
 {$endif BrowserLog}
 {$endif BrowserLog}
 
 
@@ -2056,7 +2106,11 @@
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.105  1999-07-29 20:54:10  peter
+  Revision 1.106  1999-08-03 22:03:19  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.105  1999/07/29 20:54:10  peter
     * write .size also
     * write .size also
 
 
   Revision 1.104  1999/07/27 23:42:21  peter
   Revision 1.104  1999/07/27 23:42:21  peter

+ 43 - 46
compiler/symsymh.inc

@@ -24,8 +24,6 @@
                    TSym
                    TSym
 ************************************************}
 ************************************************}
 
 
-       symprop = byte;
-
        { possible types for symtable entries }
        { possible types for symtable entries }
        tsymtyp = (abstractsym,varsym,typesym,procsym,unitsym,programsym,
        tsymtyp = (abstractsym,varsym,typesym,procsym,unitsym,programsym,
                   constsym,enumsym,typedconstsym,errorsym,syssym,
                   constsym,enumsym,typedconstsym,errorsym,syssym,
@@ -36,7 +34,7 @@
        psym = ^tsym;
        psym = ^tsym;
        tsym = object(tsymtableentry)
        tsym = object(tsymtableentry)
           typ        : tsymtyp;
           typ        : tsymtyp;
-          properties : symprop;
+          symoptions : tsymoptions;
           fileinfo   : tfileposinfo;
           fileinfo   : tfileposinfo;
 {$ifdef GDB}
 {$ifdef GDB}
           isstabwritten : boolean;
           isstabwritten : boolean;
@@ -65,7 +63,7 @@
 
 
        plabelsym = ^tlabelsym;
        plabelsym = ^tlabelsym;
        tlabelsym = object(tsym)
        tlabelsym = object(tsym)
-          lab : pasmlabel;
+          lab     : pasmlabel;
           defined : boolean;
           defined : boolean;
           constructor init(const n : string; l : pasmlabel);
           constructor init(const n : string; l : pasmlabel);
           destructor done;virtual;
           destructor done;virtual;
@@ -77,8 +75,8 @@
        punitsym = ^tunitsym;
        punitsym = ^tunitsym;
        tunitsym = object(tsym)
        tunitsym = object(tsym)
           unitsymtable : punitsymtable;
           unitsymtable : punitsymtable;
-          prevsym : punitsym;
-          refs : longint;
+          prevsym      : punitsym;
+          refs         : longint;
           constructor init(const n : string;ref : punitsymtable);
           constructor init(const n : string;ref : punitsymtable);
           constructor load;
           constructor load;
           destructor done;virtual;
           destructor done;virtual;
@@ -92,7 +90,7 @@
        tmacrosym = object(tsym)
        tmacrosym = object(tsym)
           defined : boolean;
           defined : boolean;
           buftext : pchar;
           buftext : pchar;
-          buflen : longint;
+          buflen  : longint;
           { macros aren't written to PPU files ! }
           { macros aren't written to PPU files ! }
           constructor init(const n : string);
           constructor init(const n : string);
           destructor done;virtual;
           destructor done;virtual;
@@ -105,12 +103,12 @@
 
 
        pprocsym = ^tprocsym;
        pprocsym = ^tprocsym;
        tprocsym = object(tsym)
        tprocsym = object(tsym)
-          definition : pprocdef;
+          definition  : pprocdef;
 {$ifdef CHAINPROCSYMS}
 {$ifdef CHAINPROCSYMS}
           nextprocsym : pprocsym;
           nextprocsym : pprocsym;
 {$endif CHAINPROCSYMS}
 {$endif CHAINPROCSYMS}
 {$ifdef GDB}
 {$ifdef GDB}
-          is_global : boolean;{necessary for stab}
+          is_global   : boolean; { necessary for stab }
 {$endif GDB}
 {$endif GDB}
           constructor init(const n : string);
           constructor init(const n : string);
           constructor load;
           constructor load;
@@ -169,17 +167,16 @@
 
 
        pvarsym = ^tvarsym;
        pvarsym = ^tvarsym;
        tvarsym = object(tsym)
        tvarsym = object(tsym)
-          address      : longint;
-          localvarsym  : pvarsym;
-          islocalcopy  : boolean;
-          definition   : pdef;
+          address       : longint;
+          localvarsym   : pvarsym;
+          islocalcopy   : boolean;
+          definition    : pdef;
           definitionsym : ptypesym;
           definitionsym : ptypesym;
-          refs         : longint;
-          var_options  : byte;
-          _mangledname : pchar;
-          reg          : tregister; { if reg<>R_NO, then the variable is an register variable }
-          varspez      : tvarspez;  { sets the type of access }
-          is_valid     : byte;
+          refs          : longint;
+          varoptions    : tvaroptions;
+          reg           : tregister; { if reg<>R_NO, then the variable is an register variable }
+          varspez       : tvarspez;  { sets the type of access }
+          varstate      : tvarstate;
           constructor init(const n : string;p : pdef);
           constructor init(const n : string;p : pdef);
           constructor init_dll(const n : string;p : pdef);
           constructor init_dll(const n : string;p : pdef);
           constructor init_C(const n,mangled : string;p : pdef);
           constructor init_C(const n,mangled : string;p : pdef);
@@ -187,7 +184,7 @@
           constructor initsym_dll(const n : string;p : ptypesym);
           constructor initsym_dll(const n : string;p : ptypesym);
           constructor initsym_C(const n,mangled : string;p : ptypesym);
           constructor initsym_C(const n,mangled : string;p : ptypesym);
           constructor load;
           constructor load;
-          destructor done;virtual;
+          destructor  done;virtual;
           procedure write;virtual;
           procedure write;virtual;
           procedure deref;virtual;
           procedure deref;virtual;
           procedure setmangledname(const s : string);
           procedure setmangledname(const s : string);
@@ -196,28 +193,28 @@
           function  getsize : longint;
           function  getsize : longint;
           function  getpushsize : longint;
           function  getpushsize : longint;
 {$ifdef GDB}
 {$ifdef GDB}
-          function stabstring : pchar;virtual;
+          function  stabstring : pchar;virtual;
           procedure concatstabto(asmlist : paasmoutput);virtual;
           procedure concatstabto(asmlist : paasmoutput);virtual;
 {$endif GDB}
 {$endif GDB}
+       private
+          _mangledname  : pchar;
        end;
        end;
 
 
        ppropertysym = ^tpropertysym;
        ppropertysym = ^tpropertysym;
        tpropertysym = object(tsym)
        tpropertysym = object(tsym)
-          options : longint;
-          proptype : pdef;
-          { proppara : pdefcoll; }
+          propoptions : tpropertyoptions;
+          proptype    : pdef;
           readaccesssym,writeaccesssym,storedsym : psym;
           readaccesssym,writeaccesssym,storedsym : psym;
           readaccessdef,writeaccessdef,storeddef : pdef;
           readaccessdef,writeaccessdef,storeddef : pdef;
           index,default : longint;
           index,default : longint;
           constructor init(const n : string);
           constructor init(const n : string);
-          destructor done;virtual;
+          destructor  done;virtual;
           constructor load;
           constructor load;
-          function getsize : longint;virtual;
+          function  getsize : longint;virtual;
           procedure write;virtual;
           procedure write;virtual;
           procedure deref;virtual;
           procedure deref;virtual;
 {$ifdef GDB}
 {$ifdef GDB}
-          { I don't know how (FK) }
-          function stabstring : pchar;virtual;
+          function  stabstring : pchar;virtual;
           procedure concatstabto(asmlist : paasmoutput);virtual;
           procedure concatstabto(asmlist : paasmoutput);virtual;
 {$endif GDB}
 {$endif GDB}
        end;
        end;
@@ -226,7 +223,7 @@
        tfuncretsym = object(tsym)
        tfuncretsym = object(tsym)
           funcretprocinfo : pointer{ should be pprocinfo};
           funcretprocinfo : pointer{ should be pprocinfo};
           funcretdef : pdef;
           funcretdef : pdef;
-          address : longint;
+          address    : longint;
           constructor init(const n : string;approcinfo : pointer{pprocinfo});
           constructor init(const n : string;approcinfo : pointer{pprocinfo});
           constructor load;
           constructor load;
           procedure write;virtual;
           procedure write;virtual;
@@ -241,20 +238,16 @@
 
 
        pabsolutesym = ^tabsolutesym;
        pabsolutesym = ^tabsolutesym;
        tabsolutesym = object(tvarsym)
        tabsolutesym = object(tvarsym)
-          abstyp : absolutetyp;
-          absseg : boolean;
-          ref : psym;
+          abstyp  : absolutetyp;
+          absseg  : boolean;
+          ref     : psym;
           asmname : pstring;
           asmname : pstring;
           constructor init(const n : string;p : pdef);
           constructor init(const n : string;p : pdef);
           constructor load;
           constructor load;
           procedure deref;virtual;
           procedure deref;virtual;
-          function mangledname : string;virtual;
+          function  mangledname : string;virtual;
           procedure write;virtual;
           procedure write;virtual;
           procedure insert_in_data;virtual;
           procedure insert_in_data;virtual;
-          { this creates a problem in gen_vmt !!!!!
-          because the pdef is not resolved yet !!
-          we should fix this
-          constructor init(const s : string;p : pdef;newref : psym);}
 {$ifdef GDB}
 {$ifdef GDB}
           procedure concatstabto(asmlist : paasmoutput);virtual;
           procedure concatstabto(asmlist : paasmoutput);virtual;
 {$endif GDB}
 {$endif GDB}
@@ -262,9 +255,9 @@
 
 
        ptypedconstsym = ^ttypedconstsym;
        ptypedconstsym = ^ttypedconstsym;
        ttypedconstsym = object(tsym)
        ttypedconstsym = object(tsym)
-          prefix : pstring;
-          definition : pdef;
-          definitionsym : ptypesym;
+          prefix          : pstring;
+          definition      : pdef;
+          definitionsym   : ptypesym;
           is_really_const : boolean;
           is_really_const : boolean;
           constructor init(const n : string;p : pdef;really_const : boolean);
           constructor init(const n : string;p : pdef;really_const : boolean);
           constructor initsym(const n : string;p : ptypesym;really_const : boolean);
           constructor initsym(const n : string;p : ptypesym;really_const : boolean);
@@ -276,7 +269,7 @@
           function  getsize:longint;
           function  getsize:longint;
           procedure insert_in_data;virtual;
           procedure insert_in_data;virtual;
 {$ifdef GDB}
 {$ifdef GDB}
-          function stabstring : pchar;virtual;
+          function  stabstring : pchar;virtual;
 {$endif GDB}
 {$endif GDB}
        end;
        end;
 
 
@@ -300,15 +293,15 @@
           procedure deref;virtual;
           procedure deref;virtual;
           procedure write;virtual;
           procedure write;virtual;
 {$ifdef GDB}
 {$ifdef GDB}
-          function stabstring : pchar;virtual;
+          function  stabstring : pchar;virtual;
           procedure concatstabto(asmlist : paasmoutput);virtual;
           procedure concatstabto(asmlist : paasmoutput);virtual;
 {$endif GDB}
 {$endif GDB}
        end;
        end;
 
 
        tenumsym = object(tsym)
        tenumsym = object(tsym)
-          value : longint;
+          value      : longint;
           definition : penumdef;
           definition : penumdef;
-          nextenum : penumsym;
+          nextenum   : penumsym;
           constructor init(const n : string;def : penumdef;v : longint);
           constructor init(const n : string;def : penumdef;v : longint);
           constructor load;
           constructor load;
           procedure write;virtual;
           procedure write;virtual;
@@ -329,7 +322,7 @@
           number : longint;
           number : longint;
           constructor init(const n : string;l : longint);
           constructor init(const n : string;l : longint);
           constructor load;
           constructor load;
-          destructor done;virtual;
+          destructor  done;virtual;
           procedure write;virtual;
           procedure write;virtual;
 {$ifdef GDB}
 {$ifdef GDB}
           procedure concatstabto(asmlist : paasmoutput);virtual;
           procedure concatstabto(asmlist : paasmoutput);virtual;
@@ -338,7 +331,11 @@
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.29  1999-07-27 23:42:23  peter
+  Revision 1.30  1999-08-03 22:03:21  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.29  1999/07/27 23:42:23  peter
     * indirect type referencing is now allowed
     * indirect type referencing is now allowed
 
 
   Revision 1.28  1999/07/24 15:13:01  michael
   Revision 1.28  1999/07/24 15:13:01  michael

+ 35 - 36
compiler/symtable.pas

@@ -34,6 +34,7 @@ unit symtable;
 {$endif}
 {$endif}
        strings,cobjects,
        strings,cobjects,
        globtype,globals,tokens,systems,verbose,
        globtype,globals,tokens,systems,verbose,
+       symconst,
        aasm
        aasm
 {$ifdef i386}
 {$ifdef i386}
        ,i386base
        ,i386base
@@ -63,13 +64,6 @@ unit symtable;
   {$endif}
   {$endif}
 
 
 
 
-{************************************************
-                Constants
-************************************************}
-
-{$i symconst.inc}
-
-
 {************************************************
 {************************************************
             Needed forward pointers
             Needed forward pointers
 ************************************************}
 ************************************************}
@@ -247,7 +241,7 @@ unit symtable;
     const
     const
        systemunit           : punitsymtable = nil; { pointer to the system unit }
        systemunit           : punitsymtable = nil; { pointer to the system unit }
        objpasunit           : punitsymtable = nil; { pointer to the objpas unit }
        objpasunit           : punitsymtable = nil; { pointer to the objpas unit }
-       current_object_option : symprop = sp_public;
+       current_object_option : tsymoptions = [sp_public];
 
 
     var
     var
        { for STAB debugging }
        { for STAB debugging }
@@ -286,7 +280,7 @@ unit symtable;
        s32bitdef : porddef;     { Pointer to 32-Bit signed        }
        s32bitdef : porddef;     { Pointer to 32-Bit signed        }
 
 
        cu64bitdef : porddef;       { pointer to 64 bit unsigned def }
        cu64bitdef : porddef;       { pointer to 64 bit unsigned def }
-       cs64bitintdef : porddef;    { pointer to 64 bit signed def, }
+       cs64bitdef : porddef;    { pointer to 64 bit signed def, }
                                    { calculated by the int unit on i386 }
                                    { calculated by the int unit on i386 }
 
 
        s32floatdef : pfloatdef;    { pointer for realconstn         }
        s32floatdef : pfloatdef;    { pointer for realconstn         }
@@ -701,9 +695,9 @@ implementation
                  pd:=st^.getdefnr(p^.index);
                  pd:=st^.getdefnr(p^.index);
                  case pd^.deftype of
                  case pd^.deftype of
                    recorddef :
                    recorddef :
-                     st:=precdef(pd)^.symtable;
+                     st:=precorddef(pd)^.symtable;
                    objectdef :
                    objectdef :
-                     st:=pobjectdef(pd)^.publicsyms;
+                     st:=pobjectdef(pd)^.symtable;
                  else
                  else
                    internalerror(556658);
                    internalerror(556658);
                  end;
                  end;
@@ -967,7 +961,7 @@ implementation
               while (srsymtable^.symtabletype in [objectsymtable,recordsymtable]) do
               while (srsymtable^.symtabletype in [objectsymtable,recordsymtable]) do
                    srsymtable:=srsymtable^.next;
                    srsymtable:=srsymtable^.next;
               srsym:=new(ptypesym,init(s,nil));
               srsym:=new(ptypesym,init(s,nil));
-              srsym^.properties:=sp_forwarddef;
+              srsym^.symoptions:=[sp_forwarddef];
               srsymtable^.insert(srsym);
               srsymtable^.insert(srsym);
            end
            end
          else if notfounderror then
          else if notfounderror then
@@ -1133,7 +1127,7 @@ implementation
            iblongstringdef : hp:=new(pstringdef,longload);
            iblongstringdef : hp:=new(pstringdef,longload);
            ibansistringdef : hp:=new(pstringdef,ansiload);
            ibansistringdef : hp:=new(pstringdef,ansiload);
            ibwidestringdef : hp:=new(pstringdef,wideload);
            ibwidestringdef : hp:=new(pstringdef,wideload);
-               ibrecorddef : hp:=new(precdef,load);
+               ibrecorddef : hp:=new(precorddef,load);
                ibobjectdef : hp:=new(pobjectdef,load);
                ibobjectdef : hp:=new(pobjectdef,load);
                  ibenumdef : hp:=new(penumdef,load);
                  ibenumdef : hp:=new(penumdef,load);
                   ibsetdef : hp:=new(psetdef,load);
                   ibsetdef : hp:=new(psetdef,load);
@@ -1457,8 +1451,8 @@ implementation
                    if hp^.symtabletype in [staticsymtable,globalsymtable] then
                    if hp^.symtabletype in [staticsymtable,globalsymtable] then
                     begin
                     begin
                        hsym:=hp^.search(sym^.name);
                        hsym:=hp^.search(sym^.name);
-                       if (assigned(hsym)) and
-                          (hsym^.properties and sp_forwarddef=0) then
+                       if assigned(hsym) and
+                          not(sp_forwarddef in hsym^.symoptions) then
                          DuplicateSym(hsym);
                          DuplicateSym(hsym);
                     end;
                     end;
                   hp:=hp^.next;
                   hp:=hp^.next;
@@ -1491,7 +1485,7 @@ implementation
               hsym:=search_class_member(pobjectdef(next^.next^.defowner),sym^.name);
               hsym:=search_class_member(pobjectdef(next^.next^.defowner),sym^.name);
               { but private ids can be reused }
               { but private ids can be reused }
               if assigned(hsym) and
               if assigned(hsym) and
-                ((hsym^.properties<>sp_private) or
+                (not(sp_private in hsym^.symoptions) or
                  (hsym^.owner^.defowner^.owner^.symtabletype<>unitsymtable)) then
                  (hsym^.owner^.defowner^.owner^.symtabletype<>unitsymtable)) then
                 DuplicateSym(hsym);
                 DuplicateSym(hsym);
            end;
            end;
@@ -1503,26 +1497,26 @@ implementation
               hsym:=search_class_member(pobjectdef(defowner),sym^.name);
               hsym:=search_class_member(pobjectdef(defowner),sym^.name);
               { but private ids can be reused }
               { but private ids can be reused }
               if assigned(hsym) and
               if assigned(hsym) and
-                ((hsym^.properties<>sp_private) or
+                (not(sp_private in hsym^.symoptions) or
                  (hsym^.owner^.defowner^.owner^.symtabletype<>unitsymtable)) then
                  (hsym^.owner^.defowner^.owner^.symtabletype<>unitsymtable)) then
                 DuplicateSym(hsym);
                 DuplicateSym(hsym);
            end;
            end;
-
-         if sym^.typ = typesym then
-           if assigned(ptypesym(sym)^.definition) then
-             begin
-             if not assigned(ptypesym(sym)^.definition^.owner) and
-                (ptypesym(sym)^.definition^.deftype<>errordef) then
+         { register definition of typesym }
+         if (sym^.typ = typesym) and
+            assigned(ptypesym(sym)^.definition) then
+          begin
+            if not(assigned(ptypesym(sym)^.definition^.owner)) and
+               (ptypesym(sym)^.definition^.deftype<>errordef) then
               registerdef(ptypesym(sym)^.definition);
               registerdef(ptypesym(sym)^.definition);
 {$ifdef GDB}
 {$ifdef GDB}
-             if (cs_debuginfo in aktmoduleswitches) and assigned(debuglist)
-                and (symtabletype in [globalsymtable,staticsymtable]) then
-                   begin
-                   ptypesym(sym)^.isusedinstab := true;
-                   sym^.concatstabto(debuglist);
-                   end;
+            if (cs_debuginfo in aktmoduleswitches) and assigned(debuglist) and
+               (symtabletype in [globalsymtable,staticsymtable]) then
+              begin
+                ptypesym(sym)^.isusedinstab := true;
+                sym^.concatstabto(debuglist);
+              end;
 {$endif GDB}
 {$endif GDB}
-             end;
+          end;
          { insert in index and search hash }
          { insert in index and search hash }
          symindex^.insert(sym);
          symindex^.insert(sym);
          symsearch^.insert(sym);
          symsearch^.insert(sym);
@@ -1549,7 +1543,7 @@ implementation
              be carefull aktprocsym^.definition is not allways
              be carefull aktprocsym^.definition is not allways
              loaded already (PFV) }
              loaded already (PFV) }
            if (symtabletype=objectsymtable) and
            if (symtabletype=objectsymtable) and
-              ((hp^.properties and sp_static)=0) and
+              not(sp_static in hp^.symoptions) and
               allow_only_static
               allow_only_static
               {assigned(aktprocsym) and
               {assigned(aktprocsym) and
               assigned(aktprocsym^.definition) and
               assigned(aktprocsym^.definition) and
@@ -2138,7 +2132,7 @@ implementation
          sym:=nil;
          sym:=nil;
          while assigned(pd) do
          while assigned(pd) do
            begin
            begin
-              sym:=pd^.publicsyms^.search(n);
+              sym:=pd^.symtable^.search(n);
               if assigned(sym) then
               if assigned(sym) then
                 break;
                 break;
               pd:=pd^.childof;
               pd:=pd^.childof;
@@ -2147,7 +2141,7 @@ implementation
            caused bug0214 }
            caused bug0214 }
          if assigned(sym) then
          if assigned(sym) then
            begin
            begin
-             srsymtable:=pd^.publicsyms;
+             srsymtable:=pd^.symtable;
            end;
            end;
          search_class_member:=sym;
          search_class_member:=sym;
       end;
       end;
@@ -2157,7 +2151,8 @@ implementation
 
 
    procedure testfordefaultproperty(p : pnamedindexobject);
    procedure testfordefaultproperty(p : pnamedindexobject);
      begin
      begin
-        if (psym(p)^.typ=propertysym) and ((ppropertysym(p)^.options and ppo_defaultproperty)<>0) then
+        if (psym(p)^.typ=propertysym) and
+           (ppo_defaultproperty in ppropertysym(p)^.propoptions) then
           _defaultprop:=ppropertysym(p);
           _defaultprop:=ppropertysym(p);
      end;
      end;
 
 
@@ -2168,7 +2163,7 @@ implementation
         _defaultprop:=nil;
         _defaultprop:=nil;
         while assigned(pd) do
         while assigned(pd) do
           begin
           begin
-             pd^.publicsyms^.foreach({$ifndef TP}@{$endif}testfordefaultproperty);
+             pd^.symtable^.foreach({$ifndef TP}@{$endif}testfordefaultproperty);
              if assigned(_defaultprop) then
              if assigned(_defaultprop) then
                break;
                break;
              pd:=pd^.childof;
              pd:=pd^.childof;
@@ -2348,7 +2343,11 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.34  1999-08-03 17:51:45  florian
+  Revision 1.35  1999-08-03 22:03:22  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.34  1999/08/03 17:51:45  florian
     * reduced memory usage by factor 2-3 (it
     * reduced memory usage by factor 2-3 (it
       improved also the speed) by reducing the
       improved also the speed) by reducing the
       growsize of the symbol tables
       growsize of the symbol tables

+ 37 - 31
compiler/systems.pas

@@ -62,7 +62,9 @@ unit systems;
             target_m68k_linux,target_m68k_PalmOS,target_alpha_linux
             target_m68k_linux,target_m68k_PalmOS,target_alpha_linux
        );
        );
 
 
-       ttargetflags = (tf_needs_isconsole,tf_supports_stack_checking);
+       ttargetflags = (tf_none,
+            tf_supports_stack_checking,tf_need_export
+       );
 
 
      const
      const
        {$ifdef i386} i386targetcnt=5; {$else} i386targetcnt=0; {$endif}
        {$ifdef i386} i386targetcnt=5; {$else} i386targetcnt=0; {$endif}
@@ -206,7 +208,7 @@ unit systems;
        ttargetinfo = packed record
        ttargetinfo = packed record
           target      : ttarget;
           target      : ttarget;
           flags       : set of ttargetflags;
           flags       : set of ttargetflags;
-          cpu    : ttargetcpu;
+          cpu         : ttargetcpu;
           short_name  : string[8];
           short_name  : string[8];
           unit_env    : string[12];
           unit_env    : string[12];
           system_unit : string[8];
           system_unit : string[8];
@@ -218,12 +220,12 @@ unit systems;
           resext,
           resext,
           resobjext,
           resobjext,
           exeext      : string[4];
           exeext      : string[4];
-          os      : tos;
-          link  : tlink;
+          os          : tos;
+          link        : tlink;
           assem       : tasm;
           assem       : tasm;
           assemsrc    : tasm; { default source writing assembler }
           assemsrc    : tasm; { default source writing assembler }
-          ar      : tar;
-          res    : tres;
+          ar          : tar;
+          res         : tres;
           heapsize,
           heapsize,
           maxheapsize,
           maxheapsize,
           stacksize   : longint;
           stacksize   : longint;
@@ -984,7 +986,7 @@ implementation
           ,(
           ,(
             target      : target_i386_GO32V1;
             target      : target_i386_GO32V1;
             flags       : [];
             flags       : [];
-            cpu  : i386;
+            cpu         : i386;
             short_name  : 'GO32V1';
             short_name  : 'GO32V1';
             unit_env    : 'GO32V1UNITS';
             unit_env    : 'GO32V1UNITS';
             system_unit : 'SYSTEM';
             system_unit : 'SYSTEM';
@@ -996,12 +998,12 @@ implementation
             resext      : '.res';
             resext      : '.res';
             resobjext   : '.o1r';
             resobjext   : '.o1r';
             exeext      : ''; { The linker produces a.out }
             exeext      : ''; { The linker produces a.out }
-            os    : os_i386_GO32V1;
+            os          : os_i386_GO32V1;
             link        : link_i386_ldgo32v1;
             link        : link_i386_ldgo32v1;
             assem       : as_i386_as;
             assem       : as_i386_as;
             assemsrc    : as_i386_as;
             assemsrc    : as_i386_as;
-            ar    : ar_i386_ar;
-            res  : res_none;
+            ar          : ar_i386_ar;
+            res         : res_none;
             heapsize    : 2048*1024;
             heapsize    : 2048*1024;
             maxheapsize : 32768*1024;
             maxheapsize : 32768*1024;
             stacksize   : 16384
             stacksize   : 16384
@@ -1009,7 +1011,7 @@ implementation
           (
           (
             target      : target_i386_GO32V2;
             target      : target_i386_GO32V2;
             flags       : [];
             flags       : [];
-            cpu  : i386;
+            cpu         : i386;
             short_name  : 'GO32V2';
             short_name  : 'GO32V2';
             unit_env    : 'GO32V2UNITS';
             unit_env    : 'GO32V2UNITS';
             system_unit : 'SYSTEM';
             system_unit : 'SYSTEM';
@@ -1021,12 +1023,12 @@ implementation
             resext      : '.res';
             resext      : '.res';
             resobjext   : '.or';
             resobjext   : '.or';
             exeext      : '.exe';
             exeext      : '.exe';
-            os    : os_i386_GO32V2;
+            os          : os_i386_GO32V2;
             link        : link_i386_ldgo32v2;
             link        : link_i386_ldgo32v2;
             assem       : as_i386_coff;
             assem       : as_i386_coff;
             assemsrc    : as_i386_as;
             assemsrc    : as_i386_as;
-            ar    : ar_i386_ar;
-            res  : res_none;
+            ar          : ar_i386_ar;
+            res         : res_none;
             heapsize    : 2048*1024;
             heapsize    : 2048*1024;
             maxheapsize : 32768*1024;
             maxheapsize : 32768*1024;
             stacksize   : 16384
             stacksize   : 16384
@@ -1058,7 +1060,7 @@ implementation
           ),
           ),
           (
           (
             target      : target_i386_OS2;
             target      : target_i386_OS2;
-            flags       : [];
+            flags       : [tf_need_export];
             cpu  : i386;
             cpu  : i386;
             short_name  : 'OS2';
             short_name  : 'OS2';
             unit_env    : 'OS2UNITS';
             unit_env    : 'OS2UNITS';
@@ -1084,7 +1086,7 @@ implementation
           (
           (
             target      : target_i386_WIN32;
             target      : target_i386_WIN32;
             flags       : [];
             flags       : [];
-            cpu  : i386;
+            cpu         : i386;
             short_name  : 'WIN32';
             short_name  : 'WIN32';
             unit_env    : 'WIN32UNITS';
             unit_env    : 'WIN32UNITS';
             system_unit : 'SYSWIN32';
             system_unit : 'SYSWIN32';
@@ -1111,7 +1113,7 @@ implementation
           ,(
           ,(
             target      : target_m68k_Amiga;
             target      : target_m68k_Amiga;
             flags       : [];
             flags       : [];
-            cpu  : m68k;
+            cpu         : m68k;
             short_name  : 'AMIGA';
             short_name  : 'AMIGA';
             unit_env    : '';
             unit_env    : '';
             system_unit : 'sysamiga';
             system_unit : 'sysamiga';
@@ -1136,7 +1138,7 @@ implementation
           (
           (
             target      : target_m68k_Atari;
             target      : target_m68k_Atari;
             flags       : [];
             flags       : [];
-            cpu  : m68k;
+            cpu         : m68k;
             short_name  : 'ATARI';
             short_name  : 'ATARI';
             unit_env    : '';
             unit_env    : '';
             system_unit : 'SYSATARI';
             system_unit : 'SYSATARI';
@@ -1161,7 +1163,7 @@ implementation
           (
           (
             target      : target_m68k_Mac;
             target      : target_m68k_Mac;
             flags       : [];
             flags       : [];
-            cpu  : m68k;
+            cpu         : m68k;
             short_name  : 'MACOS';
             short_name  : 'MACOS';
             unit_env    : '';
             unit_env    : '';
             system_unit : 'sysmac';
             system_unit : 'sysmac';
@@ -1173,12 +1175,12 @@ implementation
             resext      : '.res';
             resext      : '.res';
             resobjext   : '.or';
             resobjext   : '.or';
             exeext      : '';
             exeext      : '';
-            os    : os_m68k_Mac;
+            os          : os_m68k_Mac;
             link        : link_m68k_ld;
             link        : link_m68k_ld;
             assem       : as_m68k_mpw;
             assem       : as_m68k_mpw;
             assemsrc    : as_m68k_mpw;
             assemsrc    : as_m68k_mpw;
-            ar    : ar_m68k_ar;
-            res  : res_none;
+            ar          : ar_m68k_ar;
+            res         : res_none;
             heapsize    : 128*1024;
             heapsize    : 128*1024;
             maxheapsize : 32768*1024;
             maxheapsize : 32768*1024;
             stacksize   : 8192
             stacksize   : 8192
@@ -1186,7 +1188,7 @@ implementation
           (
           (
             target      : target_m68k_linux;
             target      : target_m68k_linux;
             flags       : [];
             flags       : [];
-            cpu  : m68k;
+            cpu         : m68k;
             short_name  : 'LINUX';
             short_name  : 'LINUX';
             unit_env    : 'LINUXUNITS';
             unit_env    : 'LINUXUNITS';
             system_unit : 'syslinux';
             system_unit : 'syslinux';
@@ -1198,12 +1200,12 @@ implementation
             resext      : '.res';
             resext      : '.res';
             resobjext   : '.or';
             resobjext   : '.or';
             exeext      : '';
             exeext      : '';
-            os    : os_m68k_Linux;
+            os          : os_m68k_Linux;
             link        : link_m68k_ld;
             link        : link_m68k_ld;
             assem       : as_m68k_as;
             assem       : as_m68k_as;
             assemsrc    : as_m68k_as;
             assemsrc    : as_m68k_as;
-            ar    : ar_m68k_ar;
-            res  : res_none;
+            ar          : ar_m68k_ar;
+            res         : res_none;
             heapsize    : 128*1024;
             heapsize    : 128*1024;
             maxheapsize : 32768*1024;
             maxheapsize : 32768*1024;
             stacksize   : 8192
             stacksize   : 8192
@@ -1211,7 +1213,7 @@ implementation
           (
           (
             target      : target_m68k_PalmOS;
             target      : target_m68k_PalmOS;
             flags       : [];
             flags       : [];
-            cpu  : m68k;
+            cpu         : m68k;
             short_name  : 'PALMOS';
             short_name  : 'PALMOS';
             unit_env    : 'PALMUNITS';
             unit_env    : 'PALMUNITS';
             system_unit : 'syspalm';
             system_unit : 'syspalm';
@@ -1223,12 +1225,12 @@ implementation
             resext      : '.res';
             resext      : '.res';
             resobjext   : '.or';
             resobjext   : '.or';
             exeext      : '';
             exeext      : '';
-            os    : os_m68k_PalmOS;
+            os          : os_m68k_PalmOS;
             link        : link_m68k_ld;
             link        : link_m68k_ld;
             assem       : as_m68k_as;
             assem       : as_m68k_as;
             assemsrc    : as_m68k_as;
             assemsrc    : as_m68k_as;
-            ar    : ar_m68k_ar;
-            res  : res_none;
+            ar          : ar_m68k_ar;
+            res         : res_none;
             heapsize    : 128*1024;
             heapsize    : 128*1024;
             maxheapsize : 32768*1024;
             maxheapsize : 32768*1024;
             stacksize   : 8192
             stacksize   : 8192
@@ -1624,7 +1626,11 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.87  1999-08-03 17:09:43  florian
+  Revision 1.88  1999-08-03 22:03:23  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.87  1999/08/03 17:09:43  florian
     * the alpha compiler can be compiled now
     * the alpha compiler can be compiled now
 
 
   Revision 1.86  1999/08/03 15:52:00  michael
   Revision 1.86  1999/08/03 15:52:00  michael

+ 18 - 14
compiler/tcadd.pas

@@ -34,7 +34,7 @@ implementation
     uses
     uses
       globtype,systems,tokens,
       globtype,systems,tokens,
       cobjects,verbose,globals,
       cobjects,verbose,globals,
-      symtable,aasm,types,
+      symconst,symtable,aasm,types,
       hcodegen,htypechk,pass_1
       hcodegen,htypechk,pass_1
 {$ifdef i386}
 {$ifdef i386}
       ,i386base
       ,i386base
@@ -115,7 +115,7 @@ implementation
               (porddef(parraydef(ld)^.definition)^.typ<>uchar))) or
               (porddef(parraydef(ld)^.definition)^.typ<>uchar))) or
             { <> and = are defined for classes }
             { <> and = are defined for classes }
             ((ld^.deftype=objectdef) and
             ((ld^.deftype=objectdef) and
-             (not(pobjectdef(ld)^.isclass) or
+             (not(pobjectdef(ld)^.is_class) or
               not(p^.treetype in [equaln,unequaln])
               not(p^.treetype in [equaln,unequaln])
              )
              )
             ) or
             ) or
@@ -126,7 +126,7 @@ implementation
               (porddef(parraydef(rd)^.definition)^.typ<>uchar))) or
               (porddef(parraydef(rd)^.definition)^.typ<>uchar))) or
             { <> and = are defined for classes }
             { <> and = are defined for classes }
             ((rd^.deftype=objectdef) and
             ((rd^.deftype=objectdef) and
-             (not(pobjectdef(rd)^.isclass) or
+             (not(pobjectdef(rd)^.is_class) or
               not(p^.treetype in [equaln,unequaln])
               not(p^.treetype in [equaln,unequaln])
              )
              )
             ) then
             ) then
@@ -456,16 +456,16 @@ implementation
                  convdone:=true;
                  convdone:=true;
                end
                end
               { is there a 64 bit type ? }
               { is there a 64 bit type ? }
-             else if (porddef(rd)^.typ=s64bitint) or (porddef(ld)^.typ=s64bitint) then
+             else if (porddef(rd)^.typ=s64bit) or (porddef(ld)^.typ=s64bit) then
                begin
                begin
-                  if (porddef(ld)^.typ<>s64bitint) then
+                  if (porddef(ld)^.typ<>s64bit) then
                     begin
                     begin
-                      p^.left:=gentypeconvnode(p^.left,cs64bitintdef);
+                      p^.left:=gentypeconvnode(p^.left,cs64bitdef);
                       firstpass(p^.left);
                       firstpass(p^.left);
                     end;
                     end;
-                  if (porddef(rd)^.typ<>s64bitint) then
+                  if (porddef(rd)^.typ<>s64bit) then
                     begin
                     begin
-                       p^.right:=gentypeconvnode(p^.right,cs64bitintdef);
+                       p^.right:=gentypeconvnode(p^.right,cs64bitdef);
                        firstpass(p^.right);
                        firstpass(p^.right);
                     end;
                     end;
                   calcregisters(p,2,0,0);
                   calcregisters(p,2,0,0);
@@ -831,10 +831,10 @@ implementation
          else
          else
 
 
            if (rd^.deftype=objectdef) and (ld^.deftype=objectdef) and
            if (rd^.deftype=objectdef) and (ld^.deftype=objectdef) and
-              pobjectdef(rd)^.isclass and pobjectdef(ld)^.isclass then
+              pobjectdef(rd)^.is_class and pobjectdef(ld)^.is_class then
             begin
             begin
               p^.location.loc:=LOC_REGISTER;
               p^.location.loc:=LOC_REGISTER;
-              if pobjectdef(rd)^.isrelated(pobjectdef(ld)) then
+              if pobjectdef(rd)^.is_related(pobjectdef(ld)) then
                 p^.right:=gentypeconvnode(p^.right,ld)
                 p^.right:=gentypeconvnode(p^.right,ld)
               else
               else
                 p^.left:=gentypeconvnode(p^.left,rd);
                 p^.left:=gentypeconvnode(p^.left,rd);
@@ -852,7 +852,7 @@ implementation
            if (rd^.deftype=classrefdef) and (ld^.deftype=classrefdef) then
            if (rd^.deftype=classrefdef) and (ld^.deftype=classrefdef) then
             begin
             begin
               p^.location.loc:=LOC_REGISTER;
               p^.location.loc:=LOC_REGISTER;
-              if pobjectdef(pclassrefdef(rd)^.definition)^.isrelated(pobjectdef(
+              if pobjectdef(pclassrefdef(rd)^.definition)^.is_related(pobjectdef(
                 pclassrefdef(ld)^.definition)) then
                 pclassrefdef(ld)^.definition)) then
                 p^.right:=gentypeconvnode(p^.right,ld)
                 p^.right:=gentypeconvnode(p^.right,ld)
               else
               else
@@ -870,7 +870,7 @@ implementation
 
 
          { allows comperasion with nil pointer }
          { allows comperasion with nil pointer }
            if (rd^.deftype=objectdef) and
            if (rd^.deftype=objectdef) and
-              pobjectdef(rd)^.isclass then
+              pobjectdef(rd)^.is_class then
             begin
             begin
               p^.location.loc:=LOC_REGISTER;
               p^.location.loc:=LOC_REGISTER;
               p^.left:=gentypeconvnode(p^.left,rd);
               p^.left:=gentypeconvnode(p^.left,rd);
@@ -885,7 +885,7 @@ implementation
          else
          else
 
 
            if (ld^.deftype=objectdef) and
            if (ld^.deftype=objectdef) and
-              pobjectdef(ld)^.isclass then
+              pobjectdef(ld)^.is_class then
             begin
             begin
               p^.location.loc:=LOC_REGISTER;
               p^.location.loc:=LOC_REGISTER;
               p^.right:=gentypeconvnode(p^.right,ld);
               p^.right:=gentypeconvnode(p^.right,ld);
@@ -1117,7 +1117,11 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.37  1999-07-16 10:04:37  peter
+  Revision 1.38  1999-08-03 22:03:24  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.37  1999/07/16 10:04:37  peter
     * merged
     * merged
 
 
   Revision 1.36  1999/06/17 15:32:48  pierre
   Revision 1.36  1999/06/17 15:32:48  pierre

+ 33 - 17
compiler/tccal.pas

@@ -39,7 +39,7 @@ implementation
     uses
     uses
       globtype,systems,
       globtype,systems,
       cobjects,verbose,globals,
       cobjects,verbose,globals,
-      aasm,types,
+      symconst,aasm,types,
       hcodegen,htypechk,pass_1
       hcodegen,htypechk,pass_1
 {$ifdef i386}
 {$ifdef i386}
       ,i386base,tgeni386
       ,i386base,tgeni386
@@ -221,7 +221,7 @@ implementation
                      not(
                      not(
                         (p^.left^.resulttype^.deftype=objectdef) and
                         (p^.left^.resulttype^.deftype=objectdef) and
                         (defcoll^.data^.deftype=objectdef) and
                         (defcoll^.data^.deftype=objectdef) and
-                        pobjectdef(p^.left^.resulttype)^.isrelated(pobjectdef(defcoll^.data))
+                        pobjectdef(p^.left^.resulttype)^.is_related(pobjectdef(defcoll^.data))
                         ) and
                         ) and
                    { passing a single element to a openarray of the same type }
                    { passing a single element to a openarray of the same type }
                      not(
                      not(
@@ -244,8 +244,8 @@ implementation
                    { process cargs arrayconstructor }
                    { process cargs arrayconstructor }
                    if is_array_constructor(p^.left^.resulttype) and
                    if is_array_constructor(p^.left^.resulttype) and
                       assigned(aktcallprocsym) and
                       assigned(aktcallprocsym) and
-                      (aktcallprocsym^.definition^.options and pocdecl<>0) and
-                      (aktcallprocsym^.definition^.options and poexternal<>0) then
+                      (pocall_cdecl in aktcallprocsym^.definition^.proccalloptions) and
+                      (po_external in aktcallprocsym^.definition^.procoptions) then
                     begin
                     begin
                       p^.left^.cargs:=true;
                       p^.left^.cargs:=true;
                       old_array_constructor:=allow_array_constructor;
                       old_array_constructor:=allow_array_constructor;
@@ -434,18 +434,22 @@ implementation
 
 
          inlined:=false;
          inlined:=false;
          if assigned(p^.procdefinition) and
          if assigned(p^.procdefinition) and
-            ((p^.procdefinition^.options and poinline)<>0) then
+            (pocall_inline in p^.procdefinition^.proccalloptions) then
            begin
            begin
               inlinecode:=p^.right;
               inlinecode:=p^.right;
               if assigned(inlinecode) then
               if assigned(inlinecode) then
                 begin
                 begin
                    inlined:=true;
                    inlined:=true;
-                   p^.procdefinition^.options:=p^.procdefinition^.options and (not poinline);
+{$ifdef INCLUDEOK}
+                   exclude(p^.procdefinition^.proccalloptions,pocall_inline);
+{$else}
+                   p^.procdefinition^.proccalloptions:=p^.procdefinition^.proccalloptions-[pocall_inline];
+{$endif}
                 end;
                 end;
               p^.right:=nil;
               p^.right:=nil;
            end;
            end;
          if assigned(p^.procdefinition) and
          if assigned(p^.procdefinition) and
-            ((p^.procdefinition^.options and pocontainsself)<>0) then
+            (po_containsself in p^.procdefinition^.procoptions) then
            message(cg_e_cannot_call_message_direct);
            message(cg_e_cannot_call_message_direct);
 
 
          { procedure variable ? }
          { procedure variable ? }
@@ -962,11 +966,11 @@ implementation
 {$endif CHAINPROCSYMS}
 {$endif CHAINPROCSYMS}
                end; { end of procedure to call determination }
                end; { end of procedure to call determination }
 
 
-              is_const:=((p^.procdefinition^.options and pointernconst)<>0) and
+              is_const:=(pocall_internconst in p^.procdefinition^.proccalloptions) and
                         ((block_type=bt_const) or
                         ((block_type=bt_const) or
                          (assigned(p^.left) and (p^.left^.left^.treetype in [realconstn,ordconstn])));
                          (assigned(p^.left) and (p^.left^.left^.treetype in [realconstn,ordconstn])));
               { handle predefined procedures }
               { handle predefined procedures }
-              if ((p^.procdefinition^.options and pointernproc)<>0) or is_const then
+              if (pocall_internproc in p^.procdefinition^.proccalloptions) or is_const then
                 begin
                 begin
                    if assigned(p^.left) then
                    if assigned(p^.left) then
                      begin
                      begin
@@ -992,7 +996,7 @@ implementation
                 { no intern procedure => we do a call }
                 { no intern procedure => we do a call }
               { calc the correture value for the register }
               { calc the correture value for the register }
               { handle predefined procedures }
               { handle predefined procedures }
-              if (p^.procdefinition^.options and poinline)<>0 then
+              if (pocall_inline in p^.procdefinition^.proccalloptions) then
                 begin
                 begin
                    if assigned(p^.methodpointer) then
                    if assigned(p^.methodpointer) then
                      CGMessage(cg_e_unable_inline_object_methods);
                      CGMessage(cg_e_unable_inline_object_methods);
@@ -1009,7 +1013,11 @@ implementation
                           begin
                           begin
                              { consider it has not inlined if called
                              { consider it has not inlined if called
                                again inside the args }
                                again inside the args }
-                             p^.procdefinition^.options:=p^.procdefinition^.options and (not poinline);
+{$ifdef INCLUDEOK}
+                             exclude(p^.procdefinition^.proccalloptions,pocall_inline);
+{$else}
+                             p^.procdefinition^.proccalloptions:=p^.procdefinition^.proccalloptions-[pocall_inline];
+{$endif}
                              firstpass(inlinecode);
                              firstpass(inlinecode);
                              inlined:=true;
                              inlined:=true;
                           end;
                           end;
@@ -1047,7 +1055,7 @@ implementation
          { get a register for the return value }
          { get a register for the return value }
          if (p^.resulttype<>pdef(voiddef)) then
          if (p^.resulttype<>pdef(voiddef)) then
            begin
            begin
-              if (p^.procdefinition^.options and poconstructor)<>0 then
+              if (p^.procdefinition^.proctypeoption=potype_constructor) then
                 begin
                 begin
                    { extra handling of classes }
                    { extra handling of classes }
                    { p^.methodpointer should be assigned! }
                    { p^.methodpointer should be assigned! }
@@ -1109,7 +1117,7 @@ implementation
                 typen,hnewn : ;
                 typen,hnewn : ;
                 else
                 else
                   begin
                   begin
-                     if ((p^.procdefinition^.options and (poconstructor or podestructor)) <> 0) and
+                     if (p^.procdefinition^.proctypeoption in [potype_constructor,potype_destructor]) and
                         assigned(p^.symtable) and (p^.symtable^.symtabletype=withsymtable) and
                         assigned(p^.symtable) and (p^.symtable^.symtabletype=withsymtable) and
                         not pwithsymtable(p^.symtable)^.direct_with then
                         not pwithsymtable(p^.symtable)^.direct_with then
                        begin
                        begin
@@ -1120,9 +1128,9 @@ implementation
 
 
                      { R.Assign is not a constructor !!! }
                      { R.Assign is not a constructor !!! }
                      { but for R^.Assign, R must be valid !! }
                      { but for R^.Assign, R must be valid !! }
-                     if ((p^.procdefinition^.options and poconstructor) <> 0) or
+                     if (p^.procdefinition^.proctypeoption=potype_constructor) or
                         ((p^.methodpointer^.treetype=loadn) and
                         ((p^.methodpointer^.treetype=loadn) and
-                        ((pobjectdef(p^.methodpointer^.resulttype)^.options and oo_hasvirtual) = 0)) then
+                        (not(oo_has_virtual in pobjectdef(p^.methodpointer^.resulttype)^.objectoptions))) then
                        must_be_valid:=false
                        must_be_valid:=false
                      else
                      else
                        must_be_valid:=true;
                        must_be_valid:=true;
@@ -1162,7 +1170,11 @@ implementation
          if assigned(procs) then
          if assigned(procs) then
            dispose(procs);
            dispose(procs);
          if inlined then
          if inlined then
-           p^.procdefinition^.options:=p^.procdefinition^.options or poinline;
+{$ifdef INCLUDEOK}
+           include(p^.procdefinition^.proccalloptions,pocall_inline);
+{$else}
+           p^.procdefinition^.proccalloptions:=p^.procdefinition^.proccalloptions+[pocall_inline];
+{$endif}
          aktcallprocsym:=oldcallprocsym;
          aktcallprocsym:=oldcallprocsym;
          must_be_valid:=store_valid;
          must_be_valid:=store_valid;
       end;
       end;
@@ -1183,7 +1195,11 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.54  1999-07-01 21:33:58  peter
+  Revision 1.55  1999-08-03 22:03:27  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.54  1999/07/01 21:33:58  peter
     * merged
     * merged
 
 
   Revision 1.53  1999/06/29 14:02:33  peter
   Revision 1.53  1999/06/29 14:02:33  peter

+ 13 - 9
compiler/tccnv.pas

@@ -41,7 +41,7 @@ implementation
    uses
    uses
       globtype,systems,tokens,
       globtype,systems,tokens,
       cobjects,verbose,globals,
       cobjects,verbose,globals,
-      symtable,aasm,types,
+      symconst,symtable,aasm,types,
       hcodegen,htypechk,pass_1
       hcodegen,htypechk,pass_1
 {$ifdef i386}
 {$ifdef i386}
       ,i386base
       ,i386base
@@ -819,7 +819,7 @@ implementation
                { the conversion into a strutured type is only }
                { the conversion into a strutured type is only }
                { possible, if the source is no register    }
                { possible, if the source is no register    }
                if ((p^.resulttype^.deftype in [recorddef,stringdef,arraydef]) or
                if ((p^.resulttype^.deftype in [recorddef,stringdef,arraydef]) or
-                   ((p^.resulttype^.deftype=objectdef) and not(pobjectdef(p^.resulttype)^.isclass))
+                   ((p^.resulttype^.deftype=objectdef) and not(pobjectdef(p^.resulttype)^.is_class))
                   ) and (p^.left^.location.loc in [LOC_REGISTER,LOC_CREGISTER]) { and
                   ) and (p^.left^.location.loc in [LOC_REGISTER,LOC_CREGISTER]) { and
                    it also works if the assignment is overloaded
                    it also works if the assignment is overloaded
                    YES but this code is not executed if assignment is overloaded (PM)
                    YES but this code is not executed if assignment is overloaded (PM)
@@ -870,13 +870,13 @@ implementation
 
 
          { left must be a class }
          { left must be a class }
          if (p^.left^.resulttype^.deftype<>objectdef) or
          if (p^.left^.resulttype^.deftype<>objectdef) or
-            not(pobjectdef(p^.left^.resulttype)^.isclass) then
+            not(pobjectdef(p^.left^.resulttype)^.is_class) then
            CGMessage(type_e_mismatch);
            CGMessage(type_e_mismatch);
 
 
          { the operands must be related }
          { the operands must be related }
-         if (not(pobjectdef(p^.left^.resulttype)^.isrelated(
+         if (not(pobjectdef(p^.left^.resulttype)^.is_related(
            pobjectdef(pclassrefdef(p^.right^.resulttype)^.definition)))) and
            pobjectdef(pclassrefdef(p^.right^.resulttype)^.definition)))) and
-           (not(pobjectdef(pclassrefdef(p^.right^.resulttype)^.definition)^.isrelated(
+           (not(pobjectdef(pclassrefdef(p^.right^.resulttype)^.definition)^.is_related(
            pobjectdef(p^.left^.resulttype)))) then
            pobjectdef(p^.left^.resulttype)))) then
            CGMessage(type_e_mismatch);
            CGMessage(type_e_mismatch);
 
 
@@ -908,13 +908,13 @@ implementation
 
 
          { left must be a class }
          { left must be a class }
          if (p^.left^.resulttype^.deftype<>objectdef) or
          if (p^.left^.resulttype^.deftype<>objectdef) or
-           not(pobjectdef(p^.left^.resulttype)^.isclass) then
+           not(pobjectdef(p^.left^.resulttype)^.is_class) then
            CGMessage(type_e_mismatch);
            CGMessage(type_e_mismatch);
 
 
          { the operands must be related }
          { the operands must be related }
-         if (not(pobjectdef(p^.left^.resulttype)^.isrelated(
+         if (not(pobjectdef(p^.left^.resulttype)^.is_related(
            pobjectdef(pclassrefdef(p^.right^.resulttype)^.definition)))) and
            pobjectdef(pclassrefdef(p^.right^.resulttype)^.definition)))) and
-           (not(pobjectdef(pclassrefdef(p^.right^.resulttype)^.definition)^.isrelated(
+           (not(pobjectdef(pclassrefdef(p^.right^.resulttype)^.definition)^.is_related(
            pobjectdef(p^.left^.resulttype)))) then
            pobjectdef(p^.left^.resulttype)))) then
            CGMessage(type_e_mismatch);
            CGMessage(type_e_mismatch);
 
 
@@ -926,7 +926,11 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.41  1999-06-30 22:16:23  florian
+  Revision 1.42  1999-08-03 22:03:28  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.41  1999/06/30 22:16:23  florian
     * use of is_ordinal checked: often a qword/int64 isn't allowed (case/for ...)
     * use of is_ordinal checked: often a qword/int64 isn't allowed (case/for ...)
     * small qword problems fixed
     * small qword problems fixed
 
 

+ 6 - 2
compiler/tccon.pas

@@ -38,7 +38,7 @@ implementation
 
 
     uses
     uses
       cobjects,verbose,globals,systems,
       cobjects,verbose,globals,systems,
-      symtable,aasm,types,
+      symconst,symtable,aasm,types,
       hcodegen,pass_1
       hcodegen,pass_1
 {$ifdef i386}
 {$ifdef i386}
       ,i386base
       ,i386base
@@ -126,7 +126,11 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.6  1999-05-27 19:45:16  peter
+  Revision 1.7  1999-08-03 22:03:29  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.6  1999/05/27 19:45:16  peter
     * removed oldasm
     * removed oldasm
     * plabel -> pasmlabel
     * plabel -> pasmlabel
     * -a switches to source writing automaticly
     * -a switches to source writing automaticly

+ 11 - 8
compiler/tcflw.pas

@@ -74,12 +74,11 @@ implementation
          firstpass(p^.left);
          firstpass(p^.left);
          if codegenerror then
          if codegenerror then
            exit;
            exit;
-         if not((p^.left^.resulttype^.deftype=orddef) and
-            (porddef(p^.left^.resulttype)^.typ in [bool8bit,bool16bit,bool32bit])) then
-            begin
-               CGMessage(type_e_mismatch);
-               exit;
-            end;
+         if not is_boolean(p^.left^.resulttype) then
+           begin
+             CGMessage(type_e_mismatch);
+             exit;
+           end;
 
 
          p^.registers32:=p^.left^.registers32;
          p^.registers32:=p^.left^.registers32;
          p^.registersfpu:=p^.left^.registersfpu;
          p^.registersfpu:=p^.left^.registersfpu;
@@ -381,7 +380,7 @@ implementation
 
 
               { this must be a _class_ }
               { this must be a _class_ }
               if (p^.left^.resulttype^.deftype<>objectdef) or
               if (p^.left^.resulttype^.deftype<>objectdef) or
-                ((pobjectdef(p^.left^.resulttype)^.options and oo_is_class)=0) then
+                 not(pobjectdef(p^.left^.resulttype)^.is_class) then
                 CGMessage(type_e_mismatch);
                 CGMessage(type_e_mismatch);
 
 
               p^.registersfpu:=p^.left^.registersfpu;
               p^.registersfpu:=p^.left^.registersfpu;
@@ -493,7 +492,11 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.13  1999-08-01 18:28:15  florian
+  Revision 1.14  1999-08-03 22:03:30  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.13  1999/08/01 18:28:15  florian
     * modifications for the new code generator
     * modifications for the new code generator
 
 
   Revision 1.12  1999/06/30 22:16:25  florian
   Revision 1.12  1999/06/30 22:16:25  florian

+ 9 - 5
compiler/tcinl.pas

@@ -34,7 +34,7 @@ implementation
     uses
     uses
       cobjects,verbose,globals,systems,
       cobjects,verbose,globals,systems,
       globtype,
       globtype,
-      symtable,aasm,types,
+      symconst,symtable,aasm,types,
       hcodegen,htypechk,pass_1,
       hcodegen,htypechk,pass_1,
       tccal
       tccal
 {$ifdef i386}
 {$ifdef i386}
@@ -668,7 +668,7 @@ implementation
                                           case porddef(hp^.left^.resulttype)^.typ of
                                           case porddef(hp^.left^.resulttype)^.typ of
                                             uchar,
                                             uchar,
                                             u32bit,s32bit,
                                             u32bit,s32bit,
-                                            u64bit,s64bitint:
+                                            u64bit,s64bit:
                                               ;
                                               ;
                                             u8bit,s8bit,
                                             u8bit,s8bit,
                                             u16bit,s16bit :
                                             u16bit,s16bit :
@@ -823,7 +823,7 @@ implementation
                       begin
                       begin
                         case porddef(hp^.left^.resulttype)^.typ of
                         case porddef(hp^.left^.resulttype)^.typ of
                           u32bit,s32bit,
                           u32bit,s32bit,
-                          s64bitint,u64bit:
+                          s64bit,u64bit:
                             ;
                             ;
                           u8bit,s8bit,
                           u8bit,s8bit,
                           u16bit,s16bit:
                           u16bit,s16bit:
@@ -929,7 +929,7 @@ implementation
                            ((hpp^.left^.resulttype^.deftype = orddef) And
                            ((hpp^.left^.resulttype^.deftype = orddef) And
                             (POrdDef(hpp^.left^.resulttype)^.typ in
                             (POrdDef(hpp^.left^.resulttype)^.typ in
                               [u32bit,s32bit,
                               [u32bit,s32bit,
-                               u8bit,s8bit,u16bit,s16bit,s64bitint,u64bit])))
+                               u8bit,s8bit,u16bit,s16bit,s64bit,u64bit])))
                         Then CGMessage(type_e_mismatch);
                         Then CGMessage(type_e_mismatch);
                   must_be_valid:=true;
                   must_be_valid:=true;
                  {hp = source (String)}
                  {hp = source (String)}
@@ -1123,7 +1123,11 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.43  1999-07-30 12:28:43  peter
+  Revision 1.44  1999-08-03 22:03:32  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.43  1999/07/30 12:28:43  peter
     * fixed crash with unknown id and colon parameter in write
     * fixed crash with unknown id and colon parameter in write
 
 
   Revision 1.42  1999/07/18 14:47:35  florian
   Revision 1.42  1999/07/18 14:47:35  florian

+ 35 - 20
compiler/tcld.pas

@@ -38,7 +38,7 @@ implementation
 
 
     uses
     uses
       cobjects,verbose,globals,systems,
       cobjects,verbose,globals,systems,
-      symtable,aasm,types,
+      symconst,symtable,aasm,types,
       hcodegen,htypechk,pass_1,
       hcodegen,htypechk,pass_1,
       tccnv
       tccnv
 {$ifdef i386}
 {$ifdef i386}
@@ -120,8 +120,11 @@ implementation
                         begin
                         begin
                           p^.registers32:=1;
                           p^.registers32:=1;
                           { further, the variable can't be put into a register }
                           { further, the variable can't be put into a register }
-                          pvarsym(p^.symtableentry)^.var_options:=
-                            pvarsym(p^.symtableentry)^.var_options and not vo_regable;
+{$ifdef INCLUDEOK}
+                          exclude(pvarsym(p^.symtableentry)^.varoptions,vo_regable);
+{$else}
+                          pvarsym(p^.symtableentry)^.varoptions:=pvarsym(p^.symtableentry)^.varoptions-[vo_regable];
+{$endif}
                         end;
                         end;
                      end;
                      end;
                    if (pvarsym(p^.symtableentry)^.varspez=vs_const) then
                    if (pvarsym(p^.symtableentry)^.varspez=vs_const) then
@@ -136,7 +139,7 @@ implementation
                    if p^.symtable^.symtabletype=withsymtable then
                    if p^.symtable^.symtabletype=withsymtable then
                      inc(p^.registers32);
                      inc(p^.registers32);
 
 
-                   if (pvarsym(p^.symtableentry)^.var_options and (vo_is_thread_var or vo_is_dll_var))<>0 then
+                   if ([vo_is_thread_var,vo_is_dll_var]*pvarsym(p^.symtableentry)^.varoptions)<>[] then
                      p^.registers32:=1;
                      p^.registers32:=1;
                    { a class variable is a pointer !!!
                    { a class variable is a pointer !!!
                      yes, but we have to resolve the reference in an
                      yes, but we have to resolve the reference in an
@@ -151,24 +154,25 @@ implementation
 
 
                    if must_be_valid and p^.is_first then
                    if must_be_valid and p^.is_first then
                      begin
                      begin
-                     if pvarsym(p^.symtableentry)^.is_valid=2 then
-                       if (assigned(pvarsym(p^.symtableentry)^.owner) and assigned(aktprocsym)
-                       and (pvarsym(p^.symtableentry)^.owner = aktprocsym^.definition^.localst)) then
-                       begin
-                          if p^.symtable^.symtabletype=localsymtable then
+                       if pvarsym(p^.symtableentry)^.varstate=vs_declared2 then
+                        if (assigned(pvarsym(p^.symtableentry)^.owner) and
+                           assigned(aktprocsym) and
+                           (pvarsym(p^.symtableentry)^.owner = aktprocsym^.definition^.localst)) then
+                         begin
+                           if p^.symtable^.symtabletype=localsymtable then
                             CGMessage1(sym_n_uninitialized_local_variable,pvarsym(p^.symtableentry)^.name)
                             CGMessage1(sym_n_uninitialized_local_variable,pvarsym(p^.symtableentry)^.name)
-                          else
+                           else
                             CGMessage1(sym_n_uninitialized_variable,pvarsym(p^.symtableentry)^.name);
                             CGMessage1(sym_n_uninitialized_variable,pvarsym(p^.symtableentry)^.name);
-                       end;
+                         end;
                      end;
                      end;
                    if count_ref then
                    if count_ref then
                      begin
                      begin
                         if (p^.is_first) then
                         if (p^.is_first) then
                           begin
                           begin
-                             if (pvarsym(p^.symtableentry)^.is_valid=2) then
-                               pvarsym(p^.symtableentry)^.is_valid:=1;
-                              p^.is_first:=false;
-                           end;
+                            if pvarsym(p^.symtableentry)^.varstate=vs_declared2 then
+                             pvarsym(p^.symtableentry)^.varstate:=vs_used;
+                            p^.is_first:=false;
+                          end;
                      end;
                      end;
                      { this will create problem with local var set by
                      { this will create problem with local var set by
                      under_procedures
                      under_procedures
@@ -181,8 +185,8 @@ implementation
                      inc(pvarsym(p^.symtableentry)^.refs,t_times);
                      inc(pvarsym(p^.symtableentry)^.refs,t_times);
                 end;
                 end;
             typedconstsym :
             typedconstsym :
-              if not p^.is_absolute then
-                     p^.resulttype:=ptypedconstsym(p^.symtableentry)^.definition;
+                if not p^.is_absolute then
+                  p^.resulttype:=ptypedconstsym(p^.symtableentry)^.definition;
             procsym :
             procsym :
                 begin
                 begin
                    if assigned(pprocsym(p^.symtableentry)^.definition^.nextoverloaded) then
                    if assigned(pprocsym(p^.symtableentry)^.definition^.nextoverloaded) then
@@ -253,7 +257,7 @@ implementation
                   at_minus : p^.right:=gennode(subn,getcopy(p^.left),p^.right);
                   at_minus : p^.right:=gennode(subn,getcopy(p^.left),p^.right);
                   at_star  : p^.right:=gennode(muln,getcopy(p^.left),p^.right);
                   at_star  : p^.right:=gennode(muln,getcopy(p^.left),p^.right);
                   at_slash : p^.right:=gennode(slashn,getcopy(p^.left),p^.right);
                   at_slash : p^.right:=gennode(slashn,getcopy(p^.left),p^.right);
-                  end;
+                end;
            end;
            end;
 {$endif i386}
 {$endif i386}
          must_be_valid:=true;
          must_be_valid:=true;
@@ -263,7 +267,6 @@ implementation
            exit;
            exit;
 
 
          { some string functions don't need conversion, so treat them separatly }
          { some string functions don't need conversion, so treat them separatly }
-
          if is_shortstring(p^.left^.resulttype) and (assigned(p^.right^.resulttype)) then
          if is_shortstring(p^.left^.resulttype) and (assigned(p^.right^.resulttype)) then
           begin
           begin
             if not (is_shortstring(p^.right^.resulttype) or
             if not (is_shortstring(p^.right^.resulttype) or
@@ -302,6 +305,14 @@ implementation
              exit;
              exit;
           end;
           end;
 
 
+         { set assigned flag for varsyms }
+         if (p^.left^.treetype=loadn) and
+            (p^.left^.symtableentry^.typ=varsym) and
+            (pvarsym(p^.left^.symtableentry)^.varstate=vs_declared) then
+           pvarsym(p^.left^.symtableentry)^.varstate:=vs_assigned;
+
+
+
          p^.resulttype:=voiddef;
          p^.resulttype:=voiddef;
          {
          {
            p^.registers32:=max(p^.left^.registers32,p^.right^.registers32);
            p^.registers32:=max(p^.left^.registers32,p^.right^.registers32);
@@ -470,7 +481,11 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.36  1999-07-22 09:38:00  florian
+  Revision 1.37  1999-08-03 22:03:33  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.36  1999/07/22 09:38:00  florian
     + resourcestring implemented
     + resourcestring implemented
     + start of longstring support
     + start of longstring support
 
 

+ 11 - 7
compiler/tcmat.pas

@@ -37,7 +37,7 @@ implementation
     uses
     uses
       globtype,systems,tokens,
       globtype,systems,tokens,
       cobjects,verbose,globals,
       cobjects,verbose,globals,
-      symtable,aasm,types,
+      symconst,symtable,aasm,types,
       hcodegen,htypechk,pass_1
       hcodegen,htypechk,pass_1
 {$ifdef i386}
 {$ifdef i386}
       ,i386base
       ,i386base
@@ -89,16 +89,16 @@ implementation
            begin
            begin
               rd:=p^.right^.resulttype;
               rd:=p^.right^.resulttype;
               ld:=p^.left^.resulttype;
               ld:=p^.left^.resulttype;
-              if (porddef(rd)^.typ=s64bitint) or (porddef(ld)^.typ=s64bitint) then
+              if (porddef(rd)^.typ=s64bit) or (porddef(ld)^.typ=s64bit) then
                 begin
                 begin
-                   if (porddef(ld)^.typ<>s64bitint) then
+                   if (porddef(ld)^.typ<>s64bit) then
                      begin
                      begin
-                       p^.left:=gentypeconvnode(p^.left,cs64bitintdef);
+                       p^.left:=gentypeconvnode(p^.left,cs64bitdef);
                        firstpass(p^.left);
                        firstpass(p^.left);
                      end;
                      end;
-                   if (porddef(rd)^.typ<>s64bitint) then
+                   if (porddef(rd)^.typ<>s64bit) then
                      begin
                      begin
-                        p^.right:=gentypeconvnode(p^.right,cs64bitintdef);
+                        p^.right:=gentypeconvnode(p^.right,cs64bitdef);
                         firstpass(p^.right);
                         firstpass(p^.right);
                      end;
                      end;
                    calcregisters(p,2,0,0);
                    calcregisters(p,2,0,0);
@@ -413,7 +413,11 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.16  1999-06-02 10:11:54  florian
+  Revision 1.17  1999-08-03 22:03:34  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.16  1999/06/02 10:11:54  florian
     * make cycle fixed i.e. compilation with 0.99.10
     * make cycle fixed i.e. compilation with 0.99.10
     * some fixes for qword
     * some fixes for qword
     * start of register calling conventions
     * start of register calling conventions

+ 18 - 9
compiler/tcmem.pas

@@ -45,7 +45,7 @@ implementation
     uses
     uses
       globtype,systems,
       globtype,systems,
       cobjects,verbose,globals,
       cobjects,verbose,globals,
-      symtable,aasm,types,
+      symconst,symtable,aasm,types,
       hcodegen,htypechk,pass_1
       hcodegen,htypechk,pass_1
 {$ifdef i386}
 {$ifdef i386}
       ,i386base
       ,i386base
@@ -195,7 +195,7 @@ implementation
                         begin
                         begin
                           { generate a methodcallnode or proccallnode }
                           { generate a methodcallnode or proccallnode }
                           if (p^.left^.symtableprocentry^.owner^.symtabletype=objectsymtable) and
                           if (p^.left^.symtableprocentry^.owner^.symtabletype=objectsymtable) and
-                             (pobjectdef(p^.left^.symtableprocentry^.owner^.defowner)^.isclass) then
+                             (pobjectdef(p^.left^.symtableprocentry^.owner^.defowner)^.is_class) then
                            begin
                            begin
                              hp:=genloadmethodcallnode(pprocsym(p^.left^.symtableprocentry),p^.left^.symtableproc,
                              hp:=genloadmethodcallnode(pprocsym(p^.left^.symtableprocentry),p^.left^.symtableproc,
                                getcopy(p^.left^.methodpointer));
                                getcopy(p^.left^.methodpointer));
@@ -221,14 +221,19 @@ implementation
                         else
                         else
                          hp3:=pabstractprocdef(pprocsym(p^.left^.symtableprocentry)^.definition);
                          hp3:=pabstractprocdef(pprocsym(p^.left^.symtableprocentry)^.definition);
 
 
-                        pprocvardef(p^.resulttype)^.options:=hp3^.options;
+                        pprocvardef(p^.resulttype)^.proctypeoption:=hp3^.proctypeoption;
+                        pprocvardef(p^.resulttype)^.proccalloptions:=hp3^.proccalloptions;
+                        pprocvardef(p^.resulttype)^.procoptions:=hp3^.procoptions;
                         pprocvardef(p^.resulttype)^.retdef:=hp3^.retdef;
                         pprocvardef(p^.resulttype)^.retdef:=hp3^.retdef;
 
 
                       { method ? then set the methodpointer flag }
                       { method ? then set the methodpointer flag }
                         if (hp3^.owner^.symtabletype=objectsymtable) and
                         if (hp3^.owner^.symtabletype=objectsymtable) and
-                           (pobjectdef(hp3^.owner^.defowner)^.isclass) then
-                          pprocvardef(p^.resulttype)^.options:=pprocvardef(p^.resulttype)^.options or pomethodpointer;
-
+                           (pobjectdef(hp3^.owner^.defowner)^.is_class) then
+{$ifdef INCLUDEOK}
+                          include(pprocvardef(p^.resulttype)^.procoptions,po_methodpointer);
+{$else}
+                          pprocvardef(p^.resulttype)^.procoptions:=pprocvardef(p^.resulttype)^.procoptions+[po_methodpointer];
+{$endif}
                         hp2:=hp3^.para1;
                         hp2:=hp3^.para1;
                         while assigned(hp2) do
                         while assigned(hp2) do
                           begin
                           begin
@@ -383,7 +388,7 @@ implementation
 {$endif SUPPORT_MMX}
 {$endif SUPPORT_MMX}
          { classes must be dereferenced implicit }
          { classes must be dereferenced implicit }
          if (p^.left^.resulttype^.deftype=objectdef) and
          if (p^.left^.resulttype^.deftype=objectdef) and
-           pobjectdef(p^.left^.resulttype)^.isclass then
+           pobjectdef(p^.left^.resulttype)^.is_class then
            begin
            begin
               if p^.registers32=0 then
               if p^.registers32=0 then
                 p^.registers32:=1;
                 p^.registers32:=1;
@@ -541,7 +546,7 @@ implementation
       begin
       begin
          if (p^.resulttype^.deftype=classrefdef) or
          if (p^.resulttype^.deftype=classrefdef) or
            ((p^.resulttype^.deftype=objectdef)
            ((p^.resulttype^.deftype=objectdef)
-             and pobjectdef(p^.resulttype)^.isclass
+             and pobjectdef(p^.resulttype)^.is_class
            ) then
            ) then
            p^.location.loc:=LOC_CREGISTER
            p^.location.loc:=LOC_CREGISTER
          else
          else
@@ -591,7 +596,11 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.21  1999-07-16 10:04:39  peter
+  Revision 1.22  1999-08-03 22:03:35  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.21  1999/07/16 10:04:39  peter
     * merged
     * merged
 
 
   Revision 1.20  1999/07/05 20:25:41  peter
   Revision 1.20  1999/07/05 20:25:41  peter

+ 6 - 2
compiler/tcset.pas

@@ -37,7 +37,7 @@ implementation
     uses
     uses
       globtype,systems,
       globtype,systems,
       cobjects,verbose,globals,
       cobjects,verbose,globals,
-      symtable,aasm,types,
+      symconst,symtable,aasm,types,
       hcodegen,htypechk,pass_1,
       hcodegen,htypechk,pass_1,
       tccnv
       tccnv
 {$ifdef i386}
 {$ifdef i386}
@@ -255,7 +255,11 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.10  1999-05-27 19:45:25  peter
+  Revision 1.11  1999-08-03 22:03:38  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.10  1999/05/27 19:45:25  peter
     * removed oldasm
     * removed oldasm
     * plabel -> pasmlabel
     * plabel -> pasmlabel
     * -a switches to source writing automaticly
     * -a switches to source writing automaticly

+ 7 - 1
compiler/tokens.pas

@@ -195,6 +195,7 @@ type
     _INTERNCONST,
     _INTERNCONST,
     _SHORTSTRING,
     _SHORTSTRING,
     _FINALIZATION,
     _FINALIZATION,
+    _SAVEREGISTERS,
     _IMPLEMENTATION,
     _IMPLEMENTATION,
     _INITIALIZATION,
     _INITIALIZATION,
     _RESOURCESTRING
     _RESOURCESTRING
@@ -375,6 +376,7 @@ const
       (str:'INTERNCONST'   ;special:false;keyword:m_none),
       (str:'INTERNCONST'   ;special:false;keyword:m_none),
       (str:'SHORTSTRING'   ;special:false;keyword:m_none),
       (str:'SHORTSTRING'   ;special:false;keyword:m_none),
       (str:'FINALIZATION'  ;special:false;keyword:m_initfinal),
       (str:'FINALIZATION'  ;special:false;keyword:m_initfinal),
+      (str:'SAVEREGISTERS' ;special:false;keyword:m_none),
       (str:'IMPLEMENTATION';special:false;keyword:m_all),
       (str:'IMPLEMENTATION';special:false;keyword:m_all),
       (str:'INITIALIZATION';special:false;keyword:m_initfinal),
       (str:'INITIALIZATION';special:false;keyword:m_initfinal),
       (str:'RESOURCESTRING';special:false;keyword:m_class)
       (str:'RESOURCESTRING';special:false;keyword:m_class)
@@ -385,7 +387,11 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.9  1999-07-22 09:38:01  florian
+  Revision 1.10  1999-08-03 22:03:39  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.9  1999/07/22 09:38:01  florian
     + resourcestring implemented
     + resourcestring implemented
     + start of longstring support
     + start of longstring support
 
 

+ 7 - 2
compiler/tree.pas

@@ -29,7 +29,8 @@ unit tree;
   interface
   interface
 
 
     uses
     uses
-       globtype,cobjects,symtable,aasm
+       globtype,cobjects,
+       symconst,symtable,aasm
 {$ifdef i386}
 {$ifdef i386}
        ,i386base
        ,i386base
 {$endif}
 {$endif}
@@ -1730,7 +1731,11 @@ unit tree;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.84  1999-07-27 23:42:24  peter
+  Revision 1.85  1999-08-03 22:03:40  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.84  1999/07/27 23:42:24  peter
     * indirect type referencing is now allowed
     * indirect type referencing is now allowed
 
 
   Revision 1.83  1999/05/27 19:45:29  peter
   Revision 1.83  1999/05/27 19:45:29  peter

+ 47 - 37
compiler/types.pas

@@ -168,7 +168,7 @@ implementation
 
 
     uses
     uses
        strings,globtype,globals,htypechk,
        strings,globtype,globals,htypechk,
-       tree,verbose;
+       tree,verbose,symconst;
 
 
 
 
     function equal_paras(def1,def2 : pdefcoll;value_equal_const : boolean) : boolean;
     function equal_paras(def1,def2 : pdefcoll;value_equal_const : boolean) : boolean;
@@ -245,6 +245,8 @@ implementation
 
 
     { true if a function can be assigned to a procvar }
     { true if a function can be assigned to a procvar }
     function proc_to_procvar_equal(def1:pprocdef;def2:pprocvardef) : boolean;
     function proc_to_procvar_equal(def1:pprocdef;def2:pprocvardef) : boolean;
+      const
+        po_comp = po_compatibility_options-[po_methodpointer];
       var
       var
         ismethod : boolean;
         ismethod : boolean;
       begin
       begin
@@ -255,9 +257,9 @@ implementation
          ismethod:=assigned(def1^.owner) and
          ismethod:=assigned(def1^.owner) and
                    (def1^.owner^.symtabletype=objectsymtable) and
                    (def1^.owner^.symtabletype=objectsymtable) and
                    assigned(def1^.owner^.defowner) and
                    assigned(def1^.owner^.defowner) and
-                   (pobjectdef(def1^.owner^.defowner)^.isclass);
-         if (ismethod and not ((def2^.options and pomethodpointer)<>0)) or
-            (not(ismethod) and ((def2^.options and pomethodpointer)<>0)) then
+                   (pobjectdef(def1^.owner^.defowner)^.is_class);
+         if (ismethod and not (po_methodpointer in def2^.procoptions)) or
+            (not(ismethod) and (po_methodpointer in def2^.procoptions)) then
           begin
           begin
             Message(type_e_no_method_and_procedure_not_compatible);
             Message(type_e_no_method_and_procedure_not_compatible);
             exit;
             exit;
@@ -267,8 +269,7 @@ implementation
          if is_equal(def1^.retdef,def2^.retdef) and
          if is_equal(def1^.retdef,def2^.retdef) and
             (equal_paras(def1^.para1,def2^.para1,false) or
             (equal_paras(def1^.para1,def2^.para1,false) or
              convertable_paras(def1^.para1,def2^.para1,false)) and
              convertable_paras(def1^.para1,def2^.para1,false)) and
-            ((def1^.options and (po_compatibility_options-pomethodpointer))=
-             (def2^.options and (po_compatibility_options-pomethodpointer))) then
+            ((po_comp * def1^.procoptions)= (po_comp * def2^.procoptions)) then
            proc_to_procvar_equal:=true
            proc_to_procvar_equal:=true
          else
          else
            proc_to_procvar_equal:=false;
            proc_to_procvar_equal:=false;
@@ -288,14 +289,18 @@ implementation
          dt : tbasetype;
          dt : tbasetype;
       begin
       begin
          case def^.deftype of
          case def^.deftype of
-          orddef : begin
-                     dt:=porddef(def)^.typ;
-                     is_ordinal:=dt in [uchar,u8bit,u16bit,u32bit,u64bit,s8bit,s16bit,s32bit,
-                       s64bitint,bool8bit,bool16bit,bool32bit];
-                   end;
-         enumdef : is_ordinal:=true;
-         else
-           is_ordinal:=false;
+           orddef :
+             begin
+               dt:=porddef(def)^.typ;
+               is_ordinal:=dt in [uchar,
+                                  u8bit,u16bit,u32bit,u64bit,
+                                  s8bit,s16bit,s32bit,s64bit,
+                                  bool8bit,bool16bit,bool32bit];
+             end;
+           enumdef :
+             is_ordinal:=true;
+           else
+             is_ordinal:=false;
          end;
          end;
       end;
       end;
 
 
@@ -304,12 +309,12 @@ implementation
     function get_min_value(def : pdef) : longint;
     function get_min_value(def : pdef) : longint;
       begin
       begin
          case def^.deftype of
          case def^.deftype of
-            orddef:
-                get_min_value:=porddef(def)^.low;
-            enumdef:
-                get_min_value:=penumdef(def)^.min;
-         else
-            get_min_value:=0;
+           orddef:
+             get_min_value:=porddef(def)^.low;
+           enumdef:
+             get_min_value:=penumdef(def)^.min;
+           else
+             get_min_value:=0;
          end;
          end;
       end;
       end;
 
 
@@ -318,8 +323,8 @@ implementation
     function is_integer(def : pdef) : boolean;
     function is_integer(def : pdef) : boolean;
       begin
       begin
         is_integer:=(def^.deftype=orddef) and
         is_integer:=(def^.deftype=orddef) and
-                    (porddef(def)^.typ in [uauto,u8bit,u16bit,u32bit,s8bit,
-                                           s16bit,s32bit,u64bit,s64bitint]);
+                    (porddef(def)^.typ in [uauto,u8bit,u16bit,u32bit,u64bit,
+                                           s8bit,s16bit,s32bit,s64bit]);
       end;
       end;
 
 
 
 
@@ -348,7 +353,7 @@ implementation
            orddef :
            orddef :
              begin
              begin
                dt:=porddef(def)^.typ;
                dt:=porddef(def)^.typ;
-               is_signed:=(dt in [s8bit,s16bit,s32bit,s64bitint]);
+               is_signed:=(dt in [s8bit,s16bit,s32bit,s64bit]);
              end;
              end;
            enumdef :
            enumdef :
              is_signed:=false;
              is_signed:=false;
@@ -483,8 +488,8 @@ implementation
       begin
       begin
          ret_in_acc:=(def^.deftype in [orddef,pointerdef,enumdef,classrefdef]) or
          ret_in_acc:=(def^.deftype in [orddef,pointerdef,enumdef,classrefdef]) or
                      ((def^.deftype=stringdef) and (pstringdef(def)^.string_typ in [st_ansistring,st_widestring])) or
                      ((def^.deftype=stringdef) and (pstringdef(def)^.string_typ in [st_ansistring,st_widestring])) or
-                     ((def^.deftype=procvardef) and ((pprocvardef(def)^.options and pomethodpointer)=0)) or
-                     ((def^.deftype=objectdef) and pobjectdef(def)^.isclass) or
+                     ((def^.deftype=procvardef) and not(po_methodpointer in pprocvardef(def)^.procoptions)) or
+                     ((def^.deftype=objectdef) and pobjectdef(def)^.is_class) or
                      ((def^.deftype=setdef) and (psetdef(def)^.settype=smallset)) or
                      ((def^.deftype=setdef) and (psetdef(def)^.settype=smallset)) or
                      ((def^.deftype=floatdef) and (pfloatdef(def)^.typ=f32bit));
                      ((def^.deftype=floatdef) and (pfloatdef(def)^.typ=f32bit));
       end;
       end;
@@ -493,7 +498,7 @@ implementation
     { true, if def is a 64 bit int type }
     { true, if def is a 64 bit int type }
     function is_64bitint(def : pdef) : boolean;
     function is_64bitint(def : pdef) : boolean;
       begin
       begin
-         is_64bitint:=(def^.deftype=orddef) and (porddef(def)^.typ in [u64bit,s64bitint])
+         is_64bitint:=(def^.deftype=orddef) and (porddef(def)^.typ in [u64bit,s64bit])
       end;
       end;
 
 
 
 
@@ -502,16 +507,17 @@ implementation
       begin
       begin
          ret_in_param:=(def^.deftype in [arraydef,recorddef]) or
          ret_in_param:=(def^.deftype in [arraydef,recorddef]) or
            ((def^.deftype=stringdef) and (pstringdef(def)^.string_typ in [st_shortstring,st_longstring])) or
            ((def^.deftype=stringdef) and (pstringdef(def)^.string_typ in [st_shortstring,st_longstring])) or
-           ((def^.deftype=procvardef) and ((pprocvardef(def)^.options and pomethodpointer)<>0)) or
-           ((def^.deftype=objectdef) and not(pobjectdef(def)^.isclass)) or
+           ((def^.deftype=procvardef) and (po_methodpointer in pprocvardef(def)^.procoptions)) or
+           ((def^.deftype=objectdef) and not(pobjectdef(def)^.is_class)) or
            ((def^.deftype=setdef) and (psetdef(def)^.settype<>smallset));
            ((def^.deftype=setdef) and (psetdef(def)^.settype<>smallset));
       end;
       end;
 
 
 
 
     function push_high_param(def : pdef) : boolean;
     function push_high_param(def : pdef) : boolean;
       begin
       begin
-         push_high_param:=is_open_array(def) or is_open_string(def) or
-           is_array_of_const(def);
+         push_high_param:=is_open_array(def) or
+                          is_open_string(def) or
+                          is_array_of_const(def);
       end;
       end;
 
 
 
 
@@ -531,9 +537,9 @@ implementation
              )
              )
             )
             )
            ) or
            ) or
-           ((def^.deftype=objectdef) and not(pobjectdef(def)^.isclass)) or
+           ((def^.deftype=objectdef) and not(pobjectdef(def)^.is_class)) or
            ((def^.deftype=stringdef) and (pstringdef(def)^.string_typ in [st_shortstring,st_longstring])) or
            ((def^.deftype=stringdef) and (pstringdef(def)^.string_typ in [st_shortstring,st_longstring])) or
-           ((def^.deftype=procvardef) and ((pprocvardef(def)^.options and pomethodpointer)<>0)) or
+           ((def^.deftype=procvardef) and (po_methodpointer in pprocvardef(def)^.procoptions)) or
            ((def^.deftype=setdef) and (psetdef(def)^.settype<>smallset));
            ((def^.deftype=setdef) and (psetdef(def)^.settype<>smallset));
       end;
       end;
 
 
@@ -781,7 +787,7 @@ implementation
              begin
              begin
                 { here a problem detected in tabsolutesym }
                 { here a problem detected in tabsolutesym }
                 { the types can be forward type !!        }
                 { the types can be forward type !!        }
-                if assigned(def1^.sym) and ((def1^.sym^.properties and sp_forwarddef)<>0) then
+                if assigned(def1^.sym) and (sp_forwarddef in def1^.sym^.symoptions) then
                   b:=(def1^.sym=def2^.sym)
                   b:=(def1^.sym=def2^.sym)
                 else
                 else
                   b:=ppointerdef(def1)^.definition=ppointerdef(def2)^.definition;
                   b:=ppointerdef(def1)^.definition=ppointerdef(def2)^.definition;
@@ -851,8 +857,8 @@ implementation
                 { poassembler isn't important for compatibility }
                 { poassembler isn't important for compatibility }
                 { if a method is assigned to a methodpointer    }
                 { if a method is assigned to a methodpointer    }
                 { is checked before                             }
                 { is checked before                             }
-                b:=((pprocvardef(def1)^.options and po_compatibility_options)=
-                    (pprocvardef(def2)^.options and po_compatibility_options)) and
+                b:=((pprocvardef(def1)^.procoptions * po_compatibility_options)=
+                    (pprocvardef(def2)^.procoptions * po_compatibility_options)) and
                    is_equal(pprocvardef(def1)^.retdef,pprocvardef(def2)^.retdef);
                    is_equal(pprocvardef(def1)^.retdef,pprocvardef(def2)^.retdef);
                 { now evalute the parameters }
                 { now evalute the parameters }
                 if b then
                 if b then
@@ -898,7 +904,7 @@ implementation
            if (def1^.deftype=classrefdef) and (def2^.deftype=classrefdef) then
            if (def1^.deftype=classrefdef) and (def2^.deftype=classrefdef) then
              begin
              begin
                 { similar to pointerdef: }
                 { similar to pointerdef: }
-                if assigned(def1^.sym) and ((def1^.sym^.properties and sp_forwarddef)<>0) then
+                if assigned(def1^.sym) and (sp_forwarddef in def1^.sym^.symoptions) then
                   b:=(def1^.sym=def2^.sym)
                   b:=(def1^.sym=def2^.sym)
                 else
                 else
                   b:=is_equal(pclassrefdef(def1)^.definition,pclassrefdef(def2)^.definition);
                   b:=is_equal(pclassrefdef(def1)^.definition,pclassrefdef(def2)^.definition);
@@ -968,7 +974,11 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.78  1999-07-30 12:26:42  peter
+  Revision 1.79  1999-08-03 22:03:41  peter
+    * moved bitmask constants to sets
+    * some other type/const renamings
+
+  Revision 1.78  1999/07/30 12:26:42  peter
     * array is_equal disabled for tp,delphi mode
     * array is_equal disabled for tp,delphi mode
 
 
   Revision 1.77  1999/07/29 11:41:51  peter
   Revision 1.77  1999/07/29 11:41:51  peter

部分文件因为文件数量过多而无法显示