Skip to content

Commit 5a6290f

Browse files
committed
[NFC] Added lambda to add task continuation func.
Filtered code for adding ResumeParent to the async layout through the new lambda.
1 parent 59a309c commit 5a6290f

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

lib/IRGen/GenCall.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,13 @@ AsyncContextLayout irgen::getAsyncContextLayout(
103103
auto parameters = substitutedType->getParameters();
104104
SILFunctionConventions fnConv(substitutedType, IGF.getSILModule());
105105

106+
auto addTaskContinuationFunction = [&]() {
107+
auto ty = SILType();
108+
auto &ti = IGF.IGM.getTaskContinuationFunctionPtrTypeInfo();
109+
valTypes.push_back(ty);
110+
typeInfos.push_back(&ti);
111+
};
112+
106113
// AsyncContext * __ptrauth_swift_async_context_parent Parent;
107114
{
108115
auto ty = SILType();
@@ -113,12 +120,7 @@ AsyncContextLayout irgen::getAsyncContextLayout(
113120

114121
// TaskContinuationFunction * __ptrauth_swift_async_context_resume
115122
// ResumeParent;
116-
{
117-
auto ty = SILType();
118-
auto &ti = IGF.IGM.getTaskContinuationFunctionPtrTypeInfo();
119-
valTypes.push_back(ty);
120-
typeInfos.push_back(&ti);
121-
}
123+
addTaskContinuationFunction();
122124

123125
// ExecutorRef ResumeParentExecutor;
124126
{

0 commit comments

Comments
 (0)