|
@@ -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.
|
|
|
|
|