@@ -460,18 +460,20 @@ std::string LinkEntity::mangleAsString() const {
460460 Result.append (" Tu" );
461461 return Result;
462462 }
463+ case Kind::DistributedThunkAsyncFunctionPointer: {
464+ std::string Result = getSILDeclRef ().mangle ();
465+ Result.append (" Td" );
466+ Result.append (" Tu" );
467+ return Result;
468+ }
463469 case Kind::KnownAsyncFunctionPointer: {
464470 std::string Result (static_cast <char *>(Pointer));
465471 Result.append (" Tu" );
466472 return Result;
467473 }
468474
469475 case Kind::AsyncFunctionPointerAST: {
470- std::string Result;
471- Result = SILDeclRef (const_cast <ValueDecl *>(getDecl ()),
472- static_cast <SILDeclRef::Kind>(
473- reinterpret_cast <uintptr_t >(SecondaryPointer)))
474- .mangle ();
476+ std::string Result = getSILDeclRef ().mangle ();
475477 Result.append (" Tu" );
476478 return Result;
477479 }
@@ -483,6 +485,15 @@ std::string LinkEntity::mangleAsString() const {
483485 llvm_unreachable (" bad entity kind!" );
484486}
485487
488+ SILDeclRef LinkEntity::getSILDeclRef () const {
489+ assert (getKind () == Kind::DistributedThunkAsyncFunctionPointer ||
490+ getKind () == Kind::AsyncFunctionPointerAST);
491+
492+ return SILDeclRef (const_cast <ValueDecl *>(getDecl ()),
493+ static_cast <SILDeclRef::Kind>(
494+ reinterpret_cast <uintptr_t >(SecondaryPointer)));
495+ }
496+
486497SILLinkage LinkEntity::getLinkage (ForDefinition_t forDefinition) const {
487498 // For when `this` is a protocol conformance of some kind.
488499 auto getLinkageAsConformance = [&] {
@@ -717,6 +728,7 @@ SILLinkage LinkEntity::getLinkage(ForDefinition_t forDefinition) const {
717728 return getSILFunction ()->getEffectiveSymbolLinkage ();
718729
719730 case Kind::AsyncFunctionPointerAST:
731+ case Kind::DistributedThunkAsyncFunctionPointer:
720732 return getSILLinkage (getDeclLinkage (getDecl ()), forDefinition);
721733
722734 case Kind::DynamicallyReplaceableFunctionImpl:
@@ -779,6 +791,7 @@ bool LinkEntity::isContextDescriptor() const {
779791 return true ;
780792 case Kind::AsyncFunctionPointer:
781793 case Kind::AsyncFunctionPointerAST:
794+ case Kind::DistributedThunkAsyncFunctionPointer:
782795 case Kind::PropertyDescriptor:
783796 case Kind::DispatchThunk:
784797 case Kind::DispatchThunkDerivative:
@@ -962,6 +975,7 @@ llvm::Type *LinkEntity::getDefaultDeclarationType(IRGenModule &IGM) const {
962975 case Kind::DispatchThunkAsyncFunctionPointer:
963976 case Kind::DispatchThunkInitializerAsyncFunctionPointer:
964977 case Kind::DispatchThunkAllocatorAsyncFunctionPointer:
978+ case Kind::DistributedThunkAsyncFunctionPointer:
965979 case Kind::PartialApplyForwarderAsyncFunctionPointer:
966980 case Kind::AsyncFunctionPointerAST:
967981 case Kind::KnownAsyncFunctionPointer:
@@ -1071,6 +1085,7 @@ bool LinkEntity::isWeakImported(ModuleDecl *module) const {
10711085 }
10721086
10731087 case Kind::AsyncFunctionPointerAST:
1088+ case Kind::DistributedThunkAsyncFunctionPointer:
10741089 case Kind::DispatchThunk:
10751090 case Kind::DispatchThunkDerivative:
10761091 case Kind::DispatchThunkInitializer:
@@ -1165,6 +1180,7 @@ bool LinkEntity::isWeakImported(ModuleDecl *module) const {
11651180DeclContext *LinkEntity::getDeclContextForEmission () const {
11661181 switch (getKind ()) {
11671182 case Kind::AsyncFunctionPointerAST:
1183+ case Kind::DistributedThunkAsyncFunctionPointer:
11681184 case Kind::DispatchThunk:
11691185 case Kind::DispatchThunkDerivative:
11701186 case Kind::DispatchThunkInitializer:
0 commit comments