[LLVMdev] Using a function from another module

Kenneth Uildriks kennethuil at gmail.com
Sun Jan 10 11:02:00 PST 2010


On Sun, Jan 10, 2010 at 12:38 PM, Garrison Venn <gvenn.cfe.dev at gmail.com> wrote:
> Won't passing llvm::Function* around vs strings (function names), also work, at code generation time,
> without the need for a module A dec to module B impl. mapping?
>
> Garrison

Nope.  You cannot place a call instruction into one module whose
callee is a Function from another module.  You have to put a
declaration into the same module, and have your call instruction call
that.  And then they need to be linked together, either by llvm-link
or (if JITting) by addGlobalMapping.



More information about the llvm-dev mailing list