* fixed tstatementnode.det_resulttype and tststatementnode.pass_1

* fixed some getcopy issues with ttemp*nodes
This commit is contained in:
Jonas Maebe 2003-04-21 15:00:22 +00:00
parent e206a74439
commit 934974e234

View File

@ -89,10 +89,11 @@ interface
ttempinfo = record ttempinfo = record
{ set to the copy of a tempcreate pnode (if it gets copied) so that the } { set to the copy of a tempcreate pnode (if it gets copied) so that the }
{ refs and deletenode can hook to this copy once they get copied too } { refs and deletenode can hook to this copy once they get copied too }
hookoncopy : ptempinfo; hookoncopy : ptempinfo;
ref : treference; ref : treference;
restype : ttype; restype : ttype;
valid : boolean; valid : boolean;
nextref_set_hookoncopy_nil : boolean;
end; end;
{ a node which will create a (non)persistent temp of a given type with a given } { a node which will create a (non)persistent temp of a given type with a given }
@ -275,7 +276,8 @@ implementation
exit; exit;
{ right is the next statement in the list } { right is the next statement in the list }
resulttypepass(right); if assigned(right) then
resulttypepass(right);
if codegenerror then if codegenerror then
exit; exit;
end; end;
@ -298,7 +300,8 @@ implementation
registersmmx:=left.registersmmx; registersmmx:=left.registersmmx;
{$endif SUPPORT_MMX} {$endif SUPPORT_MMX}
{ right is the next in the list } { right is the next in the list }
firstpass(right); if assigned(right) then
firstpass(right);
if codegenerror then if codegenerror then
exit; exit;
end; end;
@ -597,6 +600,7 @@ implementation
{ so that if the refs get copied as well, they can hook themselves } { so that if the refs get copied as well, they can hook themselves }
{ to the copy of the temp } { to the copy of the temp }
tempinfo^.hookoncopy := n.tempinfo; tempinfo^.hookoncopy := n.tempinfo;
tempinfo^.nextref_set_hookoncopy_nil := false;
result := n; result := n;
end; end;
@ -650,6 +654,12 @@ implementation
begin begin
{ hook the ref to the copied temp } { hook the ref to the copied temp }
n.tempinfo := tempinfo^.hookoncopy; n.tempinfo := tempinfo^.hookoncopy;
{ if we passed a ttempdeletenode that changed the temp }
{ from a persistent one into a normal one, we must be }
{ the last reference (since our parent should free the }
{ temp (JM) }
if (tempinfo^.nextref_set_hookoncopy_nil) then
tempinfo^.hookoncopy := nil;
end end
else else
{ if the temp we refer to hasn't been copied, assume } { if the temp we refer to hasn't been copied, assume }
@ -715,6 +725,7 @@ implementation
n: ttempdeletenode; n: ttempdeletenode;
begin begin
n := ttempdeletenode(inherited getcopy); n := ttempdeletenode(inherited getcopy);
n.release_to_normal := release_to_normal;
if assigned(tempinfo^.hookoncopy) then if assigned(tempinfo^.hookoncopy) then
{ if the temp has been copied, assume it becomes a new } { if the temp has been copied, assume it becomes a new }
@ -722,8 +733,13 @@ implementation
begin begin
{ hook the tempdeletenode to the copied temp } { hook the tempdeletenode to the copied temp }
n.tempinfo := tempinfo^.hookoncopy; n.tempinfo := tempinfo^.hookoncopy;
{ the temp shall not be used, reset hookoncopy } { the temp shall not be used, reset hookoncopy }
tempinfo^.hookoncopy:=nil; { Only if release_to_normal is false, otherwise }
{ the temp can still be referenced once more (JM) }
if (not release_to_normal) then
tempinfo^.hookoncopy:=nil
else
tempinfo^.nextref_set_hookoncopy_nil := true;
end end
else else
{ if the temp we refer to hasn't been copied, we have a } { if the temp we refer to hasn't been copied, we have a }
@ -768,7 +784,11 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.42 2003-04-17 07:50:24 daniel Revision 1.43 2003-04-21 15:00:22 jonas
* fixed tstatementnode.det_resulttype and tststatementnode.pass_1
* fixed some getcopy issues with ttemp*nodes
Revision 1.42 2003/04/17 07:50:24 daniel
* Some work on interference graph construction * Some work on interference graph construction
Revision 1.41 2003/04/12 14:53:59 jonas Revision 1.41 2003/04/12 14:53:59 jonas