@@ -426,15 +426,14 @@ void TBDGenVisitor::addSymbol(SILDeclRef declRef) {
426426 addSymbol (declRef.mangle (), SymbolSource::forSILDeclRef (declRef));
427427}
428428
429- void TBDGenVisitor::addAsyncFunctionPointerSymbol (AbstractFunctionDecl *AFD) {
430- auto declRef = SILDeclRef (AFD);
429+ void TBDGenVisitor::addAsyncFunctionPointerSymbol (SILDeclRef declRef) {
431430 auto silLinkage = effectiveLinkageForClassMember (
432431 declRef.getLinkage (ForDefinition),
433432 declRef.getSubclassScope ());
434433 if (Opts.PublicSymbolsOnly && silLinkage != SILLinkage::Public)
435434 return ;
436435
437- auto entity = LinkEntity::forAsyncFunctionPointer (AFD );
436+ auto entity = LinkEntity::forAsyncFunctionPointer (declRef );
438437 auto linkage =
439438 LinkInfo::get (UniversalLinkInfo, SwiftModule, entity, ForDefinition);
440439 addSymbol (linkage.getName (), SymbolSource::forSILDeclRef (declRef));
@@ -753,7 +752,7 @@ void TBDGenVisitor::visitAbstractFunctionDecl(AbstractFunctionDecl *AFD) {
753752 visitDefaultArguments (AFD, AFD->getParameters ());
754753
755754 if (AFD->hasAsync ()) {
756- addAsyncFunctionPointerSymbol (AFD);
755+ addAsyncFunctionPointerSymbol (SILDeclRef ( AFD) );
757756 }
758757}
759758
@@ -1000,6 +999,10 @@ void TBDGenVisitor::visitConstructorDecl(ConstructorDecl *CD) {
1000999 // default ValueDecl handling gives the allocating one, so we have to
10011000 // manually include the non-allocating one.
10021001 addSymbol (SILDeclRef (CD, SILDeclRef::Kind::Initializer));
1002+ if (CD->hasAsync ()) {
1003+ addAsyncFunctionPointerSymbol (
1004+ SILDeclRef (CD, SILDeclRef::Kind::Initializer));
1005+ }
10031006 if (auto parentClass = CD->getParent ()->getSelfClassDecl ()) {
10041007 if (parentClass->isObjC () || CD->isObjC ())
10051008 recorder.addObjCMethod (parentClass, SILDeclRef (CD));
0 commit comments