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
diff --git a/android/prebuilt.go b/android/prebuilt.go
index e5d06dd..017ba76 100644
--- a/android/prebuilt.go
+++ b/android/prebuilt.go
@@ -400,13 +400,13 @@
}
func RegisterPrebuiltsPreArchMutators(ctx RegisterMutatorsContext) {
- ctx.BottomUp("prebuilt_rename", PrebuiltRenameMutator).Parallel()
+ ctx.BottomUp("prebuilt_rename", PrebuiltRenameMutator).Parallel().UsesRename()
}
func RegisterPrebuiltsPostDepsMutators(ctx RegisterMutatorsContext) {
- ctx.BottomUp("prebuilt_source", PrebuiltSourceDepsMutator).Parallel()
+ ctx.BottomUp("prebuilt_source", PrebuiltSourceDepsMutator).Parallel().UsesReverseDependencies()
ctx.BottomUp("prebuilt_select", PrebuiltSelectModuleMutator).Parallel()
- ctx.BottomUp("prebuilt_postdeps", PrebuiltPostDepsMutator).Parallel()
+ ctx.BottomUp("prebuilt_postdeps", PrebuiltPostDepsMutator).Parallel().UsesReplaceDependencies()
}
// Returns the name of the source module corresponding to a prebuilt module