[LLVMdev] Is ExecutionEngine always meant to be a singleton?

Reid Kleckner rnk at mit.edu
Fri Oct 9 16:03:01 PDT 2009


>> This would, among other things, allow "lli" to execute bitcode that
>> itself uses the ExecutionEngine.
>
> I think you're doing something a bit fishy here. I'm not sure how
> you're generating code, but you may want to look at Unladen Swallow or
> Rubinius or the Kaleidoscope tutorial for how ExecutionEngine is
> generally used for jitting, and jitting in general.

Really?  This seems like a perfectly reasonable thing to want to do.
Why shouldn't I be able to JIT a JIT?  Run lli inside lli.  If you
read his other mail, Kenneth is trying to support code that can
execute at compile time that might generate more code.  So the code
needs a way to interact with the compiler, ie the EE, and invoke it on
more bitcode.

Currently there is a JIT *TheJIT static global inside JITEmitter.cpp
which you could expose, if you wanted to.  Alternatively, if LLVM
doesn't want to expose the singleton-ness of the JIT as part of the
API, you can have a single global on your side.

Reid



More information about the llvm-dev mailing list