Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 38414db4 authored by Bowgo Tsai's avatar Bowgo Tsai Committed by Gerrit Code Review
Browse files

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

parents 3600b80e 988ff8d1
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -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