[PATCH] D87118: Add an explicit toggle for the static analyzer in clang-tidy

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 9 11:32:55 PDT 2020


thakis added inline comments.


================
Comment at: llvm/utils/gn/secondary/clang-tools-extra/clang-tidy/BUILD.gn:18
+  } else {
+    values += [ "CLANG_TIDY_ENABLE_STATIC_ANALYZER=" ]
+  }
----------------
thakis wrote:
> hans wrote:
> > Why not =0?
> Because it's a #cmakedefine01, and the string "0" counts as truthy. See http://llvm-cs.pcc.me.uk/utils/gn/build/write_cmake_config.py#15
> 
> (That should probably print an error if a #cmakedefine gets a "0" argument since that's basically never what you want.)
Reading that script more, a better answer is "because the behavior of that script isn't quite right". It should treat '0' as false-y and all the gn files should use `=0` where they currently use `=`. I'll make a separate CL for that, but for now this is consistent with everything that's there.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87118/new/

https://reviews.llvm.org/D87118



More information about the llvm-commits mailing list