diff options
| author | Chandler Carruth <chandlerc@gmail.com> | 2018-08-26 09:51:22 +0000 |
|---|---|---|
| committer | Chandler Carruth <chandlerc@gmail.com> | 2018-08-26 09:51:22 +0000 |
| commit | 9ae926b973e42633f7bc7db39b33241dbb9f2158 (patch) | |
| tree | 032f0dabf8a90e9c14cd3f96b32ec6cc117609e0 /llvm/tools/bugpoint | |
| parent | d38d9505d1bf380a67bccc6f5a29019394c1fd43 (diff) | |
| download | bcm5719-llvm-9ae926b973e42633f7bc7db39b33241dbb9f2158.tar.gz bcm5719-llvm-9ae926b973e42633f7bc7db39b33241dbb9f2158.zip | |
[IR] Replace `isa<TerminatorInst>` with `isTerminator()`.
This is a bit awkward in a handful of places where we didn't even have
an instruction and now we have to see if we can build one. But on the
whole, this seems like a win and at worst a reasonable cost for removing
`TerminatorInst`.
All of this is part of the removal of `TerminatorInst` from the
`Instruction` type hierarchy.
llvm-svn: 340701
Diffstat (limited to 'llvm/tools/bugpoint')
| -rw-r--r-- | llvm/tools/bugpoint/CrashDebugger.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/tools/bugpoint/CrashDebugger.cpp b/llvm/tools/bugpoint/CrashDebugger.cpp index a5b31e1ab32..e973bfef4dc 100644 --- a/llvm/tools/bugpoint/CrashDebugger.cpp +++ b/llvm/tools/bugpoint/CrashDebugger.cpp @@ -703,7 +703,7 @@ bool ReduceCrashingInstructions::TestInsts( // Convert list to set for fast lookup... SmallPtrSet<Instruction *, 32> Instructions; for (unsigned i = 0, e = Insts.size(); i != e; ++i) { - assert(!isa<TerminatorInst>(Insts[i])); + assert(!Insts[i]->isTerminator()); Instructions.insert(cast<Instruction>(VMap[Insts[i]])); } @@ -717,7 +717,7 @@ bool ReduceCrashingInstructions::TestInsts( for (Function::iterator FI = MI->begin(), FE = MI->end(); FI != FE; ++FI) for (BasicBlock::iterator I = FI->begin(), E = FI->end(); I != E;) { Instruction *Inst = &*I++; - if (!Instructions.count(Inst) && !isa<TerminatorInst>(Inst) && + if (!Instructions.count(Inst) && !Inst->isTerminator() && !Inst->isEHPad() && !Inst->getType()->isTokenTy() && !Inst->isSwiftError()) { if (!Inst->getType()->isVoidTy()) @@ -950,7 +950,7 @@ static Error ReduceInsts(BugDriver &BD, BugTester TestFn) { for (const Function &F : BD.getProgram()) for (const BasicBlock &BB : F) for (const Instruction &I : BB) - if (!isa<TerminatorInst>(&I)) + if (!I.isTerminator()) Insts.push_back(&I); Expected<bool> Result = |

