summaryrefslogtreecommitdiff
path: root/rust/afdo.go
diff options
context:
space:
mode:
Diffstat (limited to 'rust/afdo.go')
-rw-r--r--rust/afdo.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/rust/afdo.go b/rust/afdo.go
index 3534ee6e4..6bd4bae1a 100644
--- a/rust/afdo.go
+++ b/rust/afdo.go
@@ -39,19 +39,19 @@ func (afdo *afdo) addDep(ctx BaseModuleContext, actx android.BottomUpMutatorCont
return
}
- if mod, ok := ctx.Module().(*Module); ok && mod.Enabled() {
+ if mod, ok := ctx.Module().(*Module); ok && mod.Enabled(ctx) {
fdoProfileName, err := actx.DeviceConfig().AfdoProfile(actx.ModuleName())
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}...,
)
}
}
@@ -67,8 +67,7 @@ func (afdo *afdo) flags(ctx android.ModuleContext, flags Flags, deps PathDeps) (
}
ctx.VisitDirectDepsWithTag(cc.FdoProfileTag, func(m android.Module) {
- if ctx.OtherModuleHasProvider(m, cc.FdoProfileProvider) {
- info := ctx.OtherModuleProvider(m, cc.FdoProfileProvider).(cc.FdoProfileInfo)
+ if info, ok := android.OtherModuleProvider(ctx, m, cc.FdoProfileProvider); ok {
path := info.Path
profileUseFlag := fmt.Sprintf(afdoFlagFormat, path.String())
flags.RustFlags = append(flags.RustFlags, profileUseFlag)