Ok, thank you.<br><br><div class="gmail_quote">2011/3/21 Douglas Gregor <span dir="ltr"><<a href="mailto:dgregor@apple.com">dgregor@apple.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div style="word-wrap:break-word"><div><div class="h5"><br><div><div>On Mar 21, 2011, at 11:35 AM, Hendrik vP wrote:</div><br><blockquote type="cite"><div>As the subject says: Is it possible to build one translation-unit out of multiple source-files?</div>
<div>I copied the source to create a compilerinstance from </div><div><a href="https://github.com/gwaredd/reflector/blob/master/src/Reflector.cpp" target="_blank">https://github.com/gwaredd/reflector/blob/master/src/Reflector.cpp</a></div>

<div>For every inputfile, the FileManager, SourceManager, Preprocessor, ASTContext and</div><div>Sema will be recreated. Thus, every sourcefile ends up in it's own TranslationUnit.</div><div>I am aware of the possibility to simply include all given sourcefiles inside a temporary </div>

<div>sourcefile - it works, but it feels 'hacky'. </div><div>Any suggestions?</div></blockquote><br></div></div></div><div>I don't think there's a better way to do it within the Clang parser. You might be able to link the bitcode files together using the LLVM linker (llvm-ld).</div>
<div><br></div><div><span style="white-space:pre-wrap"> </span>- Doug</div></div>
</blockquote></div><br>