mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 00:09:17 +02:00
* cleanup
* handling of result node simplified git-svn-id: trunk@25978 -
This commit is contained in:
parent
cca520abd9
commit
424d5cafb2
@ -206,40 +206,15 @@ unit optdfa;
|
|||||||
begin
|
begin
|
||||||
if assigned(n.successor) then
|
if assigned(n.successor) then
|
||||||
begin
|
begin
|
||||||
{
|
|
||||||
write('Successor Life: ');
|
|
||||||
printdfaset(output,n.successor.optinfo^.life);
|
|
||||||
writeln;
|
|
||||||
write('Def.');
|
|
||||||
printdfaset(output,n.optinfo^.def);
|
|
||||||
writeln;
|
|
||||||
}
|
|
||||||
{ ensure we can access optinfo }
|
{ ensure we can access optinfo }
|
||||||
DFASetDiff(l,n.successor.optinfo^.life,n.optinfo^.def);
|
DFASetDiff(l,n.successor.optinfo^.life,n.optinfo^.def);
|
||||||
{
|
|
||||||
printdfaset(output,l);
|
|
||||||
writeln;
|
|
||||||
}
|
|
||||||
DFASetIncludeSet(l,n.optinfo^.use);
|
DFASetIncludeSet(l,n.optinfo^.use);
|
||||||
DFASetIncludeSet(l,n.optinfo^.life);
|
DFASetIncludeSet(l,n.optinfo^.life);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
{ last node, not exit or raise node and function? }
|
l:=n.optinfo^.use;
|
||||||
if assigned(resultnode) and
|
DFASetIncludeSet(l,n.optinfo^.life);
|
||||||
not(n.nodetype=exitn) and
|
|
||||||
not((n.nodetype=calln) and (cnf_call_never_returns in tcallnode(n).callnodeflags)) then
|
|
||||||
begin
|
|
||||||
{ if yes, result lifes }
|
|
||||||
DFASetDiff(l,resultnode.optinfo^.life,n.optinfo^.def);
|
|
||||||
DFASetIncludeSet(l,n.optinfo^.use);
|
|
||||||
DFASetIncludeSet(l,n.optinfo^.life);
|
|
||||||
end
|
|
||||||
else
|
|
||||||
begin
|
|
||||||
l:=n.optinfo^.use;
|
|
||||||
DFASetIncludeSet(l,n.optinfo^.life);
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
updatelifeinfo(n,l);
|
updatelifeinfo(n,l);
|
||||||
end;
|
end;
|
||||||
@ -261,7 +236,9 @@ unit optdfa;
|
|||||||
exit;
|
exit;
|
||||||
include(node.flags,nf_processing);
|
include(node.flags,nf_processing);
|
||||||
|
|
||||||
if not(assigned(node.successor)) and (node<>resultnode) then
|
if not(assigned(node.successor)) and (node<>resultnode) and
|
||||||
|
not((node.nodetype=calln) and (cnf_call_never_returns in tcallnode(node).callnodeflags)) and
|
||||||
|
not(node.nodetype in [raisen,exitn]) then
|
||||||
node.successor:=resultnode;
|
node.successor:=resultnode;
|
||||||
|
|
||||||
if assigned(node.successor) then
|
if assigned(node.successor) then
|
||||||
@ -602,7 +579,10 @@ unit optdfa;
|
|||||||
resultnode.optinfo^.life:=resultnode.optinfo^.use;
|
resultnode.optinfo^.life:=resultnode.optinfo^.use;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
resultnode:=cnothingnode.create;
|
begin
|
||||||
|
resultnode:=cnothingnode.create;
|
||||||
|
resultnode.allocoptinfo;
|
||||||
|
end;
|
||||||
|
|
||||||
repeat
|
repeat
|
||||||
inc(runs);
|
inc(runs);
|
||||||
|
Loading…
Reference in New Issue
Block a user