@@ -411,15 +411,14 @@ void TBDGenVisitor::addSymbol(SILDeclRef declRef) {
411411 addSymbol (declRef.mangle (), SymbolSource::forSILDeclRef (declRef));
412412}
413413
414- void TBDGenVisitor::addAsyncFunctionPointerSymbol (AbstractFunctionDecl *AFD) {
415- auto declRef = SILDeclRef (AFD);
414+ void TBDGenVisitor::addAsyncFunctionPointerSymbol (SILDeclRef declRef) {
416415 auto silLinkage = effectiveLinkageForClassMember (
417416 declRef.getLinkage (ForDefinition),
418417 declRef.getSubclassScope ());
419418 if (Opts.PublicSymbolsOnly && silLinkage != SILLinkage::Public)
420419 return ;
421420
422- auto entity = LinkEntity::forAsyncFunctionPointer (AFD );
421+ auto entity = LinkEntity::forAsyncFunctionPointer (declRef );
423422 auto linkage =
424423 LinkInfo::get (UniversalLinkInfo, SwiftModule, entity, ForDefinition);
425424 addSymbol (linkage.getName (), SymbolSource::forSILDeclRef (declRef));
@@ -742,7 +741,7 @@ void TBDGenVisitor::visitAbstractFunctionDecl(AbstractFunctionDecl *AFD) {
742741 visitDefaultArguments (AFD, AFD->getParameters ());
743742
744743 if (AFD->hasAsync ()) {
745- addAsyncFunctionPointerSymbol (AFD);
744+ addAsyncFunctionPointerSymbol (SILDeclRef ( AFD) );
746745 }
747746}
748747
@@ -989,6 +988,10 @@ void TBDGenVisitor::visitConstructorDecl(ConstructorDecl *CD) {
989988 // default ValueDecl handling gives the allocating one, so we have to
990989 // manually include the non-allocating one.
991990 addSymbol (SILDeclRef (CD, SILDeclRef::Kind::Initializer));
991+ if (CD->hasAsync ()) {
992+ addAsyncFunctionPointerSymbol (
993+ SILDeclRef (CD, SILDeclRef::Kind::Initializer));
994+ }
992995 if (auto parentClass = CD->getParent ()->getSelfClassDecl ()) {
993996 if (parentClass->isObjC () || CD->isObjC ())
994997 recorder.addObjCMethod (parentClass, SILDeclRef (CD));
0 commit comments