[PATCH] D18694: [ClangTidy] Add an 'explain-checks' option to diagnose where each checks comes from.

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 11 03:48:10 PDT 2016


alexfh added a comment.

I've just realized that the approach is artificially limited to just keeping track of the origin of the `Checks` option, while it could be easily extended to track the origin of all configuration items. What if instead of `std::vector<StringPair> CheckSources;` we introduce `std::vector<std::pair<std::string, ClangTidyOptions>> Sources;`? Then we could be able to find where a certain check option or an extra argument was introduced, for example. WDYT?


================
Comment at: clang-tidy/tool/ClangTidyMain.cpp:188
@@ -181,1 +187,3 @@
 
+static const char* CheckSourceTypeDefaultBinary = "clang-tidy binary";
+static const char* CheckSourceTypeCheckCommandLineOption =
----------------
One problem with this way of defining string constants is that they are not constants. `CheckSourceTypeDefaultBinary = "oops";` will work just fine. Instead, I prefer to use `constexpr char XXX[] = "...";` construct.


http://reviews.llvm.org/D18694





More information about the cfe-commits mailing list