@@ -32,33 +32,22 @@ class DeadEndBlocks;
32
32
// / Returns true if v is an address or trivial.
33
33
bool isValueAddressOrTrivial (SILValue v);
34
34
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.
40
37
bool isOwnershipForwardingUse (Operand *op);
41
38
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 .
44
41
bool isGuaranteedForwardingUse (Operand *op);
45
42
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 );
49
46
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 .
52
49
bool isGuaranteedForwardingValue (SILValue value);
53
50
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
-
62
51
// / Is this value the result of an instruction that 'forward's owned ownership,
63
52
// / but may not be able to forward guaranteed ownership.
64
53
// /
@@ -76,6 +65,11 @@ class ForwardingOperand {
76
65
static Optional<ForwardingOperand> get (Operand *use);
77
66
78
67
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
+ }
79
73
ValueOwnershipKind getOwnershipKind () const ;
80
74
void setOwnershipKind (ValueOwnershipKind newKind) const ;
81
75
void replaceOwnershipKind (ValueOwnershipKind oldKind,
0 commit comments