@@ -2530,7 +2530,9 @@ class AsyncCallEmission final : public CallEmission {
2530
2530
getCallee ().getFunctionPointer ().getKind ());
2531
2531
2532
2532
return FunctionPointer::createForAsyncCall (
2533
- calleeFunction, codeAuthInfo, awaitSig, awaitEntrySig.getType ());
2533
+ IGF.Builder .CreateBitCast (calleeFunction,
2534
+ awaitEntrySig.getType ()->getPointerTo ()),
2535
+ codeAuthInfo, awaitSig, awaitEntrySig.getType ());
2534
2536
}
2535
2537
2536
2538
SILType getParameterType (unsigned index) override {
@@ -5355,6 +5357,12 @@ llvm::FunctionType *FunctionPointer::getFunctionType() const {
5355
5357
return cast<llvm::Function>(SecondaryValue)->getFunctionType ();
5356
5358
}
5357
5359
5360
+ if (awaitSignature) {
5361
+ assert (llvm::cast<llvm::PointerType>(Value->getType ())
5362
+ ->isOpaqueOrPointeeTypeMatches (awaitSignature));
5363
+ return cast<llvm::FunctionType>(awaitSignature);
5364
+ }
5365
+
5358
5366
// Read the function type off the global or else from the Signature.
5359
5367
if (auto *constant = dyn_cast<llvm::Constant>(Value)) {
5360
5368
auto *gv = dyn_cast<llvm::GlobalValue>(Value);
@@ -5377,12 +5385,6 @@ llvm::FunctionType *FunctionPointer::getFunctionType() const {
5377
5385
return cast<llvm::FunctionType>(gv->getValueType ());
5378
5386
}
5379
5387
5380
- if (awaitSignature) {
5381
- assert (llvm::cast<llvm::PointerType>(Value->getType ())
5382
- ->isOpaqueOrPointeeTypeMatches (awaitSignature));
5383
- return cast<llvm::FunctionType>(awaitSignature);
5384
- }
5385
-
5386
5388
assert (llvm::cast<llvm::PointerType>(Value->getType ())
5387
5389
->isOpaqueOrPointeeTypeMatches (Sig.getType ()));
5388
5390
return Sig.getType ();
0 commit comments