* made all ppuwrite methods in leaf classes "final", because you cannot

override them safely in subclasses to add more data (they finalise
    writing their ibentry)
  * removed "virtual" from all ppuload constructors for similar reason
    as above
  + added virtual (empty) ppuwrite_plaform() method that is called from
    tstoreddef/tstoredsym.ppuwrite(), which can be safely overridden in
    child classes to add extra data (called centrally from a new
    tstoreddef/sym.writeentry() method)
  + added virtual (empty) ppuload_platform() method that is called from
    tstoreddef/tstoredsym.ppuload(), which can be safely overridden in
    child classes to read the extra data (unfortunately cannot be called
    from one single location, and these calls had to be added for each
    generic subclass separately)

git-svn-id: trunk@27378 -
This commit is contained in:
Jonas Maebe 2014-03-30 15:42:49 +00:00
parent e4437bcd51
commit 2474369dde
2 changed files with 258 additions and 104 deletions

View File

@ -68,9 +68,12 @@ interface
tstoreddef = class(tdef) tstoreddef = class(tdef)
private private
_fullownerhierarchyname : pshortstring; _fullownerhierarchyname : pshortstring;
procedure writeentry(ppufile: tcompilerppufile; ibnr: byte);
protected protected
typesymderef : tderef; typesymderef : tderef;
procedure fillgenericparas(symtable:tsymtable); procedure fillgenericparas(symtable:tsymtable);
procedure ppuwrite_platform(ppufile:tcompilerppufile);virtual;
procedure ppuload_platform(ppufile:tcompilerppufile);
public public
{$ifdef EXTDEBUG} {$ifdef EXTDEBUG}
fileinfo : tfileposinfo; fileinfo : tfileposinfo;
@ -131,9 +134,11 @@ interface
constructor createtext;virtual; constructor createtext;virtual;
constructor createuntyped;virtual; constructor createuntyped;virtual;
constructor createtyped(def : tdef);virtual; constructor createtyped(def : tdef);virtual;
constructor ppuload(ppufile:tcompilerppufile);virtual; constructor ppuload(ppufile:tcompilerppufile);
function getcopy : tstoreddef;override; function getcopy : tstoreddef;override;
procedure ppuwrite(ppufile:tcompilerppufile);override; { do not override this routine in platform-specific subclasses,
override ppuwrite_platform instead }
procedure ppuwrite(ppufile:tcompilerppufile);override;final;
procedure buildderef;override; procedure buildderef;override;
procedure deref;override; procedure deref;override;
function GetTypeName:string;override; function GetTypeName:string;override;
@ -146,10 +151,12 @@ interface
tvariantdef = class(tstoreddef) tvariantdef = class(tstoreddef)
varianttype : tvarianttype; varianttype : tvarianttype;
constructor create(v : tvarianttype);virtual; constructor create(v : tvarianttype);virtual;
constructor ppuload(ppufile:tcompilerppufile);virtual; constructor ppuload(ppufile:tcompilerppufile);
function getcopy : tstoreddef;override; function getcopy : tstoreddef;override;
function GetTypeName:string;override; function GetTypeName:string;override;
procedure ppuwrite(ppufile:tcompilerppufile);override; { do not override this routine in platform-specific subclasses,
override ppuwrite_platform instead }
procedure ppuwrite(ppufile:tcompilerppufile);override;final;
function getvardef:longint;override; function getvardef:longint;override;
procedure setsize; procedure setsize;
function is_publishable : boolean;override; function is_publishable : boolean;override;
@ -160,8 +167,10 @@ interface
tformaldef = class(tstoreddef) tformaldef = class(tstoreddef)
typed:boolean; typed:boolean;
constructor create(Atyped:boolean);virtual; constructor create(Atyped:boolean);virtual;
constructor ppuload(ppufile:tcompilerppufile);virtual; constructor ppuload(ppufile:tcompilerppufile);
procedure ppuwrite(ppufile:tcompilerppufile);override; { do not override this routine in platform-specific subclasses,
override ppuwrite_platform instead }
procedure ppuwrite(ppufile:tcompilerppufile);override;final;
function GetTypeName:string;override; function GetTypeName:string;override;
end; end;
tformaldefclass = class of tformaldef; tformaldefclass = class of tformaldef;
@ -178,15 +187,19 @@ interface
tundefineddef = class(tstoreddef) tundefineddef = class(tstoreddef)
constructor create;virtual; constructor create;virtual;
constructor ppuload(ppufile:tcompilerppufile);virtual; constructor ppuload(ppufile:tcompilerppufile);
procedure ppuwrite(ppufile:tcompilerppufile);override; { do not override this routine in platform-specific subclasses,
override ppuwrite_platform instead }
procedure ppuwrite(ppufile:tcompilerppufile);override;final;
function GetTypeName:string;override; function GetTypeName:string;override;
end; end;
tundefineddefclass = class of tundefineddef; tundefineddefclass = class of tundefineddef;
terrordef = class(tstoreddef) terrordef = class(tstoreddef)
constructor create;virtual; constructor create;virtual;
procedure ppuwrite(ppufile:tcompilerppufile);override; { do not override this routine in platform-specific subclasses,
override ppuwrite_platform instead }
procedure ppuwrite(ppufile:tcompilerppufile);override;final;
function GetTypeName:string;override; function GetTypeName:string;override;
function getmangledparaname : TSymStr;override; function getmangledparaname : TSymStr;override;
end; end;
@ -218,8 +231,10 @@ interface
{$endif x86} {$endif x86}
function size:asizeint;override; function size:asizeint;override;
function getcopy:tstoreddef;override; function getcopy:tstoreddef;override;
constructor ppuload(ppufile:tcompilerppufile);virtual; constructor ppuload(ppufile:tcompilerppufile);
procedure ppuwrite(ppufile:tcompilerppufile);override; { do not override this routine in platform-specific subclasses,
override ppuwrite_platform instead }
procedure ppuwrite(ppufile:tcompilerppufile);override;final;
function GetTypeName:string;override; function GetTypeName:string;override;
end; end;
tpointerdefclass = class of tpointerdef; tpointerdefclass = class of tpointerdef;
@ -280,10 +295,12 @@ interface
variantrecdesc : pvariantrecdesc; variantrecdesc : pvariantrecdesc;
isunion : boolean; isunion : boolean;
constructor create(const n:string; p:TSymtable);virtual; constructor create(const n:string; p:TSymtable);virtual;
constructor ppuload(ppufile:tcompilerppufile);virtual; constructor ppuload(ppufile:tcompilerppufile);
destructor destroy;override; destructor destroy;override;
function getcopy : tstoreddef;override; function getcopy : tstoreddef;override;
procedure ppuwrite(ppufile:tcompilerppufile);override; { do not override this routine in platform-specific subclasses,
override ppuwrite_platform instead }
procedure ppuwrite(ppufile:tcompilerppufile);override;final;
procedure buildderef;override; procedure buildderef;override;
procedure buildderefimpl;override; procedure buildderefimpl;override;
procedure deref;override; procedure deref;override;
@ -383,10 +400,12 @@ interface
classref_created_in_current_module : boolean; classref_created_in_current_module : boolean;
objecttype : tobjecttyp; objecttype : tobjecttyp;
constructor create(ot:tobjecttyp;const n:string;c:tobjectdef);virtual; constructor create(ot:tobjecttyp;const n:string;c:tobjectdef);virtual;
constructor ppuload(ppufile:tcompilerppufile);virtual; constructor ppuload(ppufile:tcompilerppufile);
destructor destroy;override; destructor destroy;override;
function getcopy : tstoreddef;override; function getcopy : tstoreddef;override;
procedure ppuwrite(ppufile:tcompilerppufile);override; { do not override this routine in platform-specific subclasses,
override ppuwrite_platform instead }
procedure ppuwrite(ppufile:tcompilerppufile);override;final;
function GetTypeName:string;override; function GetTypeName:string;override;
procedure buildderef;override; procedure buildderef;override;
procedure deref;override; procedure deref;override;
@ -432,8 +451,10 @@ interface
tclassrefdef = class(tabstractpointerdef) tclassrefdef = class(tabstractpointerdef)
constructor create(def:tdef);virtual; constructor create(def:tdef);virtual;
constructor ppuload(ppufile:tcompilerppufile);virtual; constructor ppuload(ppufile:tcompilerppufile);
procedure ppuwrite(ppufile:tcompilerppufile);override; { do not override this routine in platform-specific subclasses,
override ppuwrite_platform instead }
procedure ppuwrite(ppufile:tcompilerppufile);override;final;
function getcopy:tstoreddef;override; function getcopy:tstoreddef;override;
function GetTypeName:string;override; function GetTypeName:string;override;
function is_publishable : boolean;override; function is_publishable : boolean;override;
@ -459,10 +480,12 @@ interface
function elecount : asizeuint; function elecount : asizeuint;
constructor create_from_pointer(def:tdef);virtual; constructor create_from_pointer(def:tdef);virtual;
constructor create(l,h:asizeint;def:tdef);virtual; constructor create(l,h:asizeint;def:tdef);virtual;
constructor ppuload(ppufile:tcompilerppufile);virtual; constructor ppuload(ppufile:tcompilerppufile);
destructor destroy; override; destructor destroy; override;
function getcopy : tstoreddef;override; function getcopy : tstoreddef;override;
procedure ppuwrite(ppufile:tcompilerppufile);override; { do not override this routine in platform-specific subclasses,
override ppuwrite_platform instead }
procedure ppuwrite(ppufile:tcompilerppufile);override;final;
function GetTypeName:string;override; function GetTypeName:string;override;
function getmangledparaname : TSymStr;override; function getmangledparaname : TSymStr;override;
procedure buildderef;override; procedure buildderef;override;
@ -481,9 +504,11 @@ interface
low,high : TConstExprInt; low,high : TConstExprInt;
ordtype : tordtype; ordtype : tordtype;
constructor create(t : tordtype;v,b : TConstExprInt);virtual; constructor create(t : tordtype;v,b : TConstExprInt);virtual;
constructor ppuload(ppufile:tcompilerppufile);virtual; constructor ppuload(ppufile:tcompilerppufile);
function getcopy : tstoreddef;override; function getcopy : tstoreddef;override;
procedure ppuwrite(ppufile:tcompilerppufile);override; { do not override this routine in platform-specific subclasses,
override ppuwrite_platform instead }
procedure ppuwrite(ppufile:tcompilerppufile);override;final;
function is_publishable : boolean;override; function is_publishable : boolean;override;
function GetTypeName:string;override; function GetTypeName:string;override;
function alignment:shortint;override; function alignment:shortint;override;
@ -496,9 +521,11 @@ interface
tfloatdef = class(tstoreddef) tfloatdef = class(tstoreddef)
floattype : tfloattype; floattype : tfloattype;
constructor create(t : tfloattype);virtual; constructor create(t : tfloattype);virtual;
constructor ppuload(ppufile:tcompilerppufile);virtual; constructor ppuload(ppufile:tcompilerppufile);
function getcopy : tstoreddef;override; function getcopy : tstoreddef;override;
procedure ppuwrite(ppufile:tcompilerppufile);override; { do not override this routine in platform-specific subclasses,
override ppuwrite_platform instead }
procedure ppuwrite(ppufile:tcompilerppufile);override;final;
function GetTypeName:string;override; function GetTypeName:string;override;
function is_publishable : boolean;override; function is_publishable : boolean;override;
function alignment:shortint;override; function alignment:shortint;override;
@ -568,9 +595,11 @@ interface
classdefderef : tderef; classdefderef : tderef;
{$endif} {$endif}
constructor create(level:byte);virtual; constructor create(level:byte);virtual;
constructor ppuload(ppufile:tcompilerppufile);virtual; constructor ppuload(ppufile:tcompilerppufile);
function getcopy : tstoreddef;override; function getcopy : tstoreddef;override;
procedure ppuwrite(ppufile:tcompilerppufile);override; { do not override this routine in platform-specific subclasses,
override ppuwrite_platform instead }
procedure ppuwrite(ppufile:tcompilerppufile);override;final;
{$ifdef jvm} {$ifdef jvm}
procedure buildderef;override; procedure buildderef;override;
procedure deref;override; procedure deref;override;
@ -726,9 +755,11 @@ interface
a routine that has to be internally generated by the compiler } a routine that has to be internally generated by the compiler }
synthetickind : tsynthetickind; synthetickind : tsynthetickind;
constructor create(level:byte);virtual; constructor create(level:byte);virtual;
constructor ppuload(ppufile:tcompilerppufile);virtual; constructor ppuload(ppufile:tcompilerppufile);
destructor destroy;override; destructor destroy;override;
procedure ppuwrite(ppufile:tcompilerppufile);override; { do not override this routine in platform-specific subclasses,
override ppuwrite_platform instead }
procedure ppuwrite(ppufile:tcompilerppufile);override;final;
procedure buildderef;override; procedure buildderef;override;
procedure buildderefimpl;override; procedure buildderefimpl;override;
procedure deref;override; procedure deref;override;
@ -808,18 +839,20 @@ interface
stringtype : tstringtype; stringtype : tstringtype;
len : asizeint; len : asizeint;
constructor createshort(l : byte);virtual; constructor createshort(l : byte);virtual;
constructor loadshort(ppufile:tcompilerppufile);virtual; constructor loadshort(ppufile:tcompilerppufile);
constructor createlong(l : asizeint);virtual; constructor createlong(l : asizeint);virtual;
constructor loadlong(ppufile:tcompilerppufile);virtual; constructor loadlong(ppufile:tcompilerppufile);
constructor createansi(aencoding:tstringencoding);virtual; constructor createansi(aencoding:tstringencoding);virtual;
constructor loadansi(ppufile:tcompilerppufile);virtual; constructor loadansi(ppufile:tcompilerppufile);
constructor createwide;virtual; constructor createwide;virtual;
constructor loadwide(ppufile:tcompilerppufile);virtual; constructor loadwide(ppufile:tcompilerppufile);
constructor createunicode;virtual; constructor createunicode;virtual;
constructor loadunicode(ppufile:tcompilerppufile);virtual; constructor loadunicode(ppufile:tcompilerppufile);virtual;
function getcopy : tstoreddef;override; function getcopy : tstoreddef;override;
function stringtypname:string; function stringtypname:string;
procedure ppuwrite(ppufile:tcompilerppufile);override; { do not override this routine in platform-specific subclasses,
override ppuwrite_platform instead }
procedure ppuwrite(ppufile:tcompilerppufile);override;final;
function GetTypeName:string;override; function GetTypeName:string;override;
function getmangledparaname:TSymStr;override; function getmangledparaname:TSymStr;override;
function is_publishable : boolean;override; function is_publishable : boolean;override;
@ -846,10 +879,12 @@ interface
has_jumps : boolean; has_jumps : boolean;
constructor create;virtual; constructor create;virtual;
constructor create_subrange(_basedef:tenumdef;_min,_max:asizeint);virtual; constructor create_subrange(_basedef:tenumdef;_min,_max:asizeint);virtual;
constructor ppuload(ppufile:tcompilerppufile);virtual; constructor ppuload(ppufile:tcompilerppufile);
destructor destroy;override; destructor destroy;override;
function getcopy : tstoreddef;override; function getcopy : tstoreddef;override;
procedure ppuwrite(ppufile:tcompilerppufile);override; { do not override this routine in platform-specific subclasses,
override ppuwrite_platform instead }
procedure ppuwrite(ppufile:tcompilerppufile);override;final;
procedure buildderef;override; procedure buildderef;override;
procedure deref;override; procedure deref;override;
function GetTypeName:string;override; function GetTypeName:string;override;
@ -873,9 +908,11 @@ interface
setbase, setbase,
setmax : aword; setmax : aword;
constructor create(def:tdef;low, high : asizeint);virtual; constructor create(def:tdef;low, high : asizeint);virtual;
constructor ppuload(ppufile:tcompilerppufile);virtual; constructor ppuload(ppufile:tcompilerppufile);
function getcopy : tstoreddef;override; function getcopy : tstoreddef;override;
procedure ppuwrite(ppufile:tcompilerppufile);override; { do not override this routine in platform-specific subclasses,
override ppuwrite_platform instead }
procedure ppuwrite(ppufile:tcompilerppufile);override;final;
procedure buildderef;override; procedure buildderef;override;
procedure deref;override; procedure deref;override;
function GetTypeName:string;override; function GetTypeName:string;override;
@ -1669,6 +1706,13 @@ implementation
end; end;
procedure tstoreddef.writeentry(ppufile: tcompilerppufile; ibnr: byte);
begin
ppuwrite_platform(ppufile);
ppufile.writeentry(ibnr);
end;
procedure tstoreddef.fillgenericparas(symtable: tsymtable); procedure tstoreddef.fillgenericparas(symtable: tsymtable);
var var
sym : tsym; sym : tsym;
@ -1690,6 +1734,19 @@ implementation
end; end;
end; end;
procedure tstoreddef.ppuwrite_platform(ppufile: tcompilerppufile);
begin
{ by default: do nothing }
end;
procedure tstoreddef.ppuload_platform(ppufile: tcompilerppufile);
begin
{ by default: do nothing }
end;
constructor tstoreddef.create(dt:tdeftyp); constructor tstoreddef.create(dt:tdeftyp);
var var
insertstack : psymtablestackitem; insertstack : psymtablestackitem;
@ -2087,6 +2144,7 @@ implementation
stringtype:=st_shortstring; stringtype:=st_shortstring;
encoding:=0; encoding:=0;
len:=ppufile.getbyte; len:=ppufile.getbyte;
ppuload_platform(ppufile);
end; end;
@ -2105,6 +2163,7 @@ implementation
stringtype:=st_longstring; stringtype:=st_longstring;
encoding:=0; encoding:=0;
len:=ppufile.getasizeint; len:=ppufile.getasizeint;
ppuload_platform(ppufile);
end; end;
@ -2123,6 +2182,7 @@ implementation
stringtype:=st_ansistring; stringtype:=st_ansistring;
len:=ppufile.getaint; len:=ppufile.getaint;
encoding:=ppufile.getword; encoding:=ppufile.getword;
ppuload_platform(ppufile);
end; end;
@ -2147,6 +2207,7 @@ implementation
else else
encoding:=CP_UTF16BE; encoding:=CP_UTF16BE;
len:=ppufile.getaint; len:=ppufile.getaint;
ppuload_platform(ppufile);
end; end;
@ -2168,6 +2229,7 @@ implementation
stringtype:=st_unicodestring; stringtype:=st_unicodestring;
len:=ppufile.getaint; len:=ppufile.getaint;
encoding:=ppufile.getword; encoding:=ppufile.getword;
ppuload_platform(ppufile);
end; end;
@ -2206,11 +2268,11 @@ implementation
if stringtype in [st_ansistring,st_unicodestring] then if stringtype in [st_ansistring,st_unicodestring] then
ppufile.putword(encoding); ppufile.putword(encoding);
case stringtype of case stringtype of
st_shortstring : ppufile.writeentry(ibshortstringdef); st_shortstring : writeentry(ppufile,ibshortstringdef);
st_longstring : ppufile.writeentry(iblongstringdef); st_longstring : writeentry(ppufile,iblongstringdef);
st_ansistring : ppufile.writeentry(ibansistringdef); st_ansistring : writeentry(ppufile,ibansistringdef);
st_widestring : ppufile.writeentry(ibwidestringdef); st_widestring : writeentry(ppufile,ibwidestringdef);
st_unicodestring : ppufile.writeentry(ibunicodestringdef); st_unicodestring : writeentry(ppufile,ibunicodestringdef);
end; end;
end; end;
@ -2332,9 +2394,11 @@ implementation
begin begin
symtable:=nil; symtable:=nil;
ppufile.getderef(basedefderef); ppufile.getderef(basedefderef);
ppuload_platform(ppufile);
end end
else else
begin begin
ppuload_platform(ppufile);
// create with nil defowner first to prevent values changes on insert // create with nil defowner first to prevent values changes on insert
symtable:=tenumsymtable.create(nil); symtable:=tenumsymtable.create(nil);
tenumsymtable(symtable).ppuload(ppufile); tenumsymtable(symtable).ppuload(ppufile);
@ -2524,7 +2588,7 @@ implementation
{$endif} {$endif}
if df_copied_def in defoptions then if df_copied_def in defoptions then
ppufile.putderef(basedefderef); ppufile.putderef(basedefderef);
ppufile.writeentry(ibenumdef); writeentry(ppufile,ibenumdef);
if not (df_copied_def in defoptions) then if not (df_copied_def in defoptions) then
tenumsymtable(symtable).ppuwrite(ppufile); tenumsymtable(symtable).ppuwrite(ppufile);
end; end;
@ -2563,6 +2627,7 @@ implementation
low:=ppufile.getexprint; low:=ppufile.getexprint;
high:=ppufile.getexprint; high:=ppufile.getexprint;
setsize; setsize;
ppuload_platform(ppufile);
end; end;
@ -2657,7 +2722,7 @@ implementation
ppufile.putbyte(byte(ordtype)); ppufile.putbyte(byte(ordtype));
ppufile.putexprint(low); ppufile.putexprint(low);
ppufile.putexprint(high); ppufile.putexprint(high);
ppufile.writeentry(iborddef); writeentry(ppufile,iborddef);
end; end;
@ -2699,6 +2764,7 @@ implementation
inherited ppuload(floatdef,ppufile); inherited ppuload(floatdef,ppufile);
floattype:=tfloattype(ppufile.getbyte); floattype:=tfloattype(ppufile.getbyte);
setsize; setsize;
ppuload_platform(ppufile);
end; end;
@ -2782,7 +2848,7 @@ implementation
begin begin
inherited ppuwrite(ppufile); inherited ppuwrite(ppufile);
ppufile.putbyte(byte(floattype)); ppufile.putbyte(byte(floattype));
ppufile.writeentry(ibfloatdef); writeentry(ppufile,ibfloatdef);
end; end;
@ -2837,6 +2903,7 @@ implementation
ppufile.getderef(typedfiledefderef) ppufile.getderef(typedfiledefderef)
else else
typedfiledef:=nil; typedfiledef:=nil;
ppuload_platform(ppufile);
end; end;
@ -2905,7 +2972,7 @@ implementation
ppufile.putbyte(byte(filetyp)); ppufile.putbyte(byte(filetyp));
if filetyp=ft_typed then if filetyp=ft_typed then
ppufile.putderef(typedfiledefderef); ppufile.putderef(typedfiledefderef);
ppufile.writeentry(ibfiledef); writeentry(ppufile,ibfiledef);
end; end;
@ -2956,6 +3023,7 @@ implementation
inherited ppuload(variantdef,ppufile); inherited ppuload(variantdef,ppufile);
varianttype:=tvarianttype(ppufile.getbyte); varianttype:=tvarianttype(ppufile.getbyte);
setsize; setsize;
ppuload_platform(ppufile);
end; end;
@ -2969,7 +3037,7 @@ implementation
begin begin
inherited ppuwrite(ppufile); inherited ppuwrite(ppufile);
ppufile.putbyte(byte(varianttype)); ppufile.putbyte(byte(varianttype));
ppufile.writeentry(ibvariantdef); writeentry(ppufile,ibvariantdef);
end; end;
@ -3107,6 +3175,7 @@ implementation
x86pointertyp:=tx86pointertyp(ppufile.getbyte); x86pointertyp:=tx86pointertyp(ppufile.getbyte);
{$endif x86} {$endif x86}
has_pointer_math:=(ppufile.getbyte<>0); has_pointer_math:=(ppufile.getbyte<>0);
ppuload_platform(ppufile);
end; end;
@ -3134,7 +3203,7 @@ implementation
ppufile.putbyte(byte(x86pointertyp)); ppufile.putbyte(byte(x86pointertyp));
{$endif x86} {$endif x86}
ppufile.putbyte(byte(has_pointer_math)); ppufile.putbyte(byte(has_pointer_math));
ppufile.writeentry(ibpointerdef); writeentry(ppufile,ibpointerdef);
end; end;
@ -3193,13 +3262,14 @@ implementation
constructor tclassrefdef.ppuload(ppufile:tcompilerppufile); constructor tclassrefdef.ppuload(ppufile:tcompilerppufile);
begin begin
inherited ppuload(classrefdef,ppufile); inherited ppuload(classrefdef,ppufile);
ppuload_platform(ppufile);
end; end;
procedure tclassrefdef.ppuwrite(ppufile:tcompilerppufile); procedure tclassrefdef.ppuwrite(ppufile:tcompilerppufile);
begin begin
inherited ppuwrite(ppufile); inherited ppuwrite(ppufile);
ppufile.writeentry(ibclassrefdef); writeentry(ppufile,ibclassrefdef);
end; end;
@ -3287,6 +3357,7 @@ implementation
savesize:=ppufile.getaint; savesize:=ppufile.getaint;
setbase:=ppufile.getaint; setbase:=ppufile.getaint;
setmax:=ppufile.getaint; setmax:=ppufile.getaint;
ppuload_platform(ppufile);
end; end;
@ -3305,7 +3376,7 @@ implementation
ppufile.putaint(savesize); ppufile.putaint(savesize);
ppufile.putaint(setbase); ppufile.putaint(setbase);
ppufile.putaint(setmax); ppufile.putaint(setmax);
ppufile.writeentry(ibsetdef); writeentry(ppufile,ibsetdef);
end; end;
@ -3355,6 +3426,7 @@ implementation
inherited ppuload(formaldef,ppufile); inherited ppuload(formaldef,ppufile);
typed:=boolean(ppufile.getbyte); typed:=boolean(ppufile.getbyte);
savesize:=0; savesize:=0;
ppuload_platform(ppufile);
end; end;
@ -3362,7 +3434,7 @@ implementation
begin begin
inherited ppuwrite(ppufile); inherited ppuwrite(ppufile);
ppufile.putbyte(byte(typed)); ppufile.putbyte(byte(typed));
ppufile.writeentry(ibformaldef); writeentry(ppufile,ibformaldef);
end; end;
@ -3415,6 +3487,7 @@ implementation
lowrange:=ppufile.getasizeint; lowrange:=ppufile.getasizeint;
highrange:=ppufile.getasizeint; highrange:=ppufile.getasizeint;
ppufile.getsmallset(arrayoptions); ppufile.getsmallset(arrayoptions);
ppuload_platform(ppufile);
symtable:=tarraysymtable.create(self); symtable:=tarraysymtable.create(self);
tarraysymtable(symtable).ppuload(ppufile) tarraysymtable(symtable).ppuload(ppufile)
end; end;
@ -3455,7 +3528,7 @@ implementation
ppufile.putasizeint(lowrange); ppufile.putasizeint(lowrange);
ppufile.putasizeint(highrange); ppufile.putasizeint(highrange);
ppufile.putsmallset(arrayoptions); ppufile.putsmallset(arrayoptions);
ppufile.writeentry(ibarraydef); writeentry(ppufile,ibarraydef);
tarraysymtable(symtable).ppuwrite(ppufile); tarraysymtable(symtable).ppuwrite(ppufile);
end; end;
@ -3934,9 +4007,13 @@ implementation
begin begin
inherited ppuload(recorddef,ppufile); inherited ppuload(recorddef,ppufile);
if df_copied_def in defoptions then if df_copied_def in defoptions then
ppufile.getderef(cloneddefderef) begin
ppufile.getderef(cloneddefderef);
ppuload_platform(ppufile);
end
else else
begin begin
ppuload_platform(ppufile);
symtable:=trecordsymtable.create(objrealname^,0); symtable:=trecordsymtable.create(objrealname^,0);
trecordsymtable(symtable).fieldalignment:=shortint(ppufile.getbyte); trecordsymtable(symtable).fieldalignment:=shortint(ppufile.getbyte);
trecordsymtable(symtable).recordalignment:=shortint(ppufile.getbyte); trecordsymtable(symtable).recordalignment:=shortint(ppufile.getbyte);
@ -4083,7 +4160,7 @@ implementation
// writevariantrecdesc(variantrecdesc); // writevariantrecdesc(variantrecdesc);
end; end;
ppufile.writeentry(ibrecorddef); writeentry(ppufile,ibrecorddef);
if not(df_copied_def in defoptions) then if not(df_copied_def in defoptions) then
trecordsymtable(symtable).ppuwrite(ppufile); trecordsymtable(symtable).ppuwrite(ppufile);
@ -4886,6 +4963,8 @@ implementation
for i:=1 to aliasnamescount do for i:=1 to aliasnamescount do
aliasnames.insert(ppufile.getstring); aliasnames.insert(ppufile.getstring);
ppuload_platform(ppufile);
{ load para symtable } { load para symtable }
parast:=tparasymtable.create(self,level); parast:=tparasymtable.create(self,level);
tparasymtable(parast).ppuload(ppufile); tparasymtable(parast).ppuload(ppufile);
@ -5047,7 +5126,7 @@ implementation
ppufile.do_crc:=oldintfcrc; ppufile.do_crc:=oldintfcrc;
{ write this entry } { write this entry }
ppufile.writeentry(ibprocdef); writeentry(ppufile,ibprocdef);
{ Save the para symtable, this is taken from the interface } { Save the para symtable, this is taken from the interface }
tparasymtable(parast).ppuwrite(ppufile); tparasymtable(parast).ppuwrite(ppufile);
@ -5759,8 +5838,9 @@ implementation
{ load para symtable } { load para symtable }
parast:=tparasymtable.create(self,ppufile.getbyte); parast:=tparasymtable.create(self,ppufile.getbyte);
{$ifdef jvm} {$ifdef jvm}
ppufile.getderef(classdefderef); ppufile.getderef(classdefderef);
{$endif} {$endif}
ppuload_platform(ppufile);
tparasymtable(parast).ppuload(ppufile); tparasymtable(parast).ppuload(ppufile);
end; end;
@ -5814,7 +5894,7 @@ implementation
ppufile.putderef(classdefderef); ppufile.putderef(classdefderef);
{$endif} {$endif}
{ Write this entry } { Write this entry }
ppufile.writeentry(ibprocvardef); writeentry(ppufile,ibprocvardef);
{ Save the para symtable, this is taken from the interface } { Save the para symtable, this is taken from the interface }
tparasymtable(parast).ppuwrite(ppufile); tparasymtable(parast).ppuwrite(ppufile);
@ -6020,9 +6100,15 @@ implementation
ImplementedInterfaces:=nil; ImplementedInterfaces:=nil;
if df_copied_def in defoptions then if df_copied_def in defoptions then
ppufile.getderef(cloneddefderef) begin
ppufile.getderef(cloneddefderef);
ppuload_platform(ppufile);
end
else else
tObjectSymtable(symtable).ppuload(ppufile); begin
ppuload_platform(ppufile);
tObjectSymtable(symtable).ppuload(ppufile);
end;
{ handles the predefined class tobject } { handles the predefined class tobject }
{ the last TOBJECT which is loaded gets } { the last TOBJECT which is loaded gets }
@ -6205,7 +6291,7 @@ implementation
if df_copied_def in defoptions then if df_copied_def in defoptions then
ppufile.putderef(cloneddefderef); ppufile.putderef(cloneddefderef);
ppufile.writeentry(ibobjectdef); writeentry(ppufile,ibobjectdef);
if not(df_copied_def in defoptions) then if not(df_copied_def in defoptions) then
tObjectSymtable(symtable).ppuwrite(ppufile); tObjectSymtable(symtable).ppuwrite(ppufile);
@ -7140,6 +7226,7 @@ implementation
constructor tundefineddef.ppuload(ppufile:tcompilerppufile); constructor tundefineddef.ppuload(ppufile:tcompilerppufile);
begin begin
inherited ppuload(undefineddef,ppufile); inherited ppuload(undefineddef,ppufile);
ppuload_platform(ppufile);
end; end;
function tundefineddef.GetTypeName:string; function tundefineddef.GetTypeName:string;
@ -7151,7 +7238,7 @@ implementation
procedure tundefineddef.ppuwrite(ppufile:tcompilerppufile); procedure tundefineddef.ppuwrite(ppufile:tcompilerppufile);
begin begin
inherited ppuwrite(ppufile); inherited ppuwrite(ppufile);
ppufile.writeentry(ibundefineddef); writeentry(ppufile,ibundefineddef);
end; end;

View File

@ -42,6 +42,11 @@ interface
type type
{ this class is the base for all symbol objects } { this class is the base for all symbol objects }
tstoredsym = class(tsym) tstoredsym = class(tsym)
private
procedure writeentry(ppufile: tcompilerppufile; ibnr: byte);
protected
procedure ppuwrite_platform(ppufile: tcompilerppufile);virtual;
procedure ppuload_platform(ppufile: tcompilerppufile);virtual;
public public
constructor create(st:tsymtyp;const n : string); constructor create(st:tsymtyp;const n : string);
constructor ppuload(st:tsymtyp;ppufile:tcompilerppufile); constructor ppuload(st:tsymtyp;ppufile:tcompilerppufile);
@ -65,8 +70,10 @@ interface
generated asmlabel } generated asmlabel }
asmblocklabel : tasmlabel; asmblocklabel : tasmlabel;
constructor create(const n : string);virtual; constructor create(const n : string);virtual;
constructor ppuload(ppufile:tcompilerppufile);virtual; constructor ppuload(ppufile:tcompilerppufile);
procedure ppuwrite(ppufile:tcompilerppufile);override; { do not override this routine in platform-specific subclasses,
override ppuwrite_platform instead }
procedure ppuwrite(ppufile:tcompilerppufile);override;final;
function mangledname:TSymStr;override; function mangledname:TSymStr;override;
end; end;
tlabelsymclass = class of tlabelsym; tlabelsymclass = class of tlabelsym;
@ -74,9 +81,11 @@ interface
tunitsym = class(Tstoredsym) tunitsym = class(Tstoredsym)
module : tobject; { tmodule } module : tobject; { tmodule }
constructor create(const n : string;amodule : tobject);virtual; constructor create(const n : string;amodule : tobject);virtual;
constructor ppuload(ppufile:tcompilerppufile);virtual; constructor ppuload(ppufile:tcompilerppufile);
destructor destroy;override; destructor destroy;override;
procedure ppuwrite(ppufile:tcompilerppufile);override; { do not override this routine in platform-specific subclasses,
override ppuwrite_platform instead }
procedure ppuwrite(ppufile:tcompilerppufile);override;final;
end; end;
tunitsymclass = class of tunitsym; tunitsymclass = class of tunitsym;
@ -84,8 +93,10 @@ interface
unitsym:tsym; unitsym:tsym;
unitsymderef:tderef; unitsymderef:tderef;
constructor create(const n : string);virtual; constructor create(const n : string);virtual;
constructor ppuload(ppufile:tcompilerppufile);virtual; constructor ppuload(ppufile:tcompilerppufile);
procedure ppuwrite(ppufile:tcompilerppufile);override; { do not override this routine in platform-specific subclasses,
override ppuwrite_platform instead }
procedure ppuwrite(ppufile:tcompilerppufile);override;final;
procedure buildderef;override; procedure buildderef;override;
procedure deref;override; procedure deref;override;
end; end;
@ -103,14 +114,16 @@ interface
FProcdefDerefList : TFPList; FProcdefDerefList : TFPList;
public public
constructor create(const n : string);virtual; constructor create(const n : string);virtual;
constructor ppuload(ppufile:tcompilerppufile);virtual; constructor ppuload(ppufile:tcompilerppufile);
destructor destroy;override; destructor destroy;override;
{ writes all declarations except the specified one } { writes all declarations except the specified one }
procedure write_parameter_lists(skipdef:tprocdef); procedure write_parameter_lists(skipdef:tprocdef);
{ tests, if all procedures definitions are defined and not } { tests, if all procedures definitions are defined and not }
{ only forward } { only forward }
procedure check_forward; procedure check_forward;
procedure ppuwrite(ppufile:tcompilerppufile);override; { do not override this routine in platform-specific subclasses,
override ppuwrite_platform instead }
procedure ppuwrite(ppufile:tcompilerppufile);override;final;
procedure buildderef;override; procedure buildderef;override;
procedure deref;override; procedure deref;override;
function find_procdef_bytype(pt:Tproctypeoption):Tprocdef; function find_procdef_bytype(pt:Tproctypeoption):Tprocdef;
@ -132,8 +145,10 @@ interface
fprettyname : ansistring; fprettyname : ansistring;
constructor create(const n : string;def:tdef);virtual; constructor create(const n : string;def:tdef);virtual;
destructor destroy;override; destructor destroy;override;
constructor ppuload(ppufile:tcompilerppufile);virtual; constructor ppuload(ppufile:tcompilerppufile);
procedure ppuwrite(ppufile:tcompilerppufile);override; { do not override this routine in platform-specific subclasses,
override ppuwrite_platform instead }
procedure ppuwrite(ppufile:tcompilerppufile);override;final;
procedure buildderef;override; procedure buildderef;override;
procedure deref;override; procedure deref;override;
function prettyname : string;override; function prettyname : string;override;
@ -184,8 +199,10 @@ interface
cachedmangledname: pshortstring; { mangled name for ObjC or Java } cachedmangledname: pshortstring; { mangled name for ObjC or Java }
{$endif symansistr} {$endif symansistr}
constructor create(const n : string;vsp:tvarspez;def:tdef;vopts:tvaroptions);virtual; constructor create(const n : string;vsp:tvarspez;def:tdef;vopts:tvaroptions);virtual;
constructor ppuload(ppufile:tcompilerppufile);virtual; constructor ppuload(ppufile:tcompilerppufile);
procedure ppuwrite(ppufile:tcompilerppufile);override; { do not override this routine in platform-specific subclasses,
override ppuwrite_platform instead }
procedure ppuwrite(ppufile:tcompilerppufile);override;final;
procedure set_externalname(const s:string); procedure set_externalname(const s:string);
function mangledname:TSymStr;override; function mangledname:TSymStr;override;
destructor destroy;override; destructor destroy;override;
@ -213,8 +230,10 @@ interface
tlocalvarsym = class(tabstractnormalvarsym) tlocalvarsym = class(tabstractnormalvarsym)
constructor create(const n : string;vsp:tvarspez;def:tdef;vopts:tvaroptions);virtual; constructor create(const n : string;vsp:tvarspez;def:tdef;vopts:tvaroptions);virtual;
constructor ppuload(ppufile:tcompilerppufile);virtual; constructor ppuload(ppufile:tcompilerppufile);
procedure ppuwrite(ppufile:tcompilerppufile);override; { do not override this routine in platform-specific subclasses,
override ppuwrite_platform instead }
procedure ppuwrite(ppufile:tcompilerppufile);override;final;
end; end;
tlocalvarsymclass = class of tlocalvarsym; tlocalvarsymclass = class of tlocalvarsym;
@ -229,9 +248,11 @@ interface
eqval : tequaltype; eqval : tequaltype;
{$endif EXTDEBUG} {$endif EXTDEBUG}
constructor create(const n : string;nr:word;vsp:tvarspez;def:tdef;vopts:tvaroptions);virtual; constructor create(const n : string;nr:word;vsp:tvarspez;def:tdef;vopts:tvaroptions);virtual;
constructor ppuload(ppufile:tcompilerppufile);virtual; constructor ppuload(ppufile:tcompilerppufile);
destructor destroy;override; destructor destroy;override;
procedure ppuwrite(ppufile:tcompilerppufile);override; { do not override this routine in platform-specific subclasses,
override ppuwrite_platform instead }
procedure ppuwrite(ppufile:tcompilerppufile);override;final;
function needs_finalization: boolean; function needs_finalization: boolean;
end; end;
tparavarsymclass = class of tparavarsym; tparavarsymclass = class of tparavarsym;
@ -254,9 +275,11 @@ interface
constructor create(const n : string;vsp:tvarspez;def:tdef;vopts:tvaroptions);virtual; constructor create(const n : string;vsp:tvarspez;def:tdef;vopts:tvaroptions);virtual;
constructor create_dll(const n : string;vsp:tvarspez;def:tdef);virtual; constructor create_dll(const n : string;vsp:tvarspez;def:tdef);virtual;
constructor create_C(const n: string; const mangled : TSymStr;vsp:tvarspez;def:tdef);virtual; constructor create_C(const n: string; const mangled : TSymStr;vsp:tvarspez;def:tdef);virtual;
constructor ppuload(ppufile:tcompilerppufile);virtual; constructor ppuload(ppufile:tcompilerppufile);
destructor destroy;override; destructor destroy;override;
procedure ppuwrite(ppufile:tcompilerppufile);override; { do not override this routine in platform-specific subclasses,
override ppuwrite_platform instead }
procedure ppuwrite(ppufile:tcompilerppufile);override;final;
function mangledname:TSymStr;override; function mangledname:TSymStr;override;
procedure set_mangledbasename(const s: TSymStr); procedure set_mangledbasename(const s: TSymStr);
function mangledbasename: TSymStr; function mangledbasename: TSymStr;
@ -280,11 +303,13 @@ interface
constructor create(const n : string;def:tdef);virtual; constructor create(const n : string;def:tdef);virtual;
constructor create_ref(const n : string;def:tdef;_ref:tpropaccesslist);virtual; constructor create_ref(const n : string;def:tdef;_ref:tpropaccesslist);virtual;
destructor destroy;override; destructor destroy;override;
constructor ppuload(ppufile:tcompilerppufile);virtual; constructor ppuload(ppufile:tcompilerppufile);
procedure buildderef;override; procedure buildderef;override;
procedure deref;override; procedure deref;override;
function mangledname : TSymStr;override; function mangledname : TSymStr;override;
procedure ppuwrite(ppufile:tcompilerppufile);override; { do not override this routine in platform-specific subclasses,
override ppuwrite_platform instead }
procedure ppuwrite(ppufile:tcompilerppufile);override;final;
end; end;
tabsolutevarsymclass = class of tabsolutevarsym; tabsolutevarsymclass = class of tabsolutevarsym;
@ -305,9 +330,11 @@ interface
parast : tsymtable; parast : tsymtable;
constructor create(const n : string);virtual; constructor create(const n : string);virtual;
destructor destroy;override; destructor destroy;override;
constructor ppuload(ppufile:tcompilerppufile);virtual; constructor ppuload(ppufile:tcompilerppufile);
function getsize : asizeint; function getsize : asizeint;
procedure ppuwrite(ppufile:tcompilerppufile);override; { do not override this routine in platform-specific subclasses,
override ppuwrite_platform instead }
procedure ppuwrite(ppufile:tcompilerppufile);override;final;
procedure buildderef;override; procedure buildderef;override;
procedure deref;override; procedure deref;override;
function getpropaccesslist(pap:tpropaccesslisttypes;out plist:tpropaccesslist):boolean; function getpropaccesslist(pap:tpropaccesslisttypes;out plist:tpropaccesslist):boolean;
@ -336,11 +363,13 @@ interface
constructor create_ptr(const n : string;t : tconsttyp;v : pointer;def:tdef);virtual; constructor create_ptr(const n : string;t : tconsttyp;v : pointer;def:tdef);virtual;
constructor create_string(const n : string;t : tconsttyp;str:pchar;l:longint;def:tdef);virtual; constructor create_string(const n : string;t : tconsttyp;str:pchar;l:longint;def:tdef);virtual;
constructor create_wstring(const n : string;t : tconsttyp;pw:pcompilerwidestring);virtual; constructor create_wstring(const n : string;t : tconsttyp;pw:pcompilerwidestring);virtual;
constructor ppuload(ppufile:tcompilerppufile);virtual; constructor ppuload(ppufile:tcompilerppufile);
destructor destroy;override; destructor destroy;override;
procedure buildderef;override; procedure buildderef;override;
procedure deref;override; procedure deref;override;
procedure ppuwrite(ppufile:tcompilerppufile);override; { do not override this routine in platform-specific subclasses,
override ppuwrite_platform instead }
procedure ppuwrite(ppufile:tcompilerppufile);override;final;
end; end;
tconstsymclass = class of tconstsym; tconstsymclass = class of tconstsym;
@ -349,8 +378,10 @@ interface
definition : tenumdef; definition : tenumdef;
definitionderef : tderef; definitionderef : tderef;
constructor create(const n : string;def : tenumdef;v : longint);virtual; constructor create(const n : string;def : tenumdef;v : longint);virtual;
constructor ppuload(ppufile:tcompilerppufile);virtual; constructor ppuload(ppufile:tcompilerppufile);
procedure ppuwrite(ppufile:tcompilerppufile);override; { do not override this routine in platform-specific subclasses,
override ppuwrite_platform instead }
procedure ppuwrite(ppufile:tcompilerppufile);override;final;
procedure buildderef;override; procedure buildderef;override;
procedure deref;override; procedure deref;override;
end; end;
@ -359,9 +390,11 @@ interface
tsyssym = class(Tstoredsym) tsyssym = class(Tstoredsym)
number : longint; number : longint;
constructor create(const n : string;l : longint);virtual; constructor create(const n : string;l : longint);virtual;
constructor ppuload(ppufile:tcompilerppufile);virtual; constructor ppuload(ppufile:tcompilerppufile);
destructor destroy;override; destructor destroy;override;
procedure ppuwrite(ppufile:tcompilerppufile);override; { do not override this routine in platform-specific subclasses,
override ppuwrite_platform instead }
procedure ppuwrite(ppufile:tcompilerppufile);override;final;
end; end;
tsyssymclass = class of tsyssym; tsyssymclass = class of tsyssym;
@ -386,7 +419,9 @@ interface
buflen : longint; buflen : longint;
constructor create(const n : string); constructor create(const n : string);
constructor ppuload(ppufile:tcompilerppufile); constructor ppuload(ppufile:tcompilerppufile);
procedure ppuwrite(ppufile:tcompilerppufile);override; { do not override this routine in platform-specific subclasses,
override ppuwrite_platform instead }
procedure ppuwrite(ppufile:tcompilerppufile);override;final;
destructor destroy;override; destructor destroy;override;
function GetCopy:tmacro; function GetCopy:tmacro;
end; end;
@ -529,6 +564,24 @@ implementation
end; end;
procedure tstoredsym.writeentry(ppufile: tcompilerppufile; ibnr: byte);
begin
ppuwrite_platform(ppufile);
ppufile.writeentry(ibnr);
end;
procedure tstoredsym.ppuwrite_platform(ppufile: tcompilerppufile);
begin
{ by default: do nothing }
end;
procedure tstoredsym.ppuload_platform(ppufile: tcompilerppufile);
begin
{ by default: do nothing }
end;
destructor tstoredsym.destroy; destructor tstoredsym.destroy;
begin begin
inherited destroy; inherited destroy;
@ -556,6 +609,7 @@ implementation
used:=false; used:=false;
nonlocal:=false; nonlocal:=false;
defined:=true; defined:=true;
ppuload_platform(ppufile);
end; end;
@ -566,7 +620,7 @@ implementation
else else
begin begin
inherited ppuwrite(ppufile); inherited ppuwrite(ppufile);
ppufile.writeentry(iblabelsym); writeentry(ppufile,iblabelsym);
end; end;
end; end;
@ -599,6 +653,7 @@ implementation
begin begin
inherited ppuload(unitsym,ppufile); inherited ppuload(unitsym,ppufile);
module:=nil; module:=nil;
ppuload_platform(ppufile);
end; end;
destructor tunitsym.destroy; destructor tunitsym.destroy;
@ -609,7 +664,7 @@ implementation
procedure tunitsym.ppuwrite(ppufile:tcompilerppufile); procedure tunitsym.ppuwrite(ppufile:tcompilerppufile);
begin begin
inherited ppuwrite(ppufile); inherited ppuwrite(ppufile);
ppufile.writeentry(ibunitsym); writeentry(ppufile,ibunitsym);
end; end;
{**************************************************************************** {****************************************************************************
@ -626,13 +681,14 @@ implementation
begin begin
inherited ppuload(namespacesym,ppufile); inherited ppuload(namespacesym,ppufile);
ppufile.getderef(unitsymderef); ppufile.getderef(unitsymderef);
ppuload_platform(ppufile);
end; end;
procedure tnamespacesym.ppuwrite(ppufile:tcompilerppufile); procedure tnamespacesym.ppuwrite(ppufile:tcompilerppufile);
begin begin
inherited ppuwrite(ppufile); inherited ppuwrite(ppufile);
ppufile.putderef(unitsymderef); ppufile.putderef(unitsymderef);
ppufile.writeentry(ibnamespacesym); writeentry(ppufile,ibnamespacesym);
end; end;
procedure tnamespacesym.buildderef; procedure tnamespacesym.buildderef;
@ -702,6 +758,7 @@ implementation
ppufile.getderef(pdderef); ppufile.getderef(pdderef);
FProcdefDerefList.Add(Pointer(PtrInt(pdderef.dataidx))); FProcdefDerefList.Add(Pointer(PtrInt(pdderef.dataidx)));
end; end;
ppuload_platform(ppufile);
end; end;
@ -728,7 +785,7 @@ implementation
d.dataidx:=PtrInt(FProcdefDerefList[i]); d.dataidx:=PtrInt(FProcdefDerefList[i]);
ppufile.putderef(d); ppufile.putderef(d);
end; end;
ppufile.writeentry(ibprocsym); writeentry(ppufile,ibprocsym);
end; end;
@ -1204,6 +1261,7 @@ implementation
ppufile.getderef(indexdefderef); ppufile.getderef(indexdefderef);
for pap:=low(tpropaccesslisttypes) to high(tpropaccesslisttypes) do for pap:=low(tpropaccesslisttypes) to high(tpropaccesslisttypes) do
propaccesslist[pap]:=ppufile.getpropaccesslist; propaccesslist[pap]:=ppufile.getpropaccesslist;
ppuload_platform(ppufile);
if [ppo_hasparameters,ppo_overrides]*propoptions=[ppo_hasparameters] then if [ppo_hasparameters,ppo_overrides]*propoptions=[ppo_hasparameters] then
begin begin
parast:=tparasymtable.create(nil,0); parast:=tparasymtable.create(nil,0);
@ -1362,7 +1420,7 @@ implementation
ppufile.putderef(indexdefderef); ppufile.putderef(indexdefderef);
for pap:=low(tpropaccesslisttypes) to high(tpropaccesslisttypes) do for pap:=low(tpropaccesslisttypes) to high(tpropaccesslisttypes) do
ppufile.putpropaccesslist(propaccesslist[pap]); ppufile.putpropaccesslist(propaccesslist[pap]);
ppufile.writeentry(ibpropertysym); writeentry(ppufile,ibpropertysym);
if [ppo_hasparameters,ppo_overrides]*propoptions=[ppo_hasparameters] then if [ppo_hasparameters,ppo_overrides]*propoptions=[ppo_hasparameters] then
tparasymtable(parast).ppuwrite(ppufile); tparasymtable(parast).ppuwrite(ppufile);
end; end;
@ -1603,6 +1661,7 @@ implementation
externalname:=stringdup(ppufile.getstring) externalname:=stringdup(ppufile.getstring)
else else
externalname:=nil; externalname:=nil;
ppuload_platform(ppufile);
end; end;
@ -1612,7 +1671,7 @@ implementation
ppufile.putaint(fieldoffset); ppufile.putaint(fieldoffset);
if (vo_has_mangledname in varoptions) then if (vo_has_mangledname in varoptions) then
ppufile.putstring(externalname^); ppufile.putstring(externalname^);
ppufile.writeentry(ibfieldvarsym); writeentry(ppufile,ibfieldvarsym);
end; end;
@ -1808,6 +1867,7 @@ implementation
if vo_has_section in varoptions then if vo_has_section in varoptions then
section:=ppufile.getansistring; section:=ppufile.getansistring;
{$endif symansistr} {$endif symansistr}
ppuload_platform(ppufile);
end; end;
@ -1844,7 +1904,7 @@ implementation
{$endif symansistr} {$endif symansistr}
if vo_has_section in varoptions then if vo_has_section in varoptions then
ppufile.putansistring(section); ppufile.putansistring(section);
ppufile.writeentry(ibstaticvarsym); writeentry(ppufile,ibstaticvarsym);
end; end;
@ -1966,13 +2026,14 @@ implementation
constructor tlocalvarsym.ppuload(ppufile:tcompilerppufile); constructor tlocalvarsym.ppuload(ppufile:tcompilerppufile);
begin begin
inherited ppuload(localvarsym,ppufile); inherited ppuload(localvarsym,ppufile);
ppuload_platform(ppufile);
end; end;
procedure tlocalvarsym.ppuwrite(ppufile:tcompilerppufile); procedure tlocalvarsym.ppuwrite(ppufile:tcompilerppufile);
begin begin
inherited ppuwrite(ppufile); inherited ppuwrite(ppufile);
ppufile.writeentry(iblocalvarsym); writeentry(ppufile,iblocalvarsym);
end; end;
@ -2029,6 +2090,7 @@ implementation
paraloc[callerside].size:=paraloc[callerside].location^.size; paraloc[callerside].size:=paraloc[callerside].location^.size;
paraloc[callerside].intsize:=tcgsize2size[paraloc[callerside].size]; paraloc[callerside].intsize:=tcgsize2size[paraloc[callerside].size];
end; end;
ppuload_platform(ppufile);
end; end;
@ -2059,7 +2121,7 @@ implementation
ppufile.putbyte(sizeof(paraloc[callerside].location^)); ppufile.putbyte(sizeof(paraloc[callerside].location^));
ppufile.putdata(paraloc[callerside].location^,sizeof(paraloc[callerside].location^)); ppufile.putdata(paraloc[callerside].location^,sizeof(paraloc[callerside].location^));
end; end;
ppufile.writeentry(ibparavarsym); writeentry(ppufile,ibparavarsym);
end; end;
function tparavarsym.needs_finalization:boolean; function tparavarsym.needs_finalization:boolean;
@ -2126,6 +2188,7 @@ implementation
{$endif} {$endif}
end; end;
end; end;
ppuload_platform(ppufile);
end; end;
@ -2150,7 +2213,7 @@ implementation
{$endif} {$endif}
end; end;
end; end;
ppufile.writeentry(ibabsolutevarsym); writeentry(ppufile,ibabsolutevarsym);
end; end;
@ -2316,6 +2379,7 @@ implementation
else else
Message1(unit_f_ppu_invalid_entry,tostr(ord(consttyp))); Message1(unit_f_ppu_invalid_entry,tostr(ord(consttyp)));
end; end;
ppuload_platform(ppufile);
end; end;
@ -2394,7 +2458,7 @@ implementation
else else
internalerror(13); internalerror(13);
end; end;
ppufile.writeentry(ibconstsym); writeentry(ppufile,ibconstsym);
end; end;
@ -2415,6 +2479,7 @@ implementation
inherited ppuload(enumsym,ppufile); inherited ppuload(enumsym,ppufile);
ppufile.getderef(definitionderef); ppufile.getderef(definitionderef);
value:=ppufile.getlongint; value:=ppufile.getlongint;
ppuload_platform(ppufile);
end; end;
@ -2434,7 +2499,7 @@ implementation
inherited ppuwrite(ppufile); inherited ppuwrite(ppufile);
ppufile.putderef(definitionderef); ppufile.putderef(definitionderef);
ppufile.putlongint(value); ppufile.putlongint(value);
ppufile.writeentry(ibenumsym); writeentry(ppufile,ibenumsym);
end; end;
@ -2466,6 +2531,7 @@ implementation
inherited ppuload(typesym,ppufile); inherited ppuload(typesym,ppufile);
ppufile.getderef(typedefderef); ppufile.getderef(typedefderef);
fprettyname:=ppufile.getansistring; fprettyname:=ppufile.getansistring;
ppuload_platform(ppufile);
end; end;
@ -2486,7 +2552,7 @@ implementation
inherited ppuwrite(ppufile); inherited ppuwrite(ppufile);
ppufile.putderef(typedefderef); ppufile.putderef(typedefderef);
ppufile.putansistring(fprettyname); ppufile.putansistring(fprettyname);
ppufile.writeentry(ibtypesym); writeentry(ppufile,ibtypesym);
end; end;
@ -2513,6 +2579,7 @@ implementation
begin begin
inherited ppuload(syssym,ppufile); inherited ppuload(syssym,ppufile);
number:=ppufile.getlongint; number:=ppufile.getlongint;
ppuload_platform(ppufile);
end; end;
destructor tsyssym.destroy; destructor tsyssym.destroy;
@ -2524,7 +2591,7 @@ implementation
begin begin
inherited ppuwrite(ppufile); inherited ppuwrite(ppufile);
ppufile.putlongint(number); ppufile.putlongint(number);
ppufile.writeentry(ibsyssym); writeentry(ppufile,ibsyssym);
end; end;
@ -2574,7 +2641,7 @@ implementation
ppufile.putlongint(buflen); ppufile.putlongint(buflen);
if buflen > 0 then if buflen > 0 then
ppufile.putdata(buftext^,buflen); ppufile.putdata(buftext^,buflen);
ppufile.writeentry(ibmacrosym); writeentry(ppufile,ibmacrosym);
end; end;