Skip to content

Commit 2c91da5

Browse files
compnerdbob-wilson
authored andcommitted
lib: update for LLVM API change
TerminatorInst has been removed and been made into a regular Instruction. Use the `isTerminator` function instead of the dyn_cast.
1 parent 4dc2eac commit 2c91da5

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

lib/IRGen/IRBuilder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class IRBuilder : public IRBuilderBase {
8282
bool hasPostTerminatorIP() const {
8383
return GetInsertBlock() != nullptr &&
8484
!GetInsertBlock()->empty() &&
85-
isa<llvm::TerminatorInst>(GetInsertBlock()->back());
85+
GetInsertBlock()->back().isTerminator();
8686
}
8787

8888
void ClearInsertionPoint() {

lib/LLVMPasses/LLVMARCOpts.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ static bool performStoreOnlyObjectElimination(CallInst &Allocation,
718718
// it is perfectly fine to delete this instruction if all uses of the
719719
// instruction are also eliminable.
720720

721-
if (I->mayHaveSideEffects() || isa<TerminatorInst>(I))
721+
if (I->mayHaveSideEffects() || I->isTerminator())
722722
return false;
723723
break;
724724

lib/LLVMPasses/LLVMMergeFunctions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ class SwiftMergeFunctions : public ModulePass {
312312
/// Advances the current instruction to the next instruction.
313313
void nextInst() {
314314
assert(CurrentInst);
315-
if (isa<TerminatorInst>(CurrentInst)) {
315+
if (CurrentInst->isTerminator()) {
316316
auto BlockIter = std::next(CurrentInst->getParent()->getIterator());
317317
if (BlockIter == F->end()) {
318318
CurrentInst = nullptr;

0 commit comments

Comments
 (0)