summaryrefslogtreecommitdiff
path: root/lib/CodeGen/LLVMTargetMachine.cpp
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2012-02-04 05:26:17 +0000
committerNick Lewycky <nicholas@mxc.ca>2012-02-04 05:26:17 +0000
commitc0dc1b7f9725433325ea06e1272ba7fd411c2eb1 (patch)
tree60b844b08b592866539dd94d5e0223a10b83c125 /lib/CodeGen/LLVMTargetMachine.cpp
parent3b1088a2cc15a39c7a7b8dd95a56143f1dda6863 (diff)
downloadllvm-c0dc1b7f9725433325ea06e1272ba7fd411c2eb1.tar.gz
llvm-c0dc1b7f9725433325ea06e1272ba7fd411c2eb1.tar.bz2
llvm-c0dc1b7f9725433325ea06e1272ba7fd411c2eb1.tar.xz
Fix a leak!
Andy, in a previous commit you made this into an ImmutablePass so that you could add it to the PassManager, then in the next commit you left it a Pass but removed the code that added it to the PM. If you do add it to the PM then the PM should take care of deleting it, but it's also true that nothing in codegen needs this object to exist after it's done its work here. It's not clear to me which design you want; this should likely either cease to be a Pass or be added to the PM where other parts of CodeGen will request it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149765 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LLVMTargetMachine.cpp')
-rw-r--r--lib/CodeGen/LLVMTargetMachine.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/CodeGen/LLVMTargetMachine.cpp b/lib/CodeGen/LLVMTargetMachine.cpp
index de69526a1e..b2768d6123 100644
--- a/lib/CodeGen/LLVMTargetMachine.cpp
+++ b/lib/CodeGen/LLVMTargetMachine.cpp
@@ -145,6 +145,8 @@ static MCContext *addPassesToGenerateCode(LLVMTargetMachine *TM,
PassConfig->addMachinePasses();
+ delete PassConfig;
+
return Context;
}