[PATCH] Refactored Clang-tidy for better reusability.

Manuel Klimek klimek at google.com
Thu Jan 2 01:54:47 PST 2014



================
Comment at: clang-tidy/ClangTidy.cpp:156-163
@@ +155,10 @@
+    if (AnalyzerChecksEnabled) {
+      // Run our regex against all possible static analyzer checkers.
+      // Note that debug checkers print values / run programs to visualize the
+      // CFG
+      // and are thus not applicable to clang-tidy in general.
+      // Always add all core checkers if any other static analyzer checks are
+      // enabled. This is currently necessary, as other path sensitive checks
+      // rely
+      // on the core checkers.
+      for (unsigned i = 0; i < Checkers.size(); ++i) {
----------------
:gq

================
Comment at: clang-tidy/ClangTidy.h:107-109
@@ +106,5 @@
+///
+/// FIXME: Ideally we'd want to build a more generic way to use
+/// \c FrontendAction based checkers in clang-tidy, but that needs some
+/// preparation work first.
+class ClangTidyAction : public ASTFrontendAction {
----------------
Why?

================
Comment at: clang-tidy/ClangTidy.h:110
@@ +109,3 @@
+/// preparation work first.
+class ClangTidyAction : public ASTFrontendAction {
+public:
----------------
Description says this was moved to make it easier to create the AST consumer, but it doesn't seem to be used outside of the .cpp. What am I missing?


http://llvm-reviews.chandlerc.com/D2481



More information about the cfe-commits mailing list