@@ -577,6 +577,16 @@ std::string LinkEntity::mangleAsString(ASTContext &Ctx) const {
577
577
Result.append (" Twc" );
578
578
return Result;
579
579
}
580
+ case Kind::CoroAllocator: {
581
+ switch (getCoroAllocatorKind ()) {
582
+ case CoroAllocatorKind::Stack:
583
+ llvm::report_fatal_error (" attempting to mangle the coro stack allocator" );
584
+ case CoroAllocatorKind::Async:
585
+ return " _swift_coro_async_allocator" ;
586
+ case CoroAllocatorKind::Malloc:
587
+ return " _swift_coro_malloc_allocator" ;
588
+ }
589
+ }
580
590
}
581
591
llvm_unreachable (" bad entity kind!" );
582
592
}
@@ -948,6 +958,8 @@ SILLinkage LinkEntity::getLinkage(ForDefinition_t forDefinition) const {
948
958
return getUnderlyingEntityForCoroFunctionPointer ().getLinkage (
949
959
forDefinition);
950
960
return getSILLinkage (getDeclLinkage (getDecl ()), forDefinition);
961
+ case Kind::CoroAllocator:
962
+ return SILLinkage::Shared;
951
963
}
952
964
llvm_unreachable (" bad link entity kind" );
953
965
}
@@ -1051,6 +1063,7 @@ bool LinkEntity::isContextDescriptor() const {
1051
1063
case Kind::CoroFunctionPointerAST:
1052
1064
case Kind::DistributedThunkCoroFunctionPointer:
1053
1065
case Kind::KnownCoroFunctionPointer:
1066
+ case Kind::CoroAllocator:
1054
1067
return false ;
1055
1068
}
1056
1069
llvm_unreachable (" invalid descriptor" );
@@ -1188,6 +1201,8 @@ llvm::Type *LinkEntity::getDefaultDeclarationType(IRGenModule &IGM) const {
1188
1201
case Kind::DistributedThunkCoroFunctionPointer:
1189
1202
case Kind::KnownCoroFunctionPointer:
1190
1203
return IGM.CoroFunctionPointerPtrTy ;
1204
+ case Kind::CoroAllocator:
1205
+ return IGM.CoroAllocatorTy ;
1191
1206
default :
1192
1207
llvm_unreachable (" declaration LLVM type not specified" );
1193
1208
}
@@ -1220,6 +1235,7 @@ Alignment LinkEntity::getAlignment(IRGenModule &IGM) const {
1220
1235
case Kind::OpaqueTypeDescriptorRecord:
1221
1236
case Kind::AccessibleFunctionRecord:
1222
1237
case Kind::ExtendedExistentialTypeShape:
1238
+ case Kind::CoroAllocator:
1223
1239
return Alignment (4 );
1224
1240
case Kind::AsyncFunctionPointer:
1225
1241
case Kind::DispatchThunkAsyncFunctionPointer:
@@ -1359,6 +1375,7 @@ bool LinkEntity::isText() const {
1359
1375
case Kind::DynamicallyReplaceableFunctionVariable:
1360
1376
case Kind::CanonicalSpecializedGenericTypeMetadataAccessFunction:
1361
1377
case Kind::ExtendedExistentialTypeShape:
1378
+ case Kind::CoroAllocator:
1362
1379
return true ;
1363
1380
case Kind::ObjCClass:
1364
1381
case Kind::ObjCClassRef:
@@ -1520,6 +1537,7 @@ bool LinkEntity::isWeakImported(ModuleDecl *module) const {
1520
1537
case Kind::DifferentiabilityWitness:
1521
1538
case Kind::AccessibleFunctionRecord:
1522
1539
case Kind::ExtendedExistentialTypeShape:
1540
+ case Kind::CoroAllocator:
1523
1541
return false ;
1524
1542
1525
1543
case Kind::AsyncFunctionPointer:
@@ -1656,6 +1674,7 @@ DeclContext *LinkEntity::getDeclContextForEmission() const {
1656
1674
case Kind::TypeMetadataDemanglingCacheVariable:
1657
1675
case Kind::NoncanonicalSpecializedGenericTypeMetadata:
1658
1676
case Kind::NoncanonicalSpecializedGenericTypeMetadataCacheVariable:
1677
+ case Kind::CoroAllocator:
1659
1678
assert (isAlwaysSharedLinkage () && " kind should always be shared linkage" );
1660
1679
return nullptr ;
1661
1680
@@ -1708,6 +1727,7 @@ bool LinkEntity::isAlwaysSharedLinkage() const {
1708
1727
case Kind::TypeMetadataDemanglingCacheVariable:
1709
1728
case Kind::NoncanonicalSpecializedGenericTypeMetadata:
1710
1729
case Kind::NoncanonicalSpecializedGenericTypeMetadataCacheVariable:
1730
+ case Kind::CoroAllocator:
1711
1731
return true ;
1712
1732
1713
1733
default :
0 commit comments