Sfoglia il codice sorgente

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
Bill Wendling 14 anni fa
parent
commit
187b1924a4
1 ha cambiato i file con 4 aggiunte e 0 eliminazioni
  1. 4 0
      lib/Transforms/Utils/Local.cpp

+ 4 - 0
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)) {