On 9/28/07, Chris Lattner <sabre at nondot.org> wrote:> > > Sorry, I meant to ask whether it's still necessary to keep F around, > > ie. to delete generated code. Is there a standard approach to garbage > > collecting code in LLVM? > > Machine code in the JIT buffer or the LLVM IR itself? >Assuming I don't need to keep around the IR version of a function, then only the machine code. Sandro
On Sep 28, 2007, at 11:00 AM, Sandro Magi wrote:> On 9/28/07, Chris Lattner <sabre at nondot.org> wrote: >> >>> Sorry, I meant to ask whether it's still necessary to keep F around, >>> ie. to delete generated code. Is there a standard approach to >>> garbage >>> collecting code in LLVM? >> >> Machine code in the JIT buffer or the LLVM IR itself? >> > > Assuming I don't need to keep around the IR version of a function, > then only the machine code.Use ExecutionEngine::freeMachineCodeForFunction to deallocate code from the JIT buffer. -Chris
On 9/28/07, Chris Lattner <sabre at nondot.org> wrote:> > On Sep 28, 2007, at 11:00 AM, Sandro Magi wrote: > > > Assuming I don't need to keep around the IR version of a function, > > then only the machine code. > > Use ExecutionEngine::freeMachineCodeForFunction to deallocate code > from the JIT buffer.Right, so I need to identify the unused functions myself in some way, and LLVM has no facility for querying what code is still referenced/in use, etc. Sandro