Pārlūkot izejas kodu

* store the type of the helper that had been encountered during parsing in the objectdef and by extension the PPU

git-svn-id: trunk@37202 -
svenbarth 7 gadi atpakaļ
vecāks
revīzija
a6821c63e0
4 mainītis faili ar 15 papildinājumiem un 1 dzēšanām
  1. 1 0
      compiler/pdecobj.pas
  2. 1 1
      compiler/ppu.pas
  3. 3 0
      compiler/symdef.pas
  4. 10 0
      compiler/utils/ppuutils/ppudump.pp

+ 1 - 0
compiler/pdecobj.pas

@@ -1381,6 +1381,7 @@ implementation
 
             { create new class }
             current_structdef:=cobjectdef.create(objecttype,n,nil,true);
+            tobjectdef(current_structdef).helpertype:=helpertype;
 
             { include always the forward flag, it'll be removed after the parent class have been
               added. This is to prevent circular childof loops }

+ 1 - 1
compiler/ppu.pas

@@ -43,7 +43,7 @@ type
 {$endif Test_Double_checksum}
 
 const
-  CurrentPPUVersion = 194;
+  CurrentPPUVersion = 195;
 
 { unit flags }
   uf_init                = $000001; { unit has initialization section }

+ 3 - 0
compiler/symdef.pas

@@ -404,6 +404,7 @@ interface
           { for Object Pascal helpers }
           extendeddef   : tdef;
           extendeddefderef: tderef;
+          helpertype : thelpertype;
           { for Objective-C: protocols and classes can have the same name there }
           objextname     : pshortstring;
           { to be able to have a variable vmt position }
@@ -6553,6 +6554,7 @@ implementation
       begin
          inherited ppuload(objectdef,ppufile);
          objecttype:=tobjecttyp(ppufile.getbyte);
+         helpertype:=thelpertype(ppufile.getbyte);
          objextname:=ppufile.getpshortstring;
          { only used for external Objective-C classes/protocols }
          if (objextname^='') then
@@ -6757,6 +6759,7 @@ implementation
          ppufile.do_indirect_crc:=true;
          inherited ppuwrite(ppufile);
          ppufile.putbyte(byte(objecttype));
+         ppufile.putbyte(byte(helpertype));
          if assigned(objextname) then
            ppufile.putstring(objextname^)
          else

+ 10 - 0
compiler/utils/ppuutils/ppudump.pp

@@ -2899,6 +2899,7 @@ procedure readdefinitions(const s:string; ParentDef: TPpuContainerDef);
 
 { type tobjecttyp is in symconst unit }
 { type tvarianttype is in symconst unit }
+{ type thelpertype is in symconst unit }
 var
   b : byte;
   l,j,tokenbufsize : longint;
@@ -3382,6 +3383,15 @@ begin
                odt_helper:
                  objdef.ObjType:=otHelper;
              end;
+             b:=getbyte;
+             write  ([space,'      Helper Type : ']);
+             case thelpertype(b) of
+               ht_none   : writeln('none');
+               ht_class  : writeln('class helper');
+               ht_record : writeln('record helper');
+               ht_type   : writeln('type helper');
+               else        WriteWarning('Invalid helper type: ' + IntToStr(b));
+             end;
              writeln([space,'    External name : ',getstring]);
              objdef.Size:=getasizeint;
              writeln([space,'         DataSize : ',objdef.Size]);