[LLVMdev] Interpreter with multiple modules.

Thomas W. twilmotte at student.ulg.ac.be
Wed Feb 3 05:53:29 PST 2010

Hi everybody,

I'm currently working with LLVM (v 2.6) and I try to interpret LLVM bitcode
using the c API. Here is my problem : I have two LLVMModuleRef, M1 and M2,
M1 contains the function "funct()" and M2 contains a main function which
call "funct()" (M2 declares "funct()" too but it doesn't define it). If I
try to run the main function, I got the error "LLVM ERROR: Tried to execute
unknown external function: ...".

I build the interpreter giving it M1 and then I add M2. I can use the
LLVMFindFunction(...) to get the functions "funct()" and "main()" and if I
apply LLVMIsDeclaration(...) to these LLVMValueRef, I got false (so the
interpreter should know the two functions are defined and it should be able
to find their code).

Is there something to do to enable the interpreter to find a function in
another module ? I saw there is something like LLVMLinker::LinkModules(...)
in c++ but I didn't find the c version of this function.

Thanks in advance for your help,

View this message in context: http://old.nabble.com/Interpreter-with-multiple-modules.-tp27433312p27433312.html
Sent from the LLVM - Dev mailing list archive at Nabble.com.

More information about the llvm-dev mailing list