[LLVMdev] Fwd: Basic questions

Nuno Lopes nunoplopes at sapo.pt
Sun Nov 9 03:46:04 PST 2008

> I'd like to support users dynamically adding and using functions
> (plus structs, globals etc) to a Module, JIT compiling to an
> ExecutionEngine, in an interleaved fashion. That is, declare & define
> a function, run it through a FunctionPassManager, add it to an
> ExecutionEngine, use it, go ahead and repeat for a different function
> with the same Module, FunctionPassManager & ExecutionEngine, etc.

that should work without much trouble. You can also redefine a function body 
and recompile it. The only catch is with inling. If you do any inling you'll 
have to recompile the other functions that inlined the redefined function.

> Also, does there need to be a 1-1-1 correspondence between Module,
> FunctionPassManager and ExecutionEngine, or can it be 1-many(1-1)?

You can do the combinations you want, although I don't see any point in 
doing such a thing. It's just a waste of memory :)

> Thanks again, and once again sorry if this info is available in
> existing docs; I haven't been able to find it yet.

I think you'll find the doxygen docs helpful: 


More information about the llvm-dev mailing list