summaryrefslogtreecommitdiff
path: root/cc/compiler.go
diff options
context:
space:
mode:
author Colin Cross <ccross@android.com> 2019-02-04 11:22:08 -0800
committer Colin Cross <ccross@android.com> 2019-02-06 01:52:41 +0000
commit571cccfcbc795f2bc955ca7fb3ac09085b360e09 (patch)
tree16da47a7ce728a0dfec6d48b1ef89c2cf72341f3 /cc/compiler.go
parent5cb5b093d1f49a160b6ef2994c6bce07793a7d2d (diff)
Prepare for a type-safe OnceKey
Add an opaque OnceKey type and use it for all calls to Once in build/soong. A future patch will convert the arguments to Once* to OnceKey once users outside build/soong have been updated. Test: onceper_test.go Change-Id: Ifcb338e6e603e804e507203c9508d30ffb2df966
Diffstat (limited to 'cc/compiler.go')
-rw-r--r--cc/compiler.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/cc/compiler.go b/cc/compiler.go
index fbe10b50a..0aee0bdb3 100644
--- a/cc/compiler.go
+++ b/cc/compiler.go
@@ -250,8 +250,8 @@ func warningsAreAllowed(subdir string) bool {
return false
}
-func addToModuleList(ctx ModuleContext, list string, module string) {
- getNamedMapForConfig(ctx.Config(), list).Store(module, true)
+func addToModuleList(ctx ModuleContext, key android.OnceKey, module string) {
+ getNamedMapForConfig(ctx.Config(), key).Store(module, true)
}
// Create a Flags struct that collects the compile flags from global values,
@@ -503,10 +503,10 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps
if len(compiler.Properties.Srcs) > 0 {
module := ctx.ModuleDir() + "/Android.bp:" + ctx.ModuleName()
if inList("-Wno-error", flags.CFlags) || inList("-Wno-error", flags.CppFlags) {
- addToModuleList(ctx, modulesUsingWnoError, module)
+ addToModuleList(ctx, modulesUsingWnoErrorKey, module)
} else if !inList("-Werror", flags.CFlags) && !inList("-Werror", flags.CppFlags) {
if warningsAreAllowed(ctx.ModuleDir()) {
- addToModuleList(ctx, modulesAddedWall, module)
+ addToModuleList(ctx, modulesAddedWallKey, module)
flags.CFlags = append([]string{"-Wall"}, flags.CFlags...)
} else {
flags.CFlags = append([]string{"-Wall", "-Werror"}, flags.CFlags...)