[cfe-dev] How to use clang-tidy for smaller projects

Robert Underwood via cfe-dev cfe-dev at lists.llvm.org
Mon Oct 28 06:56:31 PDT 2019


Stephen,

Thanks for your detailed response.

On 27/10/2019, 22:33, Stephen Kelly via cfe-dev wrote:
>This bug covers adding a plugin extension interface to clang-tidy:
> https://bugs.llvm.org//show_bug.cgi?id=32739

Alexander Kornienko's comment about "statically-linked-out-of-tree
checks" seems to be what I am looking for,  but that isn't really
documented anywhere that I can find.  I'm just not sure where to start
on this since several of the headers are internal to
clang-tools-extra.

I also recall that its possible to compile each of the llvm projects
separately, but I am unsure how to configure CMake the use the system
installed version of the libraries, or  even if my distribution
installs enough components to do that.  I use CMake from time to time,
but I have to admit I am a little intimidated by the 1330 different
CMake settings in the HEAD branch.  I also am pretty sure how to use
the system libraries for clang-tools-extra isn't documented anywhere
either.  That would get me most of the way towards the kind of
solution that I am looking for.

> Aside from that, it is possible to write/generate bindings for the two
> steps of clang-tidy (AST Matching followed by Rewriting). You can see an
> exploration of that here:
> https://steveire.wordpress.com/2019/04/30/the-future-of-ast-matching

These tools in your talk are amazing!  I would love to see them merged
upstream (both to LLVM and to CompilerExplorer).

Respectfully,
Robert Underwood



More information about the cfe-dev mailing list