Skip to content

Commit c103503

Browse files
committed
[ownership] Add a new helper InteriorPointerOperand::getSingleBaseValue().
This returns the underlying BorrowedValue that introduce's the interior pointer operand's associated value.
1 parent a1a133f commit c103503

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

include/swift/SIL/OwnershipUtils.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,11 @@ struct InteriorPointerOperand {
621621
return true;
622622
}
623623

624+
/// Return the base BorrowedValue of the incoming value's operand.
625+
Optional<BorrowedValue> getSingleBaseValue() const {
626+
return getSingleBorrowIntroducingValue(operand->get());
627+
}
628+
624629
SILValue getProjectedAddress() const {
625630
switch (kind) {
626631
case InteriorPointerOperandKind::Invalid:

0 commit comments

Comments
 (0)