@@ -880,15 +880,20 @@ inline bool canAcceptUnownedValue(OperandOwnership operandOwnership) {
880
880
}
881
881
}
882
882
883
- // / Return the OperandOwnership for a forwarded operand when the forwarded
884
- // / result has this ValueOwnershipKind. \p allowUnowned is true for a subset
885
- // / of forwarding operations that are allowed to propagate Unowned values.
883
+ // / Return the OperandOwnership for a forwarded operand when the forwarding
884
+ // / operation has this "forwarding ownership" (as returned by
885
+ // / getForwardingOwnershipKind()). \p allowUnowned is true for a subset of
886
+ // / forwarding operations that are allowed to propagate Unowned values.
886
887
// /
887
- // / The ownership of a forwarded value is derived from the forwarding
888
- // / instruction's constant ownership attribute. If the result is owned, then the
889
- // / instruction moves owned operand to its result, ending its lifetime. If the
890
- // / result is guaranteed value, then the instruction propagates the lifetime of
891
- // / its borrows operand through its result.
888
+ // / Forwarding ownership is determined by the forwarding instruction's constant
889
+ // / ownership attribute. If forwarding ownership is owned, then the instruction
890
+ // / moves owned operand to its result, ending its lifetime. If forwarding
891
+ // / ownership is guaranteed, then the instruction propagates the lifetime of its
892
+ // / borrows operand through its result.
893
+ // /
894
+ // / The resulting forwarded value typically has forwarding ownership, but may
895
+ // / differ when the result is trivial type. e.g. an owned or guaranteed value
896
+ // / can be cast to a trivial type using owned or guaranteed forwarding.
892
897
inline OperandOwnership
893
898
ValueOwnershipKind::getForwardingOperandOwnership (bool allowUnowned) const {
894
899
switch (value) {
0 commit comments