[bugpoint] Treat token type the same as ehpad w.r.t deletion

llvm-svn: 274082
This commit is contained in:
Philip Reames 2016-06-29 00:15:35 +00:00
parent ac285cc9f6
commit 29e641cd26
1 changed files with 4 additions and 4 deletions

View File

@ -374,9 +374,9 @@ bool ReduceCrashingBlocks::TestBlocks(std::vector<const BasicBlock*> &BBs) {
(*SI)->removePredecessor(&*BB);
TerminatorInst *BBTerm = BB->getTerminator();
if (BBTerm->isEHPad())
if (BBTerm->isEHPad() || BBTerm->getType()->isTokenTy())
continue;
if (!BBTerm->getType()->isVoidTy() && !BBTerm->getType()->isTokenTy())
if (!BBTerm->getType()->isVoidTy())
BBTerm->replaceAllUsesWith(Constant::getNullValue(BBTerm->getType()));
// Replace the old terminator instruction.
@ -477,8 +477,8 @@ bool ReduceCrashingInstructions::TestInsts(std::vector<const Instruction*>
for (BasicBlock::iterator I = FI->begin(), E = FI->end(); I != E;) {
Instruction *Inst = &*I++;
if (!Instructions.count(Inst) && !isa<TerminatorInst>(Inst) &&
!Inst->isEHPad()) {
if (!Inst->getType()->isVoidTy() && !Inst->getType()->isTokenTy())
!Inst->isEHPad() && !Inst->getType()->isTokenTy()) {
if (!Inst->getType()->isVoidTy())
Inst->replaceAllUsesWith(UndefValue::get(Inst->getType()));
Inst->eraseFromParent();
}