SE-0193: Rename @_inlineable to @inlinable, @_versioned to @usableFromInline

This commit is contained in:
Slava Pestov
2018-03-29 02:55:38 -07:00
parent a00f252ff8
commit e1f50b2d36
240 changed files with 6262 additions and 6258 deletions

View File

@@ -288,15 +288,15 @@ SILLinkage SILDeclRef::getLinkage(ForDefinition_t forDefinition) const {
// Three cases:
//
// 1) Type is formally @_fixed_layout. Root initializers can be declared
// @_inlineable. The property initializer must only reference
// @inlinable. The property initializer must only reference
// public symbols, and is serialized, so we give it PublicNonABI linkage.
//
// 2) Type is not formally @_fixed_layout and the module is not resilient.
// Root initializers can be declared @_inlineable. This is the annoying
// Root initializers can be declared @inlinable. This is the annoying
// case. We give the initializer public linkage if the type is public.
//
// 3) Type is resilient. The property initializer is never public because
// root initializers cannot be @_inlineable.
// root initializers cannot be @inlinable.
//
// FIXME: Get rid of case 2 somehow.
if (isSerialized())
@@ -424,7 +424,7 @@ IsSerialized_t SILDeclRef::isSerialized() const {
dc = getDecl()->getInnermostDeclContext();
// Enum element constructors are serialized if the enum is
// @_versioned or public.
// @usableFromInline or public.
if (isEnumElement())
if (d->getEffectiveAccess() >= AccessLevel::Public)
return IsSerialized;
@@ -441,7 +441,7 @@ IsSerialized_t SILDeclRef::isSerialized() const {
return IsSerializable;
// The allocating entry point for designated initializers are serialized
// if the class is @_versioned or public.
// if the class is @usableFromInline or public.
if (kind == SILDeclRef::Kind::Allocator) {
auto *ctor = cast<ConstructorDecl>(d);
if (ctor->isDesignatedInit() &&
@@ -467,11 +467,11 @@ IsSerialized_t SILDeclRef::isSerialized() const {
}
// Declarations imported from Clang modules are serialized if
// referenced from an inlineable context.
// referenced from an inlinable context.
if (isClangImported())
return IsSerializable;
// Otherwise, ask the AST if we're inside an @_inlineable context.
// Otherwise, ask the AST if we're inside an @inlinable context.
if (dc->getResilienceExpansion() == ResilienceExpansion::Minimal)
return IsSerialized;