[clang-tidy] Add "clang-tidy as a clang plugin" skeleton.
authorBenjamin Kramer <benny.kra@googlemail.com>
Thu, 3 Mar 2016 08:58:12 +0000 (08:58 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Thu, 3 Mar 2016 08:58:12 +0000 (08:58 +0000)
commit8f5eb56df37566187e9132fb905d7fcbd9fd4732
treee124d35779d854a010ce85572f217307267ebf70
parent3d78271eacf88f9ceed2bab446942077c868aeb5
[clang-tidy] Add "clang-tidy as a clang plugin" skeleton.

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.

Differential Revision: http://reviews.llvm.org/D17807

llvm-svn: 262595
clang-tools-extra/clang-tidy/CMakeLists.txt
clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.h
clang-tools-extra/clang-tidy/plugin/CMakeLists.txt [new file with mode: 0644]
clang-tools-extra/clang-tidy/plugin/ClangTidyPlugin.cpp [new file with mode: 0644]
clang-tools-extra/test/CMakeLists.txt
clang-tools-extra/test/clang-tidy/basic.cpp