<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Jan 16, 2014 at 1:55 AM, Marc Jessome <span dir="ltr"><<a href="mailto:marc.jessome@gmail.com" target="_blank">marc.jessome@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
I'm using libTooling to parse and traverse the ASTs of full<br>
compilation databases using a RecursiveASTVisitor. I have attached a<br>
small example of how my tool is structured (a modification of<br>
<a href="http://clang.llvm.org/docs/RAVFrontendAction.html" target="_blank">http://clang.llvm.org/docs/RAVFrontendAction.html</a> to use a compilation<br>
database).<br>
<br>
I would like to be able to parse each TU and traverse the AST on its<br>
own thread so that I can process multiple TUs concurrently.<br>
<br>
Would this be possible with libTooling and tooling::ClangTool as<br>
currently implemented and used in my example? Give the implementation<br>
of newFrontendActionFactory<> I feel like it likely isn't.<br>
<br>
If not, the only way that I can currently see this being possible is<br>
by spawning up multiple threads that would each call<br>
tooling::runToolOnCodeWithArgs(), and handling the compilation<br>
database manually. </blockquote><div><br></div><div>The other way would be to use one process per TU, and have an on-disk intermediate output format. That's what we do, as it nicely scales to many machines.</div><div>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Would this be safe to do with the way clang and<br>
libTooling is currently implemented?<br></blockquote><div><br></div><div>This is somewhat doable if you are sure that your repository will always stay in the same working directory. Unfortunately clang currently chdirs, and the correct way to resolve this would be by refactoring the filesystem/path libs to allow to get directories, and then resolve paths relative to those directories, which is a bunch of work.</div>
<div><br></div><div>Cheers,</div><div>/Manuel</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Thanks,<br>
Marc<br>
<br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">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>