Bläddra i källkod

compiler: move objectoptions to tabstractrecorddef because it will be needed for records too

git-svn-id: branches/paul/extended_records@16541 -
paul 14 år sedan
förälder
incheckning
4f274b157c
3 ändrade filer med 9 tillägg och 7 borttagningar
  1. 1 1
      compiler/ppu.pas
  2. 4 4
      compiler/symdef.pas
  3. 4 2
      compiler/utils/ppudump.pp

+ 1 - 1
compiler/ppu.pas

@@ -43,7 +43,7 @@ type
 {$endif Test_Double_checksum}
 {$endif Test_Double_checksum}
 
 
 const
 const
-  CurrentPPUVersion = 122;
+  CurrentPPUVersion = 123;
 
 
 { buffer sizes }
 { buffer sizes }
   maxentrysize = 1024;
   maxentrysize = 1024;

+ 4 - 4
compiler/symdef.pas

@@ -176,6 +176,7 @@ interface
           symtable : TSymtable;
           symtable : TSymtable;
           cloneddef      : tabstractrecorddef;
           cloneddef      : tabstractrecorddef;
           cloneddefderef : tderef;
           cloneddefderef : tderef;
+          objectoptions  : tobjectoptions;
           constructor create(const n:string; dt:tdeftyp);
           constructor create(const n:string; dt:tdeftyp);
           constructor ppuload(dt:tdeftyp;ppufile:tcompilerppufile);
           constructor ppuload(dt:tdeftyp;ppufile:tcompilerppufile);
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
@@ -254,7 +255,6 @@ interface
           import_lib,
           import_lib,
           { for Objective-C: protocols and classes can have the same name there }
           { for Objective-C: protocols and classes can have the same name there }
           objextname     : pshortstring;
           objextname     : pshortstring;
-          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 }
           vmtentries     : TFPList;
           vmtentries     : TFPList;
@@ -2564,6 +2564,7 @@ implementation
         inherited create(dt);
         inherited create(dt);
         objname:=stringdup(upper(n));
         objname:=stringdup(upper(n));
         objrealname:=stringdup(n);
         objrealname:=stringdup(n);
+        objectoptions:=[];
       end;
       end;
 
 
     constructor tabstractrecorddef.ppuload(dt:tdeftyp;ppufile:tcompilerppufile);
     constructor tabstractrecorddef.ppuload(dt:tdeftyp;ppufile:tcompilerppufile);
@@ -2571,12 +2572,14 @@ implementation
         inherited ppuload(dt,ppufile);
         inherited ppuload(dt,ppufile);
         objrealname:=stringdup(ppufile.getstring);
         objrealname:=stringdup(ppufile.getstring);
         objname:=stringdup(upper(objrealname^));
         objname:=stringdup(upper(objrealname^));
+        ppufile.getsmallset(objectoptions);
       end;
       end;
 
 
     procedure tabstractrecorddef.ppuwrite(ppufile: tcompilerppufile);
     procedure tabstractrecorddef.ppuwrite(ppufile: tcompilerppufile);
       begin
       begin
         inherited ppuwrite(ppufile);
         inherited ppuwrite(ppufile);
         ppufile.putstring(objrealname^);
         ppufile.putstring(objrealname^);
+        ppufile.putsmallset(objectoptions);
       end;
       end;
 
 
     destructor tabstractrecorddef.destroy;
     destructor tabstractrecorddef.destroy;
@@ -3970,7 +3973,6 @@ implementation
         inherited create(n,objectdef);
         inherited create(n,objectdef);
         fcurrent_dispid:=0;
         fcurrent_dispid:=0;
         objecttype:=ot;
         objecttype:=ot;
-        objectoptions:=[];
         childof:=nil;
         childof:=nil;
         symtable:=tObjectSymtable.create(self,n,current_settings.packrecords);
         symtable:=tObjectSymtable.create(self,n,current_settings.packrecords);
         { create space for vmt !! }
         { create space for vmt !! }
@@ -4012,7 +4014,6 @@ implementation
          tObjectSymtable(symtable).recordalignment:=ppufile.getbyte;
          tObjectSymtable(symtable).recordalignment:=ppufile.getbyte;
          vmt_offset:=ppufile.getlongint;
          vmt_offset:=ppufile.getlongint;
          ppufile.getderef(childofderef);
          ppufile.getderef(childofderef);
-         ppufile.getsmallset(objectoptions);
 
 
          { load guid }
          { load guid }
          iidstr:=nil;
          iidstr:=nil;
@@ -4176,7 +4177,6 @@ implementation
          ppufile.putbyte(tObjectSymtable(symtable).recordalignment);
          ppufile.putbyte(tObjectSymtable(symtable).recordalignment);
          ppufile.putlongint(vmt_offset);
          ppufile.putlongint(vmt_offset);
          ppufile.putderef(childofderef);
          ppufile.putderef(childofderef);
-         ppufile.putsmallset(objectoptions);
          if objecttype in [odt_interfacecom,odt_interfacecorba,odt_dispinterface] then
          if objecttype in [odt_interfacecom,odt_interfacecorba,odt_dispinterface] then
            begin
            begin
               ppufile.putguid(iidguid^);
               ppufile.putguid(iidguid^);

+ 4 - 2
compiler/utils/ppudump.pp

@@ -2092,6 +2092,8 @@ begin
            begin
            begin
              readcommondef('Record definition',defoptions);
              readcommondef('Record definition',defoptions);
              writeln(space,'   Name of Record : ',getstring);
              writeln(space,'   Name of Record : ',getstring);
+             write  (space,'          Options : ');
+             readobjectdefoptions;
              writeln(space,'       FieldAlign : ',getbyte);
              writeln(space,'       FieldAlign : ',getbyte);
              writeln(space,'      RecordAlign : ',getbyte);
              writeln(space,'      RecordAlign : ',getbyte);
              writeln(space,'         PadAlign : ',getbyte);
              writeln(space,'         PadAlign : ',getbyte);
@@ -2110,6 +2112,8 @@ begin
            begin
            begin
              readcommondef('Object/Class definition',defoptions);
              readcommondef('Object/Class definition',defoptions);
              writeln(space,'    Name of Class : ',getstring);
              writeln(space,'    Name of Class : ',getstring);
+             write  (space,'          Options : ');
+             readobjectdefoptions;
              b:=getbyte;
              b:=getbyte;
              write  (space,'             Type : ');
              write  (space,'             Type : ');
              case tobjecttyp(b) of
              case tobjecttyp(b) of
@@ -2131,8 +2135,6 @@ begin
              writeln(space,'       Vmt offset : ',getlongint);
              writeln(space,'       Vmt offset : ',getlongint);
              write  (space,  '   Ancestor Class : ');
              write  (space,  '   Ancestor Class : ');
              readderef('');
              readderef('');
-             write  (space,'          Options : ');
-             readobjectdefoptions;
 
 
              if tobjecttyp(b) in [odt_interfacecom,odt_interfacecorba,odt_dispinterface] then
              if tobjecttyp(b) in [odt_interfacecom,odt_interfacecorba,odt_dispinterface] then
                begin
                begin