aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChih-Hung Hsieh <chh@google.com>2018-06-25 13:48:42 -0700
committerChih-Hung Hsieh <chh@google.com>2018-06-25 13:48:42 -0700
commitad47a27d9c2dfeaacf91260a3901f8d955218fd1 (patch)
tree98b217cf1f9f2a87a73ef3a19a71d595453fc5b6
parent297d9bcedaa14670a84c3dc4d4bf90b9ea033bea (diff)
downloadbuild_soong-ad47a27d9c2dfeaacf91260a3901f8d955218fd1.tar.gz
build_soong-ad47a27d9c2dfeaacf91260a3901f8d955218fd1.tar.bz2
build_soong-ad47a27d9c2dfeaacf91260a3901f8d955218fd1.zip
Define CLANG_TIDY_UNKNOWN_CFLAGS for build/make.
Bug: 110538415 Test: build with WITH_TIDY=1 Change-Id: I6c5b5a0cb3ad3c2756bbae5e7c0234a0dafe5991
-rw-r--r--cc/config/tidy.go7
-rw-r--r--cc/makevars.go1
2 files changed, 8 insertions, 0 deletions
diff --git a/cc/config/tidy.go b/cc/config/tidy.go
index a20d5560..5d53a8cd 100644
--- a/cc/config/tidy.go
+++ b/cc/config/tidy.go
@@ -19,6 +19,13 @@ import (
"strings"
)
+// clang-tidy doesn't recognize every flag that clang does. This is unlikely to
+// be a complete list, but we can populate this with the ones we know to avoid
+// issues with clang-diagnostic-unused-command-line-argument.
+var ClangTidyUnknownCflags = sorted([]string{
+ "-Wa,%",
+})
+
func init() {
// Most Android source files are not clang-tidy clean yet.
// Global tidy checks include only google*, performance*,
diff --git a/cc/makevars.go b/cc/makevars.go
index 5a912e10..88d4639b 100644
--- a/cc/makevars.go
+++ b/cc/makevars.go
@@ -75,6 +75,7 @@ func makeVarsProvider(ctx android.MakeVarsContext) {
ctx.Strict("LLVM_OBJCOPY", "${config.ClangBin}/llvm-objcopy")
ctx.Strict("LLVM_STRIP", "${config.ClangBin}/llvm-strip")
ctx.Strict("PATH_TO_CLANG_TIDY", "${config.ClangBin}/clang-tidy")
+ ctx.Strict("CLANG_TIDY_UNKNOWN_CFLAGS", strings.Join(config.ClangTidyUnknownCflags, " "))
ctx.StrictSorted("CLANG_CONFIG_UNKNOWN_CFLAGS", strings.Join(config.ClangUnknownCflags, " "))
ctx.Strict("RS_LLVM_PREBUILTS_VERSION", "${config.RSClangVersion}")