Fix bugpoint to work with swifterror values

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297196 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Arnold Schwaighofer 2017-03-07 20:28:59 +00:00
parent 6b149f36d5
commit 43959eee19

View 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;