diff --git a/cc/builder.go b/cc/builder.go index b583586f3..d8e90b617 100644 --- a/cc/builder.go +++ b/cc/builder.go @@ -307,7 +307,7 @@ type builderFlags struct { rsFlags string toolchain config.Toolchain tidy bool - coverage bool + gcovCoverage bool sAbiDump bool emitXrefs bool @@ -369,7 +369,7 @@ func TransformSourceToObj(ctx android.ModuleContext, subdir string, srcFiles and tidyFiles = make(android.Paths, 0, len(srcFiles)) } var coverageFiles android.Paths - if flags.coverage { + if flags.gcovCoverage { coverageFiles = make(android.Paths, 0, len(srcFiles)) } var kytheFiles android.Paths @@ -470,7 +470,7 @@ func TransformSourceToObj(ctx android.ModuleContext, subdir string, srcFiles and var ccCmd string tidy := flags.tidy - coverage := flags.coverage + coverage := flags.gcovCoverage dump := flags.sAbiDump rule := cc emitXref := flags.emitXrefs diff --git a/cc/cc.go b/cc/cc.go index 6e02b2497..63aab95e5 100644 --- a/cc/cc.go +++ b/cc/cc.go @@ -182,11 +182,11 @@ type Flags struct { // These must be after any module include flags, which will be in CommonFlags. SystemIncludeFlags []string - Toolchain config.Toolchain - Tidy bool - Coverage bool - SAbiDump bool - EmitXrefs bool // If true, generate Ninja rules to generate emitXrefs input files for Kythe + Toolchain config.Toolchain + Tidy bool + GcovCoverage bool + SAbiDump bool + EmitXrefs bool // If true, generate Ninja rules to generate emitXrefs input files for Kythe RequiredInstructionSet string DynamicLinker string diff --git a/cc/coverage.go b/cc/coverage.go index b94b628fc..bde07fd63 100644 --- a/cc/coverage.go +++ b/cc/coverage.go @@ -82,10 +82,10 @@ func (cov *coverage) flags(ctx ModuleContext, flags Flags, deps PathDeps) (Flags } if cov.Properties.CoverageEnabled { - flags.Coverage = true cov.linkCoverage = true if gcovCoverage { + flags.GcovCoverage = true flags.Local.CommonFlags = append(flags.Local.CommonFlags, "--coverage", "-O0") // Override -Wframe-larger-than and non-default optimization diff --git a/cc/util.go b/cc/util.go index 60070bbc4..af26268e2 100644 --- a/cc/util.go +++ b/cc/util.go @@ -82,7 +82,7 @@ func flagsToBuilderFlags(in Flags) builderFlags { tidyFlags: strings.Join(in.TidyFlags, " "), sAbiFlags: strings.Join(in.SAbiFlags, " "), toolchain: in.Toolchain, - coverage: in.Coverage, + gcovCoverage: in.GcovCoverage, tidy: in.Tidy, sAbiDump: in.SAbiDump, emitXrefs: in.EmitXrefs,