[LLVMdev] Parsing (and compiling) on demand.

Nick Lewycky nicholas at mxc.ca
Sat Apr 17 12:15:25 PDT 2010

lost wrote:
> Ok than, but how to insert a call to an undefined function?

You need to have the function declaration and insert a call to that. 
Once your LazyFunctionCreator is called, you fill in the body and call 
JIT->getPointerToFunction() on it and return that result.

I haven't actually tried this, but it seems to be the only way to use 
this API, so I presume someone else has. The only potential problem I 
can forsee is if the JIT isn't actually re-entrant.


>> See ExecutionEngine::InstallLazyFunctionCreator().
>> http://llvm.org/doxygen/classllvm_1_1ExecutionEngine.html#6a126d6cd1fa07a4331179597de0c46a
>> Nick

More information about the llvm-dev mailing list