Package com.tonic.analysis.ssa.transform
Class DeadCodeElimination
- java.lang.Object
-
- com.tonic.analysis.ssa.transform.DeadCodeElimination
-
- All Implemented Interfaces:
IRTransform
public class DeadCodeElimination extends Object implements IRTransform
Removes dead code (definitions with no uses).
-
-
Constructor Summary
Constructors Constructor Description DeadCodeElimination()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetName()Gets the name of this transformation.static voidremoveUnreachableBlocks(IRMethod method)Removes blocks not reachable from the method entry or any exception handler.booleanrun(IRMethod method)Runs the dead code elimination transformation on the specified method.
-
-
-
Method Detail
-
getName
public String getName()
Gets the name of this transformation.- Specified by:
getNamein interfaceIRTransform- Returns:
- the transformation name
-
run
public boolean run(IRMethod method)
Runs the dead code elimination transformation on the specified method.- Specified by:
runin interfaceIRTransform- Parameters:
method- the method to transform- Returns:
- true if the method was modified
-
removeUnreachableBlocks
public static void removeUnreachableBlocks(IRMethod method)
Removes blocks not reachable from the method entry or any exception handler.- Parameters:
method- the method whose unreachable blocks to remove
-
-