@@ -460,18 +460,20 @@ std::string LinkEntity::mangleAsString() const {
460
460
Result.append (" Tu" );
461
461
return Result;
462
462
}
463
+ case Kind::DistributedThunkAsyncFunctionPointer: {
464
+ std::string Result = getSILDeclRef ().mangle ();
465
+ Result.append (" Td" );
466
+ Result.append (" Tu" );
467
+ return Result;
468
+ }
463
469
case Kind::KnownAsyncFunctionPointer: {
464
470
std::string Result (static_cast <char *>(Pointer));
465
471
Result.append (" Tu" );
466
472
return Result;
467
473
}
468
474
469
475
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 ();
475
477
Result.append (" Tu" );
476
478
return Result;
477
479
}
@@ -483,6 +485,15 @@ std::string LinkEntity::mangleAsString() const {
483
485
llvm_unreachable (" bad entity kind!" );
484
486
}
485
487
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
+
486
497
SILLinkage LinkEntity::getLinkage (ForDefinition_t forDefinition) const {
487
498
// For when `this` is a protocol conformance of some kind.
488
499
auto getLinkageAsConformance = [&] {
@@ -717,6 +728,7 @@ SILLinkage LinkEntity::getLinkage(ForDefinition_t forDefinition) const {
717
728
return getSILFunction ()->getEffectiveSymbolLinkage ();
718
729
719
730
case Kind::AsyncFunctionPointerAST:
731
+ case Kind::DistributedThunkAsyncFunctionPointer:
720
732
return getSILLinkage (getDeclLinkage (getDecl ()), forDefinition);
721
733
722
734
case Kind::DynamicallyReplaceableFunctionImpl:
@@ -779,6 +791,7 @@ bool LinkEntity::isContextDescriptor() const {
779
791
return true ;
780
792
case Kind::AsyncFunctionPointer:
781
793
case Kind::AsyncFunctionPointerAST:
794
+ case Kind::DistributedThunkAsyncFunctionPointer:
782
795
case Kind::PropertyDescriptor:
783
796
case Kind::DispatchThunk:
784
797
case Kind::DispatchThunkDerivative:
@@ -962,6 +975,7 @@ llvm::Type *LinkEntity::getDefaultDeclarationType(IRGenModule &IGM) const {
962
975
case Kind::DispatchThunkAsyncFunctionPointer:
963
976
case Kind::DispatchThunkInitializerAsyncFunctionPointer:
964
977
case Kind::DispatchThunkAllocatorAsyncFunctionPointer:
978
+ case Kind::DistributedThunkAsyncFunctionPointer:
965
979
case Kind::PartialApplyForwarderAsyncFunctionPointer:
966
980
case Kind::AsyncFunctionPointerAST:
967
981
case Kind::KnownAsyncFunctionPointer:
@@ -1071,6 +1085,7 @@ bool LinkEntity::isWeakImported(ModuleDecl *module) const {
1071
1085
}
1072
1086
1073
1087
case Kind::AsyncFunctionPointerAST:
1088
+ case Kind::DistributedThunkAsyncFunctionPointer:
1074
1089
case Kind::DispatchThunk:
1075
1090
case Kind::DispatchThunkDerivative:
1076
1091
case Kind::DispatchThunkInitializer:
@@ -1165,6 +1180,7 @@ bool LinkEntity::isWeakImported(ModuleDecl *module) const {
1165
1180
DeclContext *LinkEntity::getDeclContextForEmission () const {
1166
1181
switch (getKind ()) {
1167
1182
case Kind::AsyncFunctionPointerAST:
1183
+ case Kind::DistributedThunkAsyncFunctionPointer:
1168
1184
case Kind::DispatchThunk:
1169
1185
case Kind::DispatchThunkDerivative:
1170
1186
case Kind::DispatchThunkInitializer:
0 commit comments