Merge "Revert "[pgo] Return updated Flags after adding flags for PGO/AFDO"" am: 38414db4de

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1413430

Change-Id: I27e6f7450ad00ae056695f2d48f0ea16c1a3f2e8
This commit is contained in:
Bowgo Tsai
2020-08-28 08:33:36 +00:00
committed by Automerger Merge Worker

View File

@@ -290,16 +290,17 @@ func (pgo *pgo) flags(ctx ModuleContext, flags Flags) Flags {
// Add flags to profile this module based on its profile_kind
if props.ShouldProfileModule && props.isInstrumentation() {
props.addInstrumentationProfileGatherFlags(ctx, flags)
// Instrumentation PGO use and gather flags cannot coexist.
return props.addInstrumentationProfileGatherFlags(ctx, flags)
return flags
} else if props.ShouldProfileModule && props.isSampling() {
flags = props.addSamplingProfileGatherFlags(ctx, flags)
props.addSamplingProfileGatherFlags(ctx, flags)
} else if ctx.DeviceConfig().SamplingPGO() {
flags = props.addSamplingProfileGatherFlags(ctx, flags)
props.addSamplingProfileGatherFlags(ctx, flags)
}
if !ctx.Config().IsEnvTrue("ANDROID_PGO_NO_PROFILE_USE") {
flags = props.addProfileUseFlags(ctx, flags)
props.addProfileUseFlags(ctx, flags)
}
return flags