[LLVMdev] Generating machine code directly to memory

Sampsa Lehtonen sampsa.lehtonen at iki.fi
Wed Jul 9 13:48:56 PDT 2008


Hello,

Is it possible to produce machine code directly to memory buffer so that 
it could be called immediately? What I would like to do is something 
like this:

Compiler:
Scripting language (Antlr) ->
LLVM IR ->
(Optimization) ->
Raw Machine code ->
(Transport media) ->
Execution

The idea is that I could compile my scripts directly to asm without any 
extra steps and in run-time. Then those asm pieces could be loaded back 
later without need to use Antrl/LLVM at all.

I've already been able to turn script into asm files using antlr/llvm 
but there's an extra step to compile the asm... Is it possible to emit 
code directly to memory and then execute it somehow?

LLVM BC with JIT is just fine, but I really would like to release my 
soft without LLVM at all.

Thanks!

- Sampsa



More information about the llvm-dev mailing list