SIL: Correctly handle @_alwaysEmitIntoClient properties and subscripts

Fixes <rdar://problem/50058883>.
This commit is contained in:
Slava Pestov
2019-04-29 16:39:18 -04:00
parent fa5d66c4a4
commit b275a88976
2 changed files with 24 additions and 1 deletions

View File

@@ -301,6 +301,11 @@ SILLinkage SILDeclRef::getLinkage(ForDefinition_t forDefinition) const {
// serialized bodies, but no public symbol in the generated binary.
if (d->getAttrs().hasAttribute<AlwaysEmitIntoClientAttr>())
limit = Limit::AlwaysEmitIntoClient;
if (auto accessor = dyn_cast<AccessorDecl>(d)) {
auto *storage = accessor->getStorage();
if (storage->getAttrs().hasAttribute<AlwaysEmitIntoClientAttr>())
limit = Limit::AlwaysEmitIntoClient;
}
// ivar initializers and destroyers are completely contained within the class
// from which they come, and never get seen externally.