Skip to content

Commit 6684934

Browse files
committed
[ownership] Change BorrowedValue::visitInteriorPointerOperand to pass IntPtrOperand as a value, not a const ref.
1. The reason to do this is that an InteriorPointerOperand is a value type. 2. Sometimes one wants to be able to use the IntPtrOperand that is not a const & and the value type formulation always works. Functionality wise, this is NFCI.
1 parent b16f340 commit 6684934

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

include/swift/SIL/OwnershipUtils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ struct BorrowedValue {
533533
/// we were able to understand all uses and thus guarantee we found all
534534
/// interior pointer uses. Returns false otherwise.
535535
bool visitInteriorPointerOperands(
536-
function_ref<void(const InteriorPointerOperand &)> func) const;
536+
function_ref<void(InteriorPointerOperand)> func) const;
537537

538538
/// Visit all immediate uses of this borrowed value and if any of them are
539539
/// reborrows, place them in BorrowingOperand form into \p

lib/SIL/Utils/OwnershipUtils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ bool BorrowedValue::visitExtendedLocalScopeEndingUses(
601601
}
602602

603603
bool BorrowedValue::visitInteriorPointerOperands(
604-
function_ref<void(const InteriorPointerOperand &)> func) const {
604+
function_ref<void(InteriorPointerOperand)> func) const {
605605
SmallVector<Operand *, 32> worklist(value->getUses());
606606
while (!worklist.empty()) {
607607
auto *op = worklist.pop_back_val();

0 commit comments

Comments
 (0)