Skip to content

Commit 2b8e266

Browse files
authored
Revert "[pmo] Fix load [copy] like I fixed load_borrow."
1 parent 3932133 commit 2b8e266

File tree

5 files changed

+190
-869
lines changed

5 files changed

+190
-869
lines changed

include/swift/Basic/STLExtras.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -639,12 +639,12 @@ inline T accumulate(const Container &C, T init, BinaryOperation op) {
639639
}
640640

641641
template <typename Container, typename T>
642-
inline bool binary_search(const Container &C, const T &value) {
642+
inline bool binary_search(const Container &C, T value) {
643643
return std::binary_search(C.begin(), C.end(), value);
644644
}
645645

646646
template <typename Container, typename T, typename BinaryOperation>
647-
inline bool binary_search(const Container &C, const T &value, BinaryOperation op) {
647+
inline bool binary_search(const Container &C, T value, BinaryOperation op) {
648648
return std::binary_search(C.begin(), C.end(), value, op);
649649
}
650650

lib/SIL/OwnershipUtils.cpp

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,6 @@ bool swift::getUnderlyingBorrowIntroducingValues(
163163
continue;
164164
}
165165

166-
// If v produces .none ownership, then we can ignore it. It is important
167-
// that we put this before checking for guaranteed forwarding instructions,
168-
// since we want to ignore guaranteed forwarding instructions that in this
169-
// specific case produce a .none value.
170-
if (v.getOwnershipKind() == ValueOwnershipKind::None)
171-
continue;
172-
173166
// Otherwise if v is an ownership forwarding value, add its defining
174167
// instruction
175168
if (isGuaranteedForwardingValue(v)) {
@@ -180,9 +173,10 @@ bool swift::getUnderlyingBorrowIntroducingValues(
180173
continue;
181174
}
182175

183-
// Otherwise, this is an introducer we do not understand. Bail and return
184-
// false.
185-
return false;
176+
// If v produces any ownership, then we can ignore it. Otherwise, we need to
177+
// return false since this is an introducer we do not understand.
178+
if (v.getOwnershipKind() != ValueOwnershipKind::None)
179+
return false;
186180
}
187181

188182
return true;

0 commit comments

Comments
 (0)