diff --git a/llvm/tools/bugpoint/CrashDebugger.cpp b/llvm/tools/bugpoint/CrashDebugger.cpp index 9c9dddedceb8..67ceaa90e35e 100644 --- a/llvm/tools/bugpoint/CrashDebugger.cpp +++ b/llvm/tools/bugpoint/CrashDebugger.cpp @@ -298,8 +298,7 @@ bool ReduceCrashingBlocks::TestBlocks(std::vector &BBs) { TerminatorInst *BBTerm = BB->getTerminator(); - if (BB->getTerminator()->getType() != - Type::getVoidTy(BB->getContext())) + if (!BB->getTerminator()->getType()->isVoidTy()) BBTerm->replaceAllUsesWith(Constant::getNullValue(BBTerm->getType())); // Replace the old terminator instruction. @@ -393,7 +392,7 @@ bool ReduceCrashingInstructions::TestInsts(std::vector for (BasicBlock::iterator I = FI->begin(), E = FI->end(); I != E;) { Instruction *Inst = I++; if (!Instructions.count(Inst) && !isa(Inst)) { - if (Inst->getType() != Type::getVoidTy(Inst->getContext())) + if (!Inst->getType()->isVoidTy()) Inst->replaceAllUsesWith(UndefValue::get(Inst->getType())); Inst->eraseFromParent(); } diff --git a/llvm/tools/bugpoint/ExtractFunction.cpp b/llvm/tools/bugpoint/ExtractFunction.cpp index e6a98d945a37..82f787454644 100644 --- a/llvm/tools/bugpoint/ExtractFunction.cpp +++ b/llvm/tools/bugpoint/ExtractFunction.cpp @@ -73,7 +73,7 @@ Module *BugDriver::deleteInstructionFromProgram(const Instruction *I, Instruction *TheInst = RI; // Got the corresponding instruction! // If this instruction produces a value, replace any users with null values - if (TheInst->getType() != Type::getVoidTy(I->getContext())) + if (!TheInst->getType()->isVoidTy()) TheInst->replaceAllUsesWith(Constant::getNullValue(TheInst->getType())); // Remove the instruction from the program. diff --git a/llvm/tools/bugpoint/Miscompilation.cpp b/llvm/tools/bugpoint/Miscompilation.cpp index 71484a250745..7094390464d2 100644 --- a/llvm/tools/bugpoint/Miscompilation.cpp +++ b/llvm/tools/bugpoint/Miscompilation.cpp @@ -848,7 +848,7 @@ static void CleanupAndPrepareModules(BugDriver &BD, Module *&Test, Args.push_back(i); // Pass on the arguments to the real function, return its result - if (F->getReturnType() == Type::getVoidTy(F->getContext())) { + if (F->getReturnType()->isVoidTy()) { CallInst::Create(FuncPtr, Args.begin(), Args.end(), "", DoCallBB); ReturnInst::Create(F->getContext(), DoCallBB); } else {