Class AbstractCBlockOptimizer

All Implemented Interfaces:
IPlugin, ICOptimizer, IOptimizer<ICMethod>
Direct Known Subclasses:
AbstractCElementOptimizer, AbstractCStatementOptimizer

public abstract class AbstractCBlockOptimizer extends AbstractCOptimizer
Perform a recursive optimizer on ICBlock. The policy is recurse first, so optimizer is done as post-treatment.
  • Constructor Details

    • AbstractCBlockOptimizer

      public AbstractCBlockOptimizer()
  • Method Details

    • perform

      protected int perform()
      Can be overridden. The default implementation simply calls performOnMethoBlocksRecursivively().
      Specified by:
      perform in class AbstractCOptimizer
      Returns:
    • performOnMethoBlocksRecursivively

      public final int performOnMethoBlocksRecursivively()
    • getNextSiblingStatement

      protected ICStatement getNextSiblingStatement(int statementIndex, ICBlock block, ICStatement blockNextSiblingStm)
    • optimizeBlock

      protected abstract int optimizeBlock(ICBlock b)
      Attempt to optimize CBlock. Sub-expressions may be examined. The implementor should not attempt to modify parent or siblings CBlocks.
      Parameters:
      b - CBlock
      Returns:
      the number of optimizations done
    • optimizeBlock

      protected int optimizeBlock(ICBlock b, ICCompound parent, ICStatement blockNextStm)
      Attempt to optimize CBlock, with some contextual information provided. Sub-expressions may be examined. The implementor should not attempt to modify parent or siblings CBlocks.
      Parameters:
      b -
      parent - the parent compound statement
      blockNextStm - the next statement (i.e. the next sibling statement in the AST, not control-flow related)
      Returns: