diff options
author | David Majnemer <david.majnemer@gmail.com> | 2015-11-08 04:16:12 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2015-11-08 04:16:12 +0000 |
commit | 189d7da1f5f0a9ee5c9880ee503a0b0f291c75c0 (patch) | |
tree | fb421fa311bc01a0cf2a68ff7f9b9bf8c4bd12df /llvm/tools/bugpoint/CrashDebugger.cpp | |
parent | e35244cf636b684e0725738cab900ee8f024d044 (diff) | |
download | bcm5719-llvm-189d7da1f5f0a9ee5c9880ee503a0b0f291c75c0.tar.gz bcm5719-llvm-189d7da1f5f0a9ee5c9880ee503a0b0f291c75c0.zip |
Make bugpoint ehpad/token friendly
Tokens shouldn't be blindly replaced with undef/null. Also, don't try
to remove EH pad instructions from the top of basic blocks.
llvm-svn: 252414
Diffstat (limited to 'llvm/tools/bugpoint/CrashDebugger.cpp')
-rw-r--r-- | llvm/tools/bugpoint/CrashDebugger.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/tools/bugpoint/CrashDebugger.cpp b/llvm/tools/bugpoint/CrashDebugger.cpp index 91bf033ac9c..1bfcc87e06e 100644 --- a/llvm/tools/bugpoint/CrashDebugger.cpp +++ b/llvm/tools/bugpoint/CrashDebugger.cpp @@ -373,8 +373,9 @@ bool ReduceCrashingBlocks::TestBlocks(std::vector<const BasicBlock*> &BBs) { (*SI)->removePredecessor(&*BB); TerminatorInst *BBTerm = BB->getTerminator(); - - if (!BB->getTerminator()->getType()->isVoidTy()) + if (BBTerm->isEHPad()) + continue; + if (!BBTerm->getType()->isVoidTy() && !BBTerm->getType()->isTokenTy()) BBTerm->replaceAllUsesWith(Constant::getNullValue(BBTerm->getType())); // Replace the old terminator instruction. @@ -476,7 +477,7 @@ bool ReduceCrashingInstructions::TestInsts(std::vector<const Instruction*> Instruction *Inst = &*I++; if (!Instructions.count(Inst) && !isa<TerminatorInst>(Inst) && !Inst->isEHPad()) { - if (!Inst->getType()->isVoidTy()) + if (!Inst->getType()->isVoidTy() && !Inst->getType()->isTokenTy()) Inst->replaceAllUsesWith(UndefValue::get(Inst->getType())); Inst->eraseFromParent(); } @@ -785,7 +786,7 @@ static bool DebugACrash(BugDriver &BD, } else { if (BugpointIsInterrupted) goto ExitLoops; - if (isa<LandingPadInst>(I)) + if (I->isEHPad() || I->getType()->isTokenTy()) continue; outs() << "Checking instruction: " << *I; |