Skip to content

Commit ed9efa2

Browse files
committed
[TBDGen] Add async function pointers.
In order to call async functions, instances of the AsyncFunctionPointer struct must be used. If those functions are exported from a module, the AsyncFunctionPointer by means of which the function is to be called must be exported as well. For now, the symbol is exported by manually appending the relevant suffix to the mangled name of the function.
1 parent db8183d commit ed9efa2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/TBDGen/TBDGen.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -720,6 +720,10 @@ void TBDGenVisitor::visitAbstractFunctionDecl(AbstractFunctionDecl *AFD) {
720720
AFD->getGenericSignature()));
721721

722722
visitDefaultArguments(AFD, AFD->getParameters());
723+
724+
if (AFD->isAsyncContext()) {
725+
addSymbol(LinkEntity::forAsyncFunctionPointer(AFD));
726+
}
723727
}
724728

725729
void TBDGenVisitor::visitFuncDecl(FuncDecl *FD) {

0 commit comments

Comments
 (0)