Class PassFactory


  • public abstract class PassFactory
    extends java.lang.Object
    A factory for creating JSCompiler passes based on the Options injected.

    Contains all meta-data about compiler passes (like whether it can be run multiple times, a human-readable name for logging, etc.).

    • Method Detail

      • getName

        public abstract java.lang.String getName()
        The name of the pass as it will appear in logs.
      • isRunInFixedPointLoop

        public abstract boolean isRunInFixedPointLoop()
        Whether this factory must or must not appear in a PhaseOptimizer loop.
      • getFeatureSet

        public abstract FeatureSet getFeatureSet()
        The set of features that this pass understands.

        Passes that can handle any code (no-op passes, extremely simple passes that are unlikely to be broken by new features, etc.) should return FeatureSet.latest().

      • createEmptyPass

        public static PassFactory createEmptyPass​(java.lang.String name)
        Create a no-op pass that can only run once. Used to break up loops.