@@ -430,6 +430,17 @@ std::string LinkEntity::mangleAsString() const {
430430 return mangler.mangleSILDifferentiabilityWitnessKey (
431431 {getSILDifferentiabilityWitness ()->getOriginalFunction ()->getName (),
432432 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+ }
433444 }
434445 llvm_unreachable (" bad entity kind!" );
435446}
@@ -663,9 +674,13 @@ SILLinkage LinkEntity::getLinkage(ForDefinition_t forDefinition) const {
663674 case Kind::DynamicallyReplaceableFunctionKey:
664675 return getSILFunction ()->getLinkage ();
665676
677+ case Kind::AsyncFunctionPointer:
666678 case Kind::SILFunction:
667679 return getSILFunction ()->getEffectiveSymbolLinkage ();
668680
681+ case Kind::AsyncFunctionPointerAST:
682+ return getSILLinkage (getDeclLinkage (getDecl ()), forDefinition);
683+
669684 case Kind::DynamicallyReplaceableFunctionImpl:
670685 case Kind::DynamicallyReplaceableFunctionKeyAST:
671686 return getSILLinkage (getDeclLinkage (getDecl ()), forDefinition);
@@ -712,6 +727,8 @@ bool LinkEntity::isContextDescriptor() const {
712727 case Kind::ProtocolDescriptor:
713728 case Kind::OpaqueTypeDescriptor:
714729 return true ;
730+ case Kind::AsyncFunctionPointer:
731+ case Kind::AsyncFunctionPointerAST:
715732 case Kind::PropertyDescriptor:
716733 case Kind::DispatchThunk:
717734 case Kind::DispatchThunkInitializer:
@@ -780,6 +797,8 @@ bool LinkEntity::isContextDescriptor() const {
780797
781798llvm::Type *LinkEntity::getDefaultDeclarationType (IRGenModule &IGM) const {
782799 switch (getKind ()) {
800+ case Kind::AsyncFunctionPointer:
801+ return IGM.AsyncFunctionPointerTy ;
783802 case Kind::ModuleDescriptor:
784803 case Kind::ExtensionDescriptor:
785804 case Kind::AnonymousDescriptor:
@@ -909,6 +928,7 @@ Alignment LinkEntity::getAlignment(IRGenModule &IGM) const {
909928 case Kind::MethodDescriptorAllocator:
910929 case Kind::OpaqueTypeDescriptor:
911930 return Alignment (4 );
931+ case Kind::AsyncFunctionPointer:
912932 case Kind::ObjCClassRef:
913933 case Kind::ObjCClass:
914934 case Kind::TypeMetadataLazyCacheVariable:
@@ -951,6 +971,7 @@ bool LinkEntity::isWeakImported(ModuleDecl *module) const {
951971 return getSILGlobalVariable ()->getDecl ()->isWeakImported (module );
952972 }
953973 return false ;
974+ case Kind::AsyncFunctionPointer:
954975 case Kind::DynamicallyReplaceableFunctionKey:
955976 case Kind::DynamicallyReplaceableFunctionVariable:
956977 case Kind::SILFunction: {
@@ -977,6 +998,7 @@ bool LinkEntity::isWeakImported(ModuleDecl *module) const {
977998 return false ;
978999 }
9791000
1001+ case Kind::AsyncFunctionPointerAST:
9801002 case Kind::DispatchThunk:
9811003 case Kind::DispatchThunkInitializer:
9821004 case Kind::DispatchThunkAllocator:
@@ -1053,6 +1075,7 @@ bool LinkEntity::isWeakImported(ModuleDecl *module) const {
10531075
10541076DeclContext *LinkEntity::getDeclContextForEmission () const {
10551077 switch (getKind ()) {
1078+ case Kind::AsyncFunctionPointerAST:
10561079 case Kind::DispatchThunk:
10571080 case Kind::DispatchThunkInitializer:
10581081 case Kind::DispatchThunkAllocator:
@@ -1095,6 +1118,7 @@ DeclContext *LinkEntity::getDeclContextForEmission() const {
10951118 case Kind::CanonicalSpecializedGenericSwiftMetaclassStub:
10961119 return getType ()->getClassOrBoundGenericClass ()->getDeclContext ();
10971120
1121+ case Kind::AsyncFunctionPointer:
10981122 case Kind::SILFunction:
10991123 case Kind::DynamicallyReplaceableFunctionVariable:
11001124 case Kind::DynamicallyReplaceableFunctionKey:
0 commit comments