[LLVMdev] Using a function from another module

Michael Muller mmuller at enduden.com
Mon Jan 11 18:29:18 PST 2010


Kenneth Uildriks wrote:
> On Mon, Jan 11, 2010 at 1:39 PM, Jeffrey Yasskin <jyasskin at google.com> wrote:
> > The JIT tries to handle this in some cases
> > (http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp?annotate=92771#l942),
> > but doesn't handle it for functions. There aren't any tests, so I'm
> > not surprised it's broken.
> >
> > The JIT would be simpler if we just dropped multiple-module support
> > and asked people to link their modules together before trying to JIT
> > them.  Is there a reason you can't do that?
> 
> I'd like to be able to JIT a module, call imported functions from it,
> and then write out that module without including the bodies of the
> imported functions in the output .bc file.
> 

Yeah, I have a similar use case - I want to be able to execute and dump the 
.bc file to a filesystem cache to avoid subsequent compiles.

I've come up with a fairly elegant work-around, but I'll try to put together a 
unit test that illustrates the failure.  If I feel ambitious, I'll also take 
a stab at a fix.


=============================================================================
michaelMuller = mmuller at enduden.com | http://www.mindhog.net/~mmuller
-----------------------------------------------------------------------------
Society in every state is a blessing, but government even in its best state
is but a necessary evil; in its worst state an intolerable one... 
 - Thomas Paine 
=============================================================================



More information about the llvm-dev mailing list