summaryrefslogtreecommitdiff
path: root/lib/CodeGen/LLVMTargetMachine.cpp
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2012-02-06 22:51:15 +0000
committerAndrew Trick <atrick@apple.com>2012-02-06 22:51:15 +0000
commit6939fde29cdd04cec9f440a9351c1c4340850e20 (patch)
tree47e045e324286e154bea1bfd2ca9b01c1921316a /lib/CodeGen/LLVMTargetMachine.cpp
parent0ca032b03dc3a862670461651b3a950d1f14991b (diff)
downloadllvm-6939fde29cdd04cec9f440a9351c1c4340850e20.tar.gz
llvm-6939fde29cdd04cec9f440a9351c1c4340850e20.tar.bz2
llvm-6939fde29cdd04cec9f440a9351c1c4340850e20.tar.xz
Add TargetPassConfig to the PassManager for use inside passes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149926 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LLVMTargetMachine.cpp')
-rw-r--r--lib/CodeGen/LLVMTargetMachine.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/CodeGen/LLVMTargetMachine.cpp b/lib/CodeGen/LLVMTargetMachine.cpp
index b2768d6123..f07a85f39c 100644
--- a/lib/CodeGen/LLVMTargetMachine.cpp
+++ b/lib/CodeGen/LLVMTargetMachine.cpp
@@ -116,6 +116,8 @@ static MCContext *addPassesToGenerateCode(LLVMTargetMachine *TM,
// Set PassConfig options provided by TargetMachine.
PassConfig->setDisableVerify(DisableVerify);
+ PM.add(PassConfig);
+
PassConfig->addIRPasses();
addPassesToHandleExceptions(TM, PM);
@@ -145,8 +147,6 @@ static MCContext *addPassesToGenerateCode(LLVMTargetMachine *TM,
PassConfig->addMachinePasses();
- delete PassConfig;
-
return Context;
}