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

public abstract class AbstractCOptimizer extends AbstractOptimizer<ICMethod> implements ICOptimizer
Base class for C AST optimizers.
  • Field Details

    • m

      protected ICMethod m
      Method currently being optimized.
    • g

      protected ICGlobalContext g
      Global C AST context for the current method.
    • ef

      protected ICElementFactory ef
      Element factory for the current method.
    • of

      protected ICOperatorFactory of
      Operator factory for the current method.
    • cf

      protected ICConstantFactory cf
      Constant factory for the current method.
  • Constructor Details

    • AbstractCOptimizer

      public AbstractCOptimizer()
      Create a C AST optimizer.
  • Method Details

    • getMasterOptimizer

      public ICMasterOptimizer getMasterOptimizer()
      Description copied from interface: IOptimizer
      Retrieve the optional master optimizer that manages this optimizer.
      Specified by:
      getMasterOptimizer in interface IOptimizer<ICMethod>
      Overrides:
      getMasterOptimizer in class AbstractOptimizer<ICMethod>
      Returns:
      optional reference
    • getMasterOptimizerSafe

      protected ICMasterOptimizer getMasterOptimizerSafe()
      Safely retrieve a master optimizer. If getMasterOptimizer() provides one, it is returned. Else, an empty immutable generic MO is provided.
      Returns:
      never null
    • performOnTarget

      public final int performOnTarget(ICMethod m)
      Description copied from interface: IOptimizer
      Perform the optimization pass.
      Specified by:
      performOnTarget in interface IOptimizer<ICMethod>
      Parameters:
      m - target to optimize
      Returns:
      the number of optimizations performed; if negative, an error has occurred and the optimizing process should be aborted
    • perform

      protected abstract int perform()
      Perform the optimizer-specific work.
      Returns:
      the number of optimizations performed