@@ -426,15 +426,14 @@ void TBDGenVisitor::addSymbol(SILDeclRef declRef) {
426
426
addSymbol (declRef.mangle (), SymbolSource::forSILDeclRef (declRef));
427
427
}
428
428
429
- void TBDGenVisitor::addAsyncFunctionPointerSymbol (AbstractFunctionDecl *AFD) {
430
- auto declRef = SILDeclRef (AFD);
429
+ void TBDGenVisitor::addAsyncFunctionPointerSymbol (SILDeclRef declRef) {
431
430
auto silLinkage = effectiveLinkageForClassMember (
432
431
declRef.getLinkage (ForDefinition),
433
432
declRef.getSubclassScope ());
434
433
if (Opts.PublicSymbolsOnly && silLinkage != SILLinkage::Public)
435
434
return ;
436
435
437
- auto entity = LinkEntity::forAsyncFunctionPointer (AFD );
436
+ auto entity = LinkEntity::forAsyncFunctionPointer (declRef );
438
437
auto linkage =
439
438
LinkInfo::get (UniversalLinkInfo, SwiftModule, entity, ForDefinition);
440
439
addSymbol (linkage.getName (), SymbolSource::forSILDeclRef (declRef));
@@ -753,7 +752,7 @@ void TBDGenVisitor::visitAbstractFunctionDecl(AbstractFunctionDecl *AFD) {
753
752
visitDefaultArguments (AFD, AFD->getParameters ());
754
753
755
754
if (AFD->hasAsync ()) {
756
- addAsyncFunctionPointerSymbol (AFD);
755
+ addAsyncFunctionPointerSymbol (SILDeclRef ( AFD) );
757
756
}
758
757
}
759
758
@@ -1000,6 +999,10 @@ void TBDGenVisitor::visitConstructorDecl(ConstructorDecl *CD) {
1000
999
// default ValueDecl handling gives the allocating one, so we have to
1001
1000
// manually include the non-allocating one.
1002
1001
addSymbol (SILDeclRef (CD, SILDeclRef::Kind::Initializer));
1002
+ if (CD->hasAsync ()) {
1003
+ addAsyncFunctionPointerSymbol (
1004
+ SILDeclRef (CD, SILDeclRef::Kind::Initializer));
1005
+ }
1003
1006
if (auto parentClass = CD->getParent ()->getSelfClassDecl ()) {
1004
1007
if (parentClass->isObjC () || CD->isObjC ())
1005
1008
recorder.addObjCMethod (parentClass, SILDeclRef (CD));
0 commit comments