@@ -1331,7 +1331,11 @@ std::unique_ptr<COrObjCEntryPointArgumentEmission>
1331
1331
getCOrObjCEntryPointArgumentEmission (IRGenSILFunction &IGF,
1332
1332
SILBasicBlock &entry,
1333
1333
Explosion &allParamValues) {
1334
- if (IGF.CurSILFn ->isAsync ()) {
1334
+ if (IGF.CurSILFn ->isAsync () &&
1335
+ !(/* FIXME: Remove this condition once Task.runDetached is
1336
+ available. rdar://problem/70597390*/
1337
+ IGF.CurSILFn ->getLoweredFunctionType ()->getRepresentation () ==
1338
+ SILFunctionTypeRepresentation::CFunctionPointer)) {
1335
1339
llvm_unreachable (" unsupported" );
1336
1340
} else {
1337
1341
return std::make_unique<SyncCOrObjCEntryPointArgumentEmission>(
@@ -3141,7 +3145,12 @@ static void emitReturnInst(IRGenSILFunction &IGF,
3141
3145
auto &retTI = cast<LoadableTypeInfo>(IGF.getTypeInfo (resultTy));
3142
3146
retTI.initialize (IGF, result, IGF.IndirectReturn , false );
3143
3147
IGF.Builder .CreateRetVoid ();
3144
- } else if (IGF.isAsync ()) {
3148
+ } else if (IGF.isAsync () &&
3149
+ !(/* FIXME: Remove this condition once Task.runDetached is
3150
+ available. rdar://problem/70597390*/
3151
+ IGF.CurSILFn ->getLoweredFunctionType ()
3152
+ ->getRepresentation () ==
3153
+ SILFunctionTypeRepresentation::CFunctionPointer)) {
3145
3154
// If we're generating an async function, store the result into the buffer.
3146
3155
assert (!IGF.IndirectReturn .isValid () &&
3147
3156
" Formally direct results should stay direct results for async "
0 commit comments