@@ -59,9 +59,7 @@ using TargetExecutorSignature =
5959 /* resultBuffer=*/ void *,
6060 /* substitutions=*/ void *,
6161 /* witnessTables=*/ void **,
62- /* numWitnessTables=*/ size_t ,
63- /* resumeFunc=*/ TaskContinuationFunction *,
64- /* callContext=*/ AsyncContext *),
62+ /* numWitnessTables=*/ size_t ),
6563 /* throws=*/ true >;
6664
6765SWIFT_CC (swiftasync)
@@ -102,7 +100,7 @@ static void ::swift_distributed_execute_target_resume(
102100 swift_task_dealloc (context);
103101 // See `swift_distributed_execute_target` - `parentCtx` in this case
104102 // is `callContext` which should be completely transparent on resume.
105- return resumeInParent (parentCtx-> Parent , error);
103+ return resumeInParent (parentCtx, error);
106104}
107105
108106SWIFT_CC (swiftasync)
@@ -115,9 +113,7 @@ void ::swift_distributed_execute_target(
115113 void *resultBuffer,
116114 void *substitutions,
117115 void **witnessTables,
118- size_t numWitnessTables,
119- TaskContinuationFunction *resumeFunc,
120- AsyncContext *callContext) {
116+ size_t numWitnessTables) {
121117 auto *accessor = findDistributedAccessor (targetNameStart, targetNameLength);
122118 if (!accessor) {
123119 assert (false && " no distributed accessor" );
@@ -135,17 +131,7 @@ void ::swift_distributed_execute_target(
135131 AsyncContext *calleeContext = reinterpret_cast <AsyncContext *>(
136132 swift_task_alloc (asyncFnPtr->ExpectedContextSize ));
137133
138- // TODO(concurrency): Special functions like this one are currently set-up
139- // to pass "caller" context and resume function as extra parameters due to
140- // how they are declared in C. But this particular function behaves exactly
141- // like a regular `async throws`, which means that we need to initialize
142- // intermediate `callContext` using parent `callerContext`. A better fix for
143- // this situation would be to adjust IRGen and handle function like this
144- // like regular `async` functions even though they are classified as special.
145- callContext->Parent = callerContext;
146- callContext->ResumeParent = resumeFunc;
147-
148- calleeContext->Parent = callContext;
134+ calleeContext->Parent = callerContext;
149135 calleeContext->ResumeParent = reinterpret_cast <TaskContinuationFunction *>(
150136 swift_distributed_execute_target_resume);
151137
0 commit comments