Class RedundantAssignmentEliminator

  • All Implemented Interfaces:
    ASTTransform

    public class RedundantAssignmentEliminator
    extends Object
    implements ASTTransform
    Removes a redundant re-assignment x = V that repeats an earlier identical x = V in the same block, when nothing between writes x and V is side-effect free.
    • Constructor Detail

      • RedundantAssignmentEliminator

        public RedundantAssignmentEliminator()
    • Method Detail

      • getName

        public String getName()
        Specified by:
        getName in interface ASTTransform
        Returns:
        the name of this transform for logging/debugging
      • transform

        public boolean transform​(BlockStmt root)
        Description copied from interface: ASTTransform
        Transforms the given block statement in place.
        Specified by:
        transform in interface ASTTransform
        Parameters:
        root - the block to transform
        Returns:
        true if any changes were made