Skip to content

Commit ec81d7f

Browse files
committed
Move the responsibility for adding the special direct continuation
arguments to the CallEmission.
1 parent 3cfda35 commit ec81d7f

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

lib/IRGen/GenCall.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3341,6 +3341,14 @@ class AsyncCallEmission final : public CallEmission {
33413341
break;
33423342
}
33433343
}
3344+
3345+
// If we're passing the continuation directly, add those implicit
3346+
// arguments.
3347+
if (getCallee().shouldPassContinuationDirectly()) {
3348+
asyncExplosion.add(getResumeFunctionPointer());
3349+
asyncExplosion.add(getAsyncContext());
3350+
}
3351+
33443352
super::setArgs(asyncExplosion, false, witnessMetadata);
33453353

33463354
auto layout = getAsyncContextLayout();

lib/IRGen/IRGenSIL.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3954,11 +3954,6 @@ void IRGenSILFunction::visitFullApplySite(FullApplySite site) {
39543954
}
39553955
}
39563956

3957-
if (calleeFP.shouldPassContinuationDirectly()) {
3958-
llArgs.add(emission->getResumeFunctionPointer());
3959-
llArgs.add(emission->getAsyncContext());
3960-
}
3961-
39623957
// Add all those arguments.
39633958
emission->setArgs(llArgs, false, &witnessMetadata);
39643959

0 commit comments

Comments
 (0)