Skip to content

Commit a1a133f

Browse files
committed
[ownership] Add helper methods to InteriorPointerOperand that let you easily use its internal operand.
Specifically, I added a '*' and a '->' operator so one can cast explicitly using '*' and access Operand methods using '->'.
1 parent 839c389 commit a1a133f

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
@@ -645,6 +645,11 @@ struct InteriorPointerOperand {
645645
bool getImplicitUses(SmallVectorImpl<Operand *> &foundUses,
646646
std::function<void(Operand *)> *onError = nullptr);
647647

648+
Operand *operator->() { return operand; }
649+
const Operand *operator->() const { return operand; }
650+
Operand *operator*() { return operand; }
651+
const Operand *operator*() const { return operand; }
652+
648653
private:
649654
/// Internal constructor for failable static constructor. Please do not expand
650655
/// its usage since it assumes the code passed in is well formed.

0 commit comments

Comments
 (0)