* fixed unit reloading after the addition of the def field to tcgpara

as used in the function return location (and loading in case of
    an explicit para location)

git-svn-id: branches/jvmbackend@18636 -
This commit is contained in:
Jonas Maebe 2011-08-20 08:17:17 +00:00
parent 6154f1b0d9
commit 90d82ad826
2 changed files with 34 additions and 0 deletions

View File

@ -67,6 +67,7 @@ unit parabase;
Alignment : ShortInt;
Size : TCGSize; { Size of the parameter included in all locations }
Def : tdef; { Type of the parameter }
DefDeref : tderef;
{$ifdef powerpc}
composite: boolean; { under the AIX abi, how certain parameters are passed depends on whether they are composite or not }
{$endif powerpc}
@ -78,6 +79,8 @@ unit parabase;
function add_location:pcgparalocation;
procedure get_location(var newloc:tlocation);
procedure buildderef;
procedure deref;
procedure ppuwrite(ppufile:tcompilerppufile);
procedure ppuload(ppufile:tcompilerppufile);
end;
@ -117,6 +120,7 @@ implementation
size:=OS_NO;
intsize:=0;
location:=nil;
def:=nil;
{$ifdef powerpc}
composite:=false;
{$endif powerpc}
@ -245,6 +249,18 @@ implementation
end;
procedure TCGPara.buildderef;
begin
defderef.build(def);
end;
procedure TCGPara.deref;
begin
def:=tdef(defderef.resolve);
end;
procedure TCGPara.ppuwrite(ppufile: tcompilerppufile);
var
hparaloc: PCGParaLocation;
@ -256,6 +272,7 @@ implementation
{$ifdef powerpc}
ppufile.putbyte(byte(composite));
{$endif}
ppufile.putderef(defderef);
nparaloc:=0;
hparaloc:=location;
while assigned(hparaloc) do
@ -313,6 +330,7 @@ implementation
{$ifdef powerpc}
composite:=boolean(ppufile.getbyte);
{$endif}
ppufile.getderef(defderef);
nparaloc:=ppufile.getbyte;
while nparaloc>0 do
begin

View File

@ -3441,6 +3441,8 @@ implementation
exit;
inherited buildderef;
returndefderef.build(returndef);
if po_explicitparaloc in procoptions then
funcretloc[callerside].buildderef;
{ parast }
tparasymtable(parast).buildderef;
end;
@ -3450,6 +3452,20 @@ implementation
begin
inherited deref;
returndef:=tdef(returndefderef.resolve);
if po_explicitparaloc in procoptions then
begin
funcretloc[callerside].deref;
has_paraloc_info:=callerside;
end
else
begin
{ deref is called after loading from a ppu, but also after another
unit has been reloaded/recompiled and all references must be
re-resolved. Since the funcretloc contains a reference to a tdef,
reset it so that we won't try to access the stale def }
funcretloc[callerside].init;
has_paraloc_info:=callnoside;
end;
{ parast }
tparasymtable(parast).deref;
{ recalculated parameters }