From d9fb470758d0943e8c8de4b37827dc8cf7bb4ddf Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Mon, 15 Aug 2011 20:10:51 +0000 Subject: The "landingpad" instruction will never be "trivially" dead. llvm-svn: 137642 --- llvm/lib/Transforms/Utils/Local.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'llvm/lib/Transforms/Utils/Local.cpp') 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(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)) { -- cgit v1.2.3