[LLVMdev] ModuleProvider materializeFunction

Carter Cheng carter_cheng at yahoo.com
Sat Jul 4 10:54:14 PDT 2009


Thanks for the reply. So I gather from what you are saying that if I do use materializeFunction to load a unresolved function when the JIT requests it I can do so just by using a standard Function::Create call (with the optional module argument)?

Thanks again,

Carter.

--- On Sat, 7/4/09, Nick Lewycky <nicholas at mxc.ca> wrote:

> From: Nick Lewycky <nicholas at mxc.ca>
> Subject: Re: [LLVMdev] ModuleProvider materializeFunction
> To: "LLVM Developers Mailing List" <llvmdev at cs.uiuc.edu>
> Date: Saturday, July 4, 2009, 9:02 AM
> Carter Cheng wrote:
> > I have tracing the calls to materializeFunction in the
> LLVM code in hopes of determining how to properly utilize
> this function but from my explorations I gather it's just a
> hook which is called by the JIT system and I would mostly
> have to do the work myself.
> > 
> > What is the preferred way to inject a llvm:Function
> which contains basic blocks into the Module + JIT? My
> understanding (perhaps erroneous) from some experimentation
> that modifying the module by inserting functions into it
> after you have created the EE does not automatically update
> the EE.
> 
> You should be able to add the Function to the Module at any
> time, then 
> call EE->runFunction or EE->getPointerToFunction on
> it.
> 
> materializeFunction is used to load only part of a .bc file
> from disk. 
> The functions which aren't loaded are given GhostLinkage
> then loaded 
> later (materialized) when needed.
> 
> Nick
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu 
>        http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
> 


      




More information about the llvm-dev mailing list