summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LLVMTargetMachine.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2010-08-04 23:36:02 +0000
committerBill Wendling <isanbard@gmail.com>2010-08-04 23:36:02 +0000
commitca1cb136465090f3b1b5f6dcf71a3dc8ed0223d6 (patch)
tree8ba42d7b2300faddf3bb5601c9cc6d220a123872 /llvm/lib/CodeGen/LLVMTargetMachine.cpp
parentbe67b4aa2011bb2de0404971c343b1d8a573d823 (diff)
downloadbcm5719-llvm-ca1cb136465090f3b1b5f6dcf71a3dc8ed0223d6.tar.gz
bcm5719-llvm-ca1cb136465090f3b1b5f6dcf71a3dc8ed0223d6.zip
The lower invoke pass needs to have unreachable code elimination run after it
because it could create such things. This fixes a MingW buildbot test failure. llvm-svn: 110279
Diffstat (limited to 'llvm/lib/CodeGen/LLVMTargetMachine.cpp')
-rw-r--r--llvm/lib/CodeGen/LLVMTargetMachine.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/LLVMTargetMachine.cpp b/llvm/lib/CodeGen/LLVMTargetMachine.cpp
index 807ceefd137..9d8258f1916 100644
--- a/llvm/lib/CodeGen/LLVMTargetMachine.cpp
+++ b/llvm/lib/CodeGen/LLVMTargetMachine.cpp
@@ -288,13 +288,15 @@ bool LLVMTargetMachine::addCommonCodeGenPasses(PassManagerBase &PM,
// pad is shared by multiple invokes and is also a target of a normal
// edge from elsewhere.
PM.add(createSjLjEHPass(getTargetLowering()));
- PM.add(createDwarfEHPass(this, OptLevel==CodeGenOpt::None));
- break;
+ // FALLTHROUGH
case ExceptionHandling::Dwarf:
PM.add(createDwarfEHPass(this, OptLevel==CodeGenOpt::None));
break;
case ExceptionHandling::None:
PM.add(createLowerInvokePass(getTargetLowering()));
+
+ // The lower invoke pass may create unreachable code. Remove it.
+ PM.add(createUnreachableBlockEliminationPass());
break;
}
OpenPOWER on IntegriCloud