@@ -789,13 +789,16 @@ coroutine, where a normal function return would need to transfer ownership of
789789its return value, since a normal function's context ceases to exist and be able
790790to maintain ownership of the value after it returns.
791791
792- To support these concepts, SIL supports two kinds of coroutine:
793- ``@yield_many `` and ``@yield_once ``. Either of these attributes may be
792+ To support these concepts, SIL supports two flavors: single-yield and
793+ multi-yield. These two flavors correspond to three kinds. A multi-yield
794+ coroutine is of kind ``@yield_many ``. A single-yield coroutine is of kind
795+ either ``@yield_once `` or ``@yield_once_2 ``. Any of these attributes may be
794796written before a function type to indicate that it is a coroutine type.
795- ``@yield_many `` and ``@yield_once `` coroutines are allowed to also be
796- ``@async ``. (Note that ``@async `` functions are not themselves modeled
797- explicitly as coroutines in SIL, although the implementation may use a coroutine
798- lowering strategy.)
797+
798+ Both single-yield and multi-yield coroutines are allowed to also be ``@async ``.
799+ (Note that ``@async `` functions are not themselves modeled explicitly as
800+ coroutines in SIL, although the implementation may use a coroutine lowering
801+ strategy.)
799802
800803A coroutine type may declare any number of *yielded values *, which is to
801804say, values which are provided to the caller at a yield point. Yielded
@@ -816,9 +819,10 @@ calling a yield-many coroutine of any kind.
816819Coroutines may contain the special ``yield `` and ``unwind ``
817820instructions.
818821
819- A ``@yield_many `` coroutine may yield as many times as it desires.
820- A ``@yield_once `` coroutine may yield exactly once before returning,
821- although it may also ``throw `` before reaching that point.
822+ A multi-yield (``@yield_many ``) coroutine may yield as many times as it desires.
823+ A single-yield (``@yield_once `` or ``@yield_once_2 ``) coroutine may yield
824+ exactly once before returning, although it may also ``throw `` before reaching
825+ that point.
822826
823827Variadic Generics
824828`````````````````
@@ -8376,9 +8380,10 @@ the current function was invoked with a ``try_apply`` instruction, control
83768380resumes at the normal destination, and the value of the basic block argument
83778381will be the operand of this ``return `` instruction.
83788382
8379- If the current function is a ``yield_once `` coroutine, there must not be
8380- a path from the entry block to a ``return `` which does not pass through
8381- a ``yield `` instruction. This rule does not apply in the ``raw `` SIL stage.
8383+ If the current function is a single-yield coroutine (``yield_once `` or
8384+ ``yield_once_2 ``), there must not be a path from the entry block to a
8385+ ``return `` which does not pass through a ``yield `` instruction. This rule does
8386+ not apply in the ``raw `` SIL stage.
83828387
83838388``return `` does not retain or release its operand or any other values.
83848389
@@ -8446,9 +8451,10 @@ The ``resume`` and ``unwind`` destination blocks must be uniquely
84468451referenced by the ``yield `` instruction. This prevents them from becoming
84478452critical edges.
84488453
8449- In a ``yield_once `` coroutine, there must not be a control flow path leading
8450- from the ``resume `` edge to another ``yield `` instruction in this function.
8451- This rule does not apply in the ``raw `` SIL stage.
8454+ In a single-yield coroutine (``yield_once `` or ``yield_once_2 ``), there must
8455+ not be a control flow path leading from the ``resume `` edge to another
8456+ ``yield `` instruction in this function. This rule does not apply in the ``raw ``
8457+ SIL stage.
84528458
84538459There must not be a control flow path leading from the ``unwind `` edge to
84548460a ``return `` instruction, to a ``throw `` instruction, or to any block
0 commit comments