[LLVMdev] How to call native functions from bytecode run in JIT?

Jan Rehders cmdkeen at gmx.de
Mon Jun 11 18:37:17 PDT 2007


Hi,

> Jan, how are you doing this?  Are you creating an external LLVM  
> Function
> object named "get5", then using EE::addGlobalMapping?  If 'get5'  
> exists in
> the address space, why not just let the JIT resolve it (which will  
> then
> create the stub)?

Yes. I create a Function with matching signature, calling conventions  
and external linkage which I pass together with the function's  
address to addGlobalMapping.

I have an application which creates an execution engine and a module  
and creates some bytecode functions at runtime. I need to call back  
to some of the functions in the app (for a language runtime). What do  
you mean with "address space"? The function is part of the  
application but I don't see how LLVM would find it? If I remove the  
addGlobalMapping call, the function is not found at all

- Jan





More information about the llvm-dev mailing list