@@ -9553,6 +9553,17 @@ class MoveOnlyWrapperToCopyableAddrInst
95539553 }
95549554};
95559555
9556+ class UncheckedOwnershipInst final
9557+ : public UnaryInstructionBase<SILInstructionKind::UncheckedOwnershipInst,
9558+ OwnershipForwardingSingleValueInstruction> {
9559+ friend class SILBuilder ;
9560+
9561+ UncheckedOwnershipInst (SILDebugLocation DebugLoc, SILValue operand,
9562+ ValueOwnershipKind forwardingOwnershipKind)
9563+ : UnaryInstructionBase(DebugLoc, operand, operand->getType (),
9564+ forwardingOwnershipKind) {}
9565+ };
9566+
95569567// / Given an object reference, return true iff it is non-nil and refers
95579568// / to a native swift object with strong reference count of 1.
95589569class IsUniqueInst
@@ -10123,6 +10134,7 @@ class TermInst : public NonValueInstruction {
1012310134 case TermKind::UnwindInst:
1012410135 case TermKind::UnreachableInst:
1012510136 case TermKind::ReturnInst:
10137+ case TermKind::ReturnBorrowInst:
1012610138 case TermKind::ThrowInst:
1012710139 case TermKind::ThrowAddrInst:
1012810140 case TermKind::YieldInst:
@@ -10252,6 +10264,34 @@ class ReturnInst
1025210264 }
1025310265};
1025410266
10267+ class ReturnBorrowInst final
10268+ : public InstructionBaseWithTrailingOperands<
10269+ SILInstructionKind::ReturnBorrowInst, ReturnBorrowInst, TermInst> {
10270+ friend SILBuilder;
10271+
10272+ ReturnBorrowInst (SILDebugLocation DebugLoc, ArrayRef<SILValue> operands);
10273+
10274+ static ReturnBorrowInst *create (SILDebugLocation DebugLoc, SILValue value,
10275+ ArrayRef<SILValue> enclosingValues,
10276+ SILModule &M);
10277+
10278+ public:
10279+ SILValue getReturnValue () const { return getAllOperands ()[0 ].get (); }
10280+
10281+ ArrayRef<Operand> getEnclosingValueOperands () const {
10282+ return getAllOperands ().drop_front ();
10283+ }
10284+
10285+ OperandValueArrayRef getEnclosingValues () const {
10286+ return OperandValueArrayRef (getEnclosingValueOperands ());
10287+ }
10288+
10289+ SuccessorListTy getSuccessors () {
10290+ // No Successors.
10291+ return SuccessorListTy ();
10292+ }
10293+ };
10294+
1025510295// / ThrowInst - Throw a typed error, returning it via the direct error result.
1025610296class ThrowInst
1025710297 : public UnaryInstructionBase<SILInstructionKind::ThrowInst, TermInst>
@@ -11667,6 +11707,7 @@ OwnershipForwardingSingleValueInstruction::classof(SILInstructionKind kind) {
1166711707 case SILInstructionKind::DropDeinitInst:
1166811708 case SILInstructionKind::BorrowedFromInst:
1166911709 case SILInstructionKind::ImplicitActorToOpaqueIsolationCastInst:
11710+ case SILInstructionKind::UncheckedOwnershipInst:
1167011711 return true ;
1167111712 default :
1167211713 return false ;
0 commit comments