[cfe-dev] Compilation benchmark: bzip2

Chris Lattner clattner at apple.com
Sun Dec 23 11:04:54 PST 2007


On Dec 23, 2007, at 2:15 AM, Sanghyeon Seo wrote:
> 2007/12/23, Chris Lattner <clattner at apple.com>:
>> Likewise, if
>> you want "clang emission of llvm bytecode", you should link the
>> bytecode writer into clang, instead of using llvm-as (which is
>> obviously not very fast).
>
> Okay, is this planned in near future, or can I start looking at it
> now? It shouldn't be difficult, right?

Sure, it should be really really easy: just link in the bcwriter  
library, and call WriteBitcodeToFile (from llvm/Bitcode/ReaderWriter.h).

There is a bigger question though: do we want to link more and more  
llvm libraries into clang at this point?  In addition to the bitcode  
writer, you'd eventually want the codegen and target libraries as  
well.  The bigger issue with this is that it increases link times of  
clang and most people aren't using it right now.

For now, if you want the bcwriter, I'd say go ahead and add it.  If  
you want the target libraries though, I'd suggest building them  
together into a single "backend" dylib/so file that is loaded by  
clang.  That way we can rebuild clang without relinking all the llvm  
pieces.

-Chris



More information about the cfe-dev mailing list