[LLVMdev] ModuleProvider materializeFunction

Chris Lattner clattner at apple.com
Mon Jul 6 22:27:09 PDT 2009

On Jul 4, 2009, at 5:59 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.

ModuleProvider is a very simple concept.  You can either load an  
entire module at once (e.g. with ParseBitcodeFile) or you can load  
just the outline and load functions on demand (with  
getBitcodeModuleProvider).  This allows clients to lazily load  
functions as they are needed instead of loading everything off the  
disk.  The JIT is one example that knows how to use this, it lazily  
loads functions the first time a function is called or its address is  

> 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.

What kind of update of the EE do you want?


More information about the llvm-dev mailing list