Package com.google.javascript.jscomp
Class PassListBuilder
- java.lang.Object
-
- com.google.javascript.jscomp.PassListBuilder
-
public final class PassListBuilder extends java.lang.Object
This class exists to funnel the list of passes through a central mechanism to ensure that the PassFactory can define and enforce conditions that much be met in order for the pass they create to be added to the compilation process.
-
-
Constructor Summary
Constructors Constructor Description PassListBuilder(CompilerOptions options)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addAfter(PassFactory factory, java.lang.String passName)
Insert the given pass factory before the factory of the given name.void
addAll(PassListBuilder other)
void
addAllUpTo(PassListBuilder other, java.lang.String passName)
Deprecated.replace uses of this method with a more precise definition of a pass configuration.void
addBefore(PassFactory factory, java.lang.String passName)
Insert the given pass factory before the factory of the given name.void
assertAllLoopablePasses()
Verify that all the passes are multi-run passes.void
assertAllOneTimePasses()
Verify that all the passes are one-time passes.void
assertPassOrder(PassFactory pass1, PassFactory pass2, java.lang.String msg)
Asserts that if both PassFactory are present, pass1 is ordered before pass2.com.google.common.collect.ImmutableList<PassFactory>
build()
boolean
contains(PassFactory factory)
PassFactory
findByName(java.lang.String name)
void
maybeAdd(PassFactory factory)
Add only if the PassFactory condition evaluates to true.void
removeByName(java.lang.String name)
Deprecated.Do not add new uses to the method.
-
-
-
Constructor Detail
-
PassListBuilder
public PassListBuilder(CompilerOptions options)
-
-
Method Detail
-
build
public com.google.common.collect.ImmutableList<PassFactory> build()
-
addAll
public void addAll(PassListBuilder other)
-
maybeAdd
public void maybeAdd(PassFactory factory)
Add only if the PassFactory condition evaluates to true.
-
addBefore
public void addBefore(PassFactory factory, java.lang.String passName)
Insert the given pass factory before the factory of the given name. Throws if the specified pass is not present
-
addAfter
public void addAfter(PassFactory factory, java.lang.String passName)
Insert the given pass factory before the factory of the given name. Throws if the specified pass is not present
-
addAllUpTo
@Deprecated public void addAllUpTo(PassListBuilder other, java.lang.String passName)
Deprecated.replace uses of this method with a more precise definition of a pass configuration.Returns the list of pass up to and including the named pass, otherwise return an empty set of passes.Do not add new uses of this method.
-
findByName
public PassFactory findByName(java.lang.String name)
-
removeByName
@Deprecated public void removeByName(java.lang.String name)
Deprecated.Do not add new uses to the method. This method exists only for migration purposes. Removing passes piecemeal is very fragile.Remove a pass with the specified name.
-
contains
public boolean contains(PassFactory factory)
-
assertAllOneTimePasses
public void assertAllOneTimePasses()
Verify that all the passes are one-time passes.
-
assertAllLoopablePasses
public void assertAllLoopablePasses()
Verify that all the passes are multi-run passes.
-
assertPassOrder
public void assertPassOrder(PassFactory pass1, PassFactory pass2, java.lang.String msg)
Asserts that if both PassFactory are present, pass1 is ordered before pass2.
-
-