summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2011-08-15 20:10:51 +0000
committerBill Wendling <isanbard@gmail.com>2011-08-15 20:10:51 +0000
commitd9fb470758d0943e8c8de4b37827dc8cf7bb4ddf (patch)
treecc05f0d5c77dd4ec5d2cd7c2de29db5764c49b59 /llvm/lib/Transforms
parent61a3ece665faaa0bc42b1a8bfaf2fe07d6ad4a0e (diff)
downloadbcm5719-llvm-d9fb470758d0943e8c8de4b37827dc8cf7bb4ddf.tar.gz
bcm5719-llvm-d9fb470758d0943e8c8de4b37827dc8cf7bb4ddf.zip
The "landingpad" instruction will never be "trivially" dead.
llvm-svn: 137642
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Utils/Local.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index 60dc15d6425..be0aa825001 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -226,6 +226,10 @@ bool llvm::ConstantFoldTerminator(BasicBlock *BB, bool DeleteDeadConditions) {
bool llvm::isInstructionTriviallyDead(Instruction *I) {
if (!I->use_empty() || isa<TerminatorInst>(I)) return false;
+ // We don't want the landingpad instruction removed by anything this general.
+ if (isa<LandingPadInst>(I))
+ return false;
+
// We don't want debug info removed by anything this general, unless
// debug info is empty.
if (DbgDeclareInst *DDI = dyn_cast<DbgDeclareInst>(I)) {
OpenPOWER on IntegriCloud