Skip to content

Commit 7542d19

Browse files
authored
Merge pull request #31522 from gottesmm/pr-62bd6a598471607f523b9db309c5c032cc3566b8
[sil] Add helper method FullApplySite::beginsCoroutineEvaluation().
2 parents 47fe49a + 91777ab commit 7542d19

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

include/swift/SIL/ApplySite.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,18 @@ class FullApplySite : public ApplySite {
534534
return getCalleeArgIndex(op) < getNumIndirectSILResults();
535535
}
536536

537+
/// Is this an ApplySite that begins the evaluation of a coroutine.
538+
bool beginsCoroutineEvaluation() const {
539+
switch (getKind()) {
540+
case FullApplySiteKind::ApplyInst:
541+
case FullApplySiteKind::TryApplyInst:
542+
return false;
543+
case FullApplySiteKind::BeginApplyInst:
544+
return true;
545+
}
546+
llvm_unreachable("Covered switch isn't covered?!");
547+
}
548+
537549
/// If this is a terminator apply site, then pass the first instruction of
538550
/// each successor to fun. Otherwise, pass std::next(Inst).
539551
///

0 commit comments

Comments
 (0)