[PATCH] D17807: [clang-tidy] Add "clang-tidy as a clang plugin" skeleton.

Benjamin Kramer via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 2 10:36:34 PST 2016


In theory yes, in practice that needs a bit of build system tweaking
to either build clang-tidy into clang or as a shared library. Then it
can be used like any regular Clang plugin.

It will also slow down clang significantly, but I consider that a bug ;)

On Wed, Mar 2, 2016 at 6:21 PM, David Blaikie <dblaikie at gmail.com> wrote:
> Would this also be usable as a way to run clang-tidy checks as part of
> normal compilation? (some things in clang-tidy aren't there because the FP
> is too high to be a hard error on old codebases (but might be viable once a
> codebase is able to be cleaned up (like several have been with LLVM)) or
> because they're project specific (either stylistically, or because they're
> about some project specific API))
>
> On Wed, Mar 2, 2016 at 6:47 AM, Benjamin Kramer via cfe-commits
> <cfe-commits at lists.llvm.org> wrote:
>>
>> bkramer created this revision.
>> bkramer added a reviewer: klimek.
>> bkramer added a subscriber: cfe-commits.
>>
>> This doesn't really do much at the moment. You can load it via libclang
>> and set the -checks via an extra command line argument as illustrated in
>> the test case. Support for other options (including headers check) is
>> currently missing. Also when using this with libclang some checks may
>> not work with the precompiled preamble in place.
>>
>> This can be used to easily show clang-tidy warnings in an editor
>> integration as all that's needed is adding command line flags that are
>> passed into libclang. Warnings and FixIts are exposed via the existing
>> CXDiagnostic machinery.
>>
>> http://reviews.llvm.org/D17807
>>
>> Files:
>>   clang-tidy/CMakeLists.txt
>>   clang-tidy/ClangTidyDiagnosticConsumer.h
>>   clang-tidy/plugin/CMakeLists.txt
>>   clang-tidy/plugin/ClangTidyPlugin.cpp
>>   test/clang-tidy/basic.cpp
>>
>>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>>
>


More information about the cfe-commits mailing list