mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 02:49:21 +02:00
+ has_life_info
* successor info for for nodes fixed git-svn-id: trunk@24899 -
This commit is contained in:
parent
3016d48521
commit
0af7a6f92c
@ -47,6 +47,9 @@ unit optutils;
|
|||||||
}
|
}
|
||||||
procedure CalcDefSum(p : tnode);
|
procedure CalcDefSum(p : tnode);
|
||||||
|
|
||||||
|
{ returns true, if n is a valid node and has life info }
|
||||||
|
function has_life_info(n : tnode) : boolean;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
@ -192,6 +195,7 @@ unit optutils;
|
|||||||
result:=p;
|
result:=p;
|
||||||
{ the successor of the last node of the for body is the for node itself }
|
{ the successor of the last node of the for body is the for node itself }
|
||||||
DoSet(tfornode(p).t2,p);
|
DoSet(tfornode(p).t2,p);
|
||||||
|
p.successor:=succ;
|
||||||
Breakstack.Delete(Breakstack.Count-1);
|
Breakstack.Delete(Breakstack.Count-1);
|
||||||
Continuestack.Delete(Continuestack.Count-1);
|
Continuestack.Delete(Continuestack.Count-1);
|
||||||
p.successor:=succ;
|
p.successor:=succ;
|
||||||
@ -211,7 +215,7 @@ unit optutils;
|
|||||||
Breakstack.Add(succ);
|
Breakstack.Add(succ);
|
||||||
Continuestack.Add(p);
|
Continuestack.Add(p);
|
||||||
result:=p;
|
result:=p;
|
||||||
{ the successor of the last node of the while body is the while node itself }
|
{ the successor of the last node of the while/repeat body is the while node itself }
|
||||||
DoSet(twhilerepeatnode(p).right,p);
|
DoSet(twhilerepeatnode(p).right,p);
|
||||||
p.successor:=succ;
|
p.successor:=succ;
|
||||||
Breakstack.Delete(Breakstack.Count-1);
|
Breakstack.Delete(Breakstack.Count-1);
|
||||||
@ -324,5 +328,12 @@ unit optutils;
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function has_life_info(n : tnode) : boolean;
|
||||||
|
begin
|
||||||
|
result:=assigned(n) and assigned(n.optinfo) and
|
||||||
|
assigned(n.optinfo^.life);
|
||||||
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user