[llvm-commits] [llvm] r148356 - /llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.cpp

Jim Grosbach grosbach at apple.com
Tue Jan 17 15:08:46 PST 2012


Author: grosbach
Date: Tue Jan 17 17:08:46 2012
New Revision: 148356

URL: http://llvm.org/viewvc/llvm-project?rev=148356&view=rev
Log:
Fix MCJIT memory leak of owned TargetMachine.

The JIT is expected to take ownership of the TM that's passed in. The MCJIT
wasn't freeing it, resulting in leaks.

Modified:
    llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.cpp

Modified: llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.cpp?rev=148356&r1=148355&r2=148356&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/MCJIT/MCJIT.cpp Tue Jan 17 17:08:46 2012
@@ -85,6 +85,7 @@
 
 MCJIT::~MCJIT() {
   delete MemMgr;
+  delete TM;
 }
 
 void *MCJIT::getPointerToBasicBlock(BasicBlock *BB) {





More information about the llvm-commits mailing list