* 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 -
This commit is contained in:
svenbarth 2017-09-13 21:24:06 +00:00
parent 50788e8b3b
commit a6821c63e0
4 changed files with 15 additions and 1 deletions

View File

@ -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 }

View File

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

View File

@ -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

View File

@ -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]);