Skip to content

Commit ee8f98a

Browse files
authored
Merge pull request #8712 from atrick/fix
2 parents 159fe76 + b308daf commit ee8f98a

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

lib/SIL/SILBasicBlock.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,14 @@ void SILBasicBlock::remove(SILInstruction *I) {
9090
InstList.remove(I);
9191
}
9292

93-
/// Returns the iterator following the erased instruction, STL-style.
93+
/// Returns the iterator following the erased instruction.
9494
SILBasicBlock::iterator SILBasicBlock::erase(SILInstruction *I) {
9595
// Notify the delete handlers that this instruction is going away.
9696
getModule().notifyDeleteHandlers(&*I);
9797
auto *F = getParent();
98-
// LLVM does not currently implement ilist::erase correctly. Compensate.
99-
iterator next = std::next(SILBasicBlock::iterator(I));
100-
InstList.erase(I);
98+
auto nextIter = InstList.erase(I);
10199
F->getModule().deallocateInst(I);
102-
return next;
100+
return nextIter;
103101
}
104102

105103
/// This method unlinks 'self' from the containing SILFunction and deletes it.

lib/SILOptimizer/Mandatory/AccessMarkerElimination.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,12 @@ struct AccessMarkerElimination : SILModuleTransform {
5252
if (auto beginAccess = dyn_cast<BeginAccessInst>(inst)) {
5353
beginAccess->replaceAllUsesWith(beginAccess->getSource());
5454
II = BB.erase(beginAccess);
55+
continue;
5556
}
5657
if (auto endAccess = dyn_cast<EndAccessInst>(inst)) {
5758
assert(endAccess->use_empty());
5859
II = BB.erase(endAccess);
60+
continue;
5961
}
6062
}
6163
}

test/SILOptimizer/access_marker_elim.sil

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// RUN: %target-sil-opt -enforce-exclusivity=checked -emit-sorted-sil -access-marker-elim %s | %FileCheck %s
2-
// REQUIRES: rdar:31550303 OSS Swift CI ASAN bot fails on AccessMarker tests.
32

43
sil_stage raw
54

test/SILOptimizer/access_marker_mandatory.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// RUN: %target-swift-frontend -parse-as-library -Xllvm -sil-full-demangle -enforce-exclusivity=checked -emit-sil %s | %FileCheck %s
2-
// REQUIRES: rdar:31550303 OSS Swift CI ASAN bot fails on AccessMarker tests.
32

43
public struct S {
54
var i: Int

0 commit comments

Comments
 (0)