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

Commit 7daf77bb authored by Yi Kong's avatar Yi Kong Committed by Automerger Merge Worker
Browse files

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

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

Change-Id: I73355f33044be0378e395f06f2d3b52eeed08f59
parents 6deda0a3 4f78c512
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -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