From 988ff8d149f81798da0bac0b1759fcfefa41905b Mon Sep 17 00:00:00 2001 From: Bowgo Tsai Date: Fri, 28 Aug 2020 08:08:36 +0000 Subject: [PATCH] Revert "[pgo] Return updated Flags after adding flags for PGO/AFDO" This reverts commit 5010a973880e0b8abef598cf4c0ca8de8add16fd. Reason for revert: b/166728338 - build failures on master branch Bug: 162702246 Bug: 166728338 Change-Id: Ie9e51e7c5533d220ad3e160439cb38ff88f068ac Test: TreeHugger --- cc/pgo.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cc/pgo.go b/cc/pgo.go index 6bf0ad0aa..674e1bbf1 100644 --- a/cc/pgo.go +++ b/cc/pgo.go @@ -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