@@ -10123,6 +10123,7 @@ class TermInst : public NonValueInstruction {
1012310123 case TermKind::UnwindInst:
1012410124 case TermKind::UnreachableInst:
1012510125 case TermKind::ReturnInst:
10126+ case TermKind::ReturnBorrowInst:
1012610127 case TermKind::ThrowInst:
1012710128 case TermKind::ThrowAddrInst:
1012810129 case TermKind::YieldInst:
@@ -10252,6 +10253,34 @@ class ReturnInst
1025210253 }
1025310254};
1025410255
10256+ class ReturnBorrowInst final
10257+ : public InstructionBaseWithTrailingOperands<
10258+ SILInstructionKind::ReturnBorrowInst, ReturnBorrowInst, TermInst> {
10259+ friend SILBuilder;
10260+
10261+ ReturnBorrowInst (SILDebugLocation DebugLoc, ArrayRef<SILValue> operands);
10262+
10263+ static ReturnBorrowInst *create (SILDebugLocation DebugLoc, SILValue value,
10264+ ArrayRef<SILValue> enclosingValues,
10265+ SILModule &M);
10266+
10267+ public:
10268+ SILValue getReturnValue () const { return getAllOperands ()[0 ].get (); }
10269+
10270+ ArrayRef<Operand> getEnclosingValueOperands () const {
10271+ return getAllOperands ().drop_front ();
10272+ }
10273+
10274+ OperandValueArrayRef getEnclosingValues () const {
10275+ return OperandValueArrayRef (getEnclosingValueOperands ());
10276+ }
10277+
10278+ SuccessorListTy getSuccessors () {
10279+ // No Successors.
10280+ return SuccessorListTy ();
10281+ }
10282+ };
10283+
1025510284// / ThrowInst - Throw a typed error, returning it via the direct error result.
1025610285class ThrowInst
1025710286 : public UnaryInstructionBase<SILInstructionKind::ThrowInst, TermInst>
0 commit comments