[cfe-dev] Build one translation-unit out of multiple source-files

Hendrik vP variadic.template at googlemail.com
Mon Mar 21 05:31:31 PDT 2011


Ok, thank you.

2011/3/21 Douglas Gregor <dgregor at apple.com>

>
> On Mar 21, 2011, at 11:35 AM, Hendrik vP wrote:
>
> As the subject says: Is it possible to build one translation-unit out of
> multiple source-files?
> I copied the source to create a compilerinstance from
> https://github.com/gwaredd/reflector/blob/master/src/Reflector.cpp
> For every inputfile, the FileManager, SourceManager, Preprocessor,
> ASTContext and
> Sema will be recreated. Thus, every sourcefile ends up in it's own
> TranslationUnit.
> I am aware of the possibility to simply include all given sourcefiles
> inside a temporary
> sourcefile - it works, but it feels 'hacky'.
> Any suggestions?
>
>
> 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).
>
> - Doug
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110321/2847bec9/attachment.html>


More information about the cfe-dev mailing list