<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;" class=""><div class="">There's already an analysis, LiveVariables.cpp, that does this.  It works on top of the CFG, and does a reverse dataflow analysis (using a worklist algorithm) to compute liveness information for variables.  This liveness information is currently consumed by the static analyzer to prune out redundant information from the path state.</div><br class=""><div><blockquote type="cite" class=""><div class="">On Nov 14, 2014, at 9:21 AM, Madhur Amilkanthwar <<a href="mailto:madhur13490@gmail.com" class="">madhur13490@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><p dir="ltr" class="">So assume that I want to find all live variables at the end of the block. Then how easy it is to do the job?</p>
<div class="gmail_quote">On Nov 14, 2014 2:25 PM, "Manuel Klimek" <<a href="mailto:klimek@google.com" class="">klimek@google.com</a>> wrote:<br type="attribution" class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You basically have the static analyzer's CFG and Clang's AST. With the AST you can do limited data flow analysis (as long as you don't need path or control flow sensitivity), with the CFG you can do anything you want (at least in C) given enough computing power :P<div class=""><br class=""></div><div class="">AST access is well-integrated in libtooling, CFG access less so (I haven't written a tool that uses the CFG, but given that the CFG is used for Clang's diagnostics, I'd imagine it's not too hard to use from a libTooling based tool).</div><div class=""><br class=""></div><div class="">Looping in Anna & Jordan for more info on what's possible with the CFG / static analyzer.</div><div class=""><br class=""></div><div class="">Cheers,</div><div class="">/Manuel<br class=""><br class=""><div class="gmail_quote">On Fri Nov 14 2014 at 6:56:10 AM Vanush Vaswani <<a href="mailto:vanush@gmail.com" target="_blank" class="">vanush@gmail.com</a>> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">What API's are available for Dataflow Analysis in Clang? I want to create a<br class="">
standalone tool (using libTooling) to analyse C source code.<br class="">
<br class="">
<br class="">
<br class="">
<br class="">
--<br class="">
View this message in context: <a href="http://clang-developers.42468.n3.nabble.com/Data-flow-analysis-in-Clang-tp4042447.html" target="_blank" class="">http://clang-developers.42468.<u class=""></u>n3.nabble.com/Data-flow-<u class=""></u>analysis-in-Clang-tp4042447.<u class=""></u>html</a><br class="">
Sent from the Clang Developers mailing list archive at <a href="http://Nabble.com" class="">Nabble.com</a>.<br class="">
______________________________<u class=""></u>_________________<br class="">
cfe-dev mailing list<br class="">
<a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank" class="">cfe-dev@cs.uiuc.edu</a><br class="">
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank" class="">http://lists.cs.uiuc.edu/<u class=""></u>mailman/listinfo/cfe-dev</a><br class="">
</blockquote></div></div>
<br class="">_______________________________________________<br class="">
cfe-dev mailing list<br class="">
<a href="mailto:cfe-dev@cs.uiuc.edu" class="">cfe-dev@cs.uiuc.edu</a><br class="">
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank" class="">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br class="">
<br class=""></blockquote></div>
_______________________________________________<br class="">cfe-dev mailing list<br class=""><a href="mailto:cfe-dev@cs.uiuc.edu" class="">cfe-dev@cs.uiuc.edu</a><br class="">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev<br class=""></div></blockquote></div><br class=""></body></html>