OSDN Git Service

A couple misc fixes so that bugpoint doesn't explode reducing code containing landing...
authorEli Friedman <eli.friedman@gmail.com>
Tue, 1 Nov 2011 04:40:56 +0000 (04:40 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Tue, 1 Nov 2011 04:40:56 +0000 (04:40 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143435 91177308-0d34-0410-b5e6-96231b3b80d8

tools/bugpoint/CrashDebugger.cpp

index f19ef62..a0aaf53 100644 (file)
@@ -401,7 +401,8 @@ bool ReduceCrashingInstructions::TestInsts(std::vector<const Instruction*>
     for (Function::iterator FI = MI->begin(), FE = MI->end(); FI != FE; ++FI)
       for (BasicBlock::iterator I = FI->begin(), E = FI->end(); I != E;) {
         Instruction *Inst = I++;
-        if (!Instructions.count(Inst) && !isa<TerminatorInst>(Inst)) {
+        if (!Instructions.count(Inst) && !isa<TerminatorInst>(Inst) &&
+            !isa<LandingPadInst>(Inst)) {
           if (!Inst->getType()->isVoidTy())
             Inst->replaceAllUsesWith(UndefValue::get(Inst->getType()));
           Inst->eraseFromParent();
@@ -574,6 +575,9 @@ static bool DebugACrash(BugDriver &BD,
             } else {
               if (BugpointIsInterrupted) goto ExitLoops;
 
+              if (isa<LandingPadInst>(I))
+                continue;
+
               outs() << "Checking instruction: " << *I;
               Module *M = BD.deleteInstructionFromProgram(I, Simplification);