Update to match llvm r280032

Use the ilist getReverse() function instead of constructing a
reverse_iterator from a forward iterator.

(cherry picked from commit 9e96e0965d)
This commit is contained in:
Bob Wilson
2016-10-08 22:29:01 -07:00
parent 2c21ef586d
commit ade13da759
3 changed files with 4 additions and 7 deletions

View File

@@ -907,7 +907,7 @@ bool COWArrayOpt::isArrayValueReleasedBeforeMutate(
}
static SILInstruction *getInstBefore(SILInstruction *I) {
auto It = SILBasicBlock::reverse_iterator(I->getIterator());
auto It = ++I->getIterator().getReverse();
if (I->getParent()->rend() == It)
return nullptr;
return &*It;
@@ -939,8 +939,7 @@ stripValueProjections(SILValue V,
/// by the array bounds check elimination pass.
static SILInstruction *
findPrecedingCheckSubscriptOrMakeMutable(ApplyInst *GetElementAddr) {
for (auto ReverseIt =
SILBasicBlock::reverse_iterator(GetElementAddr->getIterator()),
for (auto ReverseIt = ++GetElementAddr->getIterator().getReverse(),
End = GetElementAddr->getParent()->rend();
ReverseIt != End; ++ReverseIt) {
auto Apply = dyn_cast<ApplyInst>(&*ReverseIt);