[cfe-dev] Newbie question

Simon Harris haruki_zaemon at mac.com
Wed Oct 10 13:39:54 PDT 2012


Hi Anna,

On 11/10/2012, at 4:49 AM, Anna Zaks <ganna at apple.com> wrote:

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

A bit of both actually. Although I guess that depends on how "sensitive" we need to be. Mostly I just want to count certain things within methods and given that methods can't be nested, I could use the context to just set/reset the current count while visiting each node in an AST.

> 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

I have read these pages which is how I got a skeleton up and "running". My ultimate goal is to have these checks run inside Xcode while building Mac/iOS applications so I'd love some guidance on that score too. Building a completely custom binary seemed, at face value, to be the simplest but least appealing approach.

Ideally I'd somehow configure them as "plugins" from within an Xcode project but for now, while I'm learning, a custom binary seems the easiest.

> 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.

Oh thanks for the heads up on that. I looked at some of the checkers but hadn't managed to look at all of them. I shall check out both.

Thank you so much for getting back to me.

Simon

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


More information about the cfe-dev mailing list