[cfe-dev] Newbie question

Anna Zaks ganna at apple.com
Wed Oct 10 10:49:21 PDT 2012


Simon,

Are you writing a path-sensitive checker or just an AST visitor?

If you have not looked at this yet, here are the bits of documentation we have available. It's very rudimentary and we are planning on extending it in the near future.
http://clang-analyzer.llvm.org/checker_dev_manual.html
http://clang.llvm.org/doxygen/classento_1_1CheckerDocumentation.html

It might be helpful to look at the existing checkers and use them as examples. For example, NSErrorChecker.cpp contains a non-path sensitive check that visits function/method declarations. AttrNonNullChecker is path sensitive and it registers a callback on all calls.

Cheers,
Anna. 

On Oct 10, 2012, at 5:45 AM, Simon Harris <haruki_zaemon at mac.com> wrote:

> 10+ years ago I wrote a whole slew of static analysis checks for Java including some code duplication checking, complexity metrics, etc.
> 
> I'm looking to port some or all of them to clang — for now specifically to check Objective-C code but there's no reason they couldn't be used for more than that.
> 
> I've successfully managed to get a skeleton checker compiled in and run but I'm now largely stumped.
> 
> My specific question to get me over the first hurdle is how to I get call backs when visiting a function/method declaration?
> 
> Sorry if this has all be asked before.
> 
> Simon
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20121010/c5e7b6de/attachment.html>


More information about the cfe-dev mailing list