<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Oct 10, 2012, at 1:39 PM, Simon Harris <<a href="mailto:haruki_zaemon@mac.com">haruki_zaemon@mac.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=windows-1252"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Anna,<div><br><div><div>On 11/10/2012, at 4:49 AM, Anna Zaks <<a href="mailto:ganna@apple.com">ganna@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=windows-1252"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Simon,<div><br></div><div>Are you writing a path-sensitive checker or just an AST visitor?</div></div></blockquote><div><br></div><div>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.</div><br></div></div></div></blockquote><div><br></div><div>Path sensitive checkers use symbolic execution to explore all paths through the program as opposed to working with the AST. (Ex: As described in Ted's very old talk: <a href="http://llvm.org/devmtg/2008-08/Kremenek_StaticAnalyzer.pdf">http://llvm.org/devmtg/2008-08/Kremenek_StaticAnalyzer.pdf</a>).</div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>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.</div><div><a href="http://clang-analyzer.llvm.org/checker_dev_manual.html">http://clang-analyzer.llvm.org/checker_dev_manual.html</a></div><div><a href="http://clang.llvm.org/doxygen/classento_1_1CheckerDocumentation.html">http://clang.llvm.org/doxygen/classento_1_1CheckerDocumentation.html</a></div></div></blockquote><div><br></div><div>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.</div><div><br></div><div>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.</div></div></div></div></blockquote><div><br></div><div>As of Xcode 4.5, you can use CLANG_ANALYZER_EXEC build setting to point Xcode to your clang for analyzes. You can also use <span style="background-color: rgb(255, 255, 255); font-family: 'Lucida Grande', Geneva, Verdana, Arial, Helvetica, sans-serif; font-size: 11px; text-align: left; ">CLANG_ANALYZER_OTHER_CHECKERS to list the additional checkers.</span></div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">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.</div></blockquote><div><br></div><div>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.</div></div><br></div><div>Thank you so much for getting back to me.</div><div><br></div><div>Simon</div><div><br></div></div></blockquote></div><br></body></html>