@@ -518,7 +518,7 @@ std::string LinkEntity::mangleAsString() const {
518518 }
519519
520520 case Kind::DistributedAccessor: {
521- std::string Result ( getSILFunction ()-> getName () );
521+ std::string Result = getSILDeclRef (). mangle ( );
522522 Result.append (" TF" );
523523 return Result;
524524 }
@@ -554,6 +554,7 @@ SILDeclRef::Kind LinkEntity::getSILDeclRefKind() const {
554554 switch (getKind ()) {
555555 case Kind::DispatchThunk:
556556 case Kind::MethodDescriptor:
557+ case Kind::DistributedAccessor:
557558 return SILDeclRef::Kind::Func;
558559 case Kind::DispatchThunkInitializer:
559560 case Kind::MethodDescriptorInitializer:
@@ -571,7 +572,10 @@ SILDeclRef::Kind LinkEntity::getSILDeclRefKind() const {
571572}
572573
573574SILDeclRef 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;
575579}
576580
577581SILLinkage LinkEntity::getLinkage (ForDefinition_t forDefinition) const {
@@ -1306,8 +1310,7 @@ bool LinkEntity::isWeakImported(ModuleDecl *module) const {
13061310 return false ;
13071311 case Kind::DynamicallyReplaceableFunctionKey:
13081312 case Kind::DynamicallyReplaceableFunctionVariable:
1309- case Kind::SILFunction:
1310- case Kind::DistributedAccessor: {
1313+ case Kind::SILFunction: {
13111314 return getSILFunction ()->isWeakImported (module );
13121315 }
13131316
@@ -1369,6 +1372,7 @@ bool LinkEntity::isWeakImported(ModuleDecl *module) const {
13691372 case Kind::OpaqueTypeDescriptorAccessorImpl:
13701373 case Kind::OpaqueTypeDescriptorAccessorKey:
13711374 case Kind::OpaqueTypeDescriptorAccessorVar:
1375+ case Kind::DistributedAccessor:
13721376 return getDecl ()->isWeakImported (module );
13731377
13741378 case Kind::CanonicalSpecializedGenericSwiftMetaclassStub:
@@ -1480,6 +1484,7 @@ DeclContext *LinkEntity::getDeclContextForEmission() const {
14801484 case Kind::OpaqueTypeDescriptorAccessorKey:
14811485 case Kind::OpaqueTypeDescriptorAccessorVar:
14821486 case Kind::CanonicalPrespecializedGenericTypeCachingOnceToken:
1487+ case Kind::DistributedAccessor:
14831488 return getDecl ()->getDeclContext ();
14841489
14851490 case Kind::CanonicalSpecializedGenericSwiftMetaclassStub:
@@ -1555,7 +1560,6 @@ DeclContext *LinkEntity::getDeclContextForEmission() const {
15551560 return getUnderlyingEntityForAsyncFunctionPointer ()
15561561 .getDeclContextForEmission ();
15571562
1558- case Kind::DistributedAccessor:
15591563 case Kind::AccessibleFunctionRecord: {
15601564 return getSILFunction ()->getParentModule ();
15611565 }
0 commit comments