@@ -430,11 +430,17 @@ std::string LinkEntity::mangleAsString() const {
430
430
return mangler.mangleSILDifferentiabilityWitnessKey (
431
431
{getSILDifferentiabilityWitness ()->getOriginalFunction ()->getName (),
432
432
getSILDifferentiabilityWitness ()->getConfig ()});
433
- case Kind::AsyncFunctionPointer: {
434
- std::string Result (getSILFunction ()->getName ());
433
+
434
+ case Kind::AsyncFunctionPointer:
435
+ case Kind::DispatchThunkAsyncFunctionPointer:
436
+ case Kind::DispatchThunkInitializerAsyncFunctionPointer:
437
+ case Kind::DispatchThunkAllocatorAsyncFunctionPointer: {
438
+ std::string Result (getUnderlyingEntityForAsyncFunctionPointer ()
439
+ .mangleAsString ());
435
440
Result.append (" Tu" );
436
441
return Result;
437
442
}
443
+
438
444
case Kind::AsyncFunctionPointerAST: {
439
445
std::string Result;
440
446
Result = mangler.mangleEntity (getDecl ());
@@ -570,7 +576,6 @@ SILLinkage LinkEntity::getLinkage(ForDefinition_t forDefinition) const {
570
576
case Kind::CoroutineContinuationPrototype:
571
577
return SILLinkage::PublicExternal;
572
578
573
-
574
579
case Kind::ObjCResilientClassStub: {
575
580
switch (getMetadataAddress ()) {
576
581
case TypeMetadataAddress::FullMetadata:
@@ -674,7 +679,6 @@ SILLinkage LinkEntity::getLinkage(ForDefinition_t forDefinition) const {
674
679
case Kind::DynamicallyReplaceableFunctionKey:
675
680
return getSILFunction ()->getLinkage ();
676
681
677
- case Kind::AsyncFunctionPointer:
678
682
case Kind::SILFunction:
679
683
return getSILFunction ()->getEffectiveSymbolLinkage ();
680
684
@@ -714,6 +718,13 @@ SILLinkage LinkEntity::getLinkage(ForDefinition_t forDefinition) const {
714
718
return SILLinkage::Shared;
715
719
case Kind::DifferentiabilityWitness:
716
720
return getSILDifferentiabilityWitness ()->getLinkage ();
721
+
722
+ case Kind::AsyncFunctionPointer:
723
+ case Kind::DispatchThunkAsyncFunctionPointer:
724
+ case Kind::DispatchThunkInitializerAsyncFunctionPointer:
725
+ case Kind::DispatchThunkAllocatorAsyncFunctionPointer:
726
+ return getUnderlyingEntityForAsyncFunctionPointer ()
727
+ .getLinkage (ForDefinition);
717
728
}
718
729
llvm_unreachable (" bad link entity kind" );
719
730
}
@@ -733,6 +744,9 @@ bool LinkEntity::isContextDescriptor() const {
733
744
case Kind::DispatchThunk:
734
745
case Kind::DispatchThunkInitializer:
735
746
case Kind::DispatchThunkAllocator:
747
+ case Kind::DispatchThunkAsyncFunctionPointer:
748
+ case Kind::DispatchThunkInitializerAsyncFunctionPointer:
749
+ case Kind::DispatchThunkAllocatorAsyncFunctionPointer:
736
750
case Kind::MethodDescriptor:
737
751
case Kind::MethodDescriptorInitializer:
738
752
case Kind::MethodDescriptorAllocator:
@@ -797,8 +811,6 @@ bool LinkEntity::isContextDescriptor() const {
797
811
798
812
llvm::Type *LinkEntity::getDefaultDeclarationType (IRGenModule &IGM) const {
799
813
switch (getKind ()) {
800
- case Kind::AsyncFunctionPointer:
801
- return IGM.AsyncFunctionPointerTy ;
802
814
case Kind::ModuleDescriptor:
803
815
case Kind::ExtensionDescriptor:
804
816
case Kind::AnonymousDescriptor:
@@ -901,6 +913,12 @@ llvm::Type *LinkEntity::getDefaultDeclarationType(IRGenModule &IGM) const {
901
913
return IGM.DifferentiabilityWitnessTy ;
902
914
case Kind::CanonicalPrespecializedGenericTypeCachingOnceToken:
903
915
return IGM.OnceTy ;
916
+ case Kind::AsyncFunctionPointer:
917
+ case Kind::DispatchThunkAsyncFunctionPointer:
918
+ case Kind::DispatchThunkInitializerAsyncFunctionPointer:
919
+ case Kind::DispatchThunkAllocatorAsyncFunctionPointer:
920
+ case Kind::AsyncFunctionPointerAST:
921
+ return IGM.AsyncFunctionPointerTy ;
904
922
default :
905
923
llvm_unreachable (" declaration LLVM type not specified" );
906
924
}
@@ -929,6 +947,9 @@ Alignment LinkEntity::getAlignment(IRGenModule &IGM) const {
929
947
case Kind::OpaqueTypeDescriptor:
930
948
return Alignment (4 );
931
949
case Kind::AsyncFunctionPointer:
950
+ case Kind::DispatchThunkAsyncFunctionPointer:
951
+ case Kind::DispatchThunkInitializerAsyncFunctionPointer:
952
+ case Kind::DispatchThunkAllocatorAsyncFunctionPointer:
932
953
case Kind::ObjCClassRef:
933
954
case Kind::ObjCClass:
934
955
case Kind::TypeMetadataLazyCacheVariable:
@@ -971,7 +992,6 @@ bool LinkEntity::isWeakImported(ModuleDecl *module) const {
971
992
return getSILGlobalVariable ()->getDecl ()->isWeakImported (module );
972
993
}
973
994
return false ;
974
- case Kind::AsyncFunctionPointer:
975
995
case Kind::DynamicallyReplaceableFunctionKey:
976
996
case Kind::DynamicallyReplaceableFunctionVariable:
977
997
case Kind::SILFunction: {
@@ -1068,6 +1088,13 @@ bool LinkEntity::isWeakImported(ModuleDecl *module) const {
1068
1088
case Kind::CoroutineContinuationPrototype:
1069
1089
case Kind::DifferentiabilityWitness:
1070
1090
return false ;
1091
+
1092
+ case Kind::AsyncFunctionPointer:
1093
+ case Kind::DispatchThunkAsyncFunctionPointer:
1094
+ case Kind::DispatchThunkInitializerAsyncFunctionPointer:
1095
+ case Kind::DispatchThunkAllocatorAsyncFunctionPointer:
1096
+ return getUnderlyingEntityForAsyncFunctionPointer ()
1097
+ .isWeakImported (module );
1071
1098
}
1072
1099
1073
1100
llvm_unreachable (" Bad link entity kind" );
@@ -1118,7 +1145,6 @@ DeclContext *LinkEntity::getDeclContextForEmission() const {
1118
1145
case Kind::CanonicalSpecializedGenericSwiftMetaclassStub:
1119
1146
return getType ()->getClassOrBoundGenericClass ()->getDeclContext ();
1120
1147
1121
- case Kind::AsyncFunctionPointer:
1122
1148
case Kind::SILFunction:
1123
1149
case Kind::DynamicallyReplaceableFunctionVariable:
1124
1150
case Kind::DynamicallyReplaceableFunctionKey:
@@ -1174,6 +1200,13 @@ DeclContext *LinkEntity::getDeclContextForEmission() const {
1174
1200
case Kind::ValueWitnessTable:
1175
1201
case Kind::DifferentiabilityWitness:
1176
1202
return nullptr ;
1203
+
1204
+ case Kind::AsyncFunctionPointer:
1205
+ case Kind::DispatchThunkAsyncFunctionPointer:
1206
+ case Kind::DispatchThunkInitializerAsyncFunctionPointer:
1207
+ case Kind::DispatchThunkAllocatorAsyncFunctionPointer:
1208
+ return getUnderlyingEntityForAsyncFunctionPointer ()
1209
+ .getDeclContextForEmission ();
1177
1210
}
1178
1211
llvm_unreachable (" invalid decl kind" );
1179
1212
}
0 commit comments