From 187b1924a4b68350a6492b116db0fb19c659222f Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Mon, 15 Aug 2011 20:10:51 +0000 Subject: [PATCH] The "landingpad" instruction will never be "trivially" dead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137642 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Utils/Local.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Transforms/Utils/Local.cpp b/lib/Transforms/Utils/Local.cpp index 60dc15d6425..be0aa825001 100644 --- a/lib/Transforms/Utils/Local.cpp +++ b/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(I)) return false; + // We don't want the landingpad instruction removed by anything this general. + if (isa(I)) + return false; + // We don't want debug info removed by anything this general, unless // debug info is empty. if (DbgDeclareInst *DDI = dyn_cast(I)) { -- 2.34.1