Skip to content

Commit 2d70cd7

Browse files
committed
[IRGen] Weak link static keypath component property descriptors.
1 parent ef96728 commit 2d70cd7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/IRGen/Linking.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1371,7 +1371,6 @@ bool LinkEntity::isWeakImported(ModuleDecl *module) const {
13711371
case Kind::ObjCMetaclass:
13721372
case Kind::SwiftMetaclassStub:
13731373
case Kind::ClassMetadataBaseOffset:
1374-
case Kind::PropertyDescriptor:
13751374
case Kind::NominalTypeDescriptor:
13761375
case Kind::NominalTypeDescriptorRecord:
13771376
case Kind::ModuleDescriptor:
@@ -1390,6 +1389,11 @@ bool LinkEntity::isWeakImported(ModuleDecl *module) const {
13901389
case Kind::OpaqueTypeDescriptorAccessorVar:
13911390
case Kind::DistributedAccessor:
13921391
return getDecl()->isWeakImported(module);
1392+
1393+
case Kind::PropertyDescriptor:
1394+
// Static properties may have nil property descriptors if declared in
1395+
// modules compiled with older compilers and should be weak linked.
1396+
return (getDecl()->isWeakImported(module) || getDecl()->isStatic());
13931397

13941398
case Kind::CanonicalSpecializedGenericSwiftMetaclassStub:
13951399
return getType()->getClassOrBoundGenericClass()->isWeakImported(module);

0 commit comments

Comments
 (0)