@@ -32,33 +32,22 @@ class DeadEndBlocks;
3232// / Returns true if v is an address or trivial.
3333bool isValueAddressOrTrivial (SILValue v);
3434
35- // / These operations forward both owned and guaranteed ownership.
36- bool isOwnershipForwardingValueKind (SILNodeKind kind);
37-
38- // / Is this an operand that can forward both owned and guaranteed ownership
39- // / kinds.
35+ // / Is this an operand that can forward both owned and guaranteed ownership into
36+ // / one of the operand's owner instruction's result.
4037bool isOwnershipForwardingUse (Operand *op);
4138
42- // / Is this an operand that forwards guaranteed ownership from its value to a
43- // / result of the using instruction.
39+ // / Is this an operand that can forward guaranteed ownership into one of the
40+ // / operand's owner instruction's result .
4441bool isGuaranteedForwardingUse (Operand *op);
4542
46- // / These operations forward guaranteed ownership, but don't necessarily forward
47- // / owned values .
48- bool isGuaranteedForwardingValueKind (SILNodeKind kind );
43+ // / Is this an operand that can forward owned ownership into one of the
44+ // / operand's owner instruction's result .
45+ bool isOwnedForwardingUse (Operand *use );
4946
50- // / Is this a value that is the result of an operation that forwards owned
51- // / ownership.
47+ // / Is this a value that is the result of an instruction that forwards
48+ // / guaranteed ownership from one of its operands .
5249bool isGuaranteedForwardingValue (SILValue value);
5350
54- // / Is this a node kind that can forward owned ownership, but may not be able to
55- // / forward guaranteed ownership.
56- bool isOwnedForwardingValueKind (SILNodeKind kind);
57-
58- // / Does this operand 'forward' owned ownership, but may not be able to forward
59- // / guaranteed ownership.
60- bool isOwnedForwardingUse (Operand *use);
61-
6251// / Is this value the result of an instruction that 'forward's owned ownership,
6352// / but may not be able to forward guaranteed ownership.
6453// /
@@ -76,6 +65,11 @@ class ForwardingOperand {
7665 static Optional<ForwardingOperand> get (Operand *use);
7766
7867 Operand *getUse () const { return use; }
68+ OwnershipConstraint getOwnershipConstraint () const {
69+ // We use a force unwrap since a ForwardingOperand should always have an
70+ // ownership constraint.
71+ return *use->getOwnershipConstraint ();
72+ }
7973 ValueOwnershipKind getOwnershipKind () const ;
8074 void setOwnershipKind (ValueOwnershipKind newKind) const ;
8175 void replaceOwnershipKind (ValueOwnershipKind oldKind,
0 commit comments