summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2012-01-17 23:08:46 +0000
committerJim Grosbach <grosbach@apple.com>2012-01-17 23:08:46 +0000
commit3fa6dcfebb2c5f7bc4edc95d7cc7143ccc53d514 (patch)
tree2d70ab77b887705ec286c08cd765eb2b72f230ac
parentc72a807039a2926168992679cd211b286b0a2412 (diff)
downloadbcm5719-llvm-3fa6dcfebb2c5f7bc4edc95d7cc7143ccc53d514.tar.gz
bcm5719-llvm-3fa6dcfebb2c5f7bc4edc95d7cc7143ccc53d514.zip
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. llvm-svn: 148356
-rw-r--r--llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp b/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp
index d5aaec9333b..a0280b7c79f 100644
--- a/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp
+++ b/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp
@@ -85,6 +85,7 @@ MCJIT::MCJIT(Module *m, TargetMachine *tm, TargetJITInfo &tji,
MCJIT::~MCJIT() {
delete MemMgr;
+ delete TM;
}
void *MCJIT::getPointerToBasicBlock(BasicBlock *BB) {
OpenPOWER on IntegriCloud