[LLVMdev] JIT and anonymous procs

Chris Lattner sabre at nondot.org
Wed Mar 26 14:10:49 PDT 2008


On Wed, 26 Mar 2008, Jonathan S. Shapiro wrote:
>> All functions in the tutorial are referenced by their Function*.  The
>> Function* uniquely identifies a function and is independent of the name.
>
> I had understood that.
>
> So now I have compiled and run my top level expression's anonymous
> function. How do I go about properly freeing the Function object,
> *including* removing the anonymous procedure name from any global symbol
> table (if any) and also advising the runtime that the associated IR
> module can now be dropped along with everything else that was generated?

// Free JIT'd machine code:
EE->freeMachineCodeForFunction(F);

// Delete functions and IR:
F->eraseFromParent();

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/



More information about the llvm-dev mailing list