diff options
author | Lukacs T. Berki <lberki@google.com> | 2022-04-20 11:52:20 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2022-04-20 11:52:20 +0000 |
commit | fc8c3e1f3d09a9931fcde600aab703e8ace497f5 (patch) | |
tree | 1080eab2abc01a38d7511b006730b92ee84852cf | |
parent | 3e80e0d5b0dd483f8020beb6c4c8f65b2b51aabe (diff) | |
parent | cfcb14e688159268d106945294dd2450720410c9 (diff) | |
download | blueprint-android13-d4-s2-release.tar.gz |
Remove the concept of "early mutator". am: 83a5a308b1 am: 85011ed22a am: 24a8eb0e51 am: c25454a0d5 am: cfcb14e688android-13.0.0_r49android-13.0.0_r48android-13.0.0_r47android-13.0.0_r46android-13.0.0_r45android-13.0.0_r44android-13.0.0_r43android-13.0.0_r42android-13.0.0_r41android-13.0.0_r40android-13.0.0_r39android-13.0.0_r38android-13.0.0_r37android-13.0.0_r36android-13.0.0_r35android-13.0.0_r34android-13.0.0_r33android-13.0.0_r32android13-qpr2-s9-releaseandroid13-qpr2-s8-releaseandroid13-qpr2-s7-releaseandroid13-qpr2-s6-releaseandroid13-qpr2-s5-releaseandroid13-qpr2-s3-releaseandroid13-qpr2-s2-releaseandroid13-qpr2-s12-releaseandroid13-qpr2-s11-releaseandroid13-qpr2-s10-releaseandroid13-qpr2-s1-releaseandroid13-qpr2-releaseandroid13-qpr2-b-s1-releaseandroid13-d4-s2-releaseandroid13-d4-s1-releaseandroid13-d4-release
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/2067144
Change-Id: Icd1fa001a0e44e7a5cb1931f07a74a9710fa8bc5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | context.go | 40 | ||||
-rw-r--r-- | module_ctx.go | 27 |
2 files changed, 1 insertions, 66 deletions
@@ -83,7 +83,6 @@ type Context struct { preSingletonInfo []*singletonInfo singletonInfo []*singletonInfo mutatorInfo []*mutatorInfo - earlyMutatorInfo []*mutatorInfo variantMutatorNames []string depsModified uint32 // positive if a mutator modified the dependencies @@ -630,38 +629,6 @@ func (mutator *mutatorInfo) Parallel() MutatorHandle { 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) PrepareBuildActions(config interface{}) (deps []string, errs [ } 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 { diff --git a/module_ctx.go b/module_ctx.go index 787f483..53ee405 100644 --- a/module_ctx.go +++ b/module_ctx.go @@ -831,32 +831,6 @@ type BaseMutatorContext interface { MutatorName() string } -type EarlyMutatorContext interface { - BaseMutatorContext - - // CreateVariations splits a module into multiple variants, one for each name in the variationNames - // parameter. It returns a list of new modules in the same order as the variationNames - // list. - // - // If any of the dependencies of the module being operated on were already split - // by calling CreateVariations with the same name, the dependency will automatically - // be updated to point the matching variant. - // - // If a module is split, and then a module depending on the first module is not split - // when the Mutator is later called on it, the dependency of the depending module will - // automatically be updated to point to the first variant. - CreateVariations(...string) []Module - - // CreateLocalVariations splits a module into multiple variants, one for each name in the variantNames - // parameter. It returns a list of new modules in the same order as the variantNames - // list. - // - // Local variations do not affect automatic dependency resolution - dependencies added - // to the split module via deps or DynamicDependerModule must exactly match a variant - // that contains all the non-local variations. - CreateLocalVariations(...string) []Module -} - type TopDownMutatorContext interface { BaseMutatorContext @@ -995,7 +969,6 @@ type BottomUpMutatorContext interface { // if a second Mutator chooses to split the module a second time. type TopDownMutator func(mctx TopDownMutatorContext) type BottomUpMutator func(mctx BottomUpMutatorContext) -type EarlyMutator func(mctx EarlyMutatorContext) // DependencyTag is an interface to an arbitrary object that embeds BaseDependencyTag. It can be // used to transfer information on a dependency between the mutator that called AddDependency |