Remove the concept of "early mutator".
It was unused and as such, maintenance cost for no benefit.
Test: Presubmits.
Change-Id: Ifc35c0f55647ef88ed0bfa44bcf709e51a904ea4
diff --git a/context.go b/context.go
index e7b0d7d..6496948 100644
--- a/context.go
+++ b/context.go
@@ -83,7 +83,6 @@
preSingletonInfo []*singletonInfo
singletonInfo []*singletonInfo
mutatorInfo []*mutatorInfo
- earlyMutatorInfo []*mutatorInfo
variantMutatorNames []string
depsModified uint32 // positive if a mutator modified the dependencies
@@ -630,38 +629,6 @@
return mutator
}
-// RegisterEarlyMutator registers a mutator that will be invoked to split
-// Modules into multiple variant Modules before any dependencies have been
-// created. Each registered mutator is invoked in registration order once
-// per Module (including each variant from previous early mutators). Module
-// order is unpredictable.
-//
-// In order for dependencies to be satisifed in a later pass, all dependencies
-// of a module either must have an identical variant or must have no variations.
-//
-// The mutator type names given here must be unique to all bottom up or early
-// mutators in the Context.
-//
-// Deprecated, use a BottomUpMutator instead. The only difference between
-// EarlyMutator and BottomUpMutator is that EarlyMutator runs before the
-// deprecated DynamicDependencies.
-func (c *Context) RegisterEarlyMutator(name string, mutator EarlyMutator) {
- for _, m := range c.variantMutatorNames {
- if m == name {
- panic(fmt.Errorf("mutator name %s is already registered", name))
- }
- }
-
- c.earlyMutatorInfo = append(c.earlyMutatorInfo, &mutatorInfo{
- bottomUpMutator: func(mctx BottomUpMutatorContext) {
- mutator(mctx)
- },
- name: name,
- })
-
- c.variantMutatorNames = append(c.variantMutatorNames, name)
-}
-
// SetIgnoreUnknownModuleTypes sets the behavior of the context in the case
// where it encounters an unknown module type while parsing Blueprints files. By
// default, the context will report unknown module types as an error. If this
@@ -2483,13 +2450,8 @@
}
func (c *Context) runMutators(ctx context.Context, config interface{}) (deps []string, errs []error) {
- var mutators []*mutatorInfo
-
pprof.Do(ctx, pprof.Labels("blueprint", "runMutators"), func(ctx context.Context) {
- mutators = append(mutators, c.earlyMutatorInfo...)
- mutators = append(mutators, c.mutatorInfo...)
-
- for _, mutator := range mutators {
+ for _, mutator := range c.mutatorInfo {
pprof.Do(ctx, pprof.Labels("mutator", mutator.name), func(context.Context) {
var newDeps []string
if mutator.topDownMutator != nil {