[cfe-dev] [RFC PATCH] making the static analyzer a PluginASTAction

Ted Kremenek kremenek at apple.com
Sun Dec 18 17:05:32 PST 2011


Thanks for working on this.  I'm sorry it looks like I missed your original email.  I'm interested in this work, although I haven't had a chance to look at it yet to give you any technical feedback.

With holiday time away coming up, I may not get a chance to seriously review this work until the beginning of January.  My apologies if I can't get to it sooner than that, but this would be a disruptive enough change that I really want to be confident with the design and direction before we move ahead with changes.  I also want the other active developers on the static analyzer to get a chance to thoroughly review the work, and they may have similar bandwidth issues with the holiday season.  I'll try and give you feedback as soon as possible.

Thanks for your patience!

Cheers,
Ted

Sent from my iPad

On Dec 18, 2011, at 3:38 AM, nobled <nobled at dreamwidth.org> wrote:

>> Not sure how to post large changes; I squashed the changes into a
>> single patch attached here. Most of its size is from updating
>> test/Analysis/. I was working on it as a series of ten patches though,
>> if anyone wants a git branch for easier review.
>> 
>> This change mostly moves the option parsing code out of libFrontend
>> into libStaticAnalyzer. It can't compiler the analyzer as a separate
>> loadable module, yet.
>> 
>> Ultimately, this could remove the dependencies that libFrontendTool
>> has on all the static analyzer libraries, but can't quite yet because
>> the final change I tried to make (removing the RunAnalysis enum and
>> the related code) mysteriously caused "unable to find plugin
>> 'analyzer'" regressions, so I left that change out.
>> 
>> Also allll the tests were updated from using `clang -cc1 -analyze` to
>> using `clang -cc1 -plugin analyzer`, with some copious
>> -plugin-arg-analyzer sprinkled in between to pass the arguments to the
>> plugin layer.
>> 
>> Somehow, this change exposed a problem in lib/Driver/Tools.cpp, which
>> was by default adding "-static-analyzer-checker=security" to the
>> analyzer. I'm not sure how it ever worked before, because after this
>> change I got the error "no analyzer checkers are associated with
>> 'security'", which was true; changing it to "experimental.security"
>> fixed it.
>> 
>> There is a small hack in InitPreprocessor.cpp now, though, since I'm
>> not sure how to add a predefined macro ("__clang_analyzer__") from a
>> PluginASTAction.
> 
> This seems to be stuck in the moderation queue, which is just as well,
> since the patch had some problems that I fixed now.
> 
> The current changes are in this git branch:
> https://github.com/nobled/clang/tree/anal-plugin
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev



More information about the cfe-dev mailing list