<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Mar 21, 2011, at 11:35 AM, Hendrik vP wrote:</div><br class="Apple-interchange-newline"><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">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>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 class="Apple-tab-span" style="white-space:pre">   </span>- Doug</div></body></html>