Class Loop
- java.lang.Object
-
- soot.jimple.toolkits.annotation.logic.Loop
-
public class Loop extends Object
A (natural) loop in Jimple. A back-edge (t,h) is a control-flow edge for which h dominates t. In this case h is the header and the loop consists of all statements s which reach t without passing through h.- Author:
- Eric Bodden
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)StmtgetBackJumpStmt()Returns the statement that jumps back to the head, thereby constituing the loop.StmtgetHead()Collection<Stmt>getLoopExits()Returns all loop exists.List<Stmt>getLoopStatements()inthashCode()booleanhasSingleExit()Returnstrueif this loop has a single exit statement.booleanloopsForever()Returnstrueif this loop certainly loops forever, i.e.Collection<Stmt>targetsOfLoopExit(Stmt loopExit)Computes all targets of the given loop exit, i.e.
-
-
-
Method Detail
-
getHead
public Stmt getHead()
- Returns:
- the loop head
-
getBackJumpStmt
public Stmt getBackJumpStmt()
Returns the statement that jumps back to the head, thereby constituing the loop.
-
getLoopStatements
public List<Stmt> getLoopStatements()
- Returns:
- all statements of the loop, including the header; the header will be the first element returned and then the other statements follow in the natural ordering of the loop
-
getLoopExits
public Collection<Stmt> getLoopExits()
Returns all loop exists. A loop exit is a statement which has a successor that is not contained in the loop.
-
targetsOfLoopExit
public Collection<Stmt> targetsOfLoopExit(Stmt loopExit)
Computes all targets of the given loop exit, i.e. statements that the exit jumps to but which are not part of this loop.
-
loopsForever
public boolean loopsForever()
Returnstrueif this loop certainly loops forever, i.e. if it has not exit.- See Also:
getLoopExits()
-
hasSingleExit
public boolean hasSingleExit()
Returnstrueif this loop has a single exit statement.- See Also:
getLoopExits()
-
-