Skip to content

Commit 3ba8ab4

Browse files
committed
IRGen: Address llvm::Instruction::{move,insert}Before deprecations
See llvm/llvm-project@79499f0.
1 parent 8da5333 commit 3ba8ab4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/IRGen/IRGenSIL.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,7 @@ class IRGenSILFunction :
907907

908908
llvm::Instruction *Cloned = Orig->clone();
909909
Cloned->setOperand(0, Inner);
910-
Cloned->insertBefore(Orig);
910+
Cloned->insertBefore(Orig->getIterator());
911911
return static_cast<llvm::Value *>(Cloned);
912912
};
913913
if (auto *LdInst = dyn_cast<llvm::LoadInst>(Storage))
@@ -5762,7 +5762,7 @@ static Address isSafeForMemCpyPeephole(const TypeInfo &TI, SILArgument *arg,
57625762
return Address();
57635763
}
57645764

5765-
lifetimeBegin->moveBefore(load);
5765+
lifetimeBegin->moveBefore(load->getIterator());
57665766

57675767
// Set insertPt to the first load such that we are within the lifetime of the
57685768
// alloca marked by the lifetime intrinsic.

lib/LLVMPasses/LLVMARCOpts.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ static bool performLocalReleaseMotion(CallInst &Release, BasicBlock &BB,
398398
// there) move the release to the top of the block.
399399
// TODO: This is where we'd plug in some global algorithms someday.
400400
if (&*BBI != &Release) {
401-
Release.moveBefore(&*BBI);
401+
Release.moveBefore(BBI);
402402
return true;
403403
}
404404

@@ -520,7 +520,7 @@ static bool performLocalRetainMotion(CallInst &Retain, BasicBlock &BB,
520520
// If we were able to move the retain down, move it now.
521521
// TODO: This is where we'd plug in some global algorithms someday.
522522
if (MadeProgress) {
523-
Retain.moveBefore(&*BBI);
523+
Retain.moveBefore(BBI);
524524
return true;
525525
}
526526

0 commit comments

Comments
 (0)