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

Peter Shugalev peter at shugalev.com
Fri Mar 26 18:24:09 PDT 2010


Hi,

Just realized that ability to generate static object code (e.g. ELF w/o
using JIT) is no longer available in 2.7 (at least in release_27 branch).

For example
  > llc -filetype=obj whatever.bc
doesn't work in Linux environment anymore (well it wasn't fully
implemented before but it worked for simple bytecodes in 2.6).

I used to generate code by creating TargetMachine and
FunctionPassManager, then calling TargetMachine::addPassesToEmitFile,
then adding my own CodeEmitter/CodeWriter (exactly like llc does). I
have to say I always hated code emitter interface but at least it worked
for me.

Now LLVMTargetMachine::addPassesToEmitFile has changed. It adds its own
code emitter and it's always MachOCodeEmitter which of course I don't need.

Is there a new way to create non-JIT object code in LLVM 2.7?


-- 
Best Regards
Peter Shugalev



More information about the llvm-dev mailing list