summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Treehugger Robot <treehugger-gerrit@google.com> 2020-08-05 23:10:00 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2020-08-05 23:10:00 +0000
commitcf187bcbbcc8c49c20a5c8dddbc809897145bf95 (patch)
treea9bad3548bd235a9adfab2273e00ab2899f8a48b
parent53bba5de8a1a524694529d17ae405ae7beec9a49 (diff)
parentf45e152e15773fab6cef521b55fdf88bba0841a2 (diff)
Merge "[cc/coverage] Pass directory to -fprofile-instr-generate"
-rw-r--r--cc/coverage.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/cc/coverage.go b/cc/coverage.go
index c8233247f..f378e0d20 100644
--- a/cc/coverage.go
+++ b/cc/coverage.go
@@ -22,6 +22,8 @@ import (
"android/soong/android"
)
+const profileInstrFlag = "-fprofile-instr-generate=/data/misc/trace/clang-%p-%m.profraw"
+
type CoverageProperties struct {
Native_coverage *bool
@@ -92,7 +94,7 @@ func (cov *coverage) flags(ctx ModuleContext, flags Flags, deps PathDeps) (Flags
// flags that the module may use.
flags.Local.CFlags = append(flags.Local.CFlags, "-Wno-frame-larger-than=", "-O0")
} else if clangCoverage {
- flags.Local.CommonFlags = append(flags.Local.CommonFlags, "-fprofile-instr-generate", "-fcoverage-mapping", "-Wno-pass-failed")
+ flags.Local.CommonFlags = append(flags.Local.CommonFlags, profileInstrFlag, "-fcoverage-mapping", "-Wno-pass-failed")
}
}
@@ -139,7 +141,7 @@ func (cov *coverage) flags(ctx ModuleContext, flags Flags, deps PathDeps) (Flags
flags.Local.LdFlags = append(flags.Local.LdFlags, "-Wl,--wrap,getenv")
} else if clangCoverage {
- flags.Local.LdFlags = append(flags.Local.LdFlags, "-fprofile-instr-generate")
+ flags.Local.LdFlags = append(flags.Local.LdFlags, profileInstrFlag)
coverage := ctx.GetDirectDepWithTag(getClangProfileLibraryName(ctx), CoverageDepTag).(*Module)
deps.WholeStaticLibs = append(deps.WholeStaticLibs, coverage.OutputFile().Path())