[PATCH] D44906: [clang-tidy] Define __clang_analyzer__ macro for clang-tidy for compatibility with clang static analyzer

Alexander Kornienko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 27 08:35:45 PDT 2018


alexfh added inline comments.


================
Comment at: clang-tidy/ClangTidy.cpp:490
+        CommandLineArguments AdjustedArgs = Args;
+        AdjustedArgs.emplace_back("-D__clang_analyzer__");
+        return AdjustedArgs;
----------------
I wonder whether we should instead reuse the logic in the frontend (tools/clang/lib/Frontend/InitPreprocessor.cpp:970). This could be done by overriding ActionFactory::runInvocation and setting FrontendOptions::ProgramAction to frontend::RunAnalysis there. WDYT?


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D44906





More information about the cfe-commits mailing list