From b8533a82cdbccb86e268bd3df9319f4cf6c9193b Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Sat, 5 Oct 2024 15:25:09 -0700 Subject: Annotate mutators that use methods that prevent mutator coalescing Mutator coalescing reduces the overhead of visiting every module for every mutator by calling a series of mutator methods on a a single module in a row. This is only valid for well-behaved mutators. Add methods on MutatorHandle that allow annotating mutators that are not well behaved, and use that to prevent coalescing mutators. Bug: 372076859 Test: all soong tests pass with race detector on Flag: EXEMPT refactor Change-Id: Id9b005f05227e5558cac6d488030a7398af13fb8 --- android/namespace_test.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'android/namespace_test.go') diff --git a/android/namespace_test.go b/android/namespace_test.go index ea51c6eae..0327e7824 100644 --- a/android/namespace_test.go +++ b/android/namespace_test.go @@ -646,7 +646,7 @@ var prepareForTestWithNamespace = GroupFixturePreparers( ctx.RegisterModuleType("test_module", newTestModule) ctx.Context.RegisterModuleType("blueprint_test_module", newBlueprintTestModule) ctx.PreDepsMutators(func(ctx RegisterMutatorsContext) { - ctx.BottomUp("rename", renameMutator) + ctx.BottomUp("rename", renameMutator).UsesRename() }) }), ) @@ -709,9 +709,6 @@ type testModule struct { } func (m *testModule) DepsMutator(ctx BottomUpMutatorContext) { - if m.properties.Rename != "" { - ctx.Rename(m.properties.Rename) - } for _, d := range m.properties.Deps { ctx.AddDependency(ctx.Module(), nil, d) } -- cgit v1.2.3-59-g8ed1b