Skip to content

Commit e3f92e4

Browse files
committed
[NFC] Added lambda to add executor.
Filtered code for adding ResumeParentExecutor to the async layout through the new lambda.
1 parent 5a6290f commit e3f92e4

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

lib/IRGen/GenCall.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,12 @@ AsyncContextLayout irgen::getAsyncContextLayout(
109109
valTypes.push_back(ty);
110110
typeInfos.push_back(&ti);
111111
};
112+
auto addExecutor = [&]() {
113+
auto ty = SILType();
114+
auto &ti = IGF.IGM.getSwiftExecutorPtrTypeInfo();
115+
valTypes.push_back(ty);
116+
typeInfos.push_back(&ti);
117+
};
112118

113119
// AsyncContext * __ptrauth_swift_async_context_parent Parent;
114120
{
@@ -123,12 +129,7 @@ AsyncContextLayout irgen::getAsyncContextLayout(
123129
addTaskContinuationFunction();
124130

125131
// ExecutorRef ResumeParentExecutor;
126-
{
127-
auto ty = SILType();
128-
auto &ti = IGF.IGM.getSwiftExecutorPtrTypeInfo();
129-
valTypes.push_back(ty);
130-
typeInfos.push_back(&ti);
131-
}
132+
addExecutor();
132133

133134
// SwiftError *errorResult;
134135
auto errorCanType = IGF.IGM.Context.getExceptionType();

0 commit comments

Comments
 (0)