Skip to content

Commit 9cf1ca1

Browse files
committed
[IRGen] Weak link static keypath component property descriptors.
1 parent 9972814 commit 9cf1ca1

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
@@ -1355,7 +1355,6 @@ bool LinkEntity::isWeakImported(ModuleDecl *module) const {
13551355
case Kind::ObjCMetaclass:
13561356
case Kind::SwiftMetaclassStub:
13571357
case Kind::ClassMetadataBaseOffset:
1358-
case Kind::PropertyDescriptor:
13591358
case Kind::NominalTypeDescriptor:
13601359
case Kind::NominalTypeDescriptorRecord:
13611360
case Kind::ModuleDescriptor:
@@ -1374,6 +1373,11 @@ bool LinkEntity::isWeakImported(ModuleDecl *module) const {
13741373
case Kind::OpaqueTypeDescriptorAccessorVar:
13751374
case Kind::DistributedAccessor:
13761375
return getDecl()->isWeakImported(module);
1376+
1377+
case Kind::PropertyDescriptor:
1378+
// Static properties may have nil property descriptors if declared in
1379+
// modules compiled with older compilers and should be weak linked.
1380+
return (getDecl()->isWeakImported(module) || getDecl()->isStatic());
13771381

13781382
case Kind::CanonicalSpecializedGenericSwiftMetaclassStub:
13791383
return getType()->getClassOrBoundGenericClass()->isWeakImported(module);

0 commit comments

Comments
 (0)