@@ -7627,19 +7627,29 @@ class CopyableToMoveOnlyWrapperValueInst
76277627class MoveOnlyWrapperToCopyableValueInst
76287628 : public UnaryInstructionBase<
76297629 SILInstructionKind::MoveOnlyWrapperToCopyableValueInst,
7630- SingleValueInstruction>,
7631- public OwnershipForwardingMixin {
7630+ FirstArgOwnershipForwardingSingleValueInst> {
7631+ public:
7632+ enum InitialKind {
7633+ Guaranteed,
7634+ Owned,
7635+ };
7636+
7637+ private:
76327638 friend class SILBuilder ;
76337639
7640+ InitialKind initialKind;
7641+
76347642 MoveOnlyWrapperToCopyableValueInst (const SILFunction &fn,
76357643 SILDebugLocation DebugLoc,
7636- SILValue operand,
7637- OwnershipKind forwardingOwnershipKind)
7638- : UnaryInstructionBase(DebugLoc, operand,
7639- operand->getType ().removingMoveOnlyWrapper()),
7640- OwnershipForwardingMixin(
7641- SILInstructionKind::MoveOnlyWrapperToCopyableValueInst,
7642- forwardingOwnershipKind) {}
7644+ SILValue operand, InitialKind kind)
7645+ : UnaryInstructionBase(
7646+ DebugLoc, operand, operand->getType ().removingMoveOnlyWrapper(),
7647+ kind == InitialKind::Guaranteed ? OwnershipKind::Guaranteed
7648+ : OwnershipKind::Owned),
7649+ initialKind(kind) {}
7650+
7651+ public:
7652+ InitialKind getInitialKind () const { return initialKind; }
76437653};
76447654
76457655// / Given an object reference, return true iff it is non-nil and refers
@@ -9783,8 +9793,7 @@ inline bool OwnershipForwardingMixin::isa(SILInstructionKind kind) {
97839793 OwnershipForwardingConversionInst::classof (kind) ||
97849794 OwnershipForwardingSelectEnumInstBase::classof (kind) ||
97859795 OwnershipForwardingMultipleValueInstruction::classof (kind) ||
9786- kind == SILInstructionKind::MarkMustCheckInst ||
9787- kind == SILInstructionKind::MoveOnlyWrapperToCopyableValueInst;
9796+ kind == SILInstructionKind::MarkMustCheckInst;
97889797}
97899798
97909799inline OwnershipForwardingMixin *
0 commit comments