<div dir="ltr">Heya, I think you're the first one to try this out - I've had it on my TODO list for a long time, but it's never made it to the top.<br></div><br><div class="gmail_quote">On Mon, May 4, 2015 at 12:33 PM Pei-Shiang Hung <<a href="mailto:pshung807@gmail.com">pshung807@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dears,<br>
<br>
I'm writing a refactoring tool with clang libtooling.<br>
<br>
What I need is to rewrite source code according to live variable<br>
information. For example, for each basic block in a function, dump its<br>
live-out variables.<br>
<br>
I know it would be quite easily if I'm writing an analysis checker.<br>
<br>
void checkASTCodeBody(const Decl *D, AnalysisManager& mgr,<br>
                    BugReporter &BR) const {<br>
if (LiveVariables* L = mgr.getAnalysis<LiveVariables>(D)) {<br>
  L->dumpBlockLiveness(mgr.getSourceManager());<br>
}<br>
}<br>
<br>
simplely call mgr.getAnalysis(D) to get LiveVariables of this<br>
function. then, dump each block.<br>
<br>
But, I'm writing a standalone refactoring tool. How can I construct an<br>
AnalysisManager object?<br>
Are there any reference?<br>
<br>
Thank a lot.<br>
_______________________________________________<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>
</blockquote></div>