@@ -518,7 +518,7 @@ std::string LinkEntity::mangleAsString() const {
518
518
}
519
519
520
520
case Kind::DistributedAccessor: {
521
- std::string Result ( getSILFunction ()-> getName () );
521
+ std::string Result = getSILDeclRef (). mangle ( );
522
522
Result.append (" TF" );
523
523
return Result;
524
524
}
@@ -554,6 +554,7 @@ SILDeclRef::Kind LinkEntity::getSILDeclRefKind() const {
554
554
switch (getKind ()) {
555
555
case Kind::DispatchThunk:
556
556
case Kind::MethodDescriptor:
557
+ case Kind::DistributedAccessor:
557
558
return SILDeclRef::Kind::Func;
558
559
case Kind::DispatchThunkInitializer:
559
560
case Kind::MethodDescriptorInitializer:
@@ -571,7 +572,10 @@ SILDeclRef::Kind LinkEntity::getSILDeclRefKind() const {
571
572
}
572
573
573
574
SILDeclRef LinkEntity::getSILDeclRef () const {
574
- return SILDeclRef (const_cast <ValueDecl *>(getDecl ()), getSILDeclRefKind ());
575
+ auto ref = SILDeclRef (const_cast <ValueDecl *>(getDecl ()), getSILDeclRefKind ());
576
+ if (getKind () == Kind::DistributedAccessor)
577
+ return ref.asDistributed ();
578
+ return ref;
575
579
}
576
580
577
581
SILLinkage LinkEntity::getLinkage (ForDefinition_t forDefinition) const {
@@ -1306,8 +1310,7 @@ bool LinkEntity::isWeakImported(ModuleDecl *module) const {
1306
1310
return false ;
1307
1311
case Kind::DynamicallyReplaceableFunctionKey:
1308
1312
case Kind::DynamicallyReplaceableFunctionVariable:
1309
- case Kind::SILFunction:
1310
- case Kind::DistributedAccessor: {
1313
+ case Kind::SILFunction: {
1311
1314
return getSILFunction ()->isWeakImported (module );
1312
1315
}
1313
1316
@@ -1369,6 +1372,7 @@ bool LinkEntity::isWeakImported(ModuleDecl *module) const {
1369
1372
case Kind::OpaqueTypeDescriptorAccessorImpl:
1370
1373
case Kind::OpaqueTypeDescriptorAccessorKey:
1371
1374
case Kind::OpaqueTypeDescriptorAccessorVar:
1375
+ case Kind::DistributedAccessor:
1372
1376
return getDecl ()->isWeakImported (module );
1373
1377
1374
1378
case Kind::CanonicalSpecializedGenericSwiftMetaclassStub:
@@ -1480,6 +1484,7 @@ DeclContext *LinkEntity::getDeclContextForEmission() const {
1480
1484
case Kind::OpaqueTypeDescriptorAccessorKey:
1481
1485
case Kind::OpaqueTypeDescriptorAccessorVar:
1482
1486
case Kind::CanonicalPrespecializedGenericTypeCachingOnceToken:
1487
+ case Kind::DistributedAccessor:
1483
1488
return getDecl ()->getDeclContext ();
1484
1489
1485
1490
case Kind::CanonicalSpecializedGenericSwiftMetaclassStub:
@@ -1555,7 +1560,6 @@ DeclContext *LinkEntity::getDeclContextForEmission() const {
1555
1560
return getUnderlyingEntityForAsyncFunctionPointer ()
1556
1561
.getDeclContextForEmission ();
1557
1562
1558
- case Kind::DistributedAccessor:
1559
1563
case Kind::AccessibleFunctionRecord: {
1560
1564
return getSILFunction ()->getParentModule ();
1561
1565
}
0 commit comments