@@ -430,6 +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 ());
435
+ Result.append (" AD" );
436
+ return Result;
437
+ }
438
+ case Kind::AsyncFunctionPointerAST: {
439
+ std::string Result;
440
+ Result = mangler.mangleEntity (getDecl ());
441
+ Result.append (" AD" );
442
+ return Result;
443
+ }
433
444
}
434
445
llvm_unreachable (" bad entity kind!" );
435
446
}
@@ -663,9 +674,13 @@ SILLinkage LinkEntity::getLinkage(ForDefinition_t forDefinition) const {
663
674
case Kind::DynamicallyReplaceableFunctionKey:
664
675
return getSILFunction ()->getLinkage ();
665
676
677
+ case Kind::AsyncFunctionPointer:
666
678
case Kind::SILFunction:
667
679
return getSILFunction ()->getEffectiveSymbolLinkage ();
668
680
681
+ case Kind::AsyncFunctionPointerAST:
682
+ return getSILLinkage (getDeclLinkage (getDecl ()), forDefinition);
683
+
669
684
case Kind::DynamicallyReplaceableFunctionImpl:
670
685
case Kind::DynamicallyReplaceableFunctionKeyAST:
671
686
return getSILLinkage (getDeclLinkage (getDecl ()), forDefinition);
@@ -712,6 +727,8 @@ bool LinkEntity::isContextDescriptor() const {
712
727
case Kind::ProtocolDescriptor:
713
728
case Kind::OpaqueTypeDescriptor:
714
729
return true ;
730
+ case Kind::AsyncFunctionPointer:
731
+ case Kind::AsyncFunctionPointerAST:
715
732
case Kind::PropertyDescriptor:
716
733
case Kind::DispatchThunk:
717
734
case Kind::DispatchThunkInitializer:
@@ -780,6 +797,8 @@ bool LinkEntity::isContextDescriptor() const {
780
797
781
798
llvm::Type *LinkEntity::getDefaultDeclarationType (IRGenModule &IGM) const {
782
799
switch (getKind ()) {
800
+ case Kind::AsyncFunctionPointer:
801
+ return IGM.AsyncFunctionPointerTy ;
783
802
case Kind::ModuleDescriptor:
784
803
case Kind::ExtensionDescriptor:
785
804
case Kind::AnonymousDescriptor:
@@ -909,6 +928,7 @@ Alignment LinkEntity::getAlignment(IRGenModule &IGM) const {
909
928
case Kind::MethodDescriptorAllocator:
910
929
case Kind::OpaqueTypeDescriptor:
911
930
return Alignment (4 );
931
+ case Kind::AsyncFunctionPointer:
912
932
case Kind::ObjCClassRef:
913
933
case Kind::ObjCClass:
914
934
case Kind::TypeMetadataLazyCacheVariable:
@@ -951,6 +971,7 @@ bool LinkEntity::isWeakImported(ModuleDecl *module) const {
951
971
return getSILGlobalVariable ()->getDecl ()->isWeakImported (module );
952
972
}
953
973
return false ;
974
+ case Kind::AsyncFunctionPointer:
954
975
case Kind::DynamicallyReplaceableFunctionKey:
955
976
case Kind::DynamicallyReplaceableFunctionVariable:
956
977
case Kind::SILFunction: {
@@ -977,6 +998,7 @@ bool LinkEntity::isWeakImported(ModuleDecl *module) const {
977
998
return false ;
978
999
}
979
1000
1001
+ case Kind::AsyncFunctionPointerAST:
980
1002
case Kind::DispatchThunk:
981
1003
case Kind::DispatchThunkInitializer:
982
1004
case Kind::DispatchThunkAllocator:
@@ -1053,6 +1075,7 @@ bool LinkEntity::isWeakImported(ModuleDecl *module) const {
1053
1075
1054
1076
DeclContext *LinkEntity::getDeclContextForEmission () const {
1055
1077
switch (getKind ()) {
1078
+ case Kind::AsyncFunctionPointerAST:
1056
1079
case Kind::DispatchThunk:
1057
1080
case Kind::DispatchThunkInitializer:
1058
1081
case Kind::DispatchThunkAllocator:
@@ -1095,6 +1118,7 @@ DeclContext *LinkEntity::getDeclContextForEmission() const {
1095
1118
case Kind::CanonicalSpecializedGenericSwiftMetaclassStub:
1096
1119
return getType ()->getClassOrBoundGenericClass ()->getDeclContext ();
1097
1120
1121
+ case Kind::AsyncFunctionPointer:
1098
1122
case Kind::SILFunction:
1099
1123
case Kind::DynamicallyReplaceableFunctionVariable:
1100
1124
case Kind::DynamicallyReplaceableFunctionKey:
0 commit comments