Skip to content

Commit 9e96e09

Browse files
committed
Update to match llvm r280032
Use the ilist getReverse() function instead of constructing a reverse_iterator from a forward iterator.
1 parent 391e7d8 commit 9e96e09

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

lib/SILOptimizer/Analysis/ARCAnalysis.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,8 +1136,7 @@ SILInstruction *swift::findReleaseToMatchUnsafeGuaranteedValue(
11361136
RCFI.getRCIdentityRoot(UnsafeGuaranteedI->getOperand(0));
11371137

11381138
// Look before the "unsafeGuaranteedEnd".
1139-
for (auto ReverseIt = SILBasicBlock::reverse_iterator(
1140-
UnsafeGuaranteedEndI->getIterator()),
1139+
for (auto ReverseIt = ++UnsafeGuaranteedEndI->getIterator().getReverse(),
11411140
End = BB.rend();
11421141
ReverseIt != End; ++ReverseIt) {
11431142
SILInstruction &CurInst = *ReverseIt;

lib/SILOptimizer/LoopTransforms/COWArrayOpt.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,7 @@ bool COWArrayOpt::isArrayValueReleasedBeforeMutate(
907907
}
908908

909909
static SILInstruction *getInstBefore(SILInstruction *I) {
910-
auto It = SILBasicBlock::reverse_iterator(I->getIterator());
910+
auto It = ++I->getIterator().getReverse();
911911
if (I->getParent()->rend() == It)
912912
return nullptr;
913913
return &*It;
@@ -939,8 +939,7 @@ stripValueProjections(SILValue V,
939939
/// by the array bounds check elimination pass.
940940
static SILInstruction *
941941
findPrecedingCheckSubscriptOrMakeMutable(ApplyInst *GetElementAddr) {
942-
for (auto ReverseIt =
943-
SILBasicBlock::reverse_iterator(GetElementAddr->getIterator()),
942+
for (auto ReverseIt = ++GetElementAddr->getIterator().getReverse(),
944943
End = GetElementAddr->getParent()->rend();
945944
ReverseIt != End; ++ReverseIt) {
946945
auto Apply = dyn_cast<ApplyInst>(&*ReverseIt);

lib/SILOptimizer/SILCombiner/SILCombinerMiscVisitors.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -857,8 +857,7 @@ SILCombiner::visitInjectEnumAddrInst(InjectEnumAddrInst *IEAI) {
857857
return nullptr;
858858
}
859859

860-
for (llvm::iplist<SILInstruction>::reverse_iterator InsIt(
861-
CurrIns->getIterator());
860+
for (auto InsIt = ++CurrIns->getIterator().getReverse();
862861
InsIt != CurrBB->rend(); ++InsIt) {
863862
SILInstruction *Ins = &*InsIt;
864863
if (Ins == DataAddrInst) {

0 commit comments

Comments
 (0)