@@ -9168,6 +9168,7 @@ class TermInst : public NonValueInstruction {
91689168 case TermKind::UnreachableInst:
91699169 case TermKind::ReturnInst:
91709170 case TermKind::ThrowInst:
9171+ case TermKind::ThrowAddrInst:
91719172 case TermKind::YieldInst:
91729173 case TermKind::CondBranchInst:
91739174 case TermKind::BranchInst:
@@ -9295,8 +9296,7 @@ class ReturnInst
92959296 }
92969297};
92979298
9298- // / ThrowInst - Throw a typed error (which, in our system, is
9299- // / essentially just a funny kind of return).
9299+ // / ThrowInst - Throw a typed error, returning it via the direct error result.
93009300class ThrowInst
93019301 : public UnaryInstructionBase<SILInstructionKind::ThrowInst, TermInst>
93029302{
@@ -9317,6 +9317,30 @@ class ThrowInst
93179317 }
93189318};
93199319
9320+ // / ThrowAddrInst - Throw a typed error, previously stored in the indirect
9321+ // / error result.
9322+ class ThrowAddrInst
9323+ : public InstructionBase<SILInstructionKind::ThrowAddrInst, TermInst>
9324+ {
9325+ friend SILBuilder;
9326+
9327+ // / Constructs a ThrowAddrInst representing a throw out of the current
9328+ // / function.
9329+ // /
9330+ // / \param DebugLoc The location of the throw.
9331+ ThrowAddrInst (SILDebugLocation DebugLoc)
9332+ : InstructionBase(DebugLoc) {}
9333+
9334+ public:
9335+ SuccessorListTy getSuccessors () {
9336+ // No successors.
9337+ return SuccessorListTy ();
9338+ }
9339+
9340+ ArrayRef<Operand> getAllOperands () const { return {}; }
9341+ MutableArrayRef<Operand> getAllOperands () { return {}; }
9342+ };
9343+
93209344// / UnwindInst - Continue unwinding out of this function. Currently this is
93219345// / only used in coroutines as the eventual terminator of the unwind edge
93229346// / out of a 'yield'.
0 commit comments