[LLVMdev] Deleting order and acquiring generated function

Nicolas Capens nicolas at capens.net
Wed May 21 02:48:22 PDT 2008


Hi all,

 

I'm using LLVM to generate a fairly large number of separate functions at
run-time. To minimize the memory overhead, I'd like to delete the IR and
everything else that is no longer needed after a function has been generated
(I don't use lazy compilation or anything like that).

 

I noticed that deleting the ExecutionEngine deletes everything (Module,
Function(s), ExistingModuleProvider, and even the LLVMBuilder).
Unfortunately it also frees the generated function in memory itself.

 

So is there an existing way to delete everything except the in-memory
generated function? Alternatively, is there a way to just delete the IR and
related overhead so everything is ready for generating the next function?

 

If both are possible, which is the best approach? I have to generate new
functions from time to time, so keeping some of the LLVM objects around
seems like a good idea if the cost of reconstructing them is considerable.
As far as I can tell LLVM looks relatively light-weight though so I'd prefer
deleting everything and keeping just the generated functions.

 

Thanks again for any info,

 

Nicolas Capens

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080521/00097b44/attachment.html>


More information about the llvm-dev mailing list