<div dir="ltr">Hi James, <div><br></div><div>I am not sure if that would give me correct results? I want to find and visit all the functions called starting from one source function. Given that clang creates one AST per TU, I would need to visit all the relevant TU's to visit definitions after some functions to visit are identified in a pass. </div><div><br></div><div>Maybe I am doing it in an inefficient manner? Is there a way to visit function definitions in translation units without creating a RecuriveASTVisitor? </div><div class="gmail_extra"><br clear="all"><div><div data-smartmail="gmail_signature">--<div>Himanshu</div></div></div>
<br><div class="gmail_quote">On Thu, Jul 14, 2016 at 4:09 PM, James Dennett <span dir="ltr"><<a href="mailto:james.dennett@gmail.com" target="_blank">james.dennett@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span>On Thu, Jul 14, 2016 at 1:38 PM, Himanshu via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi all, <div><br></div><div>I run a front end action using the ClangTool::run( ... ) API on a C codebase. The action starts with a given functionof interest, and within it finds more functions of interest, and visits those. Thus, I make multiple passes over the code-base. Hence, the outline of my approach is: </div><div><div> </div><div>Create ClangTool tool</div><div>// set some initial target function, and then execute the loop: </div><div><br></div><div>while(new target functions found) {</div><div>           tool.run (front-end-action that visits functions )</div><div>}</div></div><div><br></div><div>The tool seems to execute the compile commands for each pass, even though the compilation units don't change. Is there a way to avoid this re-compilation of the same files? Or is there a better way of doing what I am trying to do? </div><div><br></div></div></blockquote><div><br></div></span><div>Can you pull that loop inside your ClangTool's code, rather than repeatedly running the tool?</div><span><font color="#888888"><div><br></div><div>-- James</div></font></span></div></div></div>
</blockquote></div><br></div></div>