Package soot.jimple.toolkits.graph
Class LoopConditionUnroller
- java.lang.Object
-
- soot.Transformer
-
- soot.BodyTransformer
-
- soot.jimple.toolkits.graph.LoopConditionUnroller
-
public class LoopConditionUnroller extends BodyTransformer
"unrolls" the condition of while/for loops.
before the first test of a while-loop, we can't be sure, if the body will be taken or not, and several optimizations (especially LCM) can't be done. In this class we try to solve this problem by unrolling the condition of the while-block: we make a copy of the condition-block, and redirect the back-edge of the while-loop to the new block.
After this transformation the edge between the original condition-block and the loop-body is only executed once (and hence suitable for LCM) and we can be sure, that the loop-body will get executed.
Exceptions are ignored (the transformation is done on aBriefBlockGraph.
-
-
Constructor Summary
Constructors Constructor Description LoopConditionUnroller()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidinternalTransform(Body body, String phaseName, Map<String,String> options)unrolls conditions.-
Methods inherited from class soot.BodyTransformer
transform, transform, transform
-
-
-
-
Method Detail
-
internalTransform
protected void internalTransform(Body body, String phaseName, Map<String,String> options)
unrolls conditions.- Specified by:
internalTransformin classBodyTransformer- Parameters:
body- the body on which to apply the transformationphaseName- the phasename for this transform; not typically used by implementations.options- the actual computed options; a combination of default options and Scene specified options.
-
-