]> granicus.if.org Git - llvm/commitdiff
Fix bugpoint to work with swifterror values
authorArnold Schwaighofer <aschwaighofer@apple.com>
Tue, 7 Mar 2017 20:28:59 +0000 (20:28 +0000)
committerArnold Schwaighofer <aschwaighofer@apple.com>
Tue, 7 Mar 2017 20:28:59 +0000 (20:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297196 91177308-0d34-0410-b5e6-96231b3b80d8

tools/bugpoint/CrashDebugger.cpp

index 0cae0669477f2f5be640ca44cd384c771d9eb516..c076309b22bb9a73480dd327631d1ee2337e313a 100644 (file)
@@ -731,7 +731,8 @@ bool ReduceCrashingInstructions::TestInsts(
       for (BasicBlock::iterator I = FI->begin(), E = FI->end(); I != E;) {
         Instruction *Inst = &*I++;
         if (!Instructions.count(Inst) && !isa<TerminatorInst>(Inst) &&
-            !Inst->isEHPad() && !Inst->getType()->isTokenTy()) {
+            !Inst->isEHPad() && !Inst->getType()->isTokenTy() &&
+            !Inst->isSwiftError()) {
           if (!Inst->getType()->isVoidTy())
             Inst->replaceAllUsesWith(UndefValue::get(Inst->getType()));
           Inst->eraseFromParent();
@@ -1015,7 +1016,8 @@ static Error ReduceInsts(BugDriver &BD,
                 // TODO: Should this be some kind of interrupted error?
                 return Error::success();
 
-              if (I->isEHPad() || I->getType()->isTokenTy())
+              if (I->isEHPad() || I->getType()->isTokenTy() ||
+                  I->isSwiftError())
                 continue;
 
               outs() << "Checking instruction: " << *I;