<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 2, 2016 at 10:36 AM, Benjamin Kramer <span dir="ltr"><<a href="mailto:benny.kra@gmail.com" target="_blank">benny.kra@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">In theory yes, in practice that needs a bit of build system tweaking<br>
to either build clang-tidy into clang or as a shared library. Then it<br>
can be used like any regular Clang plugin.<br></blockquote><div><br></div><div>I haven't looked at this patch in detail - soundds like you're saying here ^ that this patch doesn't make a "regular Clang plugin" for clang-tidy, but something irregular?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It will also slow down clang significantly, but I consider that a bug ;)<br></blockquote><div><br></div><div>Yeah, that's something I'm a tad concerned about. It seems like the matchers are convenient for writing but may be sub-optimal performance-wise. (I don't expect them to ever be as quick as checks built into Clang - doing the check as we parse the code is hard to beat performance-wise, but a burden for code maintenance, but hopefully there's something acceptable on both fronts)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5"><br>
On Wed, Mar 2, 2016 at 6:21 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:<br>
> Would this also be usable as a way to run clang-tidy checks as part of<br>
> normal compilation? (some things in clang-tidy aren't there because the FP<br>
> is too high to be a hard error on old codebases (but might be viable once a<br>
> codebase is able to be cleaned up (like several have been with LLVM)) or<br>
> because they're project specific (either stylistically, or because they're<br>
> about some project specific API))<br>
><br>
> On Wed, Mar 2, 2016 at 6:47 AM, Benjamin Kramer via cfe-commits<br>
> <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>> wrote:<br>
>><br>
>> bkramer created this revision.<br>
>> bkramer added a reviewer: klimek.<br>
>> bkramer added a subscriber: cfe-commits.<br>
>><br>
>> This doesn't really do much at the moment. You can load it via libclang<br>
>> and set the -checks via an extra command line argument as illustrated in<br>
>> the test case. Support for other options (including headers check) is<br>
>> currently missing. Also when using this with libclang some checks may<br>
>> not work with the precompiled preamble in place.<br>
>><br>
>> This can be used to easily show clang-tidy warnings in an editor<br>
>> integration as all that's needed is adding command line flags that are<br>
>> passed into libclang. Warnings and FixIts are exposed via the existing<br>
>> CXDiagnostic machinery.<br>
>><br>
>> <a href="http://reviews.llvm.org/D17807" rel="noreferrer" target="_blank">http://reviews.llvm.org/D17807</a><br>
>><br>
>> Files:<br>
>> clang-tidy/CMakeLists.txt<br>
>> clang-tidy/ClangTidyDiagnosticConsumer.h<br>
>> clang-tidy/plugin/CMakeLists.txt<br>
>> clang-tidy/plugin/ClangTidyPlugin.cpp<br>
>> test/clang-tidy/basic.cpp<br>
>><br>
>><br>
>> _______________________________________________<br>
>> cfe-commits mailing list<br>
>> <a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
>> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
>><br>
><br>
</div></div></blockquote></div><br></div></div>