Convert AFDO mutators to TransitionMutator

Convert afdoDepsMutator and afdoMutator to a TransitionMutator as a
step towards variants-on-demand.

This relands Ib05845455ccf43a07b3915a0d7b0a95896062f13 with a fix
to maintain the current behavior of not using AFDO variants for
dependencies of the linker static binary.

Bug: 319288033
Bug: 324141705
Test: afdo_test.go
Change-Id: I76e30021173fc5b7e9e1fa826039776eb3dc7b6e
This commit is contained in:
Colin Cross
2024-01-23 16:38:06 -08:00
parent 15fa814560
commit d38feb0d4a
4 changed files with 98 additions and 124 deletions

View File

@@ -44,14 +44,14 @@ func (afdo *afdo) addDep(ctx BaseModuleContext, actx android.BottomUpMutatorCont
if err != nil {
ctx.ModuleErrorf("%s", err.Error())
}
if fdoProfileName != nil {
if fdoProfileName != "" {
actx.AddFarVariationDependencies(
[]blueprint.Variation{
{Mutator: "arch", Variation: actx.Target().ArchVariation()},
{Mutator: "os", Variation: "android"},
},
cc.FdoProfileTag,
[]string{*fdoProfileName}...,
[]string{fdoProfileName}...,
)
}
}