@@ -580,18 +580,19 @@ class FullApplySite : public ApplySite {
580
580
return getSubstCalleeConv ().hasIndirectSILResults ();
581
581
}
582
582
583
- // / If our apply site has a single direct result SILValue, return that
584
- // / SILValue. Return SILValue() otherwise.
583
+ // / Get the SIL value that represents all of the given call's results. For a
584
+ // / single direct result, returns the result. For multiple results, returns a
585
+ // / fake tuple value. The tuple has no storage of its own. The real results
586
+ // / must be extracted from it.
585
587
// /
586
- // / This means that:
588
+ // / For ApplyInst, returns the single-value instruction itself.
587
589
// /
588
- // / 1. If we have an ApplyInst, we just visit the apply.
589
- // / 2. If we have a TryApplyInst, we visit the first argument of the normal
590
- // / block.
591
- // / 3. If we have a BeginApplyInst, we return SILValue() since the begin_apply
592
- // / yields values instead of returning them. A returned value should only
593
- // / be valid after a full apply site has completely finished executing.
594
- SILValue getSingleDirectResult () const {
590
+ // / For TryApplyInst returns the continuation block argument.
591
+ // /
592
+ // / For BeginApplyInst, returns an invalid value. For coroutines, there is no
593
+ // / single value representing all results. Yielded values are generally
594
+ // / handled differently since they have the convention of incoming arguments.
595
+ SILValue getPseudoResult () const {
595
596
switch (getKind ()) {
596
597
case FullApplySiteKind::ApplyInst:
597
598
return SILValue (cast<ApplyInst>(getInstruction ()));
0 commit comments