@@ -690,6 +690,22 @@ swift::swift_task_create_group_future(
690
690
initialContextSize);
691
691
}
692
692
693
+ #ifdef __ARM_ARCH_7K__
694
+ __attribute__ ((noinline))
695
+ SWIFT_CC(swiftasync) static void workaround_function_swift_task_future_waitImpl(
696
+ OpaqueValue *result, SWIFT_ASYNC_CONTEXT AsyncContext *callerContext,
697
+ AsyncTask *task, TaskContinuationFunction resumeFunction,
698
+ AsyncContext *callContext) {
699
+ // Make sure we don't eliminate calls to this function.
700
+ asm volatile (" " // Do nothing.
701
+ : // Output list, empty.
702
+ : " r" (result), " r" (callerContext), " r" (task) // Input list.
703
+ : // Clobber list, empty.
704
+ );
705
+ return ;
706
+ }
707
+ #endif
708
+
693
709
SWIFT_CC (swiftasync)
694
710
static void swift_task_future_waitImpl(
695
711
OpaqueValue *result,
@@ -709,7 +725,12 @@ static void swift_task_future_waitImpl(
709
725
result)) {
710
726
case FutureFragment::Status::Executing:
711
727
// The waiting task has been queued on the future.
728
+ #ifdef __ARM_ARCH_7K__
729
+ return workaround_function_swift_task_future_waitImpl (
730
+ result, callerContext, task, resumeFn, callContext);
731
+ #else
712
732
return ;
733
+ #endif
713
734
714
735
case FutureFragment::Status::Success: {
715
736
// Run the task with a successful result.
@@ -724,6 +745,22 @@ static void swift_task_future_waitImpl(
724
745
}
725
746
}
726
747
748
+ #ifdef __ARM_ARCH_7K__
749
+ __attribute__ ((noinline))
750
+ SWIFT_CC(swiftasync) static void workaround_function_swift_task_future_wait_throwingImpl(
751
+ OpaqueValue *result, SWIFT_ASYNC_CONTEXT AsyncContext *callerContext,
752
+ AsyncTask *task, ThrowingTaskFutureWaitContinuationFunction resumeFunction,
753
+ AsyncContext *callContext) {
754
+ // Make sure we don't eliminate calls to this function.
755
+ asm volatile (" " // Do nothing.
756
+ : // Output list, empty.
757
+ : " r" (result), " r" (callerContext), " r" (task) // Input list.
758
+ : // Clobber list, empty.
759
+ );
760
+ return ;
761
+ }
762
+ #endif
763
+
727
764
SWIFT_CC (swiftasync)
728
765
void swift_task_future_wait_throwingImpl(
729
766
OpaqueValue *result, SWIFT_ASYNC_CONTEXT AsyncContext *callerContext,
@@ -744,7 +781,12 @@ void swift_task_future_wait_throwingImpl(
744
781
result)) {
745
782
case FutureFragment::Status::Executing:
746
783
// The waiting task has been queued on the future.
784
+ #ifdef __ARM_ARCH_7K__
785
+ return workaround_function_swift_task_future_wait_throwingImpl (
786
+ result, callerContext, task, resumeFunction, callContext);
787
+ #else
747
788
return ;
789
+ #endif
748
790
749
791
case FutureFragment::Status::Success: {
750
792
auto future = task->futureFragment ();
0 commit comments