Class RedundantAssignmentEliminator
- java.lang.Object
-
- com.tonic.analysis.source.ast.transform.RedundantAssignmentEliminator
-
- All Implemented Interfaces:
ASTTransform
public class RedundantAssignmentEliminator extends Object implements ASTTransform
Removes a redundant re-assignmentx = Vthat repeats an earlier identicalx = Vin the same block, when nothing between writesxandVis side-effect free.
-
-
Constructor Summary
Constructors Constructor Description RedundantAssignmentEliminator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetName()booleantransform(BlockStmt root)Transforms the given block statement in place.
-
-
-
Method Detail
-
getName
public String getName()
- Specified by:
getNamein interfaceASTTransform- Returns:
- the name of this transform for logging/debugging
-
transform
public boolean transform(BlockStmt root)
Description copied from interface:ASTTransformTransforms the given block statement in place.- Specified by:
transformin interfaceASTTransform- Parameters:
root- the block to transform- Returns:
- true if any changes were made
-
-