Re: [cfe-users] How to use clang-tidy plugin.

2017-01-20 Thread Benjamin Kramer via cfe-users
Using ASTMatchers in a plugin should work as long as clang doesn't use them. The problems arise when both the plugin and clang define the same symbols. But with the current cmake build it's not possible to just link ASTMatchers, it will drag all dependencies of ASTMatchers along and cause linker er

Re: [cfe-users] How to use clang-tidy plugin.

2017-01-20 Thread Alfred Zien via cfe-users
Thanks for clarifying! Based on this, as I understand, we can't use any other library (for example ASTMatchers) in plugin that clang doesn't use? > On 19 Jan 2017, at 19:44, Benjamin Kramer wrote: > > I don't think I ever added the build rules to build clang-tidy as a > plugin for use outside o

Re: [cfe-users] How to use clang-tidy plugin.

2017-01-19 Thread Benjamin Kramer via cfe-users
I don't think I ever added the build rules to build clang-tidy as a plugin for use outside of libclang. You can use it via libclang and the python bindings currently. Adding the necessary build rules isn't easy because you'd have to avoid linking clang symbols into both the plugin and the actual cl

Re: [cfe-users] How to use clang-tidy plugin.

2017-01-17 Thread Alfred Zien via cfe-users
Hmm, I discovered that it is actually part of libclang. But still, I run $ clang main.c -fsyntax-only -Xclang -load -Xclang /Users/zienag/dev/llvm_trunk/build/lib/libclang.dylib -Xclang -plugin -Xclang clang-tidy And it produces error: error: unable to find plugin 'clang-tidy' :( > On 17 J