Reimplement afdo support for rust
Ignore-AOSP-First: The parent CL is internal Bug: 267229065 Test: go test Change-Id: Ia14679285b92f3f14ff269392a61f978c71311b2
This commit is contained in:
@@ -39,7 +39,6 @@ func init() {
|
||||
ctx.BottomUp("rust_libraries", LibraryMutator).Parallel()
|
||||
ctx.BottomUp("rust_stdlinkage", LibstdMutator).Parallel()
|
||||
ctx.BottomUp("rust_begin", BeginMutator).Parallel()
|
||||
|
||||
})
|
||||
android.PostDepsMutators(func(ctx android.RegisterMutatorsContext) {
|
||||
ctx.BottomUp("rust_sanitizers", rustSanitizerRuntimeMutator).Parallel()
|
||||
@@ -920,7 +919,7 @@ func (mod *Module) GenerateAndroidBuildActions(actx android.ModuleContext) {
|
||||
|
||||
// Calculate rustc flags
|
||||
if mod.afdo != nil {
|
||||
flags, deps = mod.afdo.flags(ctx, flags, deps)
|
||||
flags, deps = mod.afdo.flags(actx, flags, deps)
|
||||
}
|
||||
if mod.compiler != nil {
|
||||
flags = mod.compiler.compilerFlags(ctx, flags)
|
||||
@@ -1613,6 +1612,8 @@ func (mod *Module) DepsMutator(actx android.BottomUpMutatorContext) {
|
||||
|
||||
// proc_macros are compiler plugins, and so we need the host arch variant as a dependendcy.
|
||||
actx.AddFarVariationDependencies(ctx.Config().BuildOSTarget.Variations(), procMacroDepTag, deps.ProcMacros...)
|
||||
|
||||
mod.afdo.addDep(ctx, actx)
|
||||
}
|
||||
|
||||
// addRlibDependency will add an rlib dependency, rewriting to the snapshot library if available.
|
||||
|
Reference in New Issue
Block a user