File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -625,7 +625,11 @@ SILLinkage SILDeclRef::getDefinitionLinkage() const {
625625 case Limit::None:
626626 return SILLinkage::Package;
627627 case Limit::AlwaysEmitIntoClient:
628- return SILLinkage::PackageNonABI;
628+ // Drop the AEIC if the enclosing decl is not effectively public.
629+ // This matches what we do in the `internal` case.
630+ if (isSerialized ())
631+ return SILLinkage::PackageNonABI;
632+ else return SILLinkage::Package;
629633 case Limit::OnDemand:
630634 return SILLinkage::Shared;
631635 case Limit::NeverPublic:
Original file line number Diff line number Diff line change @@ -58,3 +58,21 @@ public final class C {
5858 @_alwaysEmitIntoClient
5959 deinit { }
6060}
61+
62+
63+ // We drop AEIC if the containing context does not have effective public
64+ // visibility.
65+ internal struct InternalContext {
66+ // CHECK-LABEL: sil hidden [ossa] @$s33always_emit_into_client_attribute15InternalContextV1vSivgZ
67+ @_alwaysEmitIntoClient
68+ internal static var v : Int { 1 }
69+ }
70+
71+ // We drop AEIC if the containing context does not have effective public
72+ // visibility.
73+ package struct PackageContext {
74+ // CHECK-LABEL: sil package [ossa] @$s33always_emit_into_client_attribute14PackageContextV1vSivgZ
75+
76+ @_alwaysEmitIntoClient
77+ package static var v : Int { 1 }
78+ }
You can’t perform that action at this time.
0 commit comments