Can you please give me some ideas for checkers to implement?<div><br></div><div>Thanks,</div><div>Arjun<br><br><div class="gmail_quote">On Sat, Oct 1, 2011 at 12:13 AM, Anna Zaks <span dir="ltr"><<a href="mailto:ganna@apple.com" target="_blank">ganna@apple.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hi Arjun,<div><br></div><div>Currently, the clang static analyzer only performs intra-procedural analysis. I don't think that any other checkers in the analyzer use CallGraph, so you might need a bit of extra plumbing to construct one.</div>


<div><br></div><div>Also, I am not sure if the checker you are working on is going to be different from the compiler warning:</div><div><br></div><div><div>$ clang -Wall ~/tmp/example.c </div><div>/Users/zaks/tmp/example.c:5:12: warning: unused function 'xxx' [-Wunused-function]</div>


<div>static int foo() {return 3;}</div><div><br></div><div>Cheers,</div><div>Anna.</div><div><div><div>On Sep 30, 2011, at 10:36 PM, Arjun Singri wrote:</div><br><blockquote type="cite">Hi,<br><br>Thank you for replying. I will keep that in mind when writing the checker. <div>


<br></div><div>To use the CallGraph class I need to supply it an object of type "Program". The only way I can get a Program object is through the Indexer object which itself is obtained from AnalysisManager. But when the AnalysisManager object is constructed in Frontend/AnalysisConsumer.cpp:148, a value of zero is passed for the Indexer making the Indexer NULL. Why is this? Can I get a reference to the Program object any other way?<div>




<br></div><div>Thanks,</div><div>Arjun<br><br><div class="gmail_quote">On Fri, Sep 30, 2011 at 2:09 PM, Anna Zaks <span dir="ltr"><<a href="mailto:ganna@apple.com" target="_blank">ganna@apple.com</a>></span> wrote:<br>




<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
Hi Arjun,<br>
<br>
scan-build is a script that hijacks the build system to call the static analyzer. Currently, the analyzer can only reason about one translation unit at a time.<br>
<br>
So there is no reason to have multiple roots to represent different main functions. In addition, your checker would/should only be applicable to functions with internal linkage.<br>
<br>
Cheers,<br>
Anna.<br>
<div><div></div><div><br>
On Sep 30, 2011, at 12:58 PM, Arjun Singri wrote:<br>
<br>
> Hi,<br>
><br>
> I am currently trying to implement a checker that detects unused methods. I am making use of the CallGraph class for this. Every time CallGraph detects the "main" function, it designates it as the root node. Considering that scan-build accepts multiple files each having a main function, does it make sense to modify CallGraph to have mutlple root nodes?<br>






><br>
> Thanks,<br>
> Arjun<br>
</div></div>> _______________________________________________<br>
> cfe-dev mailing list<br>
> <a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br>
</blockquote></div><br>
</div></div>
</blockquote></div><br></div></div></div></blockquote></div><br></div>