From fe1da75972dbe786c2dc22dab14ed93db5ad544a Mon Sep 17 00:00:00 2001 From: Pirama Arumuga Nainar Date: Wed, 2 Sep 2020 17:44:06 +0000 Subject: [PATCH] Revert "Revert "[pgo] Return updated Flags after adding flags for PGO/AFDO"" This reverts commit 988ff8d149f81798da0bac0b1759fcfefa41905b. Reason for revert: RBE can now handle PGO profiles during remote linking. Bug: http://b/162702246 Test: m ANDROID_PGO_INSTRUMENT=hwui hwuimacro and check hwuimacro has PGO instrumentation. Change-Id: I724b53dc086923beeb6f4b8903136545d18f4ece --- cc/pgo.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cc/pgo.go b/cc/pgo.go index 674e1bbf1..6bf0ad0aa 100644 --- a/cc/pgo.go +++ b/cc/pgo.go @@ -290,17 +290,16 @@ 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 flags + return props.addInstrumentationProfileGatherFlags(ctx, flags) } else if props.ShouldProfileModule && props.isSampling() { - props.addSamplingProfileGatherFlags(ctx, flags) + flags = props.addSamplingProfileGatherFlags(ctx, flags) } else if ctx.DeviceConfig().SamplingPGO() { - props.addSamplingProfileGatherFlags(ctx, flags) + flags = props.addSamplingProfileGatherFlags(ctx, flags) } if !ctx.Config().IsEnvTrue("ANDROID_PGO_NO_PROFILE_USE") { - props.addProfileUseFlags(ctx, flags) + flags = props.addProfileUseFlags(ctx, flags) } return flags