[PATCH] Refactored Clang-tidy for better reusability.

Alexander Kornienko alexfh at google.com
Thu Jan 2 02:06:38 PST 2014


On 2 Jan 2014 10:54, "Manuel Klimek" <klimek at google.com> wrote:
>
> ================
> 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?

It is supposed to make writing different frontends easier. I've got a patch
for an out-of-tree project, that makes use of this.

>
>
> http://llvm-reviews.chandlerc.com/D2481
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140102/a7e711a7/attachment.html>


More information about the cfe-commits mailing list