export clang-tidy extraArgFlags to Bazel
We want to keep these flags in sync between Soong and Bazel, so we need
to export it to a variable that Bazel can read.
Test: CI
Bug: 255750565
Change-Id: Idf019fa6a85d2d6bb2341b6cb989a48e9ef27d2e
diff --git a/cc/tidy.go b/cc/tidy.go
index a3d548b..bbcaece 100644
--- a/cc/tidy.go
+++ b/cc/tidy.go
@@ -136,19 +136,7 @@
flags.TidyFlags = append(flags.TidyFlags, "-extra-arg-before=-fno-caret-diagnostics")
}
- extraArgFlags := []string{
- // We might be using the static analyzer through clang tidy.
- // https://bugs.llvm.org/show_bug.cgi?id=32914
- "-D__clang_analyzer__",
-
- // A recent change in clang-tidy (r328258) enabled destructor inlining, which
- // appears to cause a number of false positives. Until that's resolved, this turns
- // off the effects of r328258.
- // https://bugs.llvm.org/show_bug.cgi?id=37459
- "-Xclang", "-analyzer-config", "-Xclang", "c++-temp-dtor-inlining=false",
- }
-
- for _, f := range extraArgFlags {
+ for _, f := range config.TidyExtraArgFlags() {
flags.TidyFlags = append(flags.TidyFlags, "-extra-arg-before="+f)
}