[LLVMdev] Module management questions

Larry Gritz lg at larrygritz.com
Fri Aug 20 12:39:04 PDT 2010

On Aug 18, 2010, at 10:24 AM, Reid Kleckner wrote:

> You can free the machine code yourself by saying
> EE->freeMachineCodeForFunction(F) .  If you destroy the EE, it will
> also free the machine code.

Thanks, but unfortunately, this is exactly the opposite of what I want to do.  I need to retain the machine code indefinitely, but I want to free all possible other resources that are not strictly needed simply to jump into the machine code and execute it.  In particular, the Modules appear to be the culprit in the memory consumption.

If I call ExecutionEngine::removeModule (after JITing a function from the module), does that mean that I can subsequently no longer call the function?  Or can I?  Can I delete the Module at that point and still use the machine code?

Larry Gritz
lg at larrygritz.com

More information about the llvm-dev mailing list