<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<br>
On 6/4/2012 2:57 PM, Anna Zaks wrote:
<blockquote
cite="mid:B73EA041-B682-4B1F-9794-F31B4F174C59@apple.com"
type="cite"><br>
<div>
<div>On Jun 1, 2012, at 6:36 PM, Karl Mazurak wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div>Hi all -<br>
<br>
Our group is considering using Clang for some program
analysis, <br>
primarily aimed at bug-hunting. We're targeting C++, which
I understand <br>
means the static analyzer isn't an option just yet, </div>
</blockquote>
<blockquote type="cite">
<div>but it looks like <br>
there's still plenty there that could be useful - so much
that I'm not <br>
sure what to start experimenting with.<br>
<br>
The plugin tutorial uses a PluginASTAction and links to an
example with <br>
a RecursiveASTVisitor, but of course we'd like to avoid
reinventing the <br>
wheel (at coding time or at run time) as much as possible.
For <br>
instance, are CFGs pre-constructed somewhere? </div>
</blockquote>
<div><br>
</div>
<div>CFG is part of Analyzes library and is used by both clang
and the analyzer.</div>
<div>You can use ViewCFG and DumpCFG checkers to see how C++
statements are modeled (and what the deficiencies are):</div>
<div><b style="color: rgb(0, 0, 0); font-family: monospace;
font-style: normal; font-variant: normal; letter-spacing:
normal; line-height: 18px; orphans: 2; text-align: left;
text-indent: 0px; text-transform: none; white-space: normal;
widows: 2; word-spacing: 0px; -webkit-text-size-adjust:
auto; -webkit-text-stroke-width: 0px; background-color:
rgb(255, 255, 255); font-size: small; ">clang -cc1 -analyze
-analyzer-checker=debug.ViewCFG test.c</b></div>
<br>
<blockquote type="cite">
<div> Does the dataflow <br>
framework in Analysis/FlowSensitive work with C++? </div>
</blockquote>
The analyzer's C++ support is work in progress. You can run the
analyzer's path sensitive checkers on C++ code, however, it does
not reason about many C++ concepts. </div>
<div><br>
</div>
</blockquote>
Actually, except for some of the new c++11 concepts like lambdas,
most are currently handled and the analyzer can already be very
useful for C++ programs.<br>
<blockquote
cite="mid:B73EA041-B682-4B1F-9794-F31B4F174C59@apple.com"
type="cite">
<div>
<blockquote type="cite">
<div> Is this Sema of any <br>
use outside the path-sensitive analyzer? </div>
</blockquote>
<div><br>
</div>
You can write a non-path-sensitive checkers, which visit
different AST nodes (AST does have full C++ support). See AST
Visitors in <a moz-do-not-send="true"
href="http://clang-analyzer.llvm.org/checker_dev_manual.html#ast">http://clang-analyzer.llvm.org/checker_dev_manual.html#ast</a>. </div>
<div><br>
</div>
<div>
<blockquote type="cite">
<div>And is there anything in Clang <br>
that could be useful in aggregating results together in
whole program <br>
analysis?<br>
<br>
</div>
</blockquote>
<div><br>
</div>
The static analyzer does not currently support whole program
analysis. </div>
<div><br>
<blockquote type="cite">
<div>Thanks!<br>
<br>
-- <br>
Karl<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a moz-do-not-send="true" href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</div>
</blockquote>
</div>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
cfe-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a>
</pre>
</blockquote>
</body>
</html>