[cfe-dev] RFC: Pumping Clang-Tidy warnings through the Static Analyzer's BugReporter.

Artem Dergachev via cfe-dev cfe-dev at lists.llvm.org
Wed Aug 14 16:37:07 PDT 2019


On 8/14/19 9:20 AM, Reid Kleckner wrote:
> On Wed, Aug 14, 2019 at 12:24 AM Dmitri Gribenko via cfe-dev 
> <cfe-dev at lists.llvm.org <mailto:cfe-dev at lists.llvm.org>> wrote:
>
>     I would like to suggest something different: move Clang Static
>     Analyzer to clang-tools-extra. Build it either as a separate binary or
>     compile it into the clang-tidy binary. Then let `clang -analyze`
>     delegate to that binary for backwards compatibility.
>
>
> Speaking as an outsider in the peanut gallery who does very little 
> static analysis, this is very appealing to me. It would save binary 
> size in clang and make buildingĀ and testing clang faster, if the 
> developer isn't working in the static analyzer space.

Generally we already have a cmake flag for this, 
-DCLANG_ENABLE_STATIC_ANALYZER=OFF (defaults to ON). This flag is 
definitely a must-have for people who try to make their clang binary as 
tiny as possible. But i understand that this flag is not exceptionally 
discoverable and a lot of people probably suffer unnecessarily long 
compile times simply because they didn't discover it.

That said, i suspect that unless you work exclusively on CodeGen, you 
probably do not want to turn off the Static Analyzer, because the Static 
Analyzer has some interesting tests that you can accidentally break when 
you work on anything else (Preprocessor, Lexer, AST, Sema...). In 
particular, Richard Smith regularly touches our code :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20190814/665c2fc8/attachment.html>


More information about the cfe-dev mailing list