aboutsummaryrefslogtreecommitdiffstats
path: root/cc/pgo.go
diff options
context:
space:
mode:
authorPirama Arumuga Nainar <pirama@google.com>2017-12-13 16:48:20 -0800
committerPirama Arumuga Nainar <pirama@google.com>2017-12-13 17:48:33 -0800
commit690ed553632a360f62893d99f4219746c7d6907f (patch)
tree8d3e844c077d0df28c915bd62a6d584492c49ec6 /cc/pgo.go
parent7434c565ffcce1ac05d9184912eb2dbe3ec5ea82 (diff)
downloadbuild_soong-690ed553632a360f62893d99f4219746c7d6907f.tar.gz
build_soong-690ed553632a360f62893d99f4219746c7d6907f.tar.bz2
build_soong-690ed553632a360f62893d99f4219746c7d6907f.zip
Add cflags sub-property to 'pgo'
This (possibly arch-specific) property adds extra flags while building for profiling. For example, dex2oat requires setting '-Wno-frame-larger-than' when instrumentation is enabled. Test: Build 'pgo' module with the new property and inspect build.ninja Change-Id: Ia36422a400b0e0b87cbb33b1c8e565569475a56d
Diffstat (limited to 'cc/pgo.go')
-rw-r--r--cc/pgo.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/cc/pgo.go b/cc/pgo.go
index 9fea1542..fef962e4 100644
--- a/cc/pgo.go
+++ b/cc/pgo.go
@@ -42,6 +42,9 @@ type PgoProperties struct {
Profile_file *string `android:"arch_variant"`
Benchmarks []string
Enable_profile_use *bool `android:"arch_variant"`
+ // Additional compiler flags to use when building this module
+ // for profiling (either instrumentation or sampling).
+ Cflags []string `android:"arch_variant"`
} `android:"arch_variant"`
PgoPresent bool `blueprint:"mutated"`
@@ -65,6 +68,8 @@ func (pgo *pgo) props() []interface{} {
}
func (props *PgoProperties) addProfileGatherFlags(ctx ModuleContext, flags Flags) Flags {
+ flags.CFlags = append(flags.CFlags, props.Pgo.Cflags...)
+
if props.isInstrumentation() {
flags.CFlags = append(flags.CFlags, profileInstrumentFlag)
// The profile runtime is added below in deps(). Add the below