[LLVMdev] Static code generation - is it gone from LLVM 2.7?

Peter Shugalev peter at shugalev.com
Mon Mar 29 11:00:21 PDT 2010


Chris Lattner wrote:
>> But since LLVM 2.7 TargetMachine::addPassesToEmitFile (as implemented in
>> LLVMTargetMachine child class) adds its own final pass (AsmPrinter)
>> paired with either AsmStreamer, MachOStreamer or NullStreamer. I cannot
>> pass my own descendant of MCStreamer class. Now we've got predefined set
>> of final passes instead of free choice.
> 
> LLVM 2.7 doesn't have final support for this.  The idea is that we'd add ELF and PECOFFStreamers as well, or parameterize it a different way.
> 

Obviously API hasn't settled yet. My suggestion is to add "MCStreamer
*Streamer" as an additional argument to addPassesToEmitFile() and
FileType of CGFT_Custom. The problem of passing MCContext to streamer
after its construction requires some work but I don't think it's a hard one.

Anyway predefined set of streamers whether it includes ELF/COFF/whatever
or not is a bad idea.

Thanks for answers again!


-- 
Best Regards
Peter Shugalev



More information about the llvm-dev mailing list