From fb0233aae54dc18b9c0c725a2767eac032dffa02 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Thu, 5 Apr 2018 20:27:22 -0700 Subject: [PATCH 1/6] Sema: Clean up createDesignatedInitOverride() --- lib/Sema/CodeSynthesis.cpp | 120 ++++++++++++++++++++----------------- 1 file changed, 65 insertions(+), 55 deletions(-) diff --git a/lib/Sema/CodeSynthesis.cpp b/lib/Sema/CodeSynthesis.cpp index 5561ab40037fc..24c7b195de42b 100644 --- a/lib/Sema/CodeSynthesis.cpp +++ b/lib/Sema/CodeSynthesis.cpp @@ -1997,6 +1997,68 @@ static void createStubBody(TypeChecker &tc, ConstructorDecl *ctor) { ctor->setStubImplementation(true); } +static void configureDesignatedInitAttributes(TypeChecker &tc, + ClassDecl *classDecl, + ConstructorDecl *ctor, + ConstructorDecl *superclassCtor) { + auto &ctx = tc.Context; + + AccessLevel access = classDecl->getFormalAccess(); + access = std::max(access, AccessLevel::Internal); + access = std::min(access, superclassCtor->getFormalAccess()); + + ctor->setAccess(access); + + // Inherit the @inlinable attribute. + if (superclassCtor->getFormalAccess(/*useDC=*/nullptr, + /*treatUsableFromInlineAsPublic=*/true) + >= AccessLevel::Public) { + if (superclassCtor->getAttrs().hasAttribute()) { + auto *clonedAttr = new (ctx) InlinableAttr(/*implicit=*/true); + ctor->getAttrs().add(clonedAttr); + } + } + + // Inherit the @usableFromInline attribute. We need better abstractions + // for dealing with @usableFromInline. + if (superclassCtor->getFormalAccess(/*useDC=*/nullptr, + /*treatUsableFromInlineAsPublic=*/true) + >= AccessLevel::Public) { + if (access == AccessLevel::Internal && + !superclassCtor->isDynamic()) { + auto *clonedAttr = new (ctx) UsableFromInlineAttr(/*implicit=*/true); + ctor->getAttrs().add(clonedAttr); + } + } + + // Make sure the constructor is only as available as its superclass's + // constructor. + AvailabilityInference::applyInferredAvailableAttrs(ctor, superclassCtor, ctx); + + if (superclassCtor->isObjC()) { + // Inherit the @objc name from the superclass initializer, if it + // has one. + if (auto objcAttr = superclassCtor->getAttrs().getAttribute()) { + if (objcAttr->hasName()) { + auto *clonedAttr = objcAttr->clone(ctx); + clonedAttr->setImplicit(true); + ctor->getAttrs().add(clonedAttr); + } + } + + auto errorConvention = superclassCtor->getForeignErrorConvention(); + markAsObjC(tc, ctor, ObjCReason::ImplicitlyObjC, errorConvention); + } + if (superclassCtor->isRequired()) + ctor->getAttrs().add(new (ctx) RequiredAttr(/*IsImplicit=*/true)); + if (superclassCtor->isDynamic()) + ctor->getAttrs().add(new (ctx) DynamicAttr(/*IsImplicit*/true)); + + // Wire up the overrides. + ctor->getAttrs().add(new (ctx) OverrideAttr(/*IsImplicit=*/true)); + ctor->setOverriddenDecl(superclassCtor); +} + ConstructorDecl * swift::createDesignatedInitOverride(TypeChecker &tc, ClassDecl *classDecl, @@ -2082,66 +2144,14 @@ swift::createDesignatedInitOverride(TypeChecker &tc, ctor->setImplicit(); - AccessLevel access = classDecl->getFormalAccess(); - access = std::max(access, AccessLevel::Internal); - access = std::min(access, superclassCtor->getFormalAccess()); - - ctor->setAccess(access); - - // This is really painful. We need better abstractions for dealing with - // @usableFromInline. - if (superclassCtor->getFormalAccess(/*useDC=*/nullptr, - /*treatUsableFromInlineAsPublic=*/true) - >= AccessLevel::Public) { - if (access == AccessLevel::Internal && - !superclassCtor->isDynamic()) { - auto *clonedAttr = new (ctx) UsableFromInlineAttr(/*implicit=*/true); - ctor->getAttrs().add(clonedAttr); - } - } - - // Inherit the @inlinable attribute. - if (ctor->getFormalAccess(/*useDC=*/nullptr, - /*treatUsableFromInlineAsPublic=*/true) - >= AccessLevel::Public) { - if (superclassCtor->getAttrs().hasAttribute()) { - auto *clonedAttr = new (ctx) InlinableAttr(/*implicit=*/true); - ctor->getAttrs().add(clonedAttr); - } - } - - // Make sure the constructor is only as available as its superclass's - // constructor. - AvailabilityInference::applyInferredAvailableAttrs(ctor, superclassCtor, ctx); - // Set the interface type of the initializer. ctor->setGenericEnvironment(classDecl->getGenericEnvironmentOfContext()); tc.configureInterfaceType(ctor, ctor->getGenericSignature()); - - if (superclassCtor->isObjC()) { - // Inherit the @objc name from the superclass initializer, if it - // has one. - if (auto objcAttr = superclassCtor->getAttrs().getAttribute()) { - if (objcAttr->hasName()) { - auto *clonedAttr = objcAttr->clone(ctx); - clonedAttr->setImplicit(true); - ctor->getAttrs().add(clonedAttr); - } - } - - auto errorConvention = superclassCtor->getForeignErrorConvention(); - markAsObjC(tc, ctor, ObjCReason::ImplicitlyObjC, errorConvention); - } - if (superclassCtor->isRequired()) - ctor->getAttrs().add(new (tc.Context) RequiredAttr(/*IsImplicit=*/true)); - if (superclassCtor->isDynamic()) - ctor->getAttrs().add(new (tc.Context) DynamicAttr(/*IsImplicit*/true)); - - // Wire up the overrides. - ctor->getAttrs().add(new (tc.Context) OverrideAttr(/*IsImplicit=*/true)); - ctor->setOverriddenDecl(superclassCtor); ctor->setValidationStarted(); + configureDesignatedInitAttributes(tc, classDecl, + ctor, superclassCtor); + if (kind == DesignatedInitKind::Stub) { // Make this a stub implementation. createStubBody(tc, ctor); From 618cbca27dbba9fd374cea065c41b44786cac16f Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Thu, 5 Apr 2018 20:43:26 -0700 Subject: [PATCH 2/6] Sema: Rename some 'versioned' diagnostics --- include/swift/AST/DiagnosticsSema.def | 6 +++--- lib/Sema/TypeCheckAttr.cpp | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/swift/AST/DiagnosticsSema.def b/include/swift/AST/DiagnosticsSema.def index 29a8673b771ae..78ca1abc5696b 100644 --- a/include/swift/AST/DiagnosticsSema.def +++ b/include/swift/AST/DiagnosticsSema.def @@ -3736,15 +3736,15 @@ ERROR(fixed_layout_attr_on_internal_type, "%select{private|fileprivate|internal|%error|%error}1", (DeclName, AccessLevel)) -ERROR(versioned_attr_with_explicit_access, +ERROR(usable_from_inline_attr_with_explicit_access, none, "'@usableFromInline' attribute can only be applied to internal " "declarations, but %0 is %select{private|fileprivate|%error|public|open}1", (DeclName, AccessLevel)) -ERROR(versioned_attr_in_protocol,none, +ERROR(usable_from_inline_attr_in_protocol,none, "'@usableFromInline' attribute cannot be used in protocols", ()) -ERROR(versioned_dynamic_not_supported,none, +ERROR(usable_from_inline_dynamic_not_supported,none, "'@usableFromInline' attribute cannot be applied to 'dynamic' declarations", ()) #define FRAGILE_FUNC_KIND \ diff --git a/lib/Sema/TypeCheckAttr.cpp b/lib/Sema/TypeCheckAttr.cpp index 77ada361db4ba..c839a881bc9b4 100644 --- a/lib/Sema/TypeCheckAttr.cpp +++ b/lib/Sema/TypeCheckAttr.cpp @@ -1959,13 +1959,14 @@ void AttributeChecker::visitUsableFromInlineAttr(UsableFromInlineAttr *attr) { // FIXME: Once protocols can contain nominal types, do we want to allow // these nominal types to have access control (and also @usableFromInline)? if (isa(VD->getDeclContext())) { - diagnoseAndRemoveAttr(attr, diag::versioned_attr_in_protocol); + diagnoseAndRemoveAttr(attr, diag::usable_from_inline_attr_in_protocol); return; } // @usableFromInline can only be applied to internal declarations. if (VD->getFormalAccess() != AccessLevel::Internal) { - diagnoseAndRemoveAttr(attr, diag::versioned_attr_with_explicit_access, + diagnoseAndRemoveAttr(attr, + diag::usable_from_inline_attr_with_explicit_access, VD->getFullName(), VD->getFormalAccess()); return; @@ -1974,7 +1975,7 @@ void AttributeChecker::visitUsableFromInlineAttr(UsableFromInlineAttr *attr) { // Symbols of dynamically-dispatched declarations are never referenced // directly, so marking them as @usableFromInline does not make sense. if (VD->isDynamic()) { - diagnoseAndRemoveAttr(attr, diag::versioned_dynamic_not_supported); + diagnoseAndRemoveAttr(attr, diag::usable_from_inline_dynamic_not_supported); return; } } From b4e145dc3484e53c6898a6b58552f26ad9984dac Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Thu, 5 Apr 2018 20:53:59 -0700 Subject: [PATCH 3/6] SE-0193: @inlinable implies @usableFromInline --- include/swift/AST/DiagnosticsSema.def | 3 +++ lib/AST/Decl.cpp | 14 ++++++++++---- lib/Sema/CodeSynthesis.cpp | 3 ++- lib/Sema/TypeCheckAttr.cpp | 14 +++++++++----- test/attr/attr_inlinable.swift | 13 ++++++------- 5 files changed, 30 insertions(+), 17 deletions(-) diff --git a/include/swift/AST/DiagnosticsSema.def b/include/swift/AST/DiagnosticsSema.def index 78ca1abc5696b..0f1e9842e01d0 100644 --- a/include/swift/AST/DiagnosticsSema.def +++ b/include/swift/AST/DiagnosticsSema.def @@ -3741,6 +3741,9 @@ ERROR(usable_from_inline_attr_with_explicit_access, "declarations, but %0 is %select{private|fileprivate|%error|public|open}1", (DeclName, AccessLevel)) +WARNING(inlinable_implies_usable_from_inline,none, + "'@inlinable' declaration is already '@usableFromInline'",()) + ERROR(usable_from_inline_attr_in_protocol,none, "'@usableFromInline' attribute cannot be used in protocols", ()) diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index 978b8ff52889a..ed4d3556cf512 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -2106,12 +2106,16 @@ SourceLoc ValueDecl::getAttributeInsertionLoc(bool forModifier) const { bool ValueDecl::isUsableFromInline() const { assert(getFormalAccess() == AccessLevel::Internal); - if (getAttrs().hasAttribute()) + if (getAttrs().hasAttribute() || + getAttrs().hasAttribute()) return true; - if (auto *accessor = dyn_cast(this)) - if (accessor->getStorage()->getAttrs().hasAttribute()) + if (auto *accessor = dyn_cast(this)) { + auto *storage = accessor->getStorage(); + if (storage->getAttrs().hasAttribute() || + storage->getAttrs().hasAttribute()) return true; + } if (auto *EED = dyn_cast(this)) if (EED->getParentEnum()->getAttrs().hasAttribute()) @@ -2261,7 +2265,9 @@ void ValueDecl::copyFormalAccessFrom(ValueDecl *source) { } // Inherit the @usableFromInline attribute. - if (source->getAttrs().hasAttribute()) { + if (source->getAttrs().hasAttribute() && + !getAttrs().hasAttribute() && + !getAttrs().hasAttribute()) { auto &ctx = getASTContext(); auto *clonedAttr = new (ctx) UsableFromInlineAttr(/*implicit=*/true); getAttrs().add(clonedAttr); diff --git a/lib/Sema/CodeSynthesis.cpp b/lib/Sema/CodeSynthesis.cpp index 24c7b195de42b..718b7769c3aac 100644 --- a/lib/Sema/CodeSynthesis.cpp +++ b/lib/Sema/CodeSynthesis.cpp @@ -2025,7 +2025,8 @@ static void configureDesignatedInitAttributes(TypeChecker &tc, /*treatUsableFromInlineAsPublic=*/true) >= AccessLevel::Public) { if (access == AccessLevel::Internal && - !superclassCtor->isDynamic()) { + !superclassCtor->isDynamic() && + !ctor->getAttrs().hasAttribute()) { auto *clonedAttr = new (ctx) UsableFromInlineAttr(/*implicit=*/true); ctor->getAttrs().add(clonedAttr); } diff --git a/lib/Sema/TypeCheckAttr.cpp b/lib/Sema/TypeCheckAttr.cpp index c839a881bc9b4..2c6ae5c4c3f7e 100644 --- a/lib/Sema/TypeCheckAttr.cpp +++ b/lib/Sema/TypeCheckAttr.cpp @@ -1978,6 +1978,12 @@ void AttributeChecker::visitUsableFromInlineAttr(UsableFromInlineAttr *attr) { diagnoseAndRemoveAttr(attr, diag::usable_from_inline_dynamic_not_supported); return; } + + // On internal declarations, @inlinable implies @usableFromInline. + if (VD->getAttrs().hasAttribute()) { + diagnoseAndRemoveAttr(attr, diag::inlinable_implies_usable_from_inline); + return; + } } void AttributeChecker::visitInlinableAttr(InlinableAttr *attr) { @@ -2004,11 +2010,9 @@ void AttributeChecker::visitInlinableAttr(InlinableAttr *attr) { return; } - // @inlinable can only be applied to public or @usableFromInline - // declarations. - auto access = VD->getFormalAccess(/*useDC=*/nullptr, - /*treatUsableFromInlineAsPublic=*/true); - if (access < AccessLevel::Public) { + // @inlinable can only be applied to public or internal declarations. + auto access = VD->getFormalAccess(); + if (access < AccessLevel::Internal) { diagnoseAndRemoveAttr(attr, diag::inlinable_decl_not_public, VD->getBaseName(), access); diff --git a/test/attr/attr_inlinable.swift b/test/attr/attr_inlinable.swift index 3cae5c8a710f5..649a0aab89b13 100644 --- a/test/attr/attr_inlinable.swift +++ b/test/attr/attr_inlinable.swift @@ -5,6 +5,9 @@ @inlinable struct TestInlinableStruct {} // expected-error@-1 {{'@inlinable' attribute cannot be applied to this declaration}} +@inlinable @usableFromInline func redundantAttribute() {} +// expected-warning@-1 {{'@inlinable' declaration is already '@usableFromInline'}} + private func privateFunction() {} // expected-note@-1{{global function 'privateFunction()' is not '@usableFromInline' or public}} fileprivate func fileprivateFunction() {} @@ -101,8 +104,7 @@ public struct Struct { } @inlinable - @usableFromInline - func versionedInlinableMethod() { + func internalInlinableMethod() { struct Nested {} // expected-error@-1 {{type 'Nested' cannot be nested inside an '@inlinable' function}} } @@ -121,8 +123,8 @@ public struct Struct { } @inlinable - func internalInlinableMethod() { - // expected-error@-2 {{'@inlinable' attribute can only be applied to public declarations, but 'internalInlinableMethod' is internal}} + private func privateInlinableMethod() { + // expected-error@-2 {{'@inlinable' attribute can only be applied to public declarations, but 'privateInlinableMethod' is private}} struct Nested {} // OK } @@ -148,7 +150,6 @@ extension VersionedProtocol { // expected-note@-1 {{instance method 'internalMethod()' is not '@usableFromInline' or public}} @inlinable - @usableFromInline func versionedMethod() -> T { internalMethod() // expected-error@-1 {{instance method 'internalMethod()' is internal and cannot be referenced from an '@inlinable' function}} @@ -199,7 +200,6 @@ class Middle : Base {} @usableFromInline @_fixed_layout class Derived : Middle { - @usableFromInline @inlinable init(y: Int) { super.init(x: y) @@ -220,7 +220,6 @@ class Middle2 : Base2 {} @_fixed_layout @usableFromInline class Derived2 : Middle2 { - @usableFromInline @inlinable init(y: Int) { super.init(x: y) From 2e5aef9c8daf50d0f4bfc93ff3214d5c4354ce18 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Thu, 5 Apr 2018 23:22:55 -0700 Subject: [PATCH 4/6] stdlib: Remove redundant @usableFromInline attributes --- stdlib/public/core/Algorithm.swift | 2 - stdlib/public/core/AnyHashable.swift | 11 -- stdlib/public/core/ArrayBody.swift | 6 - stdlib/public/core/ArrayBuffer.swift | 41 ---- stdlib/public/core/ArrayBufferProtocol.swift | 3 - stdlib/public/core/ArrayCast.swift | 2 - stdlib/public/core/Arrays.swift.gyb | 40 +--- stdlib/public/core/AssertCommon.swift | 2 - stdlib/public/core/Bool.swift | 1 - stdlib/public/core/BridgeObjectiveC.swift | 6 - stdlib/public/core/BridgeStorage.swift | 1 - stdlib/public/core/Builtin.swift | 40 +--- stdlib/public/core/CString.swift | 5 - stdlib/public/core/CTypes.swift | 3 - stdlib/public/core/Character.swift | 17 +- .../public/core/CharacterUnicodeScalars.swift | 3 - stdlib/public/core/CocoaArray.swift | 5 - stdlib/public/core/Codable.swift.gyb | 56 ------ stdlib/public/core/Collection.swift | 2 - .../public/core/ContiguousArrayBuffer.swift | 56 ------ stdlib/public/core/DebuggerSupport.swift | 10 - stdlib/public/core/Dictionary.swift | 184 +----------------- stdlib/public/core/DropWhile.swift | 4 - stdlib/public/core/Dump.swift | 2 - .../core/ExistentialCollection.swift.gyb | 89 --------- stdlib/public/core/Filter.swift | 3 - stdlib/public/core/FixedArray.swift.gyb | 16 -- stdlib/public/core/Flatten.swift | 7 - .../core/FloatingPointParsing.swift.gyb | 1 - .../public/core/FloatingPointTypes.swift.gyb | 11 -- stdlib/public/core/Hashing.swift | 7 - stdlib/public/core/HeapBuffer.swift | 6 - stdlib/public/core/ICU.swift | 3 - stdlib/public/core/Indices.swift | 1 - stdlib/public/core/IntegerParsing.swift | 4 - stdlib/public/core/Integers.swift.gyb | 3 - stdlib/public/core/KeyPath.swift | 88 +-------- stdlib/public/core/LazyCollection.swift | 1 - stdlib/public/core/LazySequence.swift | 1 - stdlib/public/core/ManagedBuffer.swift | 20 +- stdlib/public/core/Map.swift | 3 - stdlib/public/core/Mirror.swift | 4 - stdlib/public/core/Misc.swift | 1 - stdlib/public/core/Optional.swift | 1 - stdlib/public/core/OutputStream.swift | 12 -- stdlib/public/core/PrefixWhile.swift | 5 - stdlib/public/core/ReflectionMirror.swift | 11 -- stdlib/public/core/Repeat.swift | 1 - stdlib/public/core/Reverse.swift | 1 - stdlib/public/core/Runtime.swift.gyb | 32 --- stdlib/public/core/SentinelCollection.swift | 14 -- stdlib/public/core/Sequence.swift | 12 -- stdlib/public/core/Set.swift | 169 +--------------- stdlib/public/core/Shims.swift | 1 - stdlib/public/core/SliceBuffer.swift | 29 --- stdlib/public/core/SmallString.swift | 35 +--- stdlib/public/core/Sort.swift.gyb | 6 - stdlib/public/core/StaticString.swift | 2 - stdlib/public/core/Stride.swift.gyb | 4 - stdlib/public/core/String.swift | 14 -- stdlib/public/core/StringBridge.swift | 4 - stdlib/public/core/StringCharacterView.swift | 7 - stdlib/public/core/StringComparable.swift | 6 - stdlib/public/core/StringComparison.swift | 2 - .../public/core/StringGraphemeBreaking.swift | 14 -- stdlib/public/core/StringGuts.swift | 38 +--- stdlib/public/core/StringGutsVisitor.swift | 4 - stdlib/public/core/StringHashable.swift | 1 - stdlib/public/core/StringIndex.swift | 9 - stdlib/public/core/StringLegacy.swift | 3 - stdlib/public/core/StringObject.swift | 57 +----- stdlib/public/core/StringProtocol.swift | 2 - .../StringRangeReplaceableCollection.swift | 5 - stdlib/public/core/StringStorage.swift | 17 -- stdlib/public/core/StringSwitch.swift | 2 - stdlib/public/core/StringUTF16.swift | 9 - stdlib/public/core/StringUTF8.swift | 9 - .../public/core/StringUnicodeScalarView.swift | 12 -- stdlib/public/core/StringVariant.swift | 14 -- stdlib/public/core/Substring.swift.gyb | 7 - stdlib/public/core/SwiftNativeNSArray.swift | 21 -- stdlib/public/core/ThreadLocalStorage.swift | 5 - stdlib/public/core/UIntBuffer.swift | 6 - stdlib/public/core/UTF16.swift | 2 - stdlib/public/core/UTF32.swift | 1 - stdlib/public/core/UTF8.swift | 2 - stdlib/public/core/UnfoldSequence.swift | 1 - stdlib/public/core/Unicode.swift | 3 - stdlib/public/core/UnicodeEncoding.swift | 3 - stdlib/public/core/UnicodeParser.swift | 3 - stdlib/public/core/UnicodeScalar.swift | 6 +- stdlib/public/core/Unmanaged.swift | 1 - .../public/core/UnmanagedOpaqueString.swift | 28 --- stdlib/public/core/UnmanagedString.swift | 23 --- stdlib/public/core/UnsafePointer.swift.gyb | 2 - .../core/UnsafeRawBufferPointer.swift.gyb | 1 - stdlib/public/core/UnsafeRawPointer.swift.gyb | 1 - stdlib/public/core/ValidUTF8Buffer.swift | 4 - stdlib/public/core/VarArgs.swift | 12 -- .../public/core/WriteBackMutableSlice.swift | 1 - stdlib/public/core/Zip.swift | 1 - 101 files changed, 20 insertions(+), 1449 deletions(-) diff --git a/stdlib/public/core/Algorithm.swift b/stdlib/public/core/Algorithm.swift index 9aae722c3c6b2..0e12d06ebad15 100644 --- a/stdlib/public/core/Algorithm.swift +++ b/stdlib/public/core/Algorithm.swift @@ -98,7 +98,6 @@ public struct EnumeratedIterator { /// Construct from a `Base` iterator. @inlinable - @usableFromInline internal init(_base: Base) { self._base = _base self._count = 0 @@ -145,7 +144,6 @@ public struct EnumeratedSequence { /// Construct from a `Base` sequence. @inlinable - @usableFromInline internal init(_base: Base) { self._base = _base } diff --git a/stdlib/public/core/AnyHashable.swift b/stdlib/public/core/AnyHashable.swift index ad02cc881e3bf..fbeb248821875 100644 --- a/stdlib/public/core/AnyHashable.swift +++ b/stdlib/public/core/AnyHashable.swift @@ -61,26 +61,22 @@ internal struct _ConcreteHashableBox : _AnyHashableBox { internal var _baseHashable: Base @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_ base: Base) { self._baseHashable = base } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var _typeID: ObjectIdentifier { return ObjectIdentifier(type(of: self)) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func _unbox() -> T? { return (self as _AnyHashableBox as? _ConcreteHashableBox)?._baseHashable } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func _isEqual(to rhs: _AnyHashableBox) -> Bool? { if let rhs: Base = rhs._unbox() { return _baseHashable == rhs @@ -89,25 +85,21 @@ internal struct _ConcreteHashableBox : _AnyHashableBox { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var _hashValue: Int { return _baseHashable.hashValue } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) func _hash(_into hasher: inout _Hasher) { _baseHashable._hash(into: &hasher) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var _base: Any { return _baseHashable } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func _downCastConditional(into result: UnsafeMutablePointer) -> Bool { guard let value = _baseHashable as? T else { return false } @@ -122,7 +114,6 @@ internal struct _ConcreteHashableBox : _AnyHashableBox { // turns a non-custom representation into a custom one, which is used as // the lowest-common-denominator for comparisons. @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) internal func _getBridgedCustomAnyHashable(_ value: T) -> AnyHashable? { let bridgedValue = _bridgeAnythingToObjectiveC(value) return (bridgedValue as? @@ -191,7 +182,6 @@ public struct AnyHashable { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_usingDefaultRepresentationOf base: H) { self._box = _ConcreteHashableBox(base) self._usedCustomRepresentation = false @@ -217,7 +207,6 @@ public struct AnyHashable { /// This avoids the intermediate re-boxing we would get if we just did /// a downcast on `base`. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func _downCastConditional(into result: UnsafeMutablePointer) -> Bool { // Attempt the downcast. diff --git a/stdlib/public/core/ArrayBody.swift b/stdlib/public/core/ArrayBody.swift index 7f282174f5e48..ee6f7d46542bb 100644 --- a/stdlib/public/core/ArrayBody.swift +++ b/stdlib/public/core/ArrayBody.swift @@ -24,7 +24,6 @@ internal struct _ArrayBody { internal var _storage: _SwiftArrayBodyStorage @inlinable - @usableFromInline internal init( count: Int, capacity: Int, elementTypeIsBridgedVerbatim: Bool = false ) { @@ -43,14 +42,12 @@ internal struct _ArrayBody { /// capacity after a new buffer is allocated, it's typical to want /// to update it immediately after construction. @inlinable - @usableFromInline internal init() { _storage = _SwiftArrayBodyStorage(count: 0, _capacityAndFlags: 0) } /// The number of elements stored in this Array. @inlinable - @usableFromInline internal var count: Int { get { return _assumeNonNegative(_storage.count) @@ -63,7 +60,6 @@ internal struct _ArrayBody { /// The number of elements that can be stored in this Array without /// reallocation. @inlinable - @usableFromInline internal var capacity: Int { return Int(_capacityAndFlags &>> 1) } @@ -75,7 +71,6 @@ internal struct _ArrayBody { /// avoid the cost of calls into the runtime that compute the /// answer. @inlinable - @usableFromInline internal var elementTypeIsBridgedVerbatim: Bool { get { return (_capacityAndFlags & 0x1) != 0 @@ -89,7 +84,6 @@ internal struct _ArrayBody { /// Storage optimization: compresses capacity and /// elementTypeIsBridgedVerbatim together. @inlinable - @usableFromInline internal var _capacityAndFlags: UInt { get { return _storage._capacityAndFlags diff --git a/stdlib/public/core/ArrayBuffer.swift b/stdlib/public/core/ArrayBuffer.swift index f666049f83a74..d1682c9b6cfe3 100644 --- a/stdlib/public/core/ArrayBuffer.swift +++ b/stdlib/public/core/ArrayBuffer.swift @@ -27,13 +27,11 @@ internal struct _ArrayBuffer : _ArrayBufferProtocol { /// Create an empty buffer. @inlinable - @usableFromInline internal init() { _storage = _ArrayBridgeStorage(native: _emptyArrayStorage) } @inlinable - @usableFromInline // FIXME(abi): Used from tests internal init(nsArray: _NSArrayCore) { _sanityCheck(_isClassOrObjCExistential(Element.self)) _storage = _ArrayBridgeStorage(objC: nsArray) @@ -44,7 +42,6 @@ internal struct _ArrayBuffer : _ArrayBufferProtocol { /// - Precondition: The elements actually have dynamic type `U`, and `U` /// is a class or `@objc` existential. @inlinable - @usableFromInline internal func cast(toBufferOf _: U.Type) -> _ArrayBuffer { _sanityCheck(_isClassOrObjCExistential(Element.self)) _sanityCheck(_isClassOrObjCExistential(U.self)) @@ -54,7 +51,6 @@ internal struct _ArrayBuffer : _ArrayBufferProtocol { /// The spare bits that are set when a native array needs deferred /// element type checking. @inlinable - @usableFromInline internal var deferredTypeCheckMask: Int { return 1 } /// Returns an `_ArrayBuffer` containing the same elements, @@ -63,7 +59,6 @@ internal struct _ArrayBuffer : _ArrayBufferProtocol { /// - Precondition: `U` is a class or `@objc` existential derived from /// `Element`. @inlinable - @usableFromInline internal func downcast( toBufferWithDeferredTypeCheckOf _: U.Type ) -> _ArrayBuffer { @@ -80,7 +75,6 @@ internal struct _ArrayBuffer : _ArrayBufferProtocol { } @inlinable - @usableFromInline internal var needsElementTypeCheck: Bool { // NSArray's need an element typecheck when the element type isn't AnyObject return !_isNativeTypeChecked && !(AnyObject.self is Element.Type) @@ -88,7 +82,6 @@ internal struct _ArrayBuffer : _ArrayBufferProtocol { //===--- private --------------------------------------------------------===// @inlinable - @usableFromInline internal init(storage: _ArrayBridgeStorage) { _storage = storage } @@ -100,7 +93,6 @@ internal struct _ArrayBuffer : _ArrayBufferProtocol { extension _ArrayBuffer { /// Adopt the storage of `source`. @inlinable - @usableFromInline internal init(_buffer source: NativeBuffer, shiftedToStartIndex: Int) { _sanityCheck(shiftedToStartIndex == 0, "shiftedToStartIndex must be 0") _storage = _ArrayBridgeStorage(native: source._storage) @@ -108,14 +100,12 @@ extension _ArrayBuffer { /// `true`, if the array is native and does not need a deferred type check. @inlinable - @usableFromInline internal var arrayPropertyIsNativeTypeChecked: Bool { return _isNativeTypeChecked } /// Returns `true` iff this buffer's storage is uniquely-referenced. @inlinable - @usableFromInline internal mutating func isUniquelyReferenced() -> Bool { if !_isClassOrObjCExistential(Element.self) { return _storage.isUniquelyReferenced_native_noSpareBits() @@ -135,7 +125,6 @@ extension _ArrayBuffer { /// Returns `true` iff this buffer's storage is either /// uniquely-referenced or pinned. @inlinable - @usableFromInline internal mutating func isUniquelyReferencedOrPinned() -> Bool { if !_isClassOrObjCExistential(Element.self) { return _storage.isUniquelyReferencedOrPinned_native_noSpareBits() @@ -156,7 +145,6 @@ extension _ArrayBuffer { /// /// O(1) if the element type is bridged verbatim, O(*n*) otherwise. @inlinable - @usableFromInline // FIXME(abi): Used from tests internal func _asCocoaArray() -> _NSArrayCore { return _fastPath(_isNative) ? _native._asCocoaArray() : _nonNative } @@ -166,7 +154,6 @@ extension _ArrayBuffer { /// buffer store minimumCapacity elements, returns that buffer. /// Otherwise, returns `nil`. @inlinable - @usableFromInline internal mutating func requestUniqueMutableBackingBuffer(minimumCapacity: Int) -> NativeBuffer? { if _fastPath(isUniquelyReferenced()) { @@ -179,13 +166,11 @@ extension _ArrayBuffer { } @inlinable - @usableFromInline internal mutating func isMutableAndUniquelyReferenced() -> Bool { return isUniquelyReferenced() } @inlinable - @usableFromInline internal mutating func isMutableAndUniquelyReferencedOrPinned() -> Bool { return isUniquelyReferencedOrPinned() } @@ -194,7 +179,6 @@ extension _ArrayBuffer { /// containing the same number of elements as `self`, return it. /// Otherwise, return `nil`. @inlinable - @usableFromInline internal func requestNativeBuffer() -> NativeBuffer? { if !_isClassOrObjCExistential(Element.self) { return _native @@ -207,7 +191,6 @@ extension _ArrayBuffer { // handle loops atm. and so can get blocked by the presence of a loop (over // the range). This loop is not necessary for a single element access. @inlinable - @usableFromInline @inline(never) internal func _typeCheckSlowPath(_ index: Int) { if _fastPath(_isNative) { @@ -225,7 +208,6 @@ extension _ArrayBuffer { } @inlinable - @usableFromInline internal func _typeCheck(_ subRange: Range) { if !_isClassOrObjCExistential(Element.self) { return @@ -245,7 +227,6 @@ extension _ArrayBuffer { /// memory starting at `target`. Return a pointer "past the end" of the /// just-initialized memory. @inlinable - @usableFromInline @discardableResult internal func _copyContents( subRange bounds: Range, @@ -280,7 +261,6 @@ extension _ArrayBuffer { /// Returns a `_SliceBuffer` containing the given sub-range of elements in /// `bounds` from this buffer. @inlinable - @usableFromInline internal subscript(bounds: Range) -> _SliceBuffer { get { _typeCheck(bounds) @@ -333,21 +313,18 @@ extension _ArrayBuffer { /// /// - Precondition: The elements are known to be stored contiguously. @inlinable - @usableFromInline internal var firstElementAddress: UnsafeMutablePointer { _sanityCheck(_isNative, "must be a native buffer") return _native.firstElementAddress } @inlinable - @usableFromInline internal var firstElementAddressIfContiguous: UnsafeMutablePointer? { return _fastPath(_isNative) ? firstElementAddress : nil } /// The number of elements the buffer stores. @inlinable - @usableFromInline internal var count: Int { @inline(__always) get { @@ -366,7 +343,6 @@ extension _ArrayBuffer { /// Because the optimizer can hoist the original check it might have /// been invalidated by illegal user code. @inlinable - @usableFromInline internal func _checkInoutAndNativeBounds(_ index: Int, wasNative: Bool) { _precondition( _isNative == wasNative, @@ -386,7 +362,6 @@ extension _ArrayBuffer { /// inout violations. Because the optimizer can hoist the original /// check it might have been invalidated by illegal user code. @inlinable - @usableFromInline internal func _checkInoutAndNativeTypeCheckedBounds( _ index: Int, wasNativeTypeChecked: Bool ) { @@ -401,13 +376,11 @@ extension _ArrayBuffer { /// The number of elements the buffer can store without reallocation. @inlinable - @usableFromInline internal var capacity: Int { return _fastPath(_isNative) ? _native.capacity : _nonNative.count } @inlinable - @usableFromInline @inline(__always) internal func getElement(_ i: Int, wasNativeTypeChecked: Bool) -> Element { if _fastPath(wasNativeTypeChecked) { @@ -417,7 +390,6 @@ extension _ArrayBuffer { } @inlinable - @usableFromInline @inline(never) internal func _getElementSlowPath(_ i: Int) -> AnyObject { _sanityCheck( @@ -446,7 +418,6 @@ extension _ArrayBuffer { /// Get or set the value of the ith element. @inlinable - @usableFromInline internal subscript(i: Int) -> Element { get { return getElement(i, wasNativeTypeChecked: _isNativeTypeChecked) @@ -470,7 +441,6 @@ extension _ArrayBuffer { /// underlying contiguous storage. If no such storage exists, it is /// created on-demand. @inlinable - @usableFromInline internal func withUnsafeBufferPointer( _ body: (UnsafeBufferPointer) throws -> R ) rethrows -> R { @@ -487,7 +457,6 @@ extension _ArrayBuffer { /// /// - Precondition: Such contiguous storage exists or the buffer is empty. @inlinable - @usableFromInline internal mutating func withUnsafeMutableBufferPointer( _ body: (UnsafeMutableBufferPointer) throws -> R ) rethrows -> R { @@ -502,7 +471,6 @@ extension _ArrayBuffer { /// An object that keeps the elements stored in this buffer alive. @inlinable - @usableFromInline internal var owner: AnyObject { return _fastPath(_isNative) ? _native._storage : _nonNative } @@ -511,7 +479,6 @@ extension _ArrayBuffer { /// /// - Precondition: This buffer is backed by a `_ContiguousArrayBuffer`. @inlinable - @usableFromInline internal var nativeOwner: AnyObject { _sanityCheck(_isNative, "Expect a native array") return _native._storage @@ -521,7 +488,6 @@ extension _ArrayBuffer { /// buffers address the same elements when they have the same /// identity and count. @inlinable - @usableFromInline internal var identity: UnsafeRawPointer { if _isNative { return _native.identity @@ -536,7 +502,6 @@ extension _ArrayBuffer { /// /// In an empty collection, `startIndex == endIndex`. @inlinable - @usableFromInline internal var startIndex: Int { return 0 } @@ -547,7 +512,6 @@ extension _ArrayBuffer { /// reachable from `startIndex` by zero or more applications of /// `index(after:)`. @inlinable - @usableFromInline internal var endIndex: Int { return count } @@ -559,7 +523,6 @@ extension _ArrayBuffer { internal typealias NativeBuffer = _ContiguousArrayBuffer @inlinable - @usableFromInline internal var _isNative: Bool { if !_isClassOrObjCExistential(Element.self) { return true @@ -570,7 +533,6 @@ extension _ArrayBuffer { /// `true`, if the array is native and does not need a deferred type check. @inlinable - @usableFromInline internal var _isNativeTypeChecked: Bool { if !_isClassOrObjCExistential(Element.self) { return true @@ -583,7 +545,6 @@ extension _ArrayBuffer { /// /// - Precondition: `_isNative`. @inlinable - @usableFromInline internal var _native: NativeBuffer { return NativeBuffer( _isClassOrObjCExistential(Element.self) @@ -594,13 +555,11 @@ extension _ArrayBuffer { /// /// - Precondition: `_isNativeTypeChecked`. @inlinable - @usableFromInline internal var _nativeTypeChecked: NativeBuffer { return NativeBuffer(_storage.nativeInstance_noSpareBits) } @inlinable - @usableFromInline internal var _nonNative: _NSArrayCore { @inline(__always) get { diff --git a/stdlib/public/core/ArrayBufferProtocol.swift b/stdlib/public/core/ArrayBufferProtocol.swift index aa683de880a67..8c8cd4d3536f6 100644 --- a/stdlib/public/core/ArrayBufferProtocol.swift +++ b/stdlib/public/core/ArrayBufferProtocol.swift @@ -129,7 +129,6 @@ internal protocol _ArrayBufferProtocol extension _ArrayBufferProtocol where Indices == Range{ @inlinable - @usableFromInline internal var subscriptBaseAddress: UnsafeMutablePointer { return firstElementAddress } @@ -137,7 +136,6 @@ extension _ArrayBufferProtocol where Indices == Range{ // Make sure the compiler does not inline _copyBuffer to reduce code size. @inlinable @inline(never) - @usableFromInline internal init(copying buffer: Self) { let newBuffer = _ContiguousArrayBuffer( _uninitializedCount: buffer.count, minimumCapacity: buffer.count) @@ -148,7 +146,6 @@ extension _ArrayBufferProtocol where Indices == Range{ } @inlinable - @usableFromInline internal mutating func replaceSubrange( _ subrange: Range, with newCount: Int, diff --git a/stdlib/public/core/ArrayCast.swift b/stdlib/public/core/ArrayCast.swift index 034cd6fe15ea1..768da0203f00c 100644 --- a/stdlib/public/core/ArrayCast.swift +++ b/stdlib/public/core/ArrayCast.swift @@ -56,13 +56,11 @@ public func _arrayForceCast( @usableFromInline // FIXME(sil-serialize-all) internal struct _UnwrappingFailed : Error { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init() {} } extension Optional { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func unwrappedOrError() throws -> Wrapped { if let x = self { return x } throw _UnwrappingFailed() diff --git a/stdlib/public/core/Arrays.swift.gyb b/stdlib/public/core/Arrays.swift.gyb index af4283aae58fb..340073876908b 100644 --- a/stdlib/public/core/Arrays.swift.gyb +++ b/stdlib/public/core/Arrays.swift.gyb @@ -474,7 +474,6 @@ public struct ${Self}: _DestructorSafeContainer { /// Initialization from an existing buffer does not have "array.init" /// semantics because the caller may retain an alias to buffer. @inlinable - @usableFromInline internal init(_buffer: _Buffer) { self._buffer = _buffer } @@ -483,7 +482,6 @@ public struct ${Self}: _DestructorSafeContainer { /// Initialization from an existing buffer does not have "array.init" /// semantics because the caller may retain an alias to buffer. @inlinable - @usableFromInline internal init(_buffer buffer: _ContiguousArrayBuffer) { self.init(_buffer: _Buffer(_buffer: buffer, shiftedToStartIndex: 0)) } @@ -826,14 +824,12 @@ extension ${Self} { } @inlinable - @usableFromInline @_semantics("array.get_count") internal func _getCount() -> Int { return _buffer.count } @inlinable - @usableFromInline @_semantics("array.get_capacity") internal func _getCapacity() -> Int { return _buffer.capacity @@ -841,14 +837,13 @@ extension ${Self} { /// - Precondition: The array has a native buffer. @inlinable - @usableFromInline @_semantics("array.owner") internal func _getOwnerWithSemanticLabel_native() -> Builtin.NativeObject { return Builtin.unsafeCastToNativeObject(_buffer.nativeOwner) } /// - Precondition: The array has a native buffer. - @usableFromInline + @inlinable @inline(__always) internal func _getOwner_native() -> Builtin.NativeObject { #if _runtime(_ObjC) @@ -866,7 +861,6 @@ extension ${Self} { } @inlinable - @usableFromInline @_semantics("array.make_mutable") internal mutating func _makeMutableAndUnique() { if _slowPath(!_buffer.isMutableAndUniquelyReferenced()) { @@ -875,7 +869,6 @@ extension ${Self} { } @inlinable - @usableFromInline @_semantics("array.make_mutable") internal mutating func _makeMutableAndUniqueOrPinned() { if _slowPath(!_buffer.isMutableAndUniquelyReferencedOrPinned()) { @@ -886,7 +879,7 @@ extension ${Self} { /// Check that the given `index` is valid for subscripting, i.e. /// `0 ≤ index < count`. - @usableFromInline + @inlinable @inline(__always) internal func _checkSubscript_native(_ index: Int) { % if Self != 'Array': @@ -919,7 +912,6 @@ extension ${Self} { /// Check that the specified `index` is valid, i.e. `0 ≤ index ≤ count`. @inlinable - @usableFromInline @_semantics("array.check_index") internal func _checkIndex(_ index: Int) { _precondition(index <= endIndex, "${Self} index is out of range") @@ -946,7 +938,6 @@ extension ${Self} { } @inlinable - @usableFromInline @_semantics("array.get_element_address") internal func _getElementAddress(_ index: Int) -> UnsafeMutablePointer { return _buffer.subscriptBaseAddress + index @@ -1125,7 +1116,6 @@ extension ${Self} : RangeReplaceableCollection, ArrayProtocol { } @inlinable - @usableFromInline @inline(never) internal static func _allocateBufferUninitialized( minimumCapacity: Int @@ -1137,7 +1127,6 @@ extension ${Self} : RangeReplaceableCollection, ArrayProtocol { /// Construct a ${Self} of `count` uninitialized elements. @inlinable - @usableFromInline internal init(_uninitializedCount count: Int) { _precondition(count >= 0, "Can't construct ${Self} with count < 0") // Note: Sinking this constructor into an else branch below causes an extra @@ -1157,7 +1146,6 @@ extension ${Self} : RangeReplaceableCollection, ArrayProtocol { /// Entry point for `Array` literal construction; builds and returns /// a ${Self} of `count` uninitialized elements. @inlinable - @usableFromInline @_semantics("array.uninitialized") internal static func _allocateUninitialized( _ count: Int @@ -1174,7 +1162,6 @@ extension ${Self} : RangeReplaceableCollection, ArrayProtocol { /// /// - Precondition: `storage is _ContiguousArrayStorage`. @inlinable - @usableFromInline @_semantics("array.uninitialized") internal static func _adoptStorage( _ storage: __owned _ContiguousArrayStorage, count: Int @@ -1193,7 +1180,6 @@ extension ${Self} : RangeReplaceableCollection, ArrayProtocol { /// Entry point for aborting literal construction: deallocates /// a ${Self} containing only uninitialized elements. @inlinable - @usableFromInline internal mutating func _deallocateUninitialized() { // Set the count to zero and just release as normal. // Somewhat of a hack. @@ -1254,7 +1240,6 @@ extension ${Self} : RangeReplaceableCollection, ArrayProtocol { %if Self != 'Array': # // Array does not necessarily have contiguous storage @inlinable - @usableFromInline internal var _baseAddress: UnsafeMutablePointer { return _buffer.firstElementAddress } @@ -1352,7 +1337,6 @@ extension ${Self} : RangeReplaceableCollection, ArrayProtocol { /// Copy the contents of the current buffer to a new unique mutable buffer. /// The count of the new buffer is set to `oldCount`, the capacity of the /// new buffer is big enough to hold 'oldCount' + 1 elements. - @usableFromInline @inlinable @inline(never) internal mutating func _copyToNewBuffer(oldCount: Int) { @@ -1364,7 +1348,6 @@ extension ${Self} : RangeReplaceableCollection, ArrayProtocol { } @inlinable - @usableFromInline @_semantics("array.make_mutable") internal mutating func _makeUniqueAndReserveCapacityIfNotUnique() { if _slowPath(!_buffer.isMutableAndUniquelyReferenced()) { @@ -1373,7 +1356,6 @@ extension ${Self} : RangeReplaceableCollection, ArrayProtocol { } @inlinable - @usableFromInline @_semantics("array.mutate_unknown") internal mutating func _reserveCapacityAssumingUniqueBuffer(oldCount: Int) { // This is a performance optimization. This code used to be in an || @@ -1403,7 +1385,6 @@ extension ${Self} : RangeReplaceableCollection, ArrayProtocol { } @inlinable - @usableFromInline @_semantics("array.mutate_unknown") internal mutating func _appendElementAssumeUniqueAndCapacity( _ oldCount: Int, @@ -1493,7 +1474,6 @@ extension ${Self} : RangeReplaceableCollection, ArrayProtocol { } @inlinable - @usableFromInline @_semantics("array.reserve_capacity_for_append") internal mutating func reserveCapacityForAppend(newElementsCount: Int) { let oldCount = self.count @@ -1682,7 +1662,7 @@ extension ${Self} : CustomStringConvertible, CustomDebugStringConvertible { } extension ${Self} { - @usableFromInline + @inlinable @_transparent internal func _cPointerArgs() -> (AnyObject?, UnsafeRawPointer?) { let p = _baseAddressIfContiguous @@ -1847,7 +1827,6 @@ extension ${Self} { // and CustomDebugStringConvertible using a bracketed list of elements, // like an array. @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) internal func _makeCollectionDescription (for items: C, withTypeName type: String?) -> String { var result = "" @@ -1875,7 +1854,6 @@ internal struct _InitializeMemoryFromCollection< C: Collection > : _PointerFunction { @inlinable - @usableFromInline internal func call(_ rawMemory: UnsafeMutablePointer, count: Int) { var p = rawMemory var q = newValues.startIndex @@ -1888,7 +1866,6 @@ internal struct _InitializeMemoryFromCollection< } @inlinable - @usableFromInline internal init(_ newValues: C) { self.newValues = newValues } @@ -1899,7 +1876,6 @@ internal struct _InitializeMemoryFromCollection< extension _ArrayBufferProtocol { @inlinable - @usableFromInline @inline(never) internal mutating func _arrayOutOfPlaceReplace( _ bounds: Range, @@ -1924,7 +1900,6 @@ extension _ArrayBufferProtocol { /// `s`. This test is never used to ensure memory safety; that is /// always guaranteed by measuring `s` once and re-using that value. @inlinable -@usableFromInline internal func _expectEnd(of s: C, is i: C.Index) { _debugPrecondition( i == s.endIndex, @@ -1932,7 +1907,6 @@ internal func _expectEnd(of s: C, is i: C.Index) { } @inlinable -@usableFromInline internal func _growArrayCapacity(_ capacity: Int) -> Int { return capacity * 2 } @@ -2016,7 +1990,6 @@ extension _ArrayBufferProtocol { /// max(requiredCapacity, source.capacity) if newCount <= source.capacity /// max(requiredCapacity, _growArrayCapacity(source.capacity)) otherwise @inlinable - @usableFromInline @inline(never) internal func _forceCreateUniqueMutableBuffer( newCount: Int, requiredCapacity: Int @@ -2033,7 +2006,6 @@ extension _ArrayBufferProtocol { /// max(minNewCapacity, source.capacity) if minNewCapacity <= source.capacity /// max(minNewCapacity, _growArrayCapacity(source.capacity)) otherwise @inlinable - @usableFromInline @inline(never) internal func _forceCreateUniqueMutableBuffer( countForNewBuffer: Int, minNewCapacity: Int @@ -2051,7 +2023,6 @@ extension _ArrayBufferProtocol { /// max(requiredCapacity, source.capacity) if minNewCapacity <= source.capacity /// max(requiredCapacity, _growArrayCapacity(source.capacity)) otherwise @inlinable - @usableFromInline internal func _forceCreateUniqueMutableBufferImpl( countForBuffer: Int, minNewCapacity: Int, requiredCapacity: Int @@ -2084,7 +2055,6 @@ extension _ArrayBufferProtocol { /// As an optimization, may move elements out of source rather than /// copying when it isUniquelyReferenced. @inlinable - @usableFromInline @inline(never) internal mutating func _arrayOutOfPlaceUpdate( _ dest: inout _ContiguousArrayBuffer, @@ -2158,12 +2128,10 @@ extension _ArrayBufferProtocol { @_fixed_layout internal struct _IgnorePointer : _PointerFunction { @inlinable - @usableFromInline internal func call(_: UnsafeMutablePointer, count: Int) { _sanityCheck(count == 0) } - @usableFromInline @inlinable internal init() { } @@ -2171,7 +2139,6 @@ internal struct _IgnorePointer : _PointerFunction { extension _ArrayBufferProtocol { @inlinable - @usableFromInline @inline(never) internal mutating func _outlinedMakeUniqueBuffer(bufferCount: Int) { @@ -2187,7 +2154,6 @@ extension _ArrayBufferProtocol { /// Append items from `newItems` to a buffer. @inlinable - @usableFromInline internal mutating func _arrayAppendSequence( _ newItems: S ) where S.Element == Element { diff --git a/stdlib/public/core/AssertCommon.swift b/stdlib/public/core/AssertCommon.swift index c9f66bbbad94f..a736a5d030f17 100644 --- a/stdlib/public/core/AssertCommon.swift +++ b/stdlib/public/core/AssertCommon.swift @@ -31,7 +31,6 @@ func _isDebugAssertConfiguration() -> Bool { } @inlinable // FIXME(sil-serialize-all) -@usableFromInline @_transparent internal func _isReleaseAssertConfiguration() -> Bool { // The values for the assert_configuration call are: @@ -64,7 +63,6 @@ func _isStdlibInternalChecksEnabled() -> Bool { } @inlinable // FIXME(sil-serialize-all) -@usableFromInline @_transparent internal func _fatalErrorFlags() -> UInt32 { diff --git a/stdlib/public/core/Bool.swift b/stdlib/public/core/Bool.swift index 4c5feade9bf46..cac0baae48ca4 100644 --- a/stdlib/public/core/Bool.swift +++ b/stdlib/public/core/Bool.swift @@ -76,7 +76,6 @@ public struct Bool { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline @_transparent internal init(_ v: Builtin.Int1) { self._value = v } diff --git a/stdlib/public/core/BridgeObjectiveC.swift b/stdlib/public/core/BridgeObjectiveC.swift index fd6e934192a6f..f905f829bf965 100644 --- a/stdlib/public/core/BridgeObjectiveC.swift +++ b/stdlib/public/core/BridgeObjectiveC.swift @@ -98,7 +98,6 @@ public struct _BridgeableMetatype: _ObjectiveCBridgeable { internal var value: AnyObject.Type @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(value: AnyObject.Type) { self.value = value } @@ -342,7 +341,6 @@ public func _getBridgedNonVerbatimObjectiveCType(_: T.Type) -> Any.Type? // -- Pointer argument bridging @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) @_transparent internal var _nilNativeObject: AnyObject? { return nil @@ -472,7 +470,6 @@ public struct AutoreleasingUnsafeMutablePointer /// - Warning: Accessing `pointee` as a type that is unrelated to /// the underlying memory's bound type is undefined. @inlinable // FIXME(sil-serialize-all) - @usableFromInline @_transparent internal init(_ from: UnsafePointer) { self._rawValue = from._rawValue @@ -488,7 +485,6 @@ public struct AutoreleasingUnsafeMutablePointer /// - Warning: Accessing `pointee` as a type that is unrelated to /// the underlying memory's bound type is undefined. @inlinable // FIXME(sil-serialize-all) - @usableFromInline @_transparent internal init?(_ from: UnsafePointer?) { guard let unwrapped = from else { return nil } @@ -601,14 +597,12 @@ internal struct _CocoaFastEnumerationStackBuf { internal var _item15: UnsafeRawPointer? @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @_transparent internal var count: Int { return 16 } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal init() { _item0 = nil _item1 = _item0 diff --git a/stdlib/public/core/BridgeStorage.swift b/stdlib/public/core/BridgeStorage.swift index a22f3751d275a..e836a09f2563b 100644 --- a/stdlib/public/core/BridgeStorage.swift +++ b/stdlib/public/core/BridgeStorage.swift @@ -158,7 +158,6 @@ struct _BridgeStorage< //===--- private --------------------------------------------------------===// @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var _isTagged: Bool { @inline(__always) get { return Bool(Builtin.classifyBridgeObject(rawValue).isObjCTaggedPointer) diff --git a/stdlib/public/core/Builtin.swift b/stdlib/public/core/Builtin.swift index cd5f912535a42..4c5761f00047b 100644 --- a/stdlib/public/core/Builtin.swift +++ b/stdlib/public/core/Builtin.swift @@ -19,7 +19,6 @@ import SwiftShims // marked `@inline(__always)` to make primary `_roundUp` entry points seem // cheap enough for the inliner. @inlinable // FIXME(sil-serialize-all) -@usableFromInline @inline(__always) internal func _roundUpImpl(_ offset: UInt, toAlignment alignment: Int) -> UInt { _sanityCheck(alignment > 0) @@ -33,13 +32,11 @@ internal func _roundUpImpl(_ offset: UInt, toAlignment alignment: Int) -> UInt { } @inlinable // FIXME(sil-serialize-all) -@usableFromInline internal func _roundUp(_ offset: UInt, toAlignment alignment: Int) -> UInt { return _roundUpImpl(offset, toAlignment: alignment) } @inlinable // FIXME(sil-serialize-all) -@usableFromInline internal func _roundUp(_ offset: Int, toAlignment alignment: Int) -> Int { _sanityCheck(offset >= 0) return Int(_roundUpImpl(UInt(bitPattern: offset), toAlignment: alignment)) @@ -104,14 +101,12 @@ public func _identityCast(_ x: T, to expectedType: U.Type) -> U { /// `unsafeBitCast` something to `AnyObject`. @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) @_transparent internal func _reinterpretCastToAnyObject(_ x: T) -> AnyObject { return unsafeBitCast(x, to: AnyObject.self) } @inlinable -@usableFromInline @_transparent internal func == ( lhs: Builtin.NativeObject, rhs: Builtin.NativeObject @@ -120,7 +115,6 @@ internal func == ( } @inlinable -@usableFromInline @_transparent internal func != ( lhs: Builtin.NativeObject, rhs: Builtin.NativeObject @@ -129,7 +123,6 @@ internal func != ( } @inlinable -@usableFromInline @_transparent internal func == ( lhs: Builtin.RawPointer, rhs: Builtin.RawPointer @@ -138,7 +131,6 @@ internal func == ( } @inlinable -@usableFromInline @_transparent internal func != (lhs: Builtin.RawPointer, rhs: Builtin.RawPointer) -> Bool { return !(lhs == rhs) @@ -178,7 +170,6 @@ public func != (t0: Any.Type?, t1: Any.Type?) -> Bool { /// known at compile-time to be true. If condition is false, or true /// but not a compile-time constant, this call has no effect. @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) @_transparent internal func _unreachable(_ condition: Bool = true) { if condition { @@ -191,21 +182,18 @@ internal func _unreachable(_ condition: Bool = true) { /// Tell the optimizer that this code is unreachable if this builtin is /// reachable after constant folding build configuration builtins. @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) @_transparent internal func _conditionallyUnreachable() -> Never { Builtin.conditionallyUnreachable() } @inlinable // FIXME(sil-serialize-all) -@usableFromInline @_silgen_name("_swift_isClassOrObjCExistentialType") internal func _swift_isClassOrObjCExistentialType(_ x: T.Type) -> Bool /// Returns `true` iff `T` is a class type or an `@objc` existential such as /// `AnyObject`. @inlinable // FIXME(sil-serialize-all) -@usableFromInline @inline(__always) internal func _isClassOrObjCExistential(_ x: T.Type) -> Bool { @@ -288,7 +276,6 @@ public func _getUnsafePointerToStoredProperties(_ x: AnyObject) // mandatory generic inlining. @inlinable // FIXME(sil-serialize-all) -@usableFromInline @_transparent @_semantics("branchhint") internal func _branchHint(_ actual: Bool, expected: Bool) -> Bool { @@ -328,12 +315,10 @@ public func _onFastPath() { // the type of argument to be AnyClass. This is currently not possible // when using RuntimeShims.h @inlinable // FIXME(sil-serialize-all) -@usableFromInline @_silgen_name("_objcClassUsesNativeSwiftReferenceCounting") internal func _usesNativeSwiftReferenceCounting(_ theClass: AnyClass) -> Bool #else @inlinable // FIXME(sil-serialize-all) -@usableFromInline @inline(__always) internal func _usesNativeSwiftReferenceCounting(_ theClass: AnyClass) -> Bool { return true @@ -341,19 +326,16 @@ internal func _usesNativeSwiftReferenceCounting(_ theClass: AnyClass) -> Bool { #endif @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) @_silgen_name("_getSwiftClassInstanceExtents") internal func getSwiftClassInstanceExtents(_ theClass: AnyClass) -> (negative: UInt, positive: UInt) @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) @_silgen_name("_getObjCClassInstanceExtents") internal func getObjCClassInstanceExtents(_ theClass: AnyClass) -> (negative: UInt, positive: UInt) @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) @inline(__always) internal func _class_getInstancePositiveExtentSize(_ theClass: AnyClass) -> Int { #if _runtime(_ObjC) @@ -364,7 +346,6 @@ internal func _class_getInstancePositiveExtentSize(_ theClass: AnyClass) -> Int } @inlinable -@usableFromInline internal func _isValidAddress(_ address: UInt) -> Bool { // TODO: define (and use) ABI max valid pointer value @@ -376,19 +357,16 @@ func _isValidAddress(_ address: UInt) -> Bool { // TODO(): Get rid of superfluous UInt constructor // calls @inlinable // FIXME(sil-serialize-all) -@usableFromInline internal var _objCTaggedPointerBits: UInt { @inline(__always) get { return UInt(_swift_BridgeObject_TaggedPointerBits) } } @inlinable // FIXME(sil-serialize-all) -@usableFromInline internal var _objectPointerSpareBits: UInt { @inline(__always) get { return UInt(_swift_abi_SwiftSpareBitsMask) & ~_objCTaggedPointerBits } } @inlinable // FIXME(sil-serialize-all) -@usableFromInline internal var _objectPointerLowSpareBitShift: UInt { @inline(__always) get { _sanityCheck(_swift_abi_ObjCReservedLowBits < 2, @@ -400,13 +378,11 @@ internal var _objectPointerLowSpareBitShift: UInt { #if arch(i386) || arch(arm) || arch(powerpc64) || arch(powerpc64le) || arch( s390x) @inlinable // FIXME(sil-serialize-all) -@usableFromInline internal var _objectPointerIsObjCBit: UInt { @inline(__always) get { return 0x0000_0002 } } #else @inlinable // FIXME(sil-serialize-all) -@usableFromInline internal var _objectPointerIsObjCBit: UInt { @inline(__always) get { return 0x4000_0000_0000_0000 } } @@ -414,7 +390,6 @@ internal var _objectPointerIsObjCBit: UInt { /// Extract the raw bits of `x`. @inlinable // FIXME(sil-serialize-all) -@usableFromInline @inline(__always) internal func _bitPattern(_ x: Builtin.BridgeObject) -> UInt { return UInt(Builtin.castBitPatternFromBridgeObject(x)) @@ -422,20 +397,17 @@ internal func _bitPattern(_ x: Builtin.BridgeObject) -> UInt { /// Extract the raw spare bits of `x`. @inlinable // FIXME(sil-serialize-all) -@usableFromInline @inline(__always) internal func _nonPointerBits(_ x: Builtin.BridgeObject) -> UInt { return _bitPattern(x) & _objectPointerSpareBits } @inlinable // FIXME(sil-serialize-all) -@usableFromInline @inline(__always) internal func _isObjCTaggedPointer(_ x: AnyObject) -> Bool { return (Builtin.reinterpretCast(x) & _objCTaggedPointerBits) != 0 } @inlinable // FIXME(sil-serialize-all) -@usableFromInline @inline(__always) internal func _isObjCTaggedPointer(_ x: UInt) -> Bool { return (x & _objCTaggedPointerBits) != 0 @@ -443,23 +415,22 @@ internal func _isObjCTaggedPointer(_ x: UInt) -> Bool { /// TODO: describe extras -@inlinable /*@usableFromInline*/ @inline(__always) public // FIXME +@inlinable @inline(__always) public // FIXME func _isTaggedObject(_ x: Builtin.BridgeObject) -> Bool { return _bitPattern(x) & _objCTaggedPointerBits != 0 } -@inlinable /*@usableFromInline*/ @inline(__always) public // FIXME +@inlinable @inline(__always) public // FIXME func _isNativePointer(_ x: Builtin.BridgeObject) -> Bool { return ( _bitPattern(x) & (_objCTaggedPointerBits | _objectPointerIsObjCBit) ) == 0 } -@inlinable /*@usableFromInline*/ @inline(__always) public // FIXME +@inlinable @inline(__always) public // FIXME func _isNonTaggedObjCPointer(_ x: Builtin.BridgeObject) -> Bool { return !_isTaggedObject(x) && !_isNativePointer(x) } @inlinable -@usableFromInline @inline(__always) func _getNonTagBits(_ x: Builtin.BridgeObject) -> UInt { // Zero out the tag bits, and leave them all at the top. @@ -593,7 +564,6 @@ extension ManagedBufferPointer { /// - Precondition: `bits & _objectPointerIsObjCBit == 0`, /// `bits & _objectPointerSpareBits == bits`. @inlinable // FIXME(sil-serialize-all) -@usableFromInline @inline(__always) internal func _makeNativeBridgeObject( _ nativeObject: AnyObject, _ bits: UInt @@ -627,7 +597,6 @@ func _makeObjCBridgeObject( /// `object` is either a native object, or `bits == /// _objectPointerIsObjCBit`. @inlinable // FIXME(sil-serialize-all) -@usableFromInline @inline(__always) internal func _makeBridgeObject( _ object: AnyObject, _ bits: UInt @@ -691,7 +660,6 @@ func _getSuperclass(_ t: Any.Type) -> AnyClass? { /// Returns `true` if `object` is uniquely referenced. @inlinable // FIXME(sil-serialize-all) -@usableFromInline @_transparent internal func _isUnique(_ object: inout T) -> Bool { return Bool(Builtin.isUnique(&object)) @@ -699,7 +667,6 @@ internal func _isUnique(_ object: inout T) -> Bool { /// Returns `true` if `object` is uniquely referenced or pinned. @inlinable // FIXME(sil-serialize-all) -@usableFromInline @_transparent internal func _isUniqueOrPinned(_ object: inout T) -> Bool { return Bool(Builtin.isUniqueOrPinned(&object)) @@ -757,7 +724,6 @@ func _isOptional(_ type: T.Type) -> Bool { /// Extract an object reference from an Any known to contain an object. @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) internal func _unsafeDowncastToAnyObject(fromAny any: Any) -> AnyObject { _sanityCheck(type(of: any) is AnyObject.Type || type(of: any) is AnyObject.Protocol, diff --git a/stdlib/public/core/CString.swift b/stdlib/public/core/CString.swift index a86974dee386b..d4105282ed860 100644 --- a/stdlib/public/core/CString.swift +++ b/stdlib/public/core/CString.swift @@ -171,7 +171,6 @@ public func _persistCString(_ p: UnsafePointer?) -> [CChar]? { } @inlinable -@usableFromInline internal func _decodeValidCString( _ cString: UnsafePointer, repair: Bool ) -> String { @@ -184,7 +183,6 @@ internal func _decodeValidCString( } @inlinable -@usableFromInline internal func _decodeValidCString( _ cString: UnsafePointer, repair: Bool ) -> String { @@ -194,7 +192,6 @@ internal func _decodeValidCString( } @inlinable -@usableFromInline internal func _decodeCString( _ cString: UnsafePointer, repair: Bool ) -> String? { @@ -207,7 +204,6 @@ internal func _decodeCString( } @inlinable -@usableFromInline internal func _decodeCString( _ cString: UnsafePointer, repair: Bool ) -> String? { @@ -221,7 +217,6 @@ internal func _decodeCString( /// /// This internal helper takes the string length as an argument. @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) internal func _decodeCString( _ cString: UnsafePointer, as encoding: Encoding.Type, length: Int, diff --git a/stdlib/public/core/CTypes.swift b/stdlib/public/core/CTypes.swift index 29da7eeb69f90..16f548c6c0391 100644 --- a/stdlib/public/core/CTypes.swift +++ b/stdlib/public/core/CTypes.swift @@ -110,7 +110,6 @@ public struct OpaquePointer { internal var _rawValue: Builtin.RawPointer @inlinable // FIXME(sil-serialize-all) - @usableFromInline @_transparent internal init(_ v: Builtin.RawPointer) { self._rawValue = v @@ -248,7 +247,6 @@ extension CVaListPointer : CustomDebugStringConvertible { } } -@usableFromInline @inlinable internal func _memcpy( dest destination: UnsafeMutableRawPointer, @@ -268,7 +266,6 @@ internal func _memcpy( /// /// The memory regions `source.. internal static func _smallValue(_ value: Builtin.Int63) -> UInt64 { return UInt64(Builtin.zext_Int63_Int64(value)) @@ -86,13 +86,11 @@ public struct Character { typealias UTF16View = String.UTF16View @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var utf16: UTF16View { return String(self).utf16 } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal init(_smallRepresentation b: _SmallUTF16) { _sanityCheck(Int64(b._storage) >= 0) _representation = .smallUTF16( @@ -100,7 +98,6 @@ public struct Character { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal init(_largeRepresentation storage: _UTF16StringStorage) { _representation = .large(storage) } @@ -112,7 +109,6 @@ public struct Character { /// that formally because of grapheme cluster literals and the shifting /// sands of Unicode. https://bugs.swift.org/browse/SR-4955 @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal init(_largeRepresentationString s: String) { let storage = s._guts._extractNativeStorage(of: UTF16.CodeUnit.self) self.init(_largeRepresentation: storage) @@ -272,7 +268,6 @@ extension Character /// Construct a Character from a _StringGuts, assuming it consists of exactly /// one extended grapheme cluster. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_unverified guts: _StringGuts) { self = _visitGuts(guts, ascii: { ascii in @@ -292,7 +287,6 @@ extension Character /// Construct a Character from a slice of a _StringGuts, assuming /// the specified range covers exactly one extended grapheme cluster. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_unverified guts: _StringGuts, range: Range) { self = _visitGuts( guts, range: (range, performBoundsCheck: true), @@ -311,7 +305,6 @@ extension Character } @inlinable - @usableFromInline internal init(_singleCodeUnit cu: UInt16) { _sanityCheck(UTF16._isScalar(cu)) @@ -320,7 +313,6 @@ extension Character } @inlinable - @usableFromInline internal init(_codeUnitPair first: UInt16, _ second: UInt16) { _sanityCheck( @@ -333,7 +325,6 @@ extension Character } @inlinable - @usableFromInline internal init(_unverified storage: _SwiftStringStorage) { if _fastPath(storage.count <= 4) { @@ -350,7 +341,6 @@ extension Character } @inlinable - @usableFromInline internal init(_unverified variant: V) { if _fastPath(variant.count <= 4) { @@ -386,7 +376,6 @@ extension Character { internal typealias _SmallUTF16 = _UIntBuffer @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal var _smallUTF16 : _SmallUTF16? { guard case .smallUTF16(let _63bits) = _representation else { return nil } _onFastPath() @@ -400,7 +389,6 @@ extension Character { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal var _largeUTF16 : _UTF16StringStorage? { guard case .large(let storage) = _representation else { return nil } return storage @@ -409,7 +397,6 @@ extension Character { extension Character { @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal var _count : Int { if let small = _smallUTF16 { return small.count } return _largeUTF16._unsafelyUnwrappedUnchecked.count @@ -443,7 +430,7 @@ extension String { /// 0x7FFFFFFFFFFFFF80 or greater is an invalid UTF-8 sequence, we know if a /// value is ASCII by checking if it is greater than or equal to /// 0x7FFFFFFFFFFFFF00. -// FIXME(sil-serialize-all): Should be @inlinable @usableFromInline +// FIXME(sil-serialize-all): Should be @inlinable // internal var _minASCIICharReprBuiltin: Builtin.Int63 { @inline(__always) get { diff --git a/stdlib/public/core/CharacterUnicodeScalars.swift b/stdlib/public/core/CharacterUnicodeScalars.swift index ce56aca8bfecc..c76cde65705b3 100644 --- a/stdlib/public/core/CharacterUnicodeScalars.swift +++ b/stdlib/public/core/CharacterUnicodeScalars.swift @@ -16,7 +16,6 @@ extension Character { internal let _base: Character @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_base: Character) { self._base = _base } @@ -35,7 +34,6 @@ extension Character.UnicodeScalarView { internal var _base: IndexingIterator @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_base: IndexingIterator) { self._base = _base } @@ -67,7 +65,6 @@ extension Character.UnicodeScalarView { internal let _stride: UInt8 @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_encodedOffset: Int, _scalar: Unicode.UTF16.EncodedScalar, _stride: UInt8) { self._encodedOffset = _encodedOffset self._scalar = _scalar diff --git a/stdlib/public/core/CocoaArray.swift b/stdlib/public/core/CocoaArray.swift index b997bbc86514e..c22c131a9072f 100644 --- a/stdlib/public/core/CocoaArray.swift +++ b/stdlib/public/core/CocoaArray.swift @@ -30,19 +30,16 @@ import SwiftShims internal struct _CocoaArrayWrapper : RandomAccessCollection { typealias Indices = Range @inlinable - @usableFromInline internal var startIndex: Int { return 0 } @inlinable - @usableFromInline internal var endIndex: Int { return buffer.count } @inlinable - @usableFromInline internal subscript(i: Int) -> AnyObject { return buffer.objectAt(i) } @@ -58,7 +55,6 @@ internal struct _CocoaArrayWrapper : RandomAccessCollection { /// contiguous storage exists, e.g., if array doesn't have a smart /// implementation of countByEnumerating. @inlinable - @usableFromInline internal func contiguousStorage( _ subRange: Range ) -> UnsafeMutablePointer? @@ -82,7 +78,6 @@ internal struct _CocoaArrayWrapper : RandomAccessCollection { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline @_transparent internal init(_ buffer: _NSArrayCore) { self.buffer = buffer diff --git a/stdlib/public/core/Codable.swift.gyb b/stdlib/public/core/Codable.swift.gyb index a7d2a15414346..807fb170dee4a 100644 --- a/stdlib/public/core/Codable.swift.gyb +++ b/stdlib/public/core/Codable.swift.gyb @@ -1312,13 +1312,11 @@ internal struct _GenericIndexKey : CodingKey { internal var intValue: Int? @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init?(stringValue: String) { return nil } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init?(intValue: Int) { self.stringValue = "Index \(intValue)" self.intValue = intValue @@ -1400,42 +1398,35 @@ public extension DecodingError { @usableFromInline internal class _KeyedEncodingContainerBase { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(){} @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) deinit {} // These must all be given a concrete implementation in _*Box. @inlinable - @usableFromInline internal var codingPath: [CodingKey] { fatalError("_KeyedEncodingContainerBase cannot be used directly.") } @inlinable - @usableFromInline internal func encodeNil(forKey key: Key) throws { fatalError("_KeyedEncodingContainerBase cannot be used directly.") } % for type in codable_types: @inlinable - @usableFromInline internal func encode(_ value: ${type}, forKey key: Key) throws { fatalError("_KeyedEncodingContainerBase cannot be used directly.") } % end @inlinable - @usableFromInline internal func encode(_ value: T, forKey key: Key) throws { fatalError("_KeyedEncodingContainerBase cannot be used directly.") } @inlinable - @usableFromInline internal func encodeConditional( _ object: T, forKey key: Key) throws { @@ -1444,14 +1435,12 @@ internal class _KeyedEncodingContainerBase { % for type in codable_types: @inlinable - @usableFromInline internal func encodeIfPresent(_ value: ${type}?, forKey key: Key) throws { fatalError("_KeyedEncodingContainerBase cannot be used directly.") } % end @inlinable - @usableFromInline internal func encodeIfPresent( _ value: T?, forKey key: Key) throws { @@ -1459,7 +1448,6 @@ internal class _KeyedEncodingContainerBase { } @inlinable - @usableFromInline internal func nestedContainer( keyedBy keyType: NestedKey.Type, forKey key: Key ) -> KeyedEncodingContainer { @@ -1467,20 +1455,17 @@ internal class _KeyedEncodingContainerBase { } @inlinable - @usableFromInline internal func nestedUnkeyedContainer( forKey key: Key) -> UnkeyedEncodingContainer { fatalError("_KeyedEncodingContainerBase cannot be used directly.") } @inlinable - @usableFromInline internal func superEncoder() -> Encoder { fatalError("_KeyedEncodingContainerBase cannot be used directly.") } @inlinable - @usableFromInline internal func superEncoder(forKey key: Key) -> Encoder { fatalError("_KeyedEncodingContainerBase cannot be used directly.") } @@ -1497,33 +1482,28 @@ internal final class _KeyedEncodingContainerBox< internal var concrete: Concrete @inlinable - @usableFromInline internal init(_ container: Concrete) { concrete = container } @inlinable - @usableFromInline override internal var codingPath: [CodingKey] { return concrete.codingPath } @inlinable - @usableFromInline override internal func encodeNil(forKey key: Key) throws { try concrete.encodeNil(forKey: key) } % for type in codable_types: @inlinable - @usableFromInline override internal func encode(_ value: ${type}, forKey key: Key) throws { try concrete.encode(value, forKey: key) } % end @inlinable - @usableFromInline override internal func encode( _ value: T, forKey key: Key) throws { @@ -1531,7 +1511,6 @@ internal final class _KeyedEncodingContainerBox< } @inlinable - @usableFromInline override internal func encodeConditional( _ object: T, forKey key: Key) throws { @@ -1540,7 +1519,6 @@ internal final class _KeyedEncodingContainerBox< % for type in codable_types: @inlinable - @usableFromInline override internal func encodeIfPresent( _ value: ${type}?, forKey key: Key) throws { @@ -1549,7 +1527,6 @@ internal final class _KeyedEncodingContainerBox< % end @inlinable - @usableFromInline override internal func encodeIfPresent( _ value: T?, forKey key: Key) throws { @@ -1557,7 +1534,6 @@ internal final class _KeyedEncodingContainerBox< } @inlinable - @usableFromInline override internal func nestedContainer( keyedBy keyType: NestedKey.Type, forKey key: Key ) -> KeyedEncodingContainer { @@ -1565,7 +1541,6 @@ internal final class _KeyedEncodingContainerBox< } @inlinable - @usableFromInline override internal func nestedUnkeyedContainer( forKey key: Key) -> UnkeyedEncodingContainer { @@ -1573,13 +1548,11 @@ internal final class _KeyedEncodingContainerBox< } @inlinable - @usableFromInline override internal func superEncoder() -> Encoder { return concrete.superEncoder() } @inlinable - @usableFromInline override internal func superEncoder(forKey key: Key) -> Encoder { return concrete.superEncoder(forKey: key) } @@ -1589,40 +1562,33 @@ internal final class _KeyedEncodingContainerBox< @usableFromInline internal class _KeyedDecodingContainerBase { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(){} @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) deinit {} @inlinable - @usableFromInline internal var codingPath: [CodingKey] { fatalError("_KeyedDecodingContainerBase cannot be used directly.") } @inlinable - @usableFromInline internal var allKeys: [Key] { fatalError("_KeyedDecodingContainerBase cannot be used directly.") } @inlinable - @usableFromInline internal func contains(_ key: Key) -> Bool { fatalError("_KeyedDecodingContainerBase cannot be used directly.") } @inlinable - @usableFromInline internal func decodeNil(forKey key: Key) throws -> Bool { fatalError("_KeyedDecodingContainerBase cannot be used directly.") } % for type in codable_types: @inlinable - @usableFromInline internal func decode( _ type: ${type}.Type, forKey key: Key) throws -> ${type} { @@ -1631,7 +1597,6 @@ internal class _KeyedDecodingContainerBase { % end @inlinable - @usableFromInline internal func decode( _ type: T.Type, forKey key: Key) throws -> T { @@ -1640,7 +1605,6 @@ internal class _KeyedDecodingContainerBase { % for type in codable_types: @inlinable - @usableFromInline internal func decodeIfPresent( _ type: ${type}.Type, forKey key: Key) throws -> ${type}? { @@ -1649,7 +1613,6 @@ internal class _KeyedDecodingContainerBase { % end @inlinable - @usableFromInline internal func decodeIfPresent( _ type: T.Type, forKey key: Key) throws -> T? { @@ -1657,7 +1620,6 @@ internal class _KeyedDecodingContainerBase { } @inlinable - @usableFromInline internal func nestedContainer( keyedBy type: NestedKey.Type, forKey key: Key ) throws -> KeyedDecodingContainer { @@ -1665,7 +1627,6 @@ internal class _KeyedDecodingContainerBase { } @inlinable - @usableFromInline internal func nestedUnkeyedContainer( forKey key: Key) throws -> UnkeyedDecodingContainer { @@ -1673,13 +1634,11 @@ internal class _KeyedDecodingContainerBase { } @inlinable - @usableFromInline internal func superDecoder() throws -> Decoder { fatalError("_KeyedDecodingContainerBase cannot be used directly.") } @inlinable - @usableFromInline internal func superDecoder(forKey key: Key) throws -> Decoder { fatalError("_KeyedDecodingContainerBase cannot be used directly.") } @@ -1696,38 +1655,32 @@ internal final class _KeyedDecodingContainerBox< internal var concrete: Concrete @inlinable - @usableFromInline internal init(_ container: Concrete) { concrete = container } @inlinable - @usableFromInline override var codingPath: [CodingKey] { return concrete.codingPath } @inlinable - @usableFromInline override var allKeys: [Key] { return concrete.allKeys } @inlinable - @usableFromInline override internal func contains(_ key: Key) -> Bool { return concrete.contains(key) } @inlinable - @usableFromInline override internal func decodeNil(forKey key: Key) throws -> Bool { return try concrete.decodeNil(forKey: key) } % for type in codable_types: @inlinable - @usableFromInline override internal func decode( _ type: ${type}.Type, forKey key: Key) throws -> ${type} { @@ -1736,7 +1689,6 @@ internal final class _KeyedDecodingContainerBox< % end @inlinable - @usableFromInline override internal func decode( _ type: T.Type, forKey key: Key) throws -> T { @@ -1745,7 +1697,6 @@ internal final class _KeyedDecodingContainerBox< % for type in codable_types: @inlinable - @usableFromInline override internal func decodeIfPresent( _ type: ${type}.Type, forKey key: Key) throws -> ${type}? { @@ -1754,7 +1705,6 @@ internal final class _KeyedDecodingContainerBox< % end @inlinable - @usableFromInline override internal func decodeIfPresent( _ type: T.Type, forKey key: Key) throws -> T? { @@ -1762,7 +1712,6 @@ internal final class _KeyedDecodingContainerBox< } @inlinable - @usableFromInline override internal func nestedContainer( keyedBy type: NestedKey.Type, forKey key: Key ) throws -> KeyedDecodingContainer { @@ -1770,7 +1719,6 @@ internal final class _KeyedDecodingContainerBox< } @inlinable - @usableFromInline override internal func nestedUnkeyedContainer( forKey key: Key) throws -> UnkeyedDecodingContainer { @@ -1778,13 +1726,11 @@ internal final class _KeyedDecodingContainerBox< } @inlinable - @usableFromInline override internal func superDecoder() throws -> Decoder { return try concrete.superDecoder() } @inlinable - @usableFromInline override internal func superDecoder(forKey key: Key) throws -> Decoder { return try concrete.superDecoder(forKey: key) } @@ -1978,14 +1924,12 @@ internal struct _DictionaryCodingKey : CodingKey { internal let intValue: Int? @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init?(stringValue: String) { self.stringValue = stringValue self.intValue = Int(stringValue) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init?(intValue: Int) { self.stringValue = "\(intValue)" self.intValue = intValue diff --git a/stdlib/public/core/Collection.swift b/stdlib/public/core/Collection.swift index 33768f8170852..dcb73eff46cd2 100644 --- a/stdlib/public/core/Collection.swift +++ b/stdlib/public/core/Collection.swift @@ -1005,7 +1005,6 @@ extension Collection { /// Do not use this method directly; call advanced(by: n) instead. @inlinable - @usableFromInline @inline(__always) internal func _advanceForward(_ i: Index, by n: Int) -> Index { _precondition(n >= 0, @@ -1020,7 +1019,6 @@ extension Collection { /// Do not use this method directly; call advanced(by: n, limit) instead. @inlinable - @usableFromInline @inline(__always) internal func _advanceForward( _ i: Index, by n: Int, limitedBy limit: Index diff --git a/stdlib/public/core/ContiguousArrayBuffer.swift b/stdlib/public/core/ContiguousArrayBuffer.swift index f71bce949fb63..659a54ed2b279 100644 --- a/stdlib/public/core/ContiguousArrayBuffer.swift +++ b/stdlib/public/core/ContiguousArrayBuffer.swift @@ -24,7 +24,6 @@ internal final class _EmptyArrayStorage : _ContiguousArrayStorageBase { @inlinable - @usableFromInline @nonobjc internal init(_doNotCallMe: ()) { _sanityCheckFailure("creating instance of _EmptyArrayStorage") @@ -32,7 +31,6 @@ internal final class _EmptyArrayStorage #if _runtime(_ObjC) @inlinable - @usableFromInline override internal func _withVerbatimBridgedUnsafeBuffer( _ body: (UnsafeBufferPointer) throws -> R ) rethrows -> R? { @@ -40,14 +38,12 @@ internal final class _EmptyArrayStorage } @inlinable - @usableFromInline @nonobjc override internal func _getNonVerbatimBridgedCount() -> Int { return 0 } @inlinable - @usableFromInline override internal func _getNonVerbatimBridgedHeapBuffer() -> _HeapBuffer { return _HeapBuffer( _HeapBufferStorage.self, 0, 0) @@ -55,14 +51,12 @@ internal final class _EmptyArrayStorage #endif @inlinable - @usableFromInline override internal func canStoreElements(ofDynamicType _: Any.Type) -> Bool { return false } /// A type that every element in the array is. @inlinable - @usableFromInline override internal var staticElementType: Any.Type { return Void.self } @@ -71,7 +65,6 @@ internal final class _EmptyArrayStorage /// The empty array prototype. We use the same object for all empty /// `[Native]Array`s. @inlinable -@usableFromInline internal var _emptyArrayStorage : _EmptyArrayStorage { return Builtin.bridgeFromRawPointer( Builtin.addressof(&_swiftEmptyArrayStorage)) @@ -85,7 +78,6 @@ internal final class _ContiguousArrayStorage< > : _ContiguousArrayStorageBase { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) deinit { _elementPointer.deinitialize(count: countAndCapacity.count) _fixLifetime(self) @@ -96,7 +88,6 @@ internal final class _ContiguousArrayStorage< /// `UnsafeBufferPointer` to the elements and return the result. /// Otherwise, return `nil`. @inlinable - @usableFromInline internal final override func _withVerbatimBridgedUnsafeBuffer( _ body: (UnsafeBufferPointer) throws -> R ) rethrows -> R? { @@ -110,7 +101,6 @@ internal final class _ContiguousArrayStorage< /// If `Element` is bridged verbatim, invoke `body` on an /// `UnsafeBufferPointer` to the elements. @inlinable - @usableFromInline internal final func _withVerbatimBridgedUnsafeBufferImpl( _ body: (UnsafeBufferPointer) throws -> Void ) rethrows { @@ -127,7 +117,6 @@ internal final class _ContiguousArrayStorage< /// /// - Precondition: `Element` is bridged non-verbatim. @inlinable - @usableFromInline @nonobjc override internal func _getNonVerbatimBridgedCount() -> Int { _sanityCheck( @@ -140,7 +129,6 @@ internal final class _ContiguousArrayStorage< /// /// - Precondition: `Element` is bridged non-verbatim. @inlinable - @usableFromInline override internal func _getNonVerbatimBridgedHeapBuffer() -> _HeapBuffer { _sanityCheck( @@ -164,7 +152,6 @@ internal final class _ContiguousArrayStorage< /// safety; for example, the destructor has static knowledge that /// all of the elements can be destroyed as `Element`. @inlinable - @usableFromInline internal override func canStoreElements( ofDynamicType proposedElementType: Any.Type ) -> Bool { @@ -179,13 +166,11 @@ internal final class _ContiguousArrayStorage< /// A type that every element in the array is. @inlinable - @usableFromInline internal override var staticElementType: Any.Type { return Element.self } @inlinable - @usableFromInline internal final var _elementPointer : UnsafeMutablePointer { return UnsafeMutablePointer(Builtin.projectTailElems(self, Element.self)) } @@ -200,7 +185,6 @@ internal struct _ContiguousArrayBuffer : _ArrayBufferProtocol { /// result's `.firstElementAddress` or set the result's `.count` /// to zero. @inlinable - @usableFromInline internal init( _uninitializedCount uninitializedCount: Int, minimumCapacity: Int @@ -232,7 +216,6 @@ internal struct _ContiguousArrayBuffer : _ArrayBufferProtocol { /// - Warning: storage may have been stack-allocated, so it's /// crucial not to call, e.g., `malloc_size` on it. @inlinable - @usableFromInline internal init(count: Int, storage: _ContiguousArrayStorage) { _storage = storage @@ -240,7 +223,6 @@ internal struct _ContiguousArrayBuffer : _ArrayBufferProtocol { } @inlinable - @usableFromInline internal init(_ storage: _ContiguousArrayStorageBase) { _storage = storage } @@ -249,7 +231,6 @@ internal struct _ContiguousArrayBuffer : _ArrayBufferProtocol { /// /// - Warning: does not initialize elements @inlinable - @usableFromInline internal func _initStorageHeader(count: Int, capacity: Int) { #if _runtime(_ObjC) let verbatim = _isBridgedVerbatimToObjectiveC(Element.self) @@ -267,21 +248,18 @@ internal struct _ContiguousArrayBuffer : _ArrayBufferProtocol { /// True, if the array is native and does not need a deferred type check. @inlinable - @usableFromInline internal var arrayPropertyIsNativeTypeChecked: Bool { return true } /// A pointer to the first element. @inlinable - @usableFromInline internal var firstElementAddress: UnsafeMutablePointer { return UnsafeMutablePointer(Builtin.projectTailElems(_storage, Element.self)) } @inlinable - @usableFromInline internal var firstElementAddressIfContiguous: UnsafeMutablePointer? { return firstElementAddress } @@ -289,7 +267,6 @@ internal struct _ContiguousArrayBuffer : _ArrayBufferProtocol { /// Call `body(p)`, where `p` is an `UnsafeBufferPointer` over the /// underlying contiguous storage. @inlinable - @usableFromInline internal func withUnsafeBufferPointer( _ body: (UnsafeBufferPointer) throws -> R ) rethrows -> R { @@ -301,7 +278,6 @@ internal struct _ContiguousArrayBuffer : _ArrayBufferProtocol { /// Call `body(p)`, where `p` is an `UnsafeMutableBufferPointer` /// over the underlying contiguous storage. @inlinable - @usableFromInline internal mutating func withUnsafeMutableBufferPointer( _ body: (UnsafeMutableBufferPointer) throws -> R ) rethrows -> R { @@ -313,20 +289,17 @@ internal struct _ContiguousArrayBuffer : _ArrayBufferProtocol { //===--- _ArrayBufferProtocol conformance -----------------------------------===// /// Create an empty buffer. @inlinable - @usableFromInline internal init() { _storage = _emptyArrayStorage } @inlinable - @usableFromInline internal init(_buffer buffer: _ContiguousArrayBuffer, shiftedToStartIndex: Int) { _sanityCheck(shiftedToStartIndex == 0, "shiftedToStartIndex must be 0") self = buffer } @inlinable - @usableFromInline internal mutating func requestUniqueMutableBackingBuffer( minimumCapacity: Int ) -> _ContiguousArrayBuffer? { @@ -337,13 +310,11 @@ internal struct _ContiguousArrayBuffer : _ArrayBufferProtocol { } @inlinable - @usableFromInline internal mutating func isMutableAndUniquelyReferenced() -> Bool { return isUniquelyReferenced() } @inlinable - @usableFromInline internal mutating func isMutableAndUniquelyReferencedOrPinned() -> Bool { return isUniquelyReferencedOrPinned() } @@ -352,13 +323,11 @@ internal struct _ContiguousArrayBuffer : _ArrayBufferProtocol { /// containing the same number of elements as `self`, return it. /// Otherwise, return `nil`. @inlinable - @usableFromInline internal func requestNativeBuffer() -> _ContiguousArrayBuffer? { return self } @inlinable - @usableFromInline @inline(__always) internal func getElement(_ i: Int) -> Element { _sanityCheck(i >= 0 && i < count, "Array index out of range") @@ -367,7 +336,6 @@ internal struct _ContiguousArrayBuffer : _ArrayBufferProtocol { /// Get or set the value of the ith element. @inlinable - @usableFromInline internal subscript(i: Int) -> Element { @inline(__always) get { @@ -389,7 +357,6 @@ internal struct _ContiguousArrayBuffer : _ArrayBufferProtocol { /// The number of elements the buffer stores. @inlinable - @usableFromInline internal var count: Int { get { return _storage.countAndCapacity.count @@ -408,7 +375,6 @@ internal struct _ContiguousArrayBuffer : _ArrayBufferProtocol { /// Traps unless the given `index` is valid for subscripting, i.e. /// `0 ≤ index < count`. @inlinable - @usableFromInline @inline(__always) internal func _checkValidSubscript(_ index : Int) { _precondition( @@ -419,7 +385,6 @@ internal struct _ContiguousArrayBuffer : _ArrayBufferProtocol { /// The number of elements the buffer can store without reallocation. @inlinable - @usableFromInline internal var capacity: Int { return _storage.countAndCapacity.capacity } @@ -428,7 +393,6 @@ internal struct _ContiguousArrayBuffer : _ArrayBufferProtocol { /// memory starting at `target`. Return a pointer "past the end" of the /// just-initialized memory. @inlinable - @usableFromInline @discardableResult internal func _copyContents( subRange bounds: Range, @@ -448,7 +412,6 @@ internal struct _ContiguousArrayBuffer : _ArrayBufferProtocol { /// Returns a `_SliceBuffer` containing the given `bounds` of values /// from this buffer. @inlinable - @usableFromInline internal subscript(bounds: Range) -> _SliceBuffer { get { return _SliceBuffer( @@ -468,7 +431,6 @@ internal struct _ContiguousArrayBuffer : _ArrayBufferProtocol { /// may need to be considered, such as whether the buffer could be /// some immutable Cocoa container. @inlinable - @usableFromInline internal mutating func isUniquelyReferenced() -> Bool { return _isUnique(&_storage) } @@ -477,7 +439,6 @@ internal struct _ContiguousArrayBuffer : _ArrayBufferProtocol { /// uniquely-referenced or pinned. NOTE: this does not mean /// the buffer is mutable; see the comment on isUniquelyReferenced. @inlinable - @usableFromInline internal mutating func isUniquelyReferencedOrPinned() -> Bool { return _isUniqueOrPinned(&_storage) } @@ -489,7 +450,6 @@ internal struct _ContiguousArrayBuffer : _ArrayBufferProtocol { /// /// - Complexity: O(1). @inlinable - @usableFromInline internal func _asCocoaArray() -> _NSArrayCore { if count == 0 { return _emptyArrayStorage @@ -503,14 +463,12 @@ internal struct _ContiguousArrayBuffer : _ArrayBufferProtocol { /// An object that keeps the elements stored in this buffer alive. @inlinable - @usableFromInline internal var owner: AnyObject { return _storage } /// An object that keeps the elements stored in this buffer alive. @inlinable - @usableFromInline internal var nativeOwner: AnyObject { return _storage } @@ -520,7 +478,6 @@ internal struct _ContiguousArrayBuffer : _ArrayBufferProtocol { /// Two buffers address the same elements when they have the same /// identity and count. @inlinable - @usableFromInline internal var identity: UnsafeRawPointer { return UnsafeRawPointer(firstElementAddress) } @@ -528,7 +485,6 @@ internal struct _ContiguousArrayBuffer : _ArrayBufferProtocol { /// Returns `true` iff we have storage for elements of the given /// `proposedElementType`. If not, we'll be treated as immutable. @inlinable - @usableFromInline func canStoreElements(ofDynamicType proposedElementType: Any.Type) -> Bool { return _storage.canStoreElements(ofDynamicType: proposedElementType) } @@ -539,7 +495,6 @@ internal struct _ContiguousArrayBuffer : _ArrayBufferProtocol { /// /// - Complexity: O(*n*) @inlinable - @usableFromInline internal func storesOnlyElementsOfType( _: U.Type ) -> Bool { @@ -565,7 +520,6 @@ internal struct _ContiguousArrayBuffer : _ArrayBufferProtocol { /// Append the elements of `rhs` to `lhs`. @inlinable -@usableFromInline internal func += ( lhs: inout _ContiguousArrayBuffer, rhs: C ) where C.Element == Element { @@ -603,7 +557,6 @@ extension _ContiguousArrayBuffer : RandomAccessCollection { /// /// In an empty collection, `startIndex == endIndex`. @inlinable - @usableFromInline internal var startIndex: Int { return 0 } @@ -613,7 +566,6 @@ extension _ContiguousArrayBuffer : RandomAccessCollection { /// reachable from `startIndex` by zero or more applications of /// `index(after:)`. @inlinable - @usableFromInline internal var endIndex: Int { return count } @@ -629,7 +581,6 @@ extension Sequence { } @inlinable -@usableFromInline internal func _copySequenceToContiguousArray< S : Sequence >(_ source: S) -> ContiguousArray { @@ -664,7 +615,6 @@ extension Collection { extension _ContiguousArrayBuffer { @inlinable - @usableFromInline internal func _copyToContiguousArray() -> ContiguousArray { return ContiguousArray(_buffer: self) } @@ -679,7 +629,6 @@ extension _ContiguousArrayBuffer { /// makes assigning ranges very slow. Once this has been implemented, this code /// should be changed to use _UnsafePartiallyInitializedContiguousArrayBuffer. @inlinable -@usableFromInline internal func _copyCollectionToContiguousArray< C : Collection >(_ source: C) -> ContiguousArray @@ -723,7 +672,6 @@ internal struct _UnsafePartiallyInitializedContiguousArrayBuffer { /// Initialize the buffer with an initial size of `initialCapacity` /// elements. @inlinable // FIXME(sil-serialize-all) - @usableFromInline @inline(__always) // For performance reasons. internal init(initialCapacity: Int) { if initialCapacity == 0 { @@ -740,7 +688,6 @@ internal struct _UnsafePartiallyInitializedContiguousArrayBuffer { /// Add an element to the buffer, reallocating if necessary. @inlinable // FIXME(sil-serialize-all) - @usableFromInline @inline(__always) // For performance reasons. internal mutating func add(_ element: Element) { if remainingCapacity == 0 { @@ -764,7 +711,6 @@ internal struct _UnsafePartiallyInitializedContiguousArrayBuffer { /// Add an element to the buffer, which must have remaining capacity. @inlinable // FIXME(sil-serialize-all) - @usableFromInline @inline(__always) // For performance reasons. internal mutating func addWithExistingCapacity(_ element: Element) { _sanityCheck(remainingCapacity > 0, @@ -781,7 +727,6 @@ internal struct _UnsafePartiallyInitializedContiguousArrayBuffer { /// Returns the fully-initialized buffer. `self` is reset to contain an /// empty buffer and cannot be used afterward. @inlinable // FIXME(sil-serialize-all) - @usableFromInline @inline(__always) // For performance reasons. internal mutating func finish() -> ContiguousArray { // Adjust the initialized count of the buffer. @@ -797,7 +742,6 @@ internal struct _UnsafePartiallyInitializedContiguousArrayBuffer { /// Returns the fully-initialized buffer. `self` is reset to contain an /// empty buffer and cannot be used afterward. @inlinable // FIXME(sil-serialize-all) - @usableFromInline @inline(__always) // For performance reasons. internal mutating func finishWithOriginalCount() -> ContiguousArray { _sanityCheck(remainingCapacity == result.capacity - result.count, diff --git a/stdlib/public/core/DebuggerSupport.swift b/stdlib/public/core/DebuggerSupport.swift index 0a6246aaddae5..633117023c086 100644 --- a/stdlib/public/core/DebuggerSupport.swift +++ b/stdlib/public/core/DebuggerSupport.swift @@ -23,13 +23,11 @@ public enum _DebuggerSupport { case ElementOfPair @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var isCollection: Bool { return self != .NotACollection } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func getChildStatus(child: Mirror) -> CollectionStatus { let disposition = child.displayStyle ?? .struct @@ -46,7 +44,6 @@ public enum _DebuggerSupport { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static func isClass(_ value: Any) -> Bool { if let _ = type(of: value) as? AnyClass { return true @@ -55,7 +52,6 @@ public enum _DebuggerSupport { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static func checkValue( _ value: Any, ifClass: (AnyObject) -> T, @@ -68,7 +64,6 @@ public enum _DebuggerSupport { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static func asObjectIdentifier(_ value: Any) -> ObjectIdentifier? { return checkValue(value, ifClass: { return ObjectIdentifier($0) }, @@ -76,7 +71,6 @@ public enum _DebuggerSupport { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static func asNumericValue(_ value: Any) -> Int { return checkValue(value, ifClass: { return unsafeBitCast($0, to: Int.self) }, @@ -84,7 +78,6 @@ public enum _DebuggerSupport { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static func asStringRepresentation( value: Any?, mirror: Mirror, @@ -149,7 +142,6 @@ public enum _DebuggerSupport { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static func ivarCount(mirror: Mirror) -> Int { let count = Int(mirror.children.count) if let sc = mirror.superclassMirror { @@ -161,7 +153,6 @@ public enum _DebuggerSupport { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static func shouldExpand( mirror: Mirror, collectionStatus: CollectionStatus, @@ -183,7 +174,6 @@ public enum _DebuggerSupport { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static func printForDebuggerImpl( value: Any?, mirror: Mirror, diff --git a/stdlib/public/core/Dictionary.swift b/stdlib/public/core/Dictionary.swift index 342463782feac..98be4e3f28b59 100644 --- a/stdlib/public/core/Dictionary.swift +++ b/stdlib/public/core/Dictionary.swift @@ -524,14 +524,12 @@ public struct Dictionary { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_nativeBuffer: _NativeDictionaryBuffer) { _variantBuffer = .native(_nativeBuffer) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_variantBuffer: _VariantBuffer) { self._variantBuffer = _variantBuffer } @@ -1211,7 +1209,6 @@ extension Dictionary { internal var _variantBuffer: Dictionary._VariantBuffer @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_ _dictionary: Dictionary) { self._variantBuffer = _dictionary._variantBuffer } @@ -1310,7 +1307,6 @@ extension Dictionary { internal var _variantBuffer: Dictionary._VariantBuffer @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_ _dictionary: Dictionary) { self._variantBuffer = _dictionary._variantBuffer } @@ -1467,7 +1463,6 @@ extension Dictionary: Hashable where Value: Hashable { extension Dictionary: CustomStringConvertible, CustomDebugStringConvertible { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func _makeDescription() -> String { if count == 0 { return "[:]" @@ -1513,7 +1508,6 @@ internal enum _MergeError: Error { /// Equivalent to `NSDictionary.allKeys`, but does not leave objects on the /// autorelease pool. @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) internal func _stdlib_NSDictionary_allKeys(_ nsd: _NSDictionary) -> _HeapBuffer { let count = nsd.count @@ -1809,7 +1803,6 @@ internal class _RawNativeDictionaryStorage // This API is unsafe and needs a `_fixLifetime` in the caller. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @nonobjc internal final var _initializedHashtableEntriesBitMapBuffer: UnsafeMutablePointer { @@ -1820,7 +1813,6 @@ internal class _RawNativeDictionaryStorage /// created without any elements. The contents of the storage should never /// be mutated. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @nonobjc internal static var empty: RawStorage { return Builtin.bridgeFromRawPointer( @@ -1830,7 +1822,6 @@ internal class _RawNativeDictionaryStorage // This type is made with allocWithTailElems, so no init is ever called. // But we still need to have an init to satisfy the compiler. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @nonobjc internal init(_doNotCallMe: ()) { _sanityCheckFailure("Only create this by using the `empty` singleton") @@ -1845,7 +1836,6 @@ internal class _RawNativeDictionaryStorage /// _HashableTypedNativeDictionaryStorage overloads this to give /// _NativeSelfNSEnumerator proper type parameters. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @objc internal func enumerator() -> _NSEnumerator { return _NativeDictionaryNSEnumerator( @@ -1853,14 +1843,12 @@ internal class _RawNativeDictionaryStorage } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @objc(copyWithZone:) internal func copy(with zone: _SwiftNSZone?) -> AnyObject { return self } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @objc(countByEnumeratingWithState:objects:count:) internal func countByEnumerating( with state: UnsafeMutablePointer<_SwiftNSFastEnumerationState>, @@ -1881,7 +1869,6 @@ internal class _RawNativeDictionaryStorage } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @objc internal required init( objects: UnsafePointer, @@ -1892,20 +1879,17 @@ internal class _RawNativeDictionaryStorage } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @objc(objectForKey:) internal func objectFor(_ aKey: AnyObject) -> AnyObject? { return nil } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func keyEnumerator() -> _NSEnumerator { return enumerator() } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func getObjects(_ objects: UnsafeMutablePointer?, andKeys keys: UnsafeMutablePointer?) { // Do nothing, we're empty @@ -1944,7 +1928,6 @@ internal class _TypedNativeDictionaryStorage // This type is made with allocWithTailElems, so no init is ever called. // But we still need to have an init to satisfy the compiler. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @nonobjc override internal init(_doNotCallMe: ()) { _sanityCheckFailure("Only create this by calling Buffer's inits") @@ -1952,7 +1935,6 @@ internal class _TypedNativeDictionaryStorage #if _runtime(_ObjC) @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @objc internal required init( objects: UnsafePointer, @@ -1976,7 +1958,6 @@ final internal class _HashableTypedNativeDictionaryStorage // This type is made with allocWithTailElems, so no init is ever called. // But we still need to have an init to satisfy the compiler. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @nonobjc override internal init(_doNotCallMe: ()) { _sanityCheckFailure("Only create this by calling Buffer's inits'") @@ -1989,26 +1970,22 @@ final internal class _HashableTypedNativeDictionaryStorage // just wrappers around a RawNativeDictionaryStorage. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var buffer: Buffer { return Buffer(_storage: self) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var full: FullContainer { return FullContainer(_nativeBuffer: buffer) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal override func enumerator() -> _NSEnumerator { return _NativeDictionaryNSEnumerator( Buffer(_storage: self)) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @objc(countByEnumeratingWithState:objects:count:) internal override func countByEnumerating( with state: UnsafeMutablePointer<_SwiftNSFastEnumerationState>, @@ -2050,7 +2027,6 @@ final internal class _HashableTypedNativeDictionaryStorage } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @nonobjc internal func getObjectFor(_ aKey: AnyObject) -> AnyObject? { guard let nativeKey = _conditionallyBridgeFromObjectiveC(aKey, Key.self) @@ -2066,7 +2042,6 @@ final internal class _HashableTypedNativeDictionaryStorage } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @objc internal required init( objects: UnsafePointer, @@ -2077,7 +2052,6 @@ final internal class _HashableTypedNativeDictionaryStorage } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @objc(objectForKey:) override func objectFor(_ aKey: AnyObject) -> AnyObject? { return getObjectFor(aKey) @@ -2085,7 +2059,6 @@ final internal class _HashableTypedNativeDictionaryStorage // We also override the following methods for efficiency. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @objc override func getObjects(_ objects: UnsafeMutablePointer?, andKeys keys: UnsafeMutablePointer?) { @@ -2143,7 +2116,6 @@ internal struct _NativeDictionaryBuffer { /// Creates a Buffer with a storage that is typed, but doesn't understand /// Hashing. Mostly for bridging; prefer `init(minimumCapacity:)`. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_exactBucketCount bucketCount: Int, unhashable: ()) { let bitmapWordCount = _UnsafeBitMap.sizeInWords(forSizeInBits: bucketCount) let storage = Builtin.allocWithTailElems_3(TypedStorage.self, @@ -2156,7 +2128,6 @@ internal struct _NativeDictionaryBuffer { /// Given a bucket count and uninitialized RawStorage, completes the /// initialization and returns a Buffer. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_exactBucketCount bucketCount: Int, storage: RawStorage) { storage.bucketCount = bucketCount storage.count = 0 @@ -2198,13 +2169,11 @@ internal struct _NativeDictionaryBuffer { // Forwarding the individual fields of the storage in various forms @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal var bucketCount: Int { return _assumeNonNegative(_storage.bucketCount) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal var count: Int { set { _storage.count = newValue @@ -2215,7 +2184,6 @@ internal struct _NativeDictionaryBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var _initializedHashtableEntriesBitMapBuffer: UnsafeMutablePointer { return _storage._initializedHashtableEntriesBitMapBuffer @@ -2223,28 +2191,24 @@ internal struct _NativeDictionaryBuffer { // This API is unsafe and needs a `_fixLifetime` in the caller. @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal var keys: UnsafeMutablePointer { return _storage.keys.assumingMemoryBound(to: Key.self) } // This API is unsafe and needs a `_fixLifetime` in the caller. @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal var values: UnsafeMutablePointer { return _storage.values.assumingMemoryBound(to: Value.self) } /// Constructs a buffer adopting the given storage. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_storage: RawStorage) { self._storage = _storage } /// Constructs an instance from the empty singleton. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init() { self._storage = RawStorage.empty } @@ -2253,7 +2217,6 @@ internal struct _NativeDictionaryBuffer { // but only the parts that don't actually rely on hashing. @inlinable // FIXME(sil-serialize-all) - @usableFromInline @inline(__always) internal func key(at i: Int) -> Key { _sanityCheck(i >= 0 && i < bucketCount) @@ -2269,7 +2232,6 @@ internal struct _NativeDictionaryBuffer { /// /// Intended for use with verbatim bridgeable keys. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func bridgedKey(at index: Index) -> AnyObject { let k = key(at: index.offset) return _bridgeAnythingToObjectiveC(k) @@ -2279,7 +2241,6 @@ internal struct _NativeDictionaryBuffer { /// /// Intended for use with verbatim bridgeable keys. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func bridgedValue(at index: Index) -> AnyObject { let v = value(at: index.offset) return _bridgeAnythingToObjectiveC(v) @@ -2287,7 +2248,6 @@ internal struct _NativeDictionaryBuffer { #endif @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal func isInitializedEntry(at i: Int) -> Bool { _sanityCheck(i >= 0 && i < bucketCount) defer { _fixLifetime(self) } @@ -2296,7 +2256,6 @@ internal struct _NativeDictionaryBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @_transparent internal func destroyEntry(at i: Int) { _sanityCheck(isInitializedEntry(at: i)) @@ -2308,7 +2267,6 @@ internal struct _NativeDictionaryBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @_transparent internal func initializeKey(_ k: Key, value v: Value, at i: Int) { _sanityCheck(!isInitializedEntry(at: i)) @@ -2320,7 +2278,6 @@ internal struct _NativeDictionaryBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @_transparent internal func moveInitializeEntry(from: Buffer, at: Int, toEntryAt: Int) { _sanityCheck(!isInitializedEntry(at: toEntryAt)) @@ -2333,7 +2290,6 @@ internal struct _NativeDictionaryBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline @_transparent internal func value(at i: Int) -> Value { _sanityCheck(isInitializedEntry(at: i)) @@ -2343,7 +2299,6 @@ internal struct _NativeDictionaryBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @_transparent internal func setKey(_ key: Key, value: Value, at i: Int) { _sanityCheck(isInitializedEntry(at: i)) @@ -2354,7 +2309,6 @@ internal struct _NativeDictionaryBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal var startIndex: Index { // We start at "index after -1" instead of "0" because we need to find the // first occupied slot. @@ -2362,13 +2316,11 @@ internal struct _NativeDictionaryBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal var endIndex: Index { return Index(offset: bucketCount) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal func index(after i: Index) -> Index { _precondition(i != endIndex) var idx = i.offset + 1 @@ -2380,13 +2332,11 @@ internal struct _NativeDictionaryBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal func formIndex(after i: inout Index) { i = index(after: i) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func assertingGet(_ i: Index) -> SequenceElement { _precondition(i.offset >= 0 && i.offset < bucketCount) _precondition( @@ -2405,7 +2355,6 @@ extension _NativeDictionaryBuffer where Key: Hashable internal typealias SequenceElement = (key: Key, value: Value) @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @inline(__always) internal init(minimumCapacity: Int) { let bucketCount = _NativeDictionaryBuffer.bucketCount( @@ -2415,7 +2364,6 @@ extension _NativeDictionaryBuffer where Key: Hashable } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @inline(__always) internal init(bucketCount: Int) { // Actual bucket count is the next power of 2 greater than or equal to @@ -2428,7 +2376,6 @@ extension _NativeDictionaryBuffer where Key: Hashable /// Create a buffer instance with room for at least 'bucketCount' entries, /// marking all entries invalid. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_exactBucketCount bucketCount: Int) { let bitmapWordCount = _UnsafeBitMap.sizeInWords(forSizeInBits: bucketCount) let storage = Builtin.allocWithTailElems_3(HashTypedStorage.self, @@ -2440,7 +2387,6 @@ extension _NativeDictionaryBuffer where Key: Hashable #if _runtime(_ObjC) @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func bridged() -> _NSDictionary { // We can zero-cost bridge if our keys are verbatim // or if we're the empty singleton. @@ -2465,7 +2411,6 @@ extension _NativeDictionaryBuffer where Key: Hashable /// A textual representation of `self`. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var description: String { var result = "" #if INTERNAL_CHECKS_ENABLED @@ -2482,7 +2427,6 @@ extension _NativeDictionaryBuffer where Key: Hashable } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var _bucketMask: Int { // The bucket count is not negative, therefore subtracting 1 will not // overflow. @@ -2490,7 +2434,6 @@ extension _NativeDictionaryBuffer where Key: Hashable } @inlinable // FIXME(sil-serialize-all) - @usableFromInline @inline(__always) // For performance reasons. internal func _bucket(_ k: Key) -> Int { var hasher = _Hasher(seed: _storage.seed) @@ -2499,14 +2442,12 @@ extension _NativeDictionaryBuffer where Key: Hashable } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal func _index(after bucket: Int) -> Int { // Bucket is within 0 and bucketCount. Therefore adding 1 does not overflow. return (bucket &+ 1) & _bucketMask } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func _prev(_ bucket: Int) -> Int { // Bucket is not negative. Therefore subtracting 1 does not overflow. return (bucket &- 1) & _bucketMask @@ -2517,7 +2458,6 @@ extension _NativeDictionaryBuffer where Key: Hashable /// If the key is not present, returns the position where it could be /// inserted. @inlinable // FIXME(sil-serialize-all) - @usableFromInline @inline(__always) internal func _find(_ key: Key, startBucket: Int) -> (pos: Index, found: Bool) { @@ -2539,7 +2479,6 @@ extension _NativeDictionaryBuffer where Key: Hashable } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @_transparent internal static func bucketCount( forCapacity capacity: Int, @@ -2554,7 +2493,6 @@ extension _NativeDictionaryBuffer where Key: Hashable /// The `key` should not be present in the Dictionary. /// This function does *not* update `count`. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func unsafeAddNew(key newKey: Key, value: Value) { let (i, found) = _find(newKey, startBucket: _bucket(newKey)) _precondition( @@ -2567,7 +2505,6 @@ extension _NativeDictionaryBuffer where Key: Hashable // @inlinable // FIXME(sil-serialize-all) - @usableFromInline @inline(__always) internal func index(forKey key: Key) -> Index? { if count == 0 { @@ -2579,7 +2516,6 @@ extension _NativeDictionaryBuffer where Key: Hashable } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func assertingGet(_ key: Key) -> Value { let (i, found) = _find(key, startBucket: _bucket(key)) _precondition(found, "Key not found") @@ -2587,7 +2523,6 @@ extension _NativeDictionaryBuffer where Key: Hashable } @inlinable // FIXME(sil-serialize-all) - @usableFromInline @inline(__always) internal func maybeGet(_ key: Key) -> Value? { if count == 0 { @@ -2603,7 +2538,6 @@ extension _NativeDictionaryBuffer where Key: Hashable } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @discardableResult internal func updateValue(_ value: Value, forKey key: Key) -> Value? { _sanityCheckFailure( @@ -2611,7 +2545,6 @@ extension _NativeDictionaryBuffer where Key: Hashable } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @discardableResult internal func insert( _ value: Value, forKey key: Key @@ -2621,7 +2554,6 @@ extension _NativeDictionaryBuffer where Key: Hashable } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @discardableResult internal func remove(at index: Index) -> SequenceElement { _sanityCheckFailure( @@ -2629,7 +2561,6 @@ extension _NativeDictionaryBuffer where Key: Hashable } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @discardableResult internal func removeValue(forKey key: Key) -> Value? { _sanityCheckFailure( @@ -2637,14 +2568,12 @@ extension _NativeDictionaryBuffer where Key: Hashable } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func removeAll(keepingCapacity keepCapacity: Bool) { _sanityCheckFailure( "don't call mutating methods on _NativeDictionaryBuffer") } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal static func fromArray(_ elements: [SequenceElementWithoutLabels]) -> Buffer { @@ -2678,13 +2607,11 @@ final internal class _NativeDictionaryNSEnumerator internal typealias Index = _NativeDictionaryIndex @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal override required init() { _sanityCheckFailure("don't call this designated initializer") } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_ buffer: Buffer) { self.buffer = buffer nextIndex = buffer.startIndex @@ -2705,7 +2632,6 @@ final internal class _NativeDictionaryNSEnumerator // @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @objc internal func nextObject() -> AnyObject? { if nextIndex == endIndex { @@ -2717,7 +2643,6 @@ final internal class _NativeDictionaryNSEnumerator } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @objc(countByEnumeratingWithState:objects:count:) internal func countByEnumerating( with state: UnsafeMutablePointer<_SwiftNSFastEnumerationState>, @@ -2766,7 +2691,6 @@ final internal class _SwiftDeferredNSDictionary internal typealias BridgedIndex = _NativeDictionaryIndex @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @nonobjc internal init(bucketCount: Int = 2) { nativeBuffer = NativeBuffer(bucketCount: bucketCount) @@ -2774,7 +2698,6 @@ final internal class _SwiftDeferredNSDictionary } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(nativeBuffer: NativeBuffer) { self.nativeBuffer = nativeBuffer super.init() @@ -2793,7 +2716,6 @@ final internal class _SwiftDeferredNSDictionary internal var nativeBuffer: NativeBuffer @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @objc(copyWithZone:) internal func copy(with zone: _SwiftNSZone?) -> AnyObject { // Instances of this class should be visible outside of standard library as @@ -2809,7 +2731,6 @@ final internal class _SwiftDeferredNSDictionary // @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @objc internal required init( objects: UnsafePointer, @@ -2820,21 +2741,18 @@ final internal class _SwiftDeferredNSDictionary } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @objc(objectForKey:) internal func objectFor(_ aKey: AnyObject) -> AnyObject? { return bridgingObjectForKey(aKey) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @objc internal func keyEnumerator() -> _NSEnumerator { return enumerator() } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @objc internal func getObjects( _ objects: UnsafeMutablePointer?, @@ -2844,7 +2762,6 @@ final internal class _SwiftDeferredNSDictionary } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @objc(enumerateKeysAndObjectsWithOptions:usingBlock:) internal func enumerateKeysAndObjects(options: Int, using block: @convention(block) (Unmanaged, Unmanaged, @@ -2865,7 +2782,6 @@ final internal class _SwiftDeferredNSDictionary /// Returns the pointer to the stored property, which contains bridged /// Dictionary elements. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @nonobjc internal var _heapStorageBridgedPtr: UnsafeMutablePointer { return _getUnsafePointerToStoredProperties(self).assumingMemoryBound( @@ -2874,7 +2790,6 @@ final internal class _SwiftDeferredNSDictionary /// The buffer for bridged Dictionary elements, if present. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @nonobjc internal var _bridgedStorage: BridgedBuffer.RawStorage? { get { @@ -2887,7 +2802,6 @@ final internal class _SwiftDeferredNSDictionary /// Attach a buffer for bridged Dictionary elements. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @nonobjc internal func _initializeHeapStorageBridged(_ newStorage: AnyObject) { _stdlib_atomicInitializeARCRef( @@ -2896,13 +2810,11 @@ final internal class _SwiftDeferredNSDictionary /// Returns the bridged Dictionary values. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var bridgedBuffer: BridgedBuffer { return BridgedBuffer(_storage: _bridgedStorage!) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @nonobjc internal func bridgeEverything() { if _fastPath(_bridgedStorage != nil) { @@ -2933,7 +2845,6 @@ final internal class _SwiftDeferredNSDictionary } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @nonobjc internal func bridgedAllKeysAndValues( _ objects: UnsafeMutablePointer?, @@ -2979,14 +2890,12 @@ final internal class _SwiftDeferredNSDictionary } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @objc internal var count: Int { return nativeBuffer.count } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @nonobjc internal func bridgingObjectForKey(_ aKey: AnyObject) -> AnyObject? { @@ -3003,7 +2912,6 @@ final internal class _SwiftDeferredNSDictionary } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @objc internal func enumerator() -> _NSEnumerator { bridgeEverything() @@ -3011,7 +2919,6 @@ final internal class _SwiftDeferredNSDictionary } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @objc(countByEnumeratingWithState:objects:count:) internal func countByEnumerating( with state: UnsafeMutablePointer<_SwiftNSFastEnumerationState>, @@ -3073,7 +2980,6 @@ internal struct _CocoaDictionaryBuffer: _HashBuffer { internal var cocoaDictionary: _NSDictionary @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(cocoaDictionary: _NSDictionary) { self.cocoaDictionary = cocoaDictionary } @@ -3086,32 +2992,27 @@ internal struct _CocoaDictionaryBuffer: _HashBuffer { internal typealias Value = AnyObject @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var startIndex: Index { return Index(cocoaDictionary, startIndex: ()) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var endIndex: Index { return Index(cocoaDictionary, endIndex: ()) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal func index(after i: Index) -> Index { return i.successor() } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func formIndex(after i: inout Index) { // FIXME: swift-3-indexing-model: optimize if possible. i = i.successor() } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal func index(forKey key: Key) -> Index? { // Fast path that does not involve creating an array of all keys. In case // the key is present, this lookup is a penalty for the slow path, but the @@ -3135,7 +3036,6 @@ internal struct _CocoaDictionaryBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func assertingGet(_ i: Index) -> SequenceElement { let key: Key = i.allKeys[i.currentKeyIndex] let value: Value = i.cocoaDictionary.objectFor(key)! @@ -3144,7 +3044,6 @@ internal struct _CocoaDictionaryBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func assertingGet(_ key: Key) -> Value { let value: Value? = cocoaDictionary.objectFor(key) _precondition(value != nil, "Key not found in underlying NSDictionary") @@ -3152,7 +3051,6 @@ internal struct _CocoaDictionaryBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @inline(__always) internal func maybeGet(_ key: Key) -> Value? { @@ -3161,14 +3059,12 @@ internal struct _CocoaDictionaryBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @discardableResult internal mutating func updateValue(_ value: Value, forKey key: Key) -> Value? { _sanityCheckFailure("cannot mutate NSDictionary") } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @discardableResult internal mutating func insert( _ value: Value, forKey key: Key @@ -3177,33 +3073,28 @@ internal struct _CocoaDictionaryBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @discardableResult internal mutating func remove(at index: Index) -> SequenceElement { _sanityCheckFailure("cannot mutate NSDictionary") } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @discardableResult internal mutating func removeValue(forKey key: Key) -> Value? { _sanityCheckFailure("cannot mutate NSDictionary") } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func removeAll(keepingCapacity keepCapacity: Bool) { _sanityCheckFailure("cannot mutate NSDictionary") } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var count: Int { return cocoaDictionary.count } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static func fromArray(_ elements: [SequenceElementWithoutLabels]) -> _CocoaDictionaryBuffer { @@ -3231,14 +3122,12 @@ internal enum _VariantDictionaryBuffer: _HashBuffer { #endif @inlinable // FIXME(sil-serialize-all) - @usableFromInline @_transparent internal var guaranteedNative: Bool { return _canBeClass(Key.self) == 0 || _canBeClass(Value.self) == 0 } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func isUniquelyReferenced() -> Bool { // Note that &self drills down through .native(NativeBuffer) to the first // property in NativeBuffer, which is the reference to the storage. @@ -3259,7 +3148,6 @@ internal enum _VariantDictionaryBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal var asNative: NativeBuffer { get { switch self { @@ -3277,7 +3165,6 @@ internal enum _VariantDictionaryBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func ensureNativeBuffer() { #if _runtime(_ObjC) if _fastPath(guaranteedNative) { return } @@ -3289,7 +3176,6 @@ internal enum _VariantDictionaryBuffer: _HashBuffer { #if _runtime(_ObjC) @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var asCocoa: CocoaBuffer { switch self { case .native: @@ -3302,7 +3188,6 @@ internal enum _VariantDictionaryBuffer: _HashBuffer { /// Return true if self is native. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var _isNative: Bool { #if _runtime(_ObjC) switch self { @@ -3318,7 +3203,6 @@ internal enum _VariantDictionaryBuffer: _HashBuffer { @inline(__always) @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func ensureUniqueNativeBufferNative( withBucketCount desiredBucketCount: Int ) -> (reallocated: Bool, capacityChanged: Bool) { @@ -3353,7 +3237,6 @@ internal enum _VariantDictionaryBuffer: _HashBuffer { @inline(__always) @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func ensureUniqueNativeBuffer( withCapacity minimumCapacity: Int ) -> (reallocated: Bool, capacityChanged: Bool) { @@ -3366,7 +3249,6 @@ internal enum _VariantDictionaryBuffer: _HashBuffer { /// Ensure this we hold a unique reference to a native buffer /// having at least `minimumCapacity` elements. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func ensureUniqueNativeBuffer( withBucketCount desiredBucketCount: Int ) -> (reallocated: Bool, capacityChanged: Bool) { @@ -3412,7 +3294,6 @@ internal enum _VariantDictionaryBuffer: _HashBuffer { #if _runtime(_ObjC) @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @inline(never) internal mutating func migrateDataToNativeBuffer( _ cocoaBuffer: _CocoaDictionaryBuffer @@ -3426,7 +3307,6 @@ internal enum _VariantDictionaryBuffer: _HashBuffer { /// Reserves enough space for the specified number of elements to be stored /// without reallocating additional storage. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func reserveCapacity(_ capacity: Int) { _ = ensureUniqueNativeBuffer(withCapacity: capacity) } @@ -3439,7 +3319,6 @@ internal enum _VariantDictionaryBuffer: _HashBuffer { /// newly allocated storage. For native storage, this is the element count /// at which adding any more elements will exceed the load factor. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var capacity: Int { switch self { case .native: @@ -3459,7 +3338,6 @@ internal enum _VariantDictionaryBuffer: _HashBuffer { internal typealias Index = DictionaryIndex @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var startIndex: Index { if _fastPath(guaranteedNative) { return ._native(asNative.startIndex) @@ -3476,7 +3354,6 @@ internal enum _VariantDictionaryBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var endIndex: Index { if _fastPath(guaranteedNative) { return ._native(asNative.endIndex) @@ -3493,7 +3370,6 @@ internal enum _VariantDictionaryBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal func index(after i: Index) -> Index { if _fastPath(guaranteedNative) { return ._native(asNative.index(after: i._nativeIndex)) @@ -3510,14 +3386,12 @@ internal enum _VariantDictionaryBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func formIndex(after i: inout Index) { // FIXME: swift-3-indexing-model: optimize if possible. i = index(after: i) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline @inline(__always) internal func index(forKey key: Key) -> Index? { if _fastPath(guaranteedNative) { @@ -3545,7 +3419,6 @@ internal enum _VariantDictionaryBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func assertingGet(_ i: Index) -> SequenceElement { if _fastPath(guaranteedNative) { return asNative.assertingGet(i._nativeIndex) @@ -3566,7 +3439,6 @@ internal enum _VariantDictionaryBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func assertingGet(_ key: Key) -> Value { if _fastPath(guaranteedNative) { return asNative.assertingGet(key) @@ -3587,7 +3459,6 @@ internal enum _VariantDictionaryBuffer: _HashBuffer { #if _runtime(_ObjC) @inlinable // FIXME(sil-serialize-all) - @usableFromInline @inline(never) internal static func maybeGetFromCocoaBuffer( _ cocoaBuffer: CocoaBuffer, forKey key: Key @@ -3601,7 +3472,6 @@ internal enum _VariantDictionaryBuffer: _HashBuffer { #endif @inlinable // FIXME(sil-serialize-all) - @usableFromInline @inline(__always) internal func maybeGet(_ key: Key) -> Value? { if _fastPath(guaranteedNative) { @@ -3619,7 +3489,6 @@ internal enum _VariantDictionaryBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func nativeUpdateValue( _ value: Value, forKey key: Key ) -> Value? { @@ -3649,7 +3518,6 @@ internal enum _VariantDictionaryBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @discardableResult internal mutating func updateValue( _ value: Value, forKey key: Key @@ -3671,7 +3539,6 @@ internal enum _VariantDictionaryBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func nativePointerToValue(at i: Index) -> UnsafeMutablePointer { // This is a performance optimization that was put in to ensure that we did @@ -3688,7 +3555,6 @@ internal enum _VariantDictionaryBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func pointerToValue(at i: Index) -> UnsafeMutablePointer { if _fastPath(guaranteedNative) { @@ -3716,7 +3582,6 @@ internal enum _VariantDictionaryBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func nativePointerToValue( forKey key: Key, insertingDefault defaultValue: () -> Value ) -> (inserted: Bool, pointer: UnsafeMutablePointer) { @@ -3741,7 +3606,6 @@ internal enum _VariantDictionaryBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func pointerToValue( forKey key: Key, insertingDefault defaultValue: () -> Value ) -> (inserted: Bool, pointer: UnsafeMutablePointer) { @@ -3750,7 +3614,6 @@ internal enum _VariantDictionaryBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func nativeInsert( _ value: Value, forKey key: Key ) -> (inserted: Bool, memberAfterInsert: Value) { @@ -3775,7 +3638,6 @@ internal enum _VariantDictionaryBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @discardableResult internal mutating func insert( _ value: Value, forKey key: Key @@ -3785,7 +3647,6 @@ internal enum _VariantDictionaryBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func nativeMapValues( _ transform: (Value) throws -> T ) rethrows -> _VariantDictionaryBuffer { @@ -3807,7 +3668,6 @@ internal enum _VariantDictionaryBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func mapValues( _ transform: (Value) throws -> T ) rethrows -> _VariantDictionaryBuffer { @@ -3838,7 +3698,6 @@ internal enum _VariantDictionaryBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func nativeMerge( _ keysAndValues: S, uniquingKeysWith combine: (Value, Value) throws -> Value @@ -3878,7 +3737,6 @@ internal enum _VariantDictionaryBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func merge( _ keysAndValues: S, uniquingKeysWith combine: (Value, Value) throws -> Value @@ -3888,7 +3746,6 @@ internal enum _VariantDictionaryBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func nativeGroup( _ values: S, by keyForValue: (S.Element) throws -> Key @@ -3917,7 +3774,6 @@ internal enum _VariantDictionaryBuffer: _HashBuffer { /// - parameter offset: The offset of the element that will be deleted. /// Precondition: there should be an initialized entry at offset. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func nativeDelete( _ nativeBuffer: NativeBuffer, idealBucket: Int, offset: Int ) { @@ -3982,7 +3838,6 @@ internal enum _VariantDictionaryBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func nativeRemoveObject(forKey key: Key) -> Value? { var idealBucket = asNative._bucket(key) var (index, found) = asNative._find(key, startBucket: idealBucket) @@ -4017,7 +3872,6 @@ internal enum _VariantDictionaryBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func nativeRemove( at nativeIndex: NativeIndex ) -> SequenceElement { @@ -4044,7 +3898,6 @@ internal enum _VariantDictionaryBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @discardableResult internal mutating func remove(at index: Index) -> SequenceElement { if _fastPath(guaranteedNative) { @@ -4073,7 +3926,6 @@ internal enum _VariantDictionaryBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @discardableResult internal mutating func removeValue(forKey key: Key) -> Value? { if _fastPath(guaranteedNative) { @@ -4096,7 +3948,6 @@ internal enum _VariantDictionaryBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func nativeRemoveAll() { if !isUniquelyReferenced() { asNative = NativeBuffer(_exactBucketCount: asNative.bucketCount) @@ -4116,7 +3967,6 @@ internal enum _VariantDictionaryBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func removeAll(keepingCapacity keepCapacity: Bool) { if count == 0 { return @@ -4143,7 +3993,6 @@ internal enum _VariantDictionaryBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var count: Int { if _fastPath(guaranteedNative) { return asNative.count @@ -4163,7 +4012,6 @@ internal enum _VariantDictionaryBuffer: _HashBuffer { /// /// - Complexity: O(1). @inlinable // FIXME(sil-serialize-all) - @usableFromInline @inline(__always) internal func makeIterator() -> DictionaryIterator { switch self { @@ -4178,7 +4026,6 @@ internal enum _VariantDictionaryBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static func fromArray(_ elements: [SequenceElement]) -> _VariantDictionaryBuffer { @@ -4193,7 +4040,6 @@ internal struct _NativeDictionaryIndex: Comparable { internal var offset: Int @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal init(offset: Int) { self.offset = offset } @@ -4202,7 +4048,6 @@ internal struct _NativeDictionaryIndex: Comparable { extension _NativeDictionaryIndex { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static func < ( lhs: _NativeDictionaryIndex, rhs: _NativeDictionaryIndex @@ -4210,7 +4055,6 @@ extension _NativeDictionaryIndex { return lhs.offset < rhs.offset } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static func <= ( lhs: _NativeDictionaryIndex, rhs: _NativeDictionaryIndex @@ -4218,7 +4062,6 @@ extension _NativeDictionaryIndex { return lhs.offset <= rhs.offset } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static func > ( lhs: _NativeDictionaryIndex, rhs: _NativeDictionaryIndex @@ -4226,7 +4069,6 @@ extension _NativeDictionaryIndex { return lhs.offset > rhs.offset } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static func >= ( lhs: _NativeDictionaryIndex, rhs: _NativeDictionaryIndex @@ -4234,7 +4076,6 @@ extension _NativeDictionaryIndex { return lhs.offset >= rhs.offset } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static func == ( lhs: _NativeDictionaryIndex, rhs: _NativeDictionaryIndex @@ -4269,7 +4110,6 @@ internal struct _CocoaDictionaryIndex: Comparable { internal var currentKeyIndex: Int @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_ cocoaDictionary: _NSDictionary, startIndex: ()) { self.cocoaDictionary = cocoaDictionary self.allKeys = _stdlib_NSDictionary_allKeys(cocoaDictionary) @@ -4277,7 +4117,6 @@ internal struct _CocoaDictionaryIndex: Comparable { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_ cocoaDictionary: _NSDictionary, endIndex: ()) { self.cocoaDictionary = cocoaDictionary self.allKeys = _stdlib_NSDictionary_allKeys(cocoaDictionary) @@ -4285,7 +4124,6 @@ internal struct _CocoaDictionaryIndex: Comparable { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_ cocoaDictionary: _NSDictionary, _ allKeys: _HeapBuffer, _ currentKeyIndex: Int @@ -4299,7 +4137,6 @@ internal struct _CocoaDictionaryIndex: Comparable { /// /// - Precondition: The next value is representable. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func successor() -> _CocoaDictionaryIndex { // FIXME: swift-3-indexing-model: remove this method. _precondition( @@ -4311,7 +4148,6 @@ internal struct _CocoaDictionaryIndex: Comparable { extension _CocoaDictionaryIndex { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static func < ( lhs: _CocoaDictionaryIndex, rhs: _CocoaDictionaryIndex @@ -4319,7 +4155,6 @@ extension _CocoaDictionaryIndex { return lhs.currentKeyIndex < rhs.currentKeyIndex } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static func <= ( lhs: _CocoaDictionaryIndex, rhs: _CocoaDictionaryIndex @@ -4327,7 +4162,6 @@ extension _CocoaDictionaryIndex { return lhs.currentKeyIndex <= rhs.currentKeyIndex } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static func > ( lhs: _CocoaDictionaryIndex, rhs: _CocoaDictionaryIndex @@ -4335,7 +4169,6 @@ extension _CocoaDictionaryIndex { return lhs.currentKeyIndex > rhs.currentKeyIndex } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static func >= ( lhs: _CocoaDictionaryIndex, rhs: _CocoaDictionaryIndex @@ -4343,7 +4176,6 @@ extension _CocoaDictionaryIndex { return lhs.currentKeyIndex >= rhs.currentKeyIndex } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static func == ( lhs: _CocoaDictionaryIndex, rhs: _CocoaDictionaryIndex @@ -4395,7 +4227,6 @@ extension Dictionary { #endif @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_value: DictionaryIndexRepresentation) { self._value = _value } @@ -4404,27 +4235,24 @@ extension Dictionary { internal var _value: DictionaryIndexRepresentation @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal static func _native(_ index: _NativeIndex) -> Index { return DictionaryIndex(_value: ._native(index)) } #if _runtime(_ObjC) @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal static func _cocoa(_ index: _CocoaIndex) -> Index { return DictionaryIndex(_value: ._cocoa(index)) } #endif @inlinable // FIXME(sil-serialize-all) - @usableFromInline @_transparent internal var _guaranteedNative: Bool { return _canBeClass(Key.self) == 0 && _canBeClass(Value.self) == 0 } - @usableFromInline // FIXME(sil-serialize-all) + @inlinable // FIXME(sil-serialize-all) @_transparent internal var _nativeIndex: _NativeIndex { switch _value { @@ -4439,7 +4267,6 @@ extension Dictionary { #if _runtime(_ObjC) @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @_transparent internal var _cocoaIndex: _CocoaIndex { switch _value { @@ -4541,7 +4368,6 @@ final internal class _CocoaDictionaryIterator: IteratorProtocol { internal let cocoaDictionary: _NSDictionary @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var _fastEnumerationStatePtr: UnsafeMutablePointer<_SwiftNSFastEnumerationState> { return _getUnsafePointerToStoredProperties(self).assumingMemoryBound( @@ -4549,7 +4375,6 @@ final internal class _CocoaDictionaryIterator: IteratorProtocol { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var _fastEnumerationStackBufPtr: UnsafeMutablePointer<_CocoaFastEnumerationStackBuf> { return UnsafeMutableRawPointer(_fastEnumerationStatePtr + 1) @@ -4566,13 +4391,11 @@ final internal class _CocoaDictionaryIterator: IteratorProtocol { internal var itemCount: Int = 0 @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal init(_ cocoaDictionary: _NSDictionary) { self.cocoaDictionary = cocoaDictionary } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal func next() -> Element? { if itemIndex < 0 { return nil @@ -4649,13 +4472,11 @@ public struct DictionaryIterator: IteratorProtocol { internal var _state: DictionaryIteratorRepresentation @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_state: DictionaryIteratorRepresentation) { self._state = _state } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal static func _native( start: _NativeIndex, end: _NativeIndex, buffer: _NativeBuffer ) -> DictionaryIterator { @@ -4664,7 +4485,6 @@ public struct DictionaryIterator: IteratorProtocol { } #if _runtime(_ObjC) @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal static func _cocoa( _ iterator: _CocoaDictionaryIterator ) -> DictionaryIterator{ @@ -4673,14 +4493,12 @@ public struct DictionaryIterator: IteratorProtocol { #endif @inlinable // FIXME(sil-serialize-all) - @usableFromInline @_transparent internal var _guaranteedNative: Bool { return _canBeClass(Key.self) == 0 || _canBeClass(Value.self) == 0 } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal mutating func _nativeNext() -> (key: Key, value: Value)? { switch _state { case ._native(let startIndex, let endIndex, let buffer): diff --git a/stdlib/public/core/DropWhile.swift b/stdlib/public/core/DropWhile.swift index 085e797f8894f..3f9da279d36dd 100644 --- a/stdlib/public/core/DropWhile.swift +++ b/stdlib/public/core/DropWhile.swift @@ -19,7 +19,6 @@ public struct LazyDropWhileSequence { /// Create an instance with elements `transform(x)` for each element /// `x` of base. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_base: Base, predicate: @escaping (Element) -> Bool) { self._base = _base self._predicate = predicate @@ -43,7 +42,6 @@ extension LazyDropWhileSequence { public typealias Element = Base.Element @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_base: Base.Iterator, predicate: @escaping (Element) -> Bool) { self._base = _base self._predicate = predicate @@ -126,7 +124,6 @@ public struct LazyDropWhileCollection { public typealias Element = Base.Element @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_base: Base, predicate: @escaping (Element) -> Bool) { self._base = _base self._predicate = predicate @@ -161,7 +158,6 @@ extension LazyDropWhileCollection { public let base: Base.Index @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_base: Base.Index) { self.base = _base } diff --git a/stdlib/public/core/Dump.swift b/stdlib/public/core/Dump.swift index b2b2a5eae5030..40a3ff2e840c0 100644 --- a/stdlib/public/core/Dump.swift +++ b/stdlib/public/core/Dump.swift @@ -86,7 +86,6 @@ public func dump( /// Dump an object's contents. User code should use dump(). @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) @_semantics("optimize.sil.specialize.generic.never") internal func _dump_unlocked( _ value: Any, @@ -187,7 +186,6 @@ internal func _dump_unlocked( /// Dump information about an object's superclass, given a mirror reflecting /// that superclass. @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) @_semantics("optimize.sil.specialize.generic.never") internal func _dumpSuperclass_unlocked( mirror: Mirror, diff --git a/stdlib/public/core/ExistentialCollection.swift.gyb b/stdlib/public/core/ExistentialCollection.swift.gyb index 14bb576c0fd0a..ed1958d26eae6 100644 --- a/stdlib/public/core/ExistentialCollection.swift.gyb +++ b/stdlib/public/core/ExistentialCollection.swift.gyb @@ -25,7 +25,6 @@ from gyb_stdlib_support import ( import SwiftShims @inlinable // FIXME(sil-serialize-all) -@usableFromInline @inline(never) internal func _abstract( file: StaticString = #file, @@ -95,7 +94,6 @@ public struct AnyIterator { } @inlinable - @usableFromInline internal init(_box: _AnyIteratorBoxBase) { self._box = _box } @@ -120,12 +118,10 @@ extension AnyIterator: Sequence { } @_fixed_layout internal struct _ClosureBasedIterator : IteratorProtocol { @inlinable - @usableFromInline internal init(_ body: @escaping () -> Element?) { self._body = body } @inlinable - @usableFromInline internal func next() -> Element? { return _body() } @usableFromInline internal let _body: () -> Element? @@ -135,11 +131,9 @@ internal struct _ClosureBasedIterator : IteratorProtocol { @usableFromInline internal class _AnyIteratorBoxBase : IteratorProtocol { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init() {} @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) deinit {} /// Advances to the next element and returns it, or `nil` if no next element /// exists. @@ -148,7 +142,6 @@ internal class _AnyIteratorBoxBase : IteratorProtocol { /// /// - Note: Subclasses must override this method. @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal func next() -> Element? { _abstract() } } @@ -158,13 +151,10 @@ internal final class _IteratorBox< Base : IteratorProtocol > : _AnyIteratorBoxBase { @inlinable - @usableFromInline internal init(_ base: Base) { self._base = base } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) deinit {} @inlinable - @usableFromInline internal override func next() -> Base.Element? { return _base.next() } @usableFromInline internal var _base: Base @@ -194,18 +184,14 @@ internal class _AnyRandomAccessCollectionBox % if Kind == 'Sequence': @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init() { } - @usableFromInline @inlinable internal func _makeIterator() -> AnyIterator { _abstract() } - @usableFromInline @inlinable internal var _underestimatedCount: Int { _abstract() } - @usableFromInline @inlinable internal func _map( _ transform: (Element) throws -> T @@ -213,7 +199,6 @@ internal class _AnyRandomAccessCollectionBox _abstract() } - @usableFromInline @inlinable internal func _filter( _ isIncluded: (Element) throws -> Bool @@ -221,7 +206,6 @@ internal class _AnyRandomAccessCollectionBox _abstract() } - @usableFromInline @inlinable internal func _forEach( _ body: (Element) throws -> Void @@ -229,7 +213,6 @@ internal class _AnyRandomAccessCollectionBox _abstract() } - @usableFromInline @inlinable internal func __customContainsEquatableElement( _ element: Element @@ -237,7 +220,6 @@ internal class _AnyRandomAccessCollectionBox _abstract() } - @usableFromInline @inlinable internal func __preprocessingPass( _ preprocess: () throws -> R @@ -245,13 +227,11 @@ internal class _AnyRandomAccessCollectionBox _abstract() } - @usableFromInline @inlinable internal func __copyToContiguousArray() -> ContiguousArray { _abstract() } - @usableFromInline @inlinable internal func __copyContents(initializing buf: UnsafeMutableBufferPointer) -> (AnyIterator,UnsafeMutableBufferPointer.Index) { @@ -262,11 +242,9 @@ internal class _AnyRandomAccessCollectionBox % # This deinit has to be present on all the types @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) deinit {} % override = 'override' if Kind != 'Sequence' else '' - @usableFromInline @inlinable internal ${override} func _drop( while predicate: (Element) throws -> Bool @@ -274,25 +252,21 @@ internal class _AnyRandomAccessCollectionBox _abstract() } - @usableFromInline @inlinable internal ${override} func _dropFirst(_ n: Int) -> _Any${Kind}Box { _abstract() } - @usableFromInline @inlinable internal ${override} func _dropLast(_ n: Int) -> _Any${Kind}Box { _abstract() } - @usableFromInline @inlinable internal ${override} func _prefix(_ maxLength: Int) -> _Any${Kind}Box { _abstract() } - @usableFromInline @inlinable internal ${override} func _prefix( while predicate: (Element) throws -> Bool @@ -300,13 +274,11 @@ internal class _AnyRandomAccessCollectionBox _abstract() } - @usableFromInline @inlinable internal ${override} func _suffix(_ maxLength: Int) -> _Any${Kind}Box { _abstract() } - @usableFromInline @inlinable internal func _split( maxSplits: Int, omittingEmptySubsequences: Bool, @@ -316,19 +288,15 @@ internal class _AnyRandomAccessCollectionBox } % if Kind == 'Collection': - @usableFromInline @inlinable internal subscript(i: _AnyIndexBox) -> Element { _abstract() } - @usableFromInline @inlinable internal func _index(after i: _AnyIndexBox) -> _AnyIndexBox { _abstract() } - @usableFromInline @inlinable internal func _formIndex(after i: _AnyIndexBox) { _abstract() } - @usableFromInline @inlinable internal func _index( _ i: _AnyIndexBox, offsetBy n: Int @@ -336,7 +304,6 @@ internal class _AnyRandomAccessCollectionBox _abstract() } - @usableFromInline @inlinable internal func _index( _ i: _AnyIndexBox, offsetBy n: Int, limitedBy limit: _AnyIndexBox @@ -344,13 +311,11 @@ internal class _AnyRandomAccessCollectionBox _abstract() } - @usableFromInline @inlinable internal func _formIndex(_ i: inout _AnyIndexBox, offsetBy n: Int) { _abstract() } - @usableFromInline @inlinable internal func _formIndex( _ i: inout _AnyIndexBox, offsetBy n: Int, limitedBy limit: _AnyIndexBox @@ -358,7 +323,6 @@ internal class _AnyRandomAccessCollectionBox _abstract() } - @usableFromInline @inlinable internal func _distance( from start: _AnyIndexBox, to end: _AnyIndexBox @@ -380,7 +344,6 @@ internal class _AnyRandomAccessCollectionBox */ @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal var _count: Int { _abstract() } // TODO: swift-3-indexing-model: forward the following methods. @@ -389,10 +352,8 @@ internal class _AnyRandomAccessCollectionBox */ @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal var _first: Element? { _abstract() } - @usableFromInline @inlinable internal init( _startIndex: _AnyIndexBox, @@ -411,7 +372,6 @@ internal class _AnyRandomAccessCollectionBox % if Kind in ['Collection', 'BidirectionalCollection', 'RandomAccessCollection']: % override = 'override' if Kind != 'Collection' else '' - @usableFromInline @inlinable internal ${override} subscript( start start: _AnyIndexBox, @@ -420,13 +380,10 @@ internal class _AnyRandomAccessCollectionBox % end % if Kind == 'BidirectionalCollection': - @usableFromInline @inlinable internal func _index(before i: _AnyIndexBox) -> _AnyIndexBox { _abstract() } - @usableFromInline @inlinable internal func _formIndex(before i: _AnyIndexBox) { _abstract() } - @usableFromInline @inlinable internal var _last: Element? { _abstract() } % end @@ -455,99 +412,83 @@ internal final class _${Kind}Box : _Any${Kind}Box AnyIterator { return AnyIterator(_base.makeIterator()) } - @usableFromInline @inlinable internal override var _underestimatedCount: Int { return _base.underestimatedCount } - @usableFromInline @inlinable internal override func _map( _ transform: (Element) throws -> T ) rethrows -> [T] { return try _base.map(transform) } - @usableFromInline @inlinable internal override func _filter( _ isIncluded: (Element) throws -> Bool ) rethrows -> [Element] { return try _base.filter(isIncluded) } - @usableFromInline @inlinable internal override func _forEach( _ body: (Element) throws -> Void ) rethrows { return try _base.forEach(body) } - @usableFromInline @inlinable internal override func __customContainsEquatableElement( _ element: Element ) -> Bool? { return _base._customContainsEquatableElement(element) } - @usableFromInline @inlinable internal override func __preprocessingPass( _ preprocess: () throws -> R ) rethrows -> R? { return try _base._preprocessingPass(preprocess) } - @usableFromInline @inlinable internal override func __copyToContiguousArray() -> ContiguousArray { return _base._copyToContiguousArray() } - @usableFromInline @inlinable internal override func __copyContents(initializing buf: UnsafeMutableBufferPointer) -> (AnyIterator,UnsafeMutableBufferPointer.Index) { let (it,idx) = _base._copyContents(initializing: buf) return (AnyIterator(it),idx) } - @usableFromInline @inlinable internal override func _drop( while predicate: (Element) throws -> Bool ) rethrows -> _Any${Kind}Box { return try _${Kind}Box(_base: _base.drop(while: predicate)) } - @usableFromInline @inlinable internal override func _dropFirst(_ n: Int) -> _Any${Kind}Box { return _${Kind}Box(_base: _base.dropFirst(n)) } - @usableFromInline @inlinable internal override func _dropLast(_ n: Int) -> _Any${Kind}Box { return _${Kind}Box(_base: _base.dropLast(n)) } - @usableFromInline @inlinable internal override func _prefix( while predicate: (Element) throws -> Bool ) rethrows -> _Any${Kind}Box { return try _${Kind}Box(_base: _base.prefix(while: predicate)) } - @usableFromInline @inlinable internal override func _prefix(_ maxLength: Int) -> _Any${Kind}Box { return _${Kind}Box(_base: _base.prefix(maxLength)) } - @usableFromInline @inlinable internal override func _suffix(_ maxLength: Int) -> _Any${Kind}Box { return _${Kind}Box(_base: _base.suffix(maxLength)) } % for ResultKind in EqualAndWeakerKinds: - @usableFromInline @inlinable internal override func _split( maxSplits: Int, omittingEmptySubsequences: Bool, @@ -564,18 +505,15 @@ internal final class _${Kind}Box : _Any${Kind}Box : _Any${Kind}Box : _Any${Kind}Box Element { return _base[_unbox(position)] } - @usableFromInline @inlinable internal override subscript(start start: _AnyIndexBox, end end: _AnyIndexBox) -> _Any${Kind}Box @@ -610,13 +545,11 @@ internal final class _${Kind}Box : _Any${Kind}Box _AnyIndexBox { return _IndexBox(_base: _base.index(after: _unbox(position))) } - @usableFromInline @inlinable internal override func _formIndex(after position: _AnyIndexBox) { if let p = position as? _IndexBox { @@ -625,7 +558,6 @@ internal final class _${Kind}Box : _Any${Kind}Box : _Any${Kind}Box : _Any${Kind}Box : _Any${Kind}Box : _Any${Kind}Box : _Any${Kind}Box _AnyIndexBox { return _IndexBox(_base: _base.index(before: _unbox(position))) } - @usableFromInline @inlinable internal override func _formIndex(before position: _AnyIndexBox) { if let p = position as? _IndexBox { @@ -709,7 +633,6 @@ internal final class _${Kind}Box : _Any${Kind}Box { @usableFromInline internal var _makeUnderlyingIterator: () -> Iterator - @usableFromInline @inlinable internal init(_ makeUnderlyingIterator: @escaping () -> Iterator) { self._makeUnderlyingIterator = makeUnderlyingIterator @@ -736,7 +658,6 @@ internal struct _ClosureBasedSequence { } extension _ClosureBasedSequence: Sequence { - @usableFromInline @inlinable internal func makeIterator() -> Iterator { return _makeUnderlyingIterator() @@ -763,7 +684,6 @@ public struct AnySequence { self.init(_ClosureBasedSequence(makeUnderlyingIterator)) } - @usableFromInline @inlinable internal init(_box: _AnySequenceBox) { self._box = _box @@ -916,37 +836,31 @@ internal final class _IndexBox< @usableFromInline internal var _base: BaseIndex - @usableFromInline @inlinable internal init(_base: BaseIndex) { self._base = _base } - @usableFromInline @inlinable internal func _unsafeUnbox(_ other: _AnyIndexBox) -> BaseIndex { return unsafeDowncast(other, to: _IndexBox.self)._base } - @usableFromInline @inlinable internal var _typeID: ObjectIdentifier { return ObjectIdentifier(type(of: self)) } - @usableFromInline @inlinable internal func _unbox() -> T? { return (self as _AnyIndexBox as? _IndexBox)?._base } - @usableFromInline @inlinable internal func _isEqual(to rhs: _AnyIndexBox) -> Bool { return _base == _unsafeUnbox(rhs) } - @usableFromInline @inlinable internal func _isLess(than rhs: _AnyIndexBox) -> Bool { return _base < _unsafeUnbox(rhs) @@ -965,13 +879,11 @@ public struct AnyIndex { self._box = _IndexBox(_base: base) } - @usableFromInline @inlinable internal init(_box: _AnyIndexBox) { self._box = _box } - @usableFromInline @inlinable internal var _typeID: ObjectIdentifier { return _box._typeID @@ -1032,7 +944,6 @@ public struct ${Self} { @usableFromInline internal let _box: _${Self}Box - @usableFromInline @inlinable internal init(_box: _${Self}Box) { self._box = _box diff --git a/stdlib/public/core/Filter.swift b/stdlib/public/core/Filter.swift index cd802dfe336e9..62f7885415b9b 100644 --- a/stdlib/public/core/Filter.swift +++ b/stdlib/public/core/Filter.swift @@ -55,7 +55,6 @@ extension LazyFilterSequence { /// Creates an instance that produces the elements `x` of `base` /// for which `isIncluded(x) == true`. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_base: Base.Iterator, _ isIncluded: @escaping (Base.Element) -> Bool) { self._base = _base self._predicate = isIncluded @@ -218,7 +217,6 @@ extension LazyFilterCollection : LazyCollectionProtocol { @inline(__always) @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func _advanceIndex(_ i: inout Index, step: Int) { repeat { _base.formIndex(&i, offsetBy: step) @@ -227,7 +225,6 @@ extension LazyFilterCollection : LazyCollectionProtocol { @inline(__always) @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func _ensureBidirectional(step: Int) { // FIXME: This seems to be the best way of checking whether _base is // forward only without adding an extra protocol requirement. diff --git a/stdlib/public/core/FixedArray.swift.gyb b/stdlib/public/core/FixedArray.swift.gyb index f3b904a85fefb..e56a28b05d7df 100644 --- a/stdlib/public/core/FixedArray.swift.gyb +++ b/stdlib/public/core/FixedArray.swift.gyb @@ -43,19 +43,16 @@ internal struct _FixedArray${N} { extension _FixedArray${N} { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static var capacity: Int { @inline(__always) get { return ${N} } } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var capacity: Int { @inline(__always) get { return ${N} } } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var count: Int { @inline(__always) get { return Int(truncatingIfNeeded: _count) } @inline(__always) set { _count = Int8(newValue) } @@ -66,21 +63,17 @@ extension _FixedArray${N} : RandomAccessCollection, MutableCollection { internal typealias Index = Int @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var startIndex : Index { return 0 } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var endIndex : Index { return count } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal subscript(i: Index) -> T { - @usableFromInline @inline(__always) get { let count = self.count // for exclusive access @@ -97,7 +90,6 @@ extension _FixedArray${N} : RandomAccessCollection, MutableCollection { } return res } - @usableFromInline @inline(__always) set { _sanityCheck(i >= 0 && i < count) @@ -108,14 +100,12 @@ extension _FixedArray${N} : RandomAccessCollection, MutableCollection { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline @inline(__always) internal func index(after i: Index) -> Index { return i+1 } @inlinable // FIXME(sil-serialize-all) - @usableFromInline @inline(__always) internal func index(before i: Index) -> Index { return i-1 @@ -124,7 +114,6 @@ extension _FixedArray${N} : RandomAccessCollection, MutableCollection { extension _FixedArray${N} { @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal mutating func append(_ newElement: T) { _sanityCheck(count < capacity) _count += 1 @@ -134,7 +123,6 @@ extension _FixedArray${N} { extension _FixedArray${N} where T : ExpressibleByIntegerLiteral { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @inline(__always) internal init(count: Int) { _sanityCheck(count >= 0 && count <= _FixedArray${N}.capacity) @@ -148,14 +136,12 @@ extension _FixedArray${N} where T : ExpressibleByIntegerLiteral { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @inline(__always) internal init() { self.init(count: 0) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @inline(__always) internal init(allZeros: ()) { self.init(count: ${N}) @@ -164,7 +150,6 @@ extension _FixedArray${N} where T : ExpressibleByIntegerLiteral { extension _FixedArray${N} { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func withUnsafeMutableBufferPointer( _ body: (UnsafeMutableBufferPointer) throws -> R ) rethrows -> R { @@ -181,7 +166,6 @@ extension _FixedArray${N} { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func withUnsafeBufferPointer( _ body: (UnsafeBufferPointer) throws -> R ) rethrows -> R { diff --git a/stdlib/public/core/Flatten.swift b/stdlib/public/core/Flatten.swift index 9e7dbd8270ab6..88c89eff0912a 100644 --- a/stdlib/public/core/Flatten.swift +++ b/stdlib/public/core/Flatten.swift @@ -35,7 +35,6 @@ public struct FlattenSequence where Base.Element: Sequence { /// /// - Complexity: O(1) @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_base: Base) { self._base = _base } @@ -51,7 +50,6 @@ extension FlattenSequence { /// Construct around a `base` iterator. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_base: Base.Iterator) { self._base = _base } @@ -188,7 +186,6 @@ extension FlattenCollection { internal let _inner: Base.Element.Index? @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_ _outer: Base.Index, _ inner: Base.Element.Index?) { self._outer = _outer self._inner = inner @@ -312,7 +309,6 @@ extension FlattenCollection : Collection { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func _index(after i: Index) -> Index { let innerCollection = _base[i._outer] let nextInner = innerCollection.index(after: i._inner!) @@ -333,7 +329,6 @@ extension FlattenCollection : Collection { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func _index(before i: Index) -> Index { var prevOuter = i._outer if prevOuter == _base.endIndex { @@ -393,7 +388,6 @@ extension FlattenCollection : Collection { @inline(__always) @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func _advanceIndex(_ i: inout Index, step: Int) { _sanityCheck(-1...1 ~= step, "step should be within the -1...1 range") i = step < 0 ? _index(before: i) : _index(after: i) @@ -401,7 +395,6 @@ extension FlattenCollection : Collection { @inline(__always) @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func _ensureBidirectional(step: Int) { // FIXME: This seems to be the best way of checking whether _base is // forward only without adding an extra protocol requirement. diff --git a/stdlib/public/core/FloatingPointParsing.swift.gyb b/stdlib/public/core/FloatingPointParsing.swift.gyb index 59b187437ac36..7a7dca8a0466a 100644 --- a/stdlib/public/core/FloatingPointParsing.swift.gyb +++ b/stdlib/public/core/FloatingPointParsing.swift.gyb @@ -31,7 +31,6 @@ cFuncSuffix2 = {32: 'f', 64: 'd', 80: 'ld'} /// Returns `true` iff isspace(u) would return nonzero when the current /// locale is the C locale. @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) internal func _isspace_clocale(_ u: UTF16.CodeUnit) -> Bool { return "\t\n\u{b}\u{c}\r ".utf16.contains(u) } diff --git a/stdlib/public/core/FloatingPointTypes.swift.gyb b/stdlib/public/core/FloatingPointTypes.swift.gyb index c74297e17fcc0..4eb244491c242 100644 --- a/stdlib/public/core/FloatingPointTypes.swift.gyb +++ b/stdlib/public/core/FloatingPointTypes.swift.gyb @@ -172,19 +172,16 @@ extension ${Self}: BinaryFloatingPoint { // Implementation details. @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal static var _infinityExponent: UInt { @inline(__always) get { return 1 &<< UInt(exponentBitCount) - 1 } } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static var _exponentBias: UInt { @inline(__always) get { return _infinityExponent &>> 1 } } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static var _significandMask: ${RawSignificand} { @inline(__always) get { return 1 &<< ${RawSignificand}(significandBitCount) - 1 @@ -192,7 +189,6 @@ extension ${Self}: BinaryFloatingPoint { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal static var _quietNaNMask: ${RawSignificand} { @inline(__always) get { return 1 &<< ${RawSignificand}(significandBitCount - 1) @@ -325,31 +321,26 @@ extension ${Self}: BinaryFloatingPoint { internal var _storage: (UInt64, UInt16, /* pad */ UInt16, UInt16, UInt16) @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @_transparent internal var explicitSignificand: UInt64 { return _storage.0 } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @_transparent internal var signAndExponent: UInt16 { return _storage.1 } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @_transparent internal var sign: FloatingPointSign { return FloatingPointSign(rawValue: Int(signAndExponent &>> 15))! } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @_transparent internal var exponentBitPattern: UInt { return UInt(signAndExponent) & 0x7fff } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @_transparent internal init(explicitSignificand: UInt64, signAndExponent: UInt16) { _storage = (explicitSignificand, signAndExponent, 0, 0, 0) @@ -357,7 +348,6 @@ extension ${Self}: BinaryFloatingPoint { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var _representation: _Representation { return unsafeBitCast(self, to: _Representation.self) } @@ -381,7 +371,6 @@ extension ${Self}: BinaryFloatingPoint { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static var _explicitBitMask: UInt64 { @inline(__always) get { return 1 &<< 63 } } diff --git a/stdlib/public/core/Hashing.swift b/stdlib/public/core/Hashing.swift index 970eca807214d..9b5a53b864d54 100644 --- a/stdlib/public/core/Hashing.swift +++ b/stdlib/public/core/Hashing.swift @@ -29,7 +29,6 @@ enum _HashingDetail { // FIXME(hasher): Remove @inlinable // FIXME(sil-serialize-all) - @usableFromInline @_transparent internal static func getExecutionSeed() -> UInt64 { // FIXME: This needs to be a per-execution seed. This is just a placeholder @@ -39,7 +38,6 @@ enum _HashingDetail { // FIXME(hasher): Remove @inlinable // FIXME(sil-serialize-all) - @usableFromInline @_transparent internal static func hash16Bytes(_ low: UInt64, _ high: UInt64) -> UInt64 { // Murmur-inspired hashing. @@ -343,7 +341,6 @@ internal protocol _HashBuffer { /// can be used in multiple places in the implementation and stay consistent. /// Should not be used outside `Dictionary` implementation. @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) @_transparent internal var _hashContainerDefaultMaxLoadFactorInverse: Double { return 1.0 / 0.75 @@ -355,7 +352,6 @@ internal var _hashContainerDefaultMaxLoadFactorInverse: Double { /// This function is part of the runtime because `Bool` type is bridged to /// `ObjCBool`, which is in Foundation overlay. /// FIXME(sil-serialize-all): this should be internal -@inlinable // FIXME(sil-serialize-all) @usableFromInline // FIXME(sil-serialize-all) @_silgen_name("swift_stdlib_NSObject_isEqual") internal func _stdlib_NSObject_isEqual(_ lhs: AnyObject, _ rhs: AnyObject) -> Bool @@ -375,20 +371,17 @@ internal struct _UnmanagedAnyObjectArray { internal var value: UnsafeMutableRawPointer @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_ up: UnsafeMutablePointer) { self.value = UnsafeMutableRawPointer(up) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init?(_ up: UnsafeMutablePointer?) { guard let unwrapped = up else { return nil } self.init(unwrapped) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal subscript(i: Int) -> AnyObject { get { let unmanaged = value.load( diff --git a/stdlib/public/core/HeapBuffer.swift b/stdlib/public/core/HeapBuffer.swift index 30fc5b2dbc0f9..ecce7ec6602ae 100644 --- a/stdlib/public/core/HeapBuffer.swift +++ b/stdlib/public/core/HeapBuffer.swift @@ -25,7 +25,6 @@ internal protocol _HeapBufferHeader_ { internal struct _HeapBufferHeader : _HeapBufferHeader_ { internal typealias Value = T @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_ value: T) { self.value = value } @usableFromInline // FIXME(sil-serialize-all) internal var value: T @@ -41,7 +40,6 @@ extension ManagedBufferPointer where Header : _HeapBufferHeader_ { internal typealias Value = Header.Value @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal init( _ storageClass: AnyClass, _ initializer: Value, _ capacity: Int @@ -55,7 +53,6 @@ extension ManagedBufferPointer where Header : _HeapBufferHeader_ { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal var value: Value { @inline(__always) get { @@ -68,7 +65,6 @@ extension ManagedBufferPointer where Header : _HeapBufferHeader_ { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal subscript(i: Int) -> Element { @inline(__always) get { @@ -77,7 +73,6 @@ extension ManagedBufferPointer where Header : _HeapBufferHeader_ { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal var baseAddress: UnsafeMutablePointer { @inline(__always) get { @@ -86,7 +81,6 @@ extension ManagedBufferPointer where Header : _HeapBufferHeader_ { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal var storage: AnyObject? { @inline(__always) get { diff --git a/stdlib/public/core/ICU.swift b/stdlib/public/core/ICU.swift index c94b8254e942b..1cfcc761f0e5a 100644 --- a/stdlib/public/core/ICU.swift +++ b/stdlib/public/core/ICU.swift @@ -13,17 +13,14 @@ import SwiftShims extension __swift_stdlib_UErrorCode { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var isFailure: Bool { return rawValue > __swift_stdlib_U_ZERO_ERROR.rawValue } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var isWarning: Bool { return rawValue < __swift_stdlib_U_ZERO_ERROR.rawValue } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var isSuccess: Bool { return rawValue <= __swift_stdlib_U_ZERO_ERROR.rawValue } diff --git a/stdlib/public/core/Indices.swift b/stdlib/public/core/Indices.swift index 6a8c40af4185a..018c19e2d9aaf 100644 --- a/stdlib/public/core/Indices.swift +++ b/stdlib/public/core/Indices.swift @@ -21,7 +21,6 @@ public struct DefaultIndices { internal var _endIndex: Elements.Index @inlinable - @usableFromInline internal init( _elements: Elements, startIndex: Elements.Index, diff --git a/stdlib/public/core/IntegerParsing.swift b/stdlib/public/core/IntegerParsing.swift index c9f8fdaa3c563..f7038bf400177 100644 --- a/stdlib/public/core/IntegerParsing.swift +++ b/stdlib/public/core/IntegerParsing.swift @@ -11,7 +11,6 @@ //===----------------------------------------------------------------------===// @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) @inline(__always) internal func _asciiDigit( codeUnit u_: CodeUnit, radix: Result @@ -31,7 +30,6 @@ internal func _asciiDigit( } @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) @inline(__always) internal func _parseUnsignedASCII< Rest : IteratorProtocol, Result: FixedWidthInteger @@ -68,7 +66,6 @@ where Rest.Element : UnsignedInteger { // @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) @inline(__always) internal func _parseASCII< CodeUnits : IteratorProtocol, Result: FixedWidthInteger @@ -99,7 +96,6 @@ extension FixedWidthInteger { // detail for FixedWidthInteger.init(_: radix:) on the slow path to save code // size. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @_semantics("optimize.sil.specialize.generic.partial.never") @inline(never) internal static func _parseASCIISlowPath< diff --git a/stdlib/public/core/Integers.swift.gyb b/stdlib/public/core/Integers.swift.gyb index 755e8c3bee41d..b2175bc0ebe8a 100644 --- a/stdlib/public/core/Integers.swift.gyb +++ b/stdlib/public/core/Integers.swift.gyb @@ -1751,7 +1751,6 @@ ${operatorComment(x.nonMaskingOperator, False)} extension BinaryInteger { @inlinable // FIXME(sil-serialize-all) - @usableFromInline @_transparent internal func _description(radix: Int, uppercase: Bool) -> String { _precondition(2...36 ~= radix, "Radix must be between 2 and 36") @@ -3841,7 +3840,6 @@ public func numericCast(_ x: T) -> U { // FIXME(integers): switch to using `FixedWidthInteger.unsafeAdding` @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) internal func _unsafePlus(_ lhs: Int, _ rhs: Int) -> Int { #if INTERNAL_CHECKS_ENABLED return lhs + rhs @@ -3852,7 +3850,6 @@ internal func _unsafePlus(_ lhs: Int, _ rhs: Int) -> Int { // FIXME(integers): switch to using `FixedWidthInteger.unsafeSubtracting` @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) internal func _unsafeMinus(_ lhs: Int, _ rhs: Int) -> Int { #if INTERNAL_CHECKS_ENABLED return lhs - rhs diff --git a/stdlib/public/core/KeyPath.swift b/stdlib/public/core/KeyPath.swift index 1ff5f5eb6f2e0..95747c5e17eba 100644 --- a/stdlib/public/core/KeyPath.swift +++ b/stdlib/public/core/KeyPath.swift @@ -13,7 +13,6 @@ import SwiftShims @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) @_transparent internal func _abstract( methodName: StaticString = #function, @@ -120,7 +119,6 @@ public class AnyKeyPath: Hashable, _AppendKeyPath { // Prevent normal initialization. We use tail allocation via // allocWithTailElems(). @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init() { _sanityCheckFailure("use _create(...)") } @@ -152,7 +150,6 @@ public class AnyKeyPath: Hashable, _AppendKeyPath { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func withBuffer(_ f: (KeyPathBuffer) throws -> T) rethrows -> T { defer { _fixLifetime(self) } @@ -188,11 +185,9 @@ public class KeyPath: PartialKeyPath { // MARK: Implementation internal typealias Kind = KeyPathKind @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal class var kind: Kind { return .readOnly } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static func appendedType( with t: KeyPath.Type ) -> KeyPath.Type { @@ -217,7 +212,6 @@ public class KeyPath: PartialKeyPath { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal final func projectReadOnly(from root: Root) -> Value { // TODO: For perf, we could use a local growable buffer instead of Any var curBase: Any = root @@ -268,13 +262,11 @@ public class WritableKeyPath: KeyPath { // MARK: Implementation detail @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal override class var kind: Kind { return .value } // `base` is assumed to be undergoing a formal access for the duration of the // call, so must not be mutated by an alias @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func projectMutableAddress(from base: UnsafePointer) -> (pointer: UnsafeMutablePointer, owner: AnyObject?) { var p = UnsafeRawPointer(base) @@ -326,11 +318,9 @@ public class ReferenceWritableKeyPath< // MARK: Implementation detail @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal final override class var kind: Kind { return .reference } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal final override func projectMutableAddress( from base: UnsafePointer ) -> (pointer: UnsafeMutablePointer, owner: AnyObject?) { @@ -340,7 +330,6 @@ public class ReferenceWritableKeyPath< } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal final func projectMutableAddress(from origBase: Root) -> (pointer: UnsafeMutablePointer, owner: AnyObject?) { var keepAlive: AnyObject? @@ -429,7 +418,6 @@ internal enum KeyPathComponentKind { @usableFromInline // FIXME(sil-serialize-all) internal struct ComputedPropertyID: Hashable { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(value: Int, isStoredProperty: Bool, isTableOffset: Bool) { self.value = value self.isStoredProperty = isStoredProperty @@ -444,7 +432,6 @@ internal struct ComputedPropertyID: Hashable { internal var isTableOffset: Bool @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static func ==( x: ComputedPropertyID, y: ComputedPropertyID ) -> Bool { @@ -454,7 +441,6 @@ internal struct ComputedPropertyID: Hashable { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var hashValue: Int { return _hashValue(for: self) } @@ -502,7 +488,6 @@ internal enum KeyPathComponent: Hashable { @usableFromInline // FIXME(sil-serialize-all) internal struct ArgumentRef { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init( data: UnsafeRawBufferPointer, witnesses: UnsafePointer @@ -546,7 +531,6 @@ internal enum KeyPathComponent: Hashable { case optionalWrap @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static func ==(a: KeyPathComponent, b: KeyPathComponent) -> Bool { switch (a, b) { case (.struct(offset: let a), .struct(offset: let b)), @@ -590,13 +574,11 @@ internal enum KeyPathComponent: Hashable { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var hashValue: Int { return _hashValue(for: self) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func _hash(into hasher: inout _Hasher) { var hasher = hasher func appendHashFromArgument( @@ -654,13 +636,11 @@ internal final class ClassHolder { internal let instance: AnyObject @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(previous: AnyObject?, instance: AnyObject) { self.previous = previous self.instance = instance } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) deinit {} } @@ -682,13 +662,11 @@ internal final class MutatingWritebackBuffer { internal var value: NewValue @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) deinit { set(value, &base.pointee, argument, argumentSize) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(previous: AnyObject?, base: UnsafeMutablePointer, @@ -723,13 +701,11 @@ internal final class NonmutatingWritebackBuffer { internal var value: NewValue @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) deinit { set(value, base, argument, argumentSize) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(previous: AnyObject?, base: CurValue, @@ -750,7 +726,6 @@ internal final class NonmutatingWritebackBuffer { @usableFromInline // FIXME(sil-serialize-all) internal struct RawKeyPathComponent { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(header: Header, body: UnsafeRawBufferPointer) { self.header = header self.body = body @@ -765,113 +740,91 @@ internal struct RawKeyPathComponent { @usableFromInline // FIXME(sil-serialize-all) internal struct Header { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static var payloadMask: UInt32 { return _SwiftKeyPathComponentHeader_PayloadMask } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static var discriminatorMask: UInt32 { return _SwiftKeyPathComponentHeader_DiscriminatorMask } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static var discriminatorShift: UInt32 { return _SwiftKeyPathComponentHeader_DiscriminatorShift } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static var structTag: UInt32 { return _SwiftKeyPathComponentHeader_StructTag } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static var computedTag: UInt32 { return _SwiftKeyPathComponentHeader_ComputedTag } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static var classTag: UInt32 { return _SwiftKeyPathComponentHeader_ClassTag } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static var optionalTag: UInt32 { return _SwiftKeyPathComponentHeader_OptionalTag } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static var optionalChainPayload: UInt32 { return _SwiftKeyPathComponentHeader_OptionalChainPayload } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static var optionalWrapPayload: UInt32 { return _SwiftKeyPathComponentHeader_OptionalWrapPayload } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static var optionalForcePayload: UInt32 { return _SwiftKeyPathComponentHeader_OptionalForcePayload } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static var endOfReferencePrefixFlag: UInt32 { return _SwiftKeyPathComponentHeader_EndOfReferencePrefixFlag } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static var outOfLineOffsetPayload: UInt32 { return _SwiftKeyPathComponentHeader_OutOfLineOffsetPayload } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static var unresolvedFieldOffsetPayload: UInt32 { return _SwiftKeyPathComponentHeader_UnresolvedFieldOffsetPayload } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static var unresolvedIndirectOffsetPayload: UInt32 { return _SwiftKeyPathComponentHeader_UnresolvedIndirectOffsetPayload } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static var computedMutatingFlag: UInt32 { return _SwiftKeyPathComponentHeader_ComputedMutatingFlag } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static var computedSettableFlag: UInt32 { return _SwiftKeyPathComponentHeader_ComputedSettableFlag } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static var computedIDByStoredPropertyFlag: UInt32 { return _SwiftKeyPathComponentHeader_ComputedIDByStoredPropertyFlag } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static var computedIDByVTableOffsetFlag: UInt32 { return _SwiftKeyPathComponentHeader_ComputedIDByVTableOffsetFlag } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static var computedHasArgumentsFlag: UInt32 { return _SwiftKeyPathComponentHeader_ComputedHasArgumentsFlag } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static var computedIDResolutionMask: UInt32 { return _SwiftKeyPathComponentHeader_ComputedIDResolutionMask } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static var computedIDResolved: UInt32 { return _SwiftKeyPathComponentHeader_ComputedIDResolved } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static var computedIDUnresolvedIndirectPointer: UInt32 { return _SwiftKeyPathComponentHeader_ComputedIDUnresolvedIndirectPointer } @@ -880,12 +833,10 @@ internal struct RawKeyPathComponent { internal var _value: UInt32 @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var discriminator: UInt32 { return (_value & Header.discriminatorMask) >> Header.discriminatorShift } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var payload: UInt32 { get { return _value & Header.payloadMask @@ -897,7 +848,6 @@ internal struct RawKeyPathComponent { } } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var endOfReferencePrefix: Bool { get { return _value & Header.endOfReferencePrefixFlag != 0 @@ -912,7 +862,6 @@ internal struct RawKeyPathComponent { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var kind: KeyPathComponentKind { switch (discriminator, payload) { case (Header.structTag, _): @@ -935,7 +884,6 @@ internal struct RawKeyPathComponent { // The component header is 4 bytes, but may be followed by an aligned // pointer field for some kinds of component, forcing padding. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static var pointerAlignmentSkew: Int { return MemoryLayout.size - MemoryLayout.size } @@ -943,7 +891,6 @@ internal struct RawKeyPathComponent { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var bodySize: Int { switch header.kind { case .struct, .class: @@ -971,7 +918,6 @@ internal struct RawKeyPathComponent { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var _structOrClassOffset: Int { _sanityCheck(header.kind == .struct || header.kind == .class, "no offset for this kind") @@ -987,7 +933,6 @@ internal struct RawKeyPathComponent { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var _computedIDValue: Int { _sanityCheck(header.kind == .computed, "not a computed property") @@ -996,7 +941,6 @@ internal struct RawKeyPathComponent { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var _computedID: ComputedPropertyID { let payload = header.payload return ComputedPropertyID( @@ -1006,7 +950,6 @@ internal struct RawKeyPathComponent { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var _computedGetter: UnsafeRawPointer { _sanityCheck(header.kind == .computed, "not a computed property") @@ -1017,7 +960,6 @@ internal struct RawKeyPathComponent { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var _computedSetter: UnsafeRawPointer { _sanityCheck(header.kind == .computed, "not a computed property") @@ -1036,7 +978,6 @@ internal struct RawKeyPathComponent { _ instanceArguments: UnsafeMutableRawPointer) -> () @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var _computedArgumentHeaderPointer: UnsafeRawPointer { _sanityCheck(header.kind == .computed, "not a computed property") @@ -1050,12 +991,10 @@ internal struct RawKeyPathComponent { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var _computedArgumentSize: Int { return _computedArgumentHeaderPointer.load(as: Int.self) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var _computedArgumentWitnesses: UnsafePointer { return _computedArgumentHeaderPointer.load( @@ -1064,18 +1003,15 @@ internal struct RawKeyPathComponent { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var _computedArguments: UnsafeRawPointer { return _computedArgumentHeaderPointer + MemoryLayout.size * 2 } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var _computedMutableArguments: UnsafeMutableRawPointer { return UnsafeMutableRawPointer(mutating: _computedArguments) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var value: KeyPathComponent { switch header.kind { case .struct: @@ -1126,7 +1062,6 @@ internal struct RawKeyPathComponent { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func destroy() { switch header.kind { case .struct, @@ -1146,7 +1081,6 @@ internal struct RawKeyPathComponent { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func clone(into buffer: inout UnsafeMutableRawBufferPointer, endOfReferencePrefix: Bool) { var newHeader = header @@ -1210,7 +1144,7 @@ internal struct RawKeyPathComponent { } @_frozen // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) + @usableFromInline internal enum ProjectionResult { /// Continue projecting the key path with the given new value. case `continue`(NewValue) @@ -1219,7 +1153,6 @@ internal struct RawKeyPathComponent { case `break`(LeafValue) @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var assumingContinue: NewValue { switch self { case .continue(let x): @@ -1231,7 +1164,6 @@ internal struct RawKeyPathComponent { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func projectReadOnly( _ base: CurValue, to: NewValue.Type, @@ -1294,7 +1226,6 @@ internal struct RawKeyPathComponent { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func projectMutableAddress( _ base: UnsafeRawPointer, from _: CurValue.Type, @@ -1402,7 +1333,6 @@ internal struct KeyPathBuffer { internal var hasReferencePrefix: Bool @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var mutableData: UnsafeMutableRawBufferPointer { return UnsafeMutableRawBufferPointer(mutating: data) } @@ -1431,7 +1361,6 @@ internal struct KeyPathBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(size: Int, trivial: Bool, hasReferencePrefix: Bool) { _sanityCheck(size <= Int(Header.sizeMask), "key path too big") _value = UInt32(size) @@ -1440,13 +1369,10 @@ internal struct KeyPathBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var size: Int { return Int(_value & Header.sizeMask) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var trivial: Bool { return _value & Header.trivialFlag != 0 } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var hasReferencePrefix: Bool { get { return _value & Header.hasReferencePrefixFlag != 0 @@ -1463,13 +1389,11 @@ internal struct KeyPathBuffer { // In a key path pattern, the "trivial" flag is used to indicate // "instantiable in-line" @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var instantiableInLine: Bool { return trivial } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func validateReservedBits() { _precondition(_value & Header.reservedMask == 0, "Reserved bits set to an unexpected bit pattern") @@ -1477,7 +1401,6 @@ internal struct KeyPathBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(base: UnsafeRawPointer) { let header = base.load(as: Header.self) data = UnsafeRawBufferPointer( @@ -1488,7 +1411,6 @@ internal struct KeyPathBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func destroy() { // Short-circuit if nothing in the object requires destruction. if trivial { return } @@ -1502,7 +1424,6 @@ internal struct KeyPathBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func next() -> (RawKeyPathComponent, Any.Type?) { let header = pop(RawKeyPathComponent.Header.self) // Track if this is the last component of the reference prefix. @@ -1530,7 +1451,6 @@ internal struct KeyPathBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func pop(_ type: T.Type) -> T { _sanityCheck(_isPOD(T.self), "should be POD") let raw = popRaw(size: MemoryLayout.size, @@ -1544,7 +1464,6 @@ internal struct KeyPathBuffer { return result } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func popRaw(size: Int, alignment: Int) -> UnsafeRawBufferPointer { var baseAddress = data.baseAddress.unsafelyUnwrapped @@ -2065,7 +1984,6 @@ public func _appendingKeyPaths< // pointer to the KVC string. @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) internal var keyPathObjectHeaderSize: Int { return MemoryLayout.size + MemoryLayout.size } @@ -2121,7 +2039,6 @@ public func _swift_getKeyPath(pattern: UnsafeMutableRawPointer, } @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) internal func _getKeyPath_instantiatedOutOfLine( _ pattern: UnsafeRawPointer, _ arguments: UnsafeRawPointer) @@ -2151,7 +2068,6 @@ internal func _getKeyPath_instantiatedOutOfLine( } @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) internal func _getKeyPath_instantiateInline( _ objectRawPtr: Builtin.RawPointer ) { @@ -2192,7 +2108,6 @@ internal typealias MetadataAccessor = @convention(c) (UnsafeRawPointer) -> UnsafeRawPointer @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) internal func _getKeyPathClassAndInstanceSizeFromPattern( _ pattern: UnsafeRawPointer, _ arguments: UnsafeRawPointer @@ -2347,7 +2262,6 @@ internal func _getKeyPathClassAndInstanceSizeFromPattern( } @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) internal func _instantiateKeyPathBuffer( _ origPatternBuffer: KeyPathBuffer, _ origDestData: UnsafeMutableRawBufferPointer, diff --git a/stdlib/public/core/LazyCollection.swift b/stdlib/public/core/LazyCollection.swift index 82a92ac70cc88..19495e1acc521 100644 --- a/stdlib/public/core/LazyCollection.swift +++ b/stdlib/public/core/LazyCollection.swift @@ -53,7 +53,6 @@ public struct LazyCollection { /// Creates an instance with `base` as its underlying Collection /// instance. @inlinable - @usableFromInline internal init(_base: Base) { self._base = _base } diff --git a/stdlib/public/core/LazySequence.swift b/stdlib/public/core/LazySequence.swift index 4480e89fdc4b3..7fc3b738f35b8 100644 --- a/stdlib/public/core/LazySequence.swift +++ b/stdlib/public/core/LazySequence.swift @@ -185,7 +185,6 @@ public struct LazySequence: _SequenceWrapper { /// which some operations such as `map` and `filter` are implemented /// lazily. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_base: Base) { self._base = _base } diff --git a/stdlib/public/core/ManagedBuffer.swift b/stdlib/public/core/ManagedBuffer.swift index 0abf59e448d3f..2f23b627d109a 100644 --- a/stdlib/public/core/ManagedBuffer.swift +++ b/stdlib/public/core/ManagedBuffer.swift @@ -13,7 +13,6 @@ import SwiftShims @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) @_silgen_name("swift_bufferAllocate") internal func _swift_bufferAllocate( bufferType type: AnyClass, @@ -73,14 +72,12 @@ open class ManagedBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal final var firstElementAddress: UnsafeMutablePointer { return UnsafeMutablePointer(Builtin.projectTailElems(self, Element.self)) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal final var headerAddress: UnsafeMutablePointer
{ return UnsafeMutablePointer
(Builtin.addressof(&header)) } @@ -134,7 +131,6 @@ open class ManagedBuffer { /// Make ordinary initialization unavailable @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_doNotCallMe: ()) { _sanityCheckFailure("Only initialize these by calling create") } @@ -237,7 +233,6 @@ public struct ManagedBufferPointer : Equatable { /// for the _ContiguousArrayBuffer that this check must always succeed we omit /// it in this specialized constructor. @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal init(_uncheckedUnsafeBufferObject buffer: AnyObject) { ManagedBufferPointer._sanityCheckValidBufferClass(type(of: buffer)) self._nativeBuffer = Builtin.unsafeCastToNativeObject(buffer) @@ -329,7 +324,6 @@ public struct ManagedBufferPointer : Equatable { /// properties. The `deinit` of `bufferClass` must destroy its /// stored `Header` and any constructed `Element`s. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init( bufferClass: AnyClass, minimumCapacity: Int @@ -346,7 +340,6 @@ public struct ManagedBufferPointer : Equatable { /// Internal version for use by _ContiguousArrayBuffer.init where we know that /// we have a valid buffer class and that the capacity is >= 0. @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal init( _uncheckedBufferClass: AnyClass, minimumCapacity: Int @@ -372,7 +365,6 @@ public struct ManagedBufferPointer : Equatable { /// - Note: It is an error to use the `header` property of the resulting /// instance unless it has been initialized. @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal init(_ buffer: ManagedBuffer) { _nativeBuffer = Builtin.unsafeCastToNativeObject(buffer) } @@ -380,7 +372,6 @@ public struct ManagedBufferPointer : Equatable { internal typealias _My = ManagedBufferPointer @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static func _checkValidBufferClass( _ bufferClass: AnyClass, creating: Bool = false ) { @@ -399,7 +390,6 @@ public struct ManagedBufferPointer : Equatable { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static func _sanityCheckValidBufferClass( _ bufferClass: AnyClass, creating: Bool = false ) { @@ -419,7 +409,6 @@ public struct ManagedBufferPointer : Equatable { /// The required alignment for allocations of this type, minus 1 @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static var _alignmentMask: Int { return max( MemoryLayout<_HeapObject>.alignment, @@ -428,21 +417,18 @@ public struct ManagedBufferPointer : Equatable { /// The actual number of bytes allocated for this object. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var _capacityInBytes: Int { return _stdlib_malloc_size(_address) } /// The address of this instance in a convenient pointer-to-bytes form @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var _address: UnsafeMutableRawPointer { return UnsafeMutableRawPointer(Builtin.bridgeToRawPointer(_nativeBuffer)) } /// Offset from the allocated storage for `self` to the stored `Header` @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static var _headerOffset: Int { _onFastPath() return _roundUp( @@ -454,7 +440,6 @@ public struct ManagedBufferPointer : Equatable { /// instance. Not safe to use without _fixLifetime calls to /// guarantee it doesn't dangle @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var _headerPointer: UnsafeMutablePointer
{ _onFastPath() return (_address + _My._headerOffset).assumingMemoryBound( @@ -465,7 +450,6 @@ public struct ManagedBufferPointer : Equatable { /// safe to use without _fixLifetime calls to guarantee it doesn't /// dangle. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var _elementPointer: UnsafeMutablePointer { _onFastPath() return (_address + _My._elementOffset).assumingMemoryBound( @@ -474,7 +458,6 @@ public struct ManagedBufferPointer : Equatable { /// Offset from the allocated storage for `self` to the `Element` storage @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static var _elementOffset: Int { _onFastPath() return _roundUp( @@ -489,7 +472,7 @@ public struct ManagedBufferPointer : Equatable { return lhs._address == rhs._address } - @usableFromInline // FIXME(sil-serialize-all) + @usableFromInline internal var _nativeBuffer: Builtin.NativeObject } @@ -561,7 +544,6 @@ public func isKnownUniquelyReferenced(_ object: inout T) -> Bool } @inlinable -@usableFromInline internal func _isKnownUniquelyReferencedOrPinned(_ object: inout T) -> Bool { return _isUniqueOrPinned(&object) } diff --git a/stdlib/public/core/Map.swift b/stdlib/public/core/Map.swift index b10e14a59b75a..9f2ef4c2836b6 100644 --- a/stdlib/public/core/Map.swift +++ b/stdlib/public/core/Map.swift @@ -27,7 +27,6 @@ public struct LazyMapSequence { /// Creates an instance with elements `transform(x)` for each element /// `x` of base. @inlinable - @usableFromInline internal init(_base: Base, transform: @escaping (Base.Element) -> Element) { self._base = _base self._transform = transform @@ -46,7 +45,6 @@ extension LazyMapSequence { public var base: Base.Iterator { return _base } @inlinable - @usableFromInline internal init( _base: Base.Iterator, _transform: @escaping (Base.Element) -> Element @@ -108,7 +106,6 @@ public struct LazyMapCollection { /// Create an instance with elements `transform(x)` for each element /// `x` of base. @inlinable - @usableFromInline internal init(_base: Base, transform: @escaping (Base.Element) -> Element) { self._base = _base self._transform = transform diff --git a/stdlib/public/core/Mirror.swift b/stdlib/public/core/Mirror.swift index 063bd66e2cbf3..d43bdc8d25b00 100644 --- a/stdlib/public/core/Mirror.swift +++ b/stdlib/public/core/Mirror.swift @@ -157,13 +157,11 @@ public struct Mirror { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static func _noSuperclassMirror() -> Mirror? { return nil } @_semantics("optimize.sil.specialize.generic.never") @inline(never) @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal static func _superclassIterator( _ subject: Subject, _ ancestorRepresentation: AncestorRepresentation ) -> () -> Mirror? { @@ -399,14 +397,12 @@ extension Mirror { @usableFromInline // FIXME(sil-serialize-all) internal struct _Dummy : CustomReflectable { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(mirror: Mirror) { self.mirror = mirror } @usableFromInline // FIXME(sil-serialize-all) internal var mirror: Mirror @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var customMirror: Mirror { return mirror } } diff --git a/stdlib/public/core/Misc.swift b/stdlib/public/core/Misc.swift index 5512950d73c04..651238e8bfab6 100644 --- a/stdlib/public/core/Misc.swift +++ b/stdlib/public/core/Misc.swift @@ -55,7 +55,6 @@ public func _autorelease(_ x: AnyObject) { /// This function is primarily useful to call various runtime functions /// written in C++. @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) internal func _withUninitializedString( _ body: (UnsafeMutablePointer) -> R ) -> (R, String) { diff --git a/stdlib/public/core/Optional.swift b/stdlib/public/core/Optional.swift index 516010cabb053..7409982127406 100644 --- a/stdlib/public/core/Optional.swift +++ b/stdlib/public/core/Optional.swift @@ -724,7 +724,6 @@ public func ?? (optional: T?, defaultValue: @autoclosure () throws -> T?) extension Optional : _ObjectiveCBridgeable { // The object that represents `none` for an Optional of this type. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static var _nilSentinel : AnyObject { @_silgen_name("_swift_Foundation_getOptionalNilSentinelObject") get diff --git a/stdlib/public/core/OutputStream.swift b/stdlib/public/core/OutputStream.swift index 9131342332de7..b608e946a0715 100644 --- a/stdlib/public/core/OutputStream.swift +++ b/stdlib/public/core/OutputStream.swift @@ -279,7 +279,6 @@ internal func _opaqueSummary(_ metadata: Any.Type) -> UnsafePointer? /// Do our best to print a value that cannot be printed directly. @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) @_semantics("optimize.sil.specialize.generic.never") internal func _adHocPrint_unlocked( _ value: T, _ mirror: Mirror, _ target: inout TargetStream, @@ -417,7 +416,6 @@ internal func _print_unlocked( /// This function is forbidden from being inlined because when building the /// standard library inlining makes us drop the special semantics. @inlinable -@usableFromInline @inline(never) @effects(readonly) internal func _toStringReadOnlyStreamable< T : TextOutputStreamable @@ -428,7 +426,6 @@ internal func _toStringReadOnlyStreamable< } @inlinable -@usableFromInline @inline(never) @effects(readonly) internal func _toStringReadOnlyPrintable< T : CustomStringConvertible @@ -466,7 +463,6 @@ public func _debugPrint_unlocked( } @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) @_semantics("optimize.sil.specialize.generic.never") internal func _dumpPrint_unlocked( _ value: T, _ mirror: Mirror, _ target: inout TargetStream @@ -542,23 +538,19 @@ internal func _dumpPrint_unlocked( @usableFromInline // FIXME(sil-serialize-all) internal struct _Stdout : TextOutputStream { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init() {} @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func _lock() { _swift_stdlib_flockfile_stdout() } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func _unlock() { _swift_stdlib_funlockfile_stdout() } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func write(_ string: String) { if string.isEmpty { return } @@ -631,7 +623,6 @@ internal struct _TeeStream< > : TextOutputStream { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(left: L, right: R) { self.left = left self.right = right @@ -644,16 +635,13 @@ internal struct _TeeStream< /// Append the given `string` to this stream. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func write(_ string: String) { left.write(string); right.write(string) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func _lock() { left._lock(); right._lock() } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func _unlock() { right._unlock(); left._unlock() } } diff --git a/stdlib/public/core/PrefixWhile.swift b/stdlib/public/core/PrefixWhile.swift index 524505f24420a..95adf3c1bb47f 100644 --- a/stdlib/public/core/PrefixWhile.swift +++ b/stdlib/public/core/PrefixWhile.swift @@ -18,7 +18,6 @@ public struct LazyPrefixWhileSequence { public typealias Element = Base.Element @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_base: Base, predicate: @escaping (Element) -> Bool) { self._base = _base self._predicate = predicate @@ -50,7 +49,6 @@ extension LazyPrefixWhileSequence { internal let _predicate: (Element) -> Bool @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_base: Base.Iterator, predicate: @escaping (Element) -> Bool) { self._base = _base self._predicate = predicate @@ -117,7 +115,6 @@ public struct LazyPrefixWhileCollection { public typealias SubSequence = Slice> @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_base: Base, predicate: @escaping (Element) -> Bool) { self._base = _base self._predicate = predicate @@ -158,7 +155,6 @@ extension LazyPrefixWhileCollection { /// Creates a new index wrapper for `i`. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_ i: Base.Index) { self._value = .index(i) } @@ -167,7 +163,6 @@ extension LazyPrefixWhileCollection { /// `LazyPrefixWhileCollection`. This is not the same as a wrapper /// around `Base.endIndex`. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(endOf: Base) { self._value = .pastEnd } diff --git a/stdlib/public/core/ReflectionMirror.swift b/stdlib/public/core/ReflectionMirror.swift index 489f82bb6f258..a92685d1d2686 100644 --- a/stdlib/public/core/ReflectionMirror.swift +++ b/stdlib/public/core/ReflectionMirror.swift @@ -10,19 +10,16 @@ // //===----------------------------------------------------------------------===// -@inlinable // FIXME(sil-serialize-all) @usableFromInline // FIXME(sil-serialize-all) @_silgen_name("swift_reflectionMirror_normalizedType") internal func _getNormalizedType(_: T, type: Any.Type) -> Any.Type -@inlinable // FIXME(sil-serialize-all) @usableFromInline // FIXME(sil-serialize-all) @_silgen_name("swift_reflectionMirror_count") internal func _getChildCount(_: T, type: Any.Type) -> Int internal typealias NameFreeFunc = @convention(c) (UnsafePointer?) -> Void -@inlinable // FIXME(sil-serialize-all) @usableFromInline // FIXME(sil-serialize-all) @_silgen_name("swift_reflectionMirror_subscript") internal func _getChild( @@ -34,13 +31,11 @@ internal func _getChild( ) -> Any // Returns 'c' (class), 'e' (enum), 's' (struct), 't' (tuple), or '\0' (none) -@inlinable // FIXME(sil-serialize-all) @usableFromInline // FIXME(sil-serialize-all) @_silgen_name("swift_reflectionMirror_displayStyle") internal func _getDisplayStyle(_: T) -> CChar @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) internal func getChild(of value: T, type: Any.Type, index: Int) -> (label: String?, value: Any) { var nameC: UnsafePointer? = nil var freeFunc: NameFreeFunc? = nil @@ -53,24 +48,20 @@ internal func getChild(of value: T, type: Any.Type, index: Int) -> (label: St } #if _runtime(_ObjC) -@inlinable // FIXME(sil-serialize-all) @usableFromInline // FIXME(sil-serialize-all) @_silgen_name("swift_reflectionMirror_quickLookObject") internal func _getQuickLookObject(_: T) -> AnyObject? -@inlinable // FIXME(sil-serialize-all) @usableFromInline // FIXME(sil-serialize-all) @_silgen_name("_swift_stdlib_NSObject_isKindOfClass") internal func _isImpl(_ object: AnyObject, kindOf: AnyObject) -> Bool @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) internal func _is(_ object: AnyObject, kindOf `class`: String) -> Bool { return _isImpl(object, kindOf: `class` as AnyObject) } @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) internal func _getClassPlaygroundQuickLook( _ object: AnyObject ) -> PlaygroundQuickLook? { @@ -121,7 +112,6 @@ internal func _getClassPlaygroundQuickLook( extension Mirror { @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal init(internalReflecting subject: Any, subjectType: Any.Type? = nil, customAncestor: Mirror? = nil) @@ -170,7 +160,6 @@ extension Mirror { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal static func quickLookObject(_ subject: Any) -> PlaygroundQuickLook? { #if _runtime(_ObjC) let object = _getQuickLookObject(subject) diff --git a/stdlib/public/core/Repeat.swift b/stdlib/public/core/Repeat.swift index 07875b21fdc94..33948cec2e7e2 100644 --- a/stdlib/public/core/Repeat.swift +++ b/stdlib/public/core/Repeat.swift @@ -45,7 +45,6 @@ extension Repeated: RandomAccessCollection { /// Creates an instance that contains `count` elements having the /// value `repeatedValue`. - @usableFromInline @inlinable internal init(_repeating repeatedValue: Element, count: Int) { _precondition(count >= 0, "Repetition count should be non-negative") diff --git a/stdlib/public/core/Reverse.swift b/stdlib/public/core/Reverse.swift index fa5db9589f665..275496739e1b5 100644 --- a/stdlib/public/core/Reverse.swift +++ b/stdlib/public/core/Reverse.swift @@ -59,7 +59,6 @@ public struct ReversedCollection { /// reverse order. /// /// - Complexity: O(1) - @usableFromInline @inlinable internal init(_base: Base) { self._base = _base diff --git a/stdlib/public/core/Runtime.swift.gyb b/stdlib/public/core/Runtime.swift.gyb index 56b963707beb3..ebfffa8f0d43d 100644 --- a/stdlib/public/core/Runtime.swift.gyb +++ b/stdlib/public/core/Runtime.swift.gyb @@ -146,7 +146,6 @@ func _swift_stdlib_atomicStoreUInt${bits}( } @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) internal func _swift_stdlib_atomicStoreInt${bits}( object target: UnsafeMutablePointer, desired: Int${bits}) { @@ -164,7 +163,6 @@ func _swift_stdlib_atomicLoadUInt${bits}( } @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) internal func _swift_stdlib_atomicLoadInt${bits}( object target: UnsafeMutablePointer) -> Int${bits} { @@ -189,7 +187,6 @@ func _swift_stdlib_atomicFetch${operation}UInt${bits}( // Warning: no overflow checking. @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) internal func _swift_stdlib_atomicFetch${operation}Int${bits}( object target: UnsafeMutablePointer, operand: Int${bits}) -> Int${bits} { @@ -204,7 +201,6 @@ internal func _swift_stdlib_atomicFetch${operation}Int${bits}( % end @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) internal func _stdlib_atomicCompareExchangeStrongInt( object target: UnsafeMutablePointer, expected: UnsafeMutablePointer, @@ -221,7 +217,6 @@ internal func _stdlib_atomicCompareExchangeStrongInt( } @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) internal func _swift_stdlib_atomicStoreInt( object target: UnsafeMutablePointer, desired: Int) { @@ -284,7 +279,6 @@ public final class _stdlib_AtomicInt { internal var _value: Int @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var _valuePtr: UnsafeMutablePointer { return _getUnsafePointerToStoredProperties(self).assumingMemoryBound( to: Int.self) @@ -344,7 +338,6 @@ public final class _stdlib_AtomicInt { @usableFromInline // FIXME(sil-serialize-all) internal struct _Buffer32 { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init() {} % for i in range(32): @usableFromInline // FIXME(sil-serialize-all) @@ -352,7 +345,6 @@ internal struct _Buffer32 { % end @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func withBytes( _ body: (UnsafeMutablePointer) throws -> Result ) rethrows -> Result @@ -368,7 +360,6 @@ internal struct _Buffer32 { @usableFromInline // FIXME(sil-serialize-all) internal struct _Buffer72 { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init() {} % for i in range(72): @usableFromInline // FIXME(sil-serialize-all) @@ -376,7 +367,6 @@ internal struct _Buffer72 { % end @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func withBytes( _ body: (UnsafeMutablePointer) throws -> Result ) rethrows -> Result @@ -393,7 +383,6 @@ internal struct _Buffer72 { #if !os(Windows) && (arch(i386) || arch(x86_64)) % end -@inlinable // FIXME(sil-serialize-all) @usableFromInline // FIXME(sil-serialize-all) @_silgen_name("swift_float${bits}ToString") internal func _float${bits}ToStringImpl( @@ -403,7 +392,6 @@ internal func _float${bits}ToStringImpl( ) -> UInt @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) internal func _float${bits}ToString( _ value: Float${bits}, debug: Bool ) -> String { @@ -422,7 +410,6 @@ internal func _float${bits}ToString( % end -@inlinable // FIXME(sil-serialize-all) @usableFromInline // FIXME(sil-serialize-all) @_silgen_name("swift_int64ToString") internal func _int64ToStringImpl( @@ -432,7 +419,6 @@ internal func _int64ToStringImpl( ) -> UInt @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) internal func _int64ToString( _ value: Int64, radix: Int64 = 10, uppercase: Bool = false ) -> String { @@ -455,7 +441,6 @@ internal func _int64ToString( } } -@inlinable // FIXME(sil-serialize-all) @usableFromInline // FIXME(sil-serialize-all) @_silgen_name("swift_uint64ToString") internal func _uint64ToStringImpl( @@ -488,7 +473,6 @@ func _uint64ToString( } @inlinable -@usableFromInline internal func _rawPointerToString(_ value: Builtin.RawPointer) -> String { var result = _uint64ToString( UInt64( @@ -515,11 +499,9 @@ internal func _rawPointerToString(_ value: Builtin.RawPointer) -> String { @objc @_swift_native_objc_runtime_base(_SwiftNativeNSArrayBase) internal class _SwiftNativeNSArray { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @nonobjc internal init() {} @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) deinit {} } @@ -528,11 +510,9 @@ internal class _SwiftNativeNSArray { @objc @_swift_native_objc_runtime_base(_SwiftNativeNSDictionaryBase) internal class _SwiftNativeNSDictionary { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @nonobjc internal init() {} @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) deinit {} } @@ -541,11 +521,9 @@ internal class _SwiftNativeNSDictionary { @objc @_swift_native_objc_runtime_base(_SwiftNativeNSSetBase) internal class _SwiftNativeNSSet { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @nonobjc internal init() {} @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) deinit {} } @@ -554,11 +532,9 @@ internal class _SwiftNativeNSSet { @objc @_swift_native_objc_runtime_base(_SwiftNativeNSEnumeratorBase) internal class _SwiftNativeNSEnumerator { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @nonobjc internal init() {} @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) deinit {} } @@ -581,12 +557,10 @@ open class _SwiftNativeNSData { @objc internal class _stdlib_ReturnAutoreleasedDummy { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @objc internal init() {} @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) deinit {} // Use 'dynamic' to force Objective-C dispatch, which uses the @@ -630,30 +604,24 @@ public func _stdlib_initializeReturnAutoreleased() { @usableFromInline // FIXME(sil-serialize-all) internal class _SwiftNativeNSArray { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init() {} @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) deinit {} } @_fixed_layout // FIXME(sil-serialize-all) @usableFromInline // FIXME(sil-serialize-all) internal class _SwiftNativeNSDictionary { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init() {} @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) deinit {} } @_fixed_layout // FIXME(sil-serialize-all) @usableFromInline // FIXME(sil-serialize-all) internal class _SwiftNativeNSSet { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init() {} @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) deinit {} } diff --git a/stdlib/public/core/SentinelCollection.swift b/stdlib/public/core/SentinelCollection.swift index 6efff9a8ffe1d..65b9bbbef6724 100644 --- a/stdlib/public/core/SentinelCollection.swift +++ b/stdlib/public/core/SentinelCollection.swift @@ -33,14 +33,12 @@ where IsSentinel.Input == Base.Element { internal var _expired: Bool = false @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_ base: Base, until condition: IsSentinel) { _base = base _isSentinel = condition } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func next() -> Base.Element? { guard _fastPath(!_expired) else { return nil } let x = _base.next() @@ -65,7 +63,6 @@ where IsSentinel.Input == Base.Iterator.Element { internal var _base : Base @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func makeIterator() -> _SentinelIterator { return _SentinelIterator(_base.makeIterator(), until: _isSentinel) } @@ -74,7 +71,6 @@ where IsSentinel.Input == Base.Iterator.Element { @usableFromInline // FIXME(sil-serialize-all) internal struct Index : Comparable { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init( _impl: (position: Base.Index, element: Base.Iterator.Element)? ) { @@ -85,14 +81,12 @@ where IsSentinel.Input == Base.Iterator.Element { internal var _impl: (position: Base.Index, element: Base.Iterator.Element)? @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static func == (lhs: Index, rhs: Index) -> Bool { if rhs._impl == nil { return lhs._impl == nil } return lhs._impl != nil && rhs._impl!.position == lhs._impl!.position } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static func < (lhs: Index, rhs: Index) -> Bool { if rhs._impl == nil { return lhs._impl != nil } return lhs._impl != nil && rhs._impl!.position < lhs._impl!.position @@ -100,31 +94,26 @@ where IsSentinel.Input == Base.Iterator.Element { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var startIndex : Index { return _index(at: _base.startIndex) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var endIndex : Index { return Index(_impl: nil) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal subscript(i: Index) -> Base.Iterator.Element { return i._impl!.element } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func index(after i: Index) -> Index { return _index(at: _base.index(after: i._impl!.position)) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func _index(at i: Base.Index) -> Index { // We don't need this check if it's a precondition that the sentinel will be // found @@ -135,7 +124,6 @@ where IsSentinel.Input == Base.Iterator.Element { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_ base: Base, until condition: IsSentinel) { _base = base _isSentinel = condition @@ -146,11 +134,9 @@ where IsSentinel.Input == Base.Iterator.Element { @usableFromInline // FIXME(sil-serialize-all) internal struct _IsZero : _Predicate { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init() {} @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func apply(_ x: T) -> Bool { return x == 0 } diff --git a/stdlib/public/core/Sequence.swift b/stdlib/public/core/Sequence.swift index ebac78a32bd6d..457979638ab63 100644 --- a/stdlib/public/core/Sequence.swift +++ b/stdlib/public/core/Sequence.swift @@ -649,7 +649,6 @@ internal struct _DropFirstSequence @usableFromInline internal var _dropped: Int - @usableFromInline @inlinable internal init(_iterator: Base, limit: Int, dropped: Int = 0) { self._iterator = _iterator @@ -657,13 +656,11 @@ internal struct _DropFirstSequence self._dropped = dropped } - @usableFromInline @inlinable internal func makeIterator() -> _DropFirstSequence { return self } - @usableFromInline @inlinable internal mutating func next() -> Base.Element? { while _dropped < _limit { @@ -676,7 +673,6 @@ internal struct _DropFirstSequence return _iterator.next() } - @usableFromInline @inlinable internal func dropFirst(_ n: Int) -> AnySequence { // If this is already a _DropFirstSequence, we need to fold in @@ -705,7 +701,6 @@ internal struct _PrefixSequence @usableFromInline internal var _taken: Int - @usableFromInline @inlinable internal init(_iterator: Base, maxLength: Int, taken: Int = 0) { self._iterator = _iterator @@ -713,13 +708,11 @@ internal struct _PrefixSequence self._taken = taken } - @usableFromInline @inlinable internal func makeIterator() -> _PrefixSequence { return self } - @usableFromInline @inlinable internal mutating func next() -> Base.Element? { if _taken >= _maxLength { return nil } @@ -733,7 +726,6 @@ internal struct _PrefixSequence return nil } - @usableFromInline @inlinable internal func prefix(_ maxLength: Int) -> AnySequence { return AnySequence( @@ -760,7 +752,6 @@ internal struct _DropWhileSequence @usableFromInline internal var _nextElement: Base.Element? - @usableFromInline @inlinable internal init( iterator: Base, @@ -775,13 +766,11 @@ internal struct _DropWhileSequence } } - @usableFromInline @inlinable internal func makeIterator() -> _DropWhileSequence { return self } - @usableFromInline @inlinable internal mutating func next() -> Element? { guard _nextElement != nil else { @@ -793,7 +782,6 @@ internal struct _DropWhileSequence return next } - @usableFromInline @inlinable internal func drop( while predicate: (Element) throws -> Bool diff --git a/stdlib/public/core/Set.swift b/stdlib/public/core/Set.swift index e230127d20a2e..705505ace998a 100644 --- a/stdlib/public/core/Set.swift +++ b/stdlib/public/core/Set.swift @@ -180,7 +180,6 @@ extension Set { /// Private initializer. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_nativeBuffer: _NativeSetBuffer) { _variantBuffer = _VariantBuffer.native(_nativeBuffer) } @@ -393,7 +392,6 @@ extension Set: Collection { /// /// (isSubset: lhs ⊂ rhs, isEqual: lhs ⊂ rhs and |lhs| = |rhs|) @inlinable -@usableFromInline internal func _compareSets(_ lhs: Set, _ rhs: Set) -> (isSubset: Bool, isEqual: Bool) { // FIXME(performance): performance could be better if we start by comparing @@ -891,7 +889,6 @@ extension Set: SetAlgebra { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal func _subtracting(_ other: S) -> Set where S.Element == Element { var newSet = self @@ -919,7 +916,6 @@ extension Set: SetAlgebra { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func _subtract(_ other: S) where S.Element == Element { for item in other { @@ -1046,7 +1042,6 @@ extension Set: CustomStringConvertible, CustomDebugStringConvertible { #if _runtime(_ObjC) @_silgen_name("swift_stdlib_CFSetGetValues") -@inlinable // FIXME(sil-serialize-all) @usableFromInline // FIXME(sil-serialize-all) internal func _stdlib_CFSetGetValues(_ nss: _NSSet, _: UnsafeMutablePointer) @@ -1054,7 +1049,6 @@ func _stdlib_CFSetGetValues(_ nss: _NSSet, _: UnsafeMutablePointer) /// Equivalent to `NSSet.allObjects`, but does not leave objects on the /// autorelease pool. @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) internal func _stdlib_NSSet_allObjects(_ nss: _NSSet) -> _HeapBuffer { let count = nss.count @@ -1483,7 +1477,6 @@ internal class _RawNativeSetStorage: // This API is unsafe and needs a `_fixLifetime` in the caller. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @nonobjc internal final var _initializedHashtableEntriesBitMapBuffer: UnsafeMutablePointer { @@ -1494,7 +1487,6 @@ internal class _RawNativeSetStorage: /// created without any elements. The contents of the storage should never /// be mutated. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @nonobjc internal static var empty: RawStorage { return Builtin.bridgeFromRawPointer( @@ -1504,7 +1496,6 @@ internal class _RawNativeSetStorage: // This type is made with allocWithTailElems, so no init is ever called. // But we still need to have an init to satisfy the compiler. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @nonobjc internal init(_doNotCallMe: ()) { _sanityCheckFailure("Only create this by using the `empty` singleton") @@ -1519,7 +1510,6 @@ internal class _RawNativeSetStorage: /// _HashableTypedNativeSetStorage overloads this to give /// _NativeSelfNSEnumerator proper type parameters. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @objc internal func enumerator() -> _NSEnumerator { return _NativeSetNSEnumerator( @@ -1527,14 +1517,12 @@ internal class _RawNativeSetStorage: } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @objc(copyWithZone:) internal func copy(with zone: _SwiftNSZone?) -> AnyObject { return self } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @objc(countByEnumeratingWithState:objects:count:) internal func countByEnumerating( with state: UnsafeMutablePointer<_SwiftNSFastEnumerationState>, @@ -1555,21 +1543,18 @@ internal class _RawNativeSetStorage: } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @objc internal required init(objects: UnsafePointer, count: Int) { _sanityCheckFailure("don't call this designated initializer") } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @objc internal func member(_ object: AnyObject) -> AnyObject? { return nil } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @objc internal func objectEnumerator() -> _NSEnumerator { return enumerator() @@ -1602,7 +1587,6 @@ internal class _TypedNativeSetStorage: _RawNativeSetStorage { // This type is made with allocWithTailElems, so no init is ever called. // But we still need to have an init to satisfy the compiler. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @nonobjc override internal init(_doNotCallMe: ()) { _sanityCheckFailure("Only create this by calling Buffer's inits") @@ -1610,7 +1594,6 @@ internal class _TypedNativeSetStorage: _RawNativeSetStorage { #if _runtime(_ObjC) @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @objc internal required init(objects: UnsafePointer, count: Int) { _sanityCheckFailure("don't call this designated initializer") @@ -1630,7 +1613,6 @@ final internal class _HashableTypedNativeSetStorage // This type is made with allocWithTailElems, so no init is ever called. // But we still need to have an init to satisfy the compiler. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @nonobjc override internal init(_doNotCallMe: ()) { _sanityCheckFailure("Only create this by calling Buffer's inits'") @@ -1643,26 +1625,22 @@ final internal class _HashableTypedNativeSetStorage // just wrappers around a RawNativeSetStorage. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var buffer: Buffer { return Buffer(_storage: self) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var full: FullContainer { return FullContainer(_nativeBuffer: buffer) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal override func enumerator() -> _NSEnumerator { return _NativeSetNSEnumerator( Buffer(_storage: self)) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @objc(countByEnumeratingWithState:objects:count:) internal override func countByEnumerating( with state: UnsafeMutablePointer<_SwiftNSFastEnumerationState>, @@ -1704,7 +1682,6 @@ final internal class _HashableTypedNativeSetStorage } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @nonobjc internal func getObjectFor(_ aKey: AnyObject) -> AnyObject? { guard let nativeKey = _conditionallyBridgeFromObjectiveC(aKey, Key.self) @@ -1720,14 +1697,12 @@ final internal class _HashableTypedNativeSetStorage } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @objc internal required init(objects: UnsafePointer, count: Int) { _sanityCheckFailure("don't call this designated initializer") } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @objc override internal func member(_ object: AnyObject) -> AnyObject? { return getObjectFor(object) @@ -1763,7 +1738,6 @@ internal struct _NativeSetBuffer { /// Creates a Buffer with a storage that is typed, but doesn't understand /// Hashing. Mostly for bridging; prefer `init(minimumCapacity:)`. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_exactBucketCount bucketCount: Int, unhashable: ()) { let bitmapWordCount = _UnsafeBitMap.sizeInWords(forSizeInBits: bucketCount) let storage = Builtin.allocWithTailElems_2(TypedStorage.self, @@ -1775,7 +1749,6 @@ internal struct _NativeSetBuffer { /// Given a bucket count and uninitialized RawStorage, completes the /// initialization and returns a Buffer. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_exactBucketCount bucketCount: Int, storage: RawStorage) { storage.bucketCount = bucketCount storage.count = 0 @@ -1814,13 +1787,11 @@ internal struct _NativeSetBuffer { // Forwarding the individual fields of the storage in various forms @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal var bucketCount: Int { return _assumeNonNegative(_storage.bucketCount) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal var count: Int { set { _storage.count = newValue @@ -1831,7 +1802,6 @@ internal struct _NativeSetBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var _initializedHashtableEntriesBitMapBuffer: UnsafeMutablePointer { return _storage._initializedHashtableEntriesBitMapBuffer @@ -1839,21 +1809,18 @@ internal struct _NativeSetBuffer { // This API is unsafe and needs a `_fixLifetime` in the caller. @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal var keys: UnsafeMutablePointer { return _storage.keys.assumingMemoryBound(to: Key.self) } /// Constructs a buffer adopting the given storage. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_storage: RawStorage) { self._storage = _storage } /// Constructs an instance from the empty singleton. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init() { self._storage = RawStorage.empty } @@ -1862,7 +1829,6 @@ internal struct _NativeSetBuffer { // but only the parts that don't actually rely on hashing. @inlinable // FIXME(sil-serialize-all) - @usableFromInline @inline(__always) internal func key(at i: Int) -> Key { _sanityCheck(i >= 0 && i < bucketCount) @@ -1878,7 +1844,6 @@ internal struct _NativeSetBuffer { /// /// Intended for use with verbatim bridgeable keys. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func bridgedKey(at index: Index) -> AnyObject { let k = key(at: index.offset) return _bridgeAnythingToObjectiveC(k) @@ -1888,7 +1853,6 @@ internal struct _NativeSetBuffer { /// /// Intended for use with verbatim bridgeable keys. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func bridgedValue(at index: Index) -> AnyObject { let v = value(at: index.offset) return _bridgeAnythingToObjectiveC(v) @@ -1896,7 +1860,6 @@ internal struct _NativeSetBuffer { #endif @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal func isInitializedEntry(at i: Int) -> Bool { _sanityCheck(i >= 0 && i < bucketCount) defer { _fixLifetime(self) } @@ -1905,7 +1868,6 @@ internal struct _NativeSetBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @_transparent internal func destroyEntry(at i: Int) { _sanityCheck(isInitializedEntry(at: i)) @@ -1916,7 +1878,6 @@ internal struct _NativeSetBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @_transparent internal func initializeKey(_ k: Key, at i: Int) { _sanityCheck(!isInitializedEntry(at: i)) @@ -1927,7 +1888,6 @@ internal struct _NativeSetBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @_transparent internal func moveInitializeEntry(from: Buffer, at: Int, toEntryAt: Int) { _sanityCheck(!isInitializedEntry(at: toEntryAt)) @@ -1941,14 +1901,12 @@ internal struct _NativeSetBuffer { /// Alias for key(at:) in Sets for better code reuse @inlinable // FIXME(sil-serialize-all) - @usableFromInline @_transparent internal func value(at i: Int) -> Value { return key(at: i) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func setKey(_ key: Key, at i: Int) { _sanityCheck(i >= 0 && i < bucketCount) _sanityCheck(isInitializedEntry(at: i)) @@ -1958,7 +1916,6 @@ internal struct _NativeSetBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal var startIndex: Index { // We start at "index after -1" instead of "0" because we need to find the // first occupied slot. @@ -1966,13 +1923,11 @@ internal struct _NativeSetBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal var endIndex: Index { return Index(offset: bucketCount) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal func index(after i: Index) -> Index { _precondition(i != endIndex) var idx = i.offset + 1 @@ -1984,13 +1939,11 @@ internal struct _NativeSetBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal func formIndex(after i: inout Index) { i = index(after: i) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func assertingGet(_ i: Index) -> SequenceElement { _precondition(i.offset >= 0 && i.offset < bucketCount) _precondition( @@ -2009,7 +1962,6 @@ extension _NativeSetBuffer where Element: Hashable internal typealias SequenceElement = Element @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @inline(__always) internal init(minimumCapacity: Int) { let bucketCount = _NativeSetBuffer.bucketCount( @@ -2019,7 +1971,6 @@ extension _NativeSetBuffer where Element: Hashable } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @inline(__always) internal init(bucketCount: Int) { // Actual bucket count is the next power of 2 greater than or equal to @@ -2032,7 +1983,6 @@ extension _NativeSetBuffer where Element: Hashable /// Create a buffer instance with room for at least 'bucketCount' entries, /// marking all entries invalid. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_exactBucketCount bucketCount: Int) { let bitmapWordCount = _UnsafeBitMap.sizeInWords(forSizeInBits: bucketCount) let storage = Builtin.allocWithTailElems_2(HashTypedStorage.self, @@ -2043,7 +1993,6 @@ extension _NativeSetBuffer where Element: Hashable #if _runtime(_ObjC) @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func bridged() -> _NSSet { // We can zero-cost bridge if our keys are verbatim // or if we're the empty singleton. @@ -2068,7 +2017,6 @@ extension _NativeSetBuffer where Element: Hashable /// A textual representation of `self`. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var description: String { var result = "" #if INTERNAL_CHECKS_ENABLED @@ -2085,7 +2033,6 @@ extension _NativeSetBuffer where Element: Hashable } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var _bucketMask: Int { // The bucket count is not negative, therefore subtracting 1 will not // overflow. @@ -2093,7 +2040,6 @@ extension _NativeSetBuffer where Element: Hashable } @inlinable // FIXME(sil-serialize-all) - @usableFromInline @inline(__always) // For performance reasons. internal func _bucket(_ k: Key) -> Int { var hasher = _Hasher(seed: _storage.seed) @@ -2102,14 +2048,12 @@ extension _NativeSetBuffer where Element: Hashable } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal func _index(after bucket: Int) -> Int { // Bucket is within 0 and bucketCount. Therefore adding 1 does not overflow. return (bucket &+ 1) & _bucketMask } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func _prev(_ bucket: Int) -> Int { // Bucket is not negative. Therefore subtracting 1 does not overflow. return (bucket &- 1) & _bucketMask @@ -2120,7 +2064,6 @@ extension _NativeSetBuffer where Element: Hashable /// If the key is not present, returns the position where it could be /// inserted. @inlinable // FIXME(sil-serialize-all) - @usableFromInline @inline(__always) internal func _find(_ key: Key, startBucket: Int) -> (pos: Index, found: Bool) { @@ -2142,7 +2085,6 @@ extension _NativeSetBuffer where Element: Hashable } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @_transparent internal static func bucketCount( forCapacity capacity: Int, @@ -2158,7 +2100,6 @@ extension _NativeSetBuffer where Element: Hashable /// This function does *not* update `count`. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func unsafeAddNew(key newKey: Element) { let (i, found) = _find(newKey, startBucket: _bucket(newKey)) _precondition( @@ -2171,7 +2112,6 @@ extension _NativeSetBuffer where Element: Hashable // @inlinable // FIXME(sil-serialize-all) - @usableFromInline @inline(__always) internal func index(forKey key: Key) -> Index? { if count == 0 { @@ -2183,7 +2123,6 @@ extension _NativeSetBuffer where Element: Hashable } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func assertingGet(_ key: Key) -> Value { let (i, found) = _find(key, startBucket: _bucket(key)) _precondition(found, "Key not found") @@ -2191,7 +2130,6 @@ extension _NativeSetBuffer where Element: Hashable } @inlinable // FIXME(sil-serialize-all) - @usableFromInline @inline(__always) internal func maybeGet(_ key: Key) -> Value? { if count == 0 { @@ -2207,7 +2145,6 @@ extension _NativeSetBuffer where Element: Hashable } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @discardableResult internal func updateValue(_ value: Value, forKey key: Key) -> Value? { _sanityCheckFailure( @@ -2215,7 +2152,6 @@ extension _NativeSetBuffer where Element: Hashable } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @discardableResult internal func insert( _ value: Value, forKey key: Key @@ -2225,7 +2161,6 @@ extension _NativeSetBuffer where Element: Hashable } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @discardableResult internal func remove(at index: Index) -> SequenceElement { _sanityCheckFailure( @@ -2233,7 +2168,6 @@ extension _NativeSetBuffer where Element: Hashable } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @discardableResult internal func removeValue(forKey key: Key) -> Value? { _sanityCheckFailure( @@ -2241,14 +2175,12 @@ extension _NativeSetBuffer where Element: Hashable } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func removeAll(keepingCapacity keepCapacity: Bool) { _sanityCheckFailure( "don't call mutating methods on _NativeSetBuffer") } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal static func fromArray(_ elements: [SequenceElementWithoutLabels]) -> Buffer { @@ -2286,13 +2218,11 @@ final internal class _NativeSetNSEnumerator internal typealias Index = _NativeSetIndex @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal override required init() { _sanityCheckFailure("don't call this designated initializer") } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_ buffer: Buffer) { self.buffer = buffer nextIndex = buffer.startIndex @@ -2313,7 +2243,6 @@ final internal class _NativeSetNSEnumerator // @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @objc internal func nextObject() -> AnyObject? { if nextIndex == endIndex { @@ -2325,7 +2254,6 @@ final internal class _NativeSetNSEnumerator } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @objc(countByEnumeratingWithState:objects:count:) internal func countByEnumerating( with state: UnsafeMutablePointer<_SwiftNSFastEnumerationState>, @@ -2377,7 +2305,6 @@ final internal class _SwiftDeferredNSSet internal typealias Value = Element @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @nonobjc internal init(bucketCount: Int = 2) { nativeBuffer = NativeBuffer(bucketCount: bucketCount) @@ -2385,7 +2312,6 @@ final internal class _SwiftDeferredNSSet } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(nativeBuffer: NativeBuffer) { self.nativeBuffer = nativeBuffer super.init() @@ -2404,7 +2330,6 @@ final internal class _SwiftDeferredNSSet internal var nativeBuffer: NativeBuffer @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @objc(copyWithZone:) internal func copy(with zone: _SwiftNSZone?) -> AnyObject { // Instances of this class should be visible outside of standard library as @@ -2420,21 +2345,18 @@ final internal class _SwiftDeferredNSSet // @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @objc internal required init(objects: UnsafePointer, count: Int) { _sanityCheckFailure("don't call this designated initializer") } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @objc internal func member(_ object: AnyObject) -> AnyObject? { return bridgingObjectForKey(object) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @objc internal func objectEnumerator() -> _NSEnumerator { return enumerator() @@ -2443,7 +2365,6 @@ final internal class _SwiftDeferredNSSet /// Returns the pointer to the stored property, which contains bridged /// Set elements. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @nonobjc internal var _heapStorageBridgedPtr: UnsafeMutablePointer { return _getUnsafePointerToStoredProperties(self).assumingMemoryBound( @@ -2452,7 +2373,6 @@ final internal class _SwiftDeferredNSSet /// The buffer for bridged Set elements, if present. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @nonobjc internal var _bridgedStorage: BridgedBuffer.RawStorage? { @@ -2466,7 +2386,6 @@ final internal class _SwiftDeferredNSSet /// Attach a buffer for bridged Set elements. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @nonobjc internal func _initializeHeapStorageBridged(_ newStorage: AnyObject) { _stdlib_atomicInitializeARCRef( @@ -2475,13 +2394,11 @@ final internal class _SwiftDeferredNSSet /// Returns the bridged Set values. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var bridgedBuffer: BridgedBuffer { return BridgedBuffer(_storage: _bridgedStorage!) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @nonobjc internal func bridgeEverything() { if _fastPath(_bridgedStorage != nil) { @@ -2511,14 +2428,12 @@ final internal class _SwiftDeferredNSSet } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @objc internal var count: Int { return nativeBuffer.count } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @nonobjc internal func bridgingObjectForKey(_ aKey: AnyObject) -> AnyObject? { @@ -2535,7 +2450,6 @@ final internal class _SwiftDeferredNSSet } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @objc internal func enumerator() -> _NSEnumerator { bridgeEverything() @@ -2543,7 +2457,6 @@ final internal class _SwiftDeferredNSSet } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @objc(countByEnumeratingWithState:objects:count:) internal func countByEnumerating( with state: UnsafeMutablePointer<_SwiftNSFastEnumerationState>, @@ -2605,7 +2518,6 @@ internal struct _CocoaSetBuffer: _HashBuffer { internal var cocoaSet: _NSSet @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(cocoaSet: _NSSet) { self.cocoaSet = cocoaSet } @@ -2618,32 +2530,27 @@ internal struct _CocoaSetBuffer: _HashBuffer { internal typealias Value = AnyObject @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var startIndex: Index { return Index(cocoaSet, startIndex: ()) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var endIndex: Index { return Index(cocoaSet, endIndex: ()) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal func index(after i: Index) -> Index { return i.successor() } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func formIndex(after i: inout Index) { // FIXME: swift-3-indexing-model: optimize if possible. i = i.successor() } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal func index(forKey key: Key) -> Index? { // Fast path that does not involve creating an array of all keys. In case // the key is present, this lookup is a penalty for the slow path, but the @@ -2667,7 +2574,6 @@ internal struct _CocoaSetBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func assertingGet(_ i: Index) -> SequenceElement { let value: Value? = i.allKeys[i.currentKeyIndex] _sanityCheck(value != nil, "Item not found in underlying NSSet") @@ -2676,7 +2582,6 @@ internal struct _CocoaSetBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func assertingGet(_ key: Key) -> Value { let value: Value? = cocoaSet.member(key) _precondition(value != nil, "Member not found in underlying NSSet") @@ -2684,7 +2589,6 @@ internal struct _CocoaSetBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @inline(__always) internal func maybeGet(_ key: Key) -> Value? { @@ -2693,14 +2597,12 @@ internal struct _CocoaSetBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @discardableResult internal mutating func updateValue(_ value: Value, forKey key: Key) -> Value? { _sanityCheckFailure("cannot mutate NSSet") } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @discardableResult internal mutating func insert( _ value: Value, forKey key: Key @@ -2709,33 +2611,28 @@ internal struct _CocoaSetBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @discardableResult internal mutating func remove(at index: Index) -> SequenceElement { _sanityCheckFailure("cannot mutate NSSet") } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @discardableResult internal mutating func removeValue(forKey key: Key) -> Value? { _sanityCheckFailure("cannot mutate NSSet") } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func removeAll(keepingCapacity keepCapacity: Bool) { _sanityCheckFailure("cannot mutate NSSet") } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var count: Int { return cocoaSet.count } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static func fromArray(_ elements: [SequenceElementWithoutLabels]) -> _CocoaSetBuffer { @@ -2766,14 +2663,12 @@ internal enum _VariantSetBuffer: _HashBuffer { #endif @inlinable // FIXME(sil-serialize-all) - @usableFromInline @_transparent internal var guaranteedNative: Bool { return _canBeClass(Key.self) == 0 || _canBeClass(Value.self) == 0 } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func isUniquelyReferenced() -> Bool { // Note that &self drills down through .native(NativeBuffer) to the first // property in NativeBuffer, which is the reference to the storage. @@ -2794,7 +2689,6 @@ internal enum _VariantSetBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal var asNative: NativeBuffer { get { switch self { @@ -2812,7 +2706,6 @@ internal enum _VariantSetBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func ensureNativeBuffer() { #if _runtime(_ObjC) if _fastPath(guaranteedNative) { return } @@ -2824,7 +2717,6 @@ internal enum _VariantSetBuffer: _HashBuffer { #if _runtime(_ObjC) @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var asCocoa: CocoaBuffer { switch self { case .native: @@ -2837,7 +2729,6 @@ internal enum _VariantSetBuffer: _HashBuffer { /// Return true if self is native. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var _isNative: Bool { #if _runtime(_ObjC) switch self { @@ -2853,7 +2744,6 @@ internal enum _VariantSetBuffer: _HashBuffer { @inline(__always) @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func ensureUniqueNativeBufferNative( withBucketCount desiredBucketCount: Int ) -> (reallocated: Bool, capacityChanged: Bool) { @@ -2885,7 +2775,6 @@ internal enum _VariantSetBuffer: _HashBuffer { @inline(__always) @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func ensureUniqueNativeBuffer( withCapacity minimumCapacity: Int ) -> (reallocated: Bool, capacityChanged: Bool) { @@ -2898,7 +2787,6 @@ internal enum _VariantSetBuffer: _HashBuffer { /// Ensure this we hold a unique reference to a native buffer /// having at least `minimumCapacity` elements. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func ensureUniqueNativeBuffer( withBucketCount desiredBucketCount: Int ) -> (reallocated: Bool, capacityChanged: Bool) { @@ -2942,7 +2830,6 @@ internal enum _VariantSetBuffer: _HashBuffer { #if _runtime(_ObjC) @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @inline(never) internal mutating func migrateDataToNativeBuffer( _ cocoaBuffer: _CocoaSetBuffer @@ -2956,7 +2843,6 @@ internal enum _VariantSetBuffer: _HashBuffer { /// Reserves enough space for the specified number of elements to be stored /// without reallocating additional storage. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func reserveCapacity(_ capacity: Int) { _ = ensureUniqueNativeBuffer(withCapacity: capacity) } @@ -2969,7 +2855,6 @@ internal enum _VariantSetBuffer: _HashBuffer { /// newly allocated storage. For native storage, this is the element count /// at which adding any more elements will exceed the load factor. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var capacity: Int { switch self { case .native: @@ -2989,7 +2874,6 @@ internal enum _VariantSetBuffer: _HashBuffer { internal typealias Index = SetIndex @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var startIndex: Index { if _fastPath(guaranteedNative) { return ._native(asNative.startIndex) @@ -3006,7 +2890,6 @@ internal enum _VariantSetBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var endIndex: Index { if _fastPath(guaranteedNative) { return ._native(asNative.endIndex) @@ -3023,7 +2906,6 @@ internal enum _VariantSetBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal func index(after i: Index) -> Index { if _fastPath(guaranteedNative) { return ._native(asNative.index(after: i._nativeIndex)) @@ -3040,14 +2922,12 @@ internal enum _VariantSetBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func formIndex(after i: inout Index) { // FIXME: swift-3-indexing-model: optimize if possible. i = index(after: i) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline @inline(__always) internal func index(forKey key: Key) -> Index? { if _fastPath(guaranteedNative) { @@ -3075,7 +2955,6 @@ internal enum _VariantSetBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func assertingGet(_ i: Index) -> SequenceElement { if _fastPath(guaranteedNative) { return asNative.assertingGet(i._nativeIndex) @@ -3094,7 +2973,6 @@ internal enum _VariantSetBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func assertingGet(_ key: Key) -> Value { if _fastPath(guaranteedNative) { return asNative.assertingGet(key) @@ -3115,7 +2993,6 @@ internal enum _VariantSetBuffer: _HashBuffer { #if _runtime(_ObjC) @inlinable // FIXME(sil-serialize-all) - @usableFromInline @inline(never) internal static func maybeGetFromCocoaBuffer( _ cocoaBuffer: CocoaBuffer, forKey key: Key @@ -3129,7 +3006,6 @@ internal enum _VariantSetBuffer: _HashBuffer { #endif @inlinable // FIXME(sil-serialize-all) - @usableFromInline @inline(__always) internal func maybeGet(_ key: Key) -> Value? { if _fastPath(guaranteedNative) { @@ -3147,7 +3023,6 @@ internal enum _VariantSetBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func nativeUpdateValue( _ value: Value, forKey key: Key ) -> Value? { @@ -3177,7 +3052,6 @@ internal enum _VariantSetBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @discardableResult internal mutating func updateValue( _ value: Value, forKey key: Key @@ -3199,7 +3073,6 @@ internal enum _VariantSetBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func nativeInsert( _ value: Value, forKey key: Key ) -> (inserted: Bool, memberAfterInsert: Value) { @@ -3224,7 +3097,6 @@ internal enum _VariantSetBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @discardableResult internal mutating func insert( _ value: Value, forKey key: Key @@ -3237,7 +3109,6 @@ internal enum _VariantSetBuffer: _HashBuffer { /// - parameter offset: The offset of the element that will be deleted. /// Precondition: there should be an initialized entry at offset. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func nativeDelete( _ nativeBuffer: NativeBuffer, idealBucket: Int, offset: Int ) { @@ -3302,7 +3173,6 @@ internal enum _VariantSetBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func nativeRemoveObject(forKey key: Key) -> Value? { var idealBucket = asNative._bucket(key) var (index, found) = asNative._find(key, startBucket: idealBucket) @@ -3337,7 +3207,6 @@ internal enum _VariantSetBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func nativeRemove( at nativeIndex: NativeIndex ) -> SequenceElement { @@ -3364,7 +3233,6 @@ internal enum _VariantSetBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @discardableResult internal mutating func remove(at index: Index) -> SequenceElement { if _fastPath(guaranteedNative) { @@ -3394,7 +3262,6 @@ internal enum _VariantSetBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @discardableResult internal mutating func removeValue(forKey key: Key) -> Value? { if _fastPath(guaranteedNative) { @@ -3417,7 +3284,6 @@ internal enum _VariantSetBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func nativeRemoveAll() { if !isUniquelyReferenced() { asNative = NativeBuffer(_exactBucketCount: asNative.bucketCount) @@ -3437,7 +3303,6 @@ internal enum _VariantSetBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func removeAll(keepingCapacity keepCapacity: Bool) { if count == 0 { return @@ -3464,7 +3329,6 @@ internal enum _VariantSetBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var count: Int { if _fastPath(guaranteedNative) { return asNative.count @@ -3484,7 +3348,6 @@ internal enum _VariantSetBuffer: _HashBuffer { /// /// - Complexity: O(1). @inlinable // FIXME(sil-serialize-all) - @usableFromInline @inline(__always) internal func makeIterator() -> SetIterator { switch self { @@ -3499,7 +3362,6 @@ internal enum _VariantSetBuffer: _HashBuffer { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static func fromArray(_ elements: [SequenceElement]) -> _VariantSetBuffer { @@ -3514,7 +3376,6 @@ internal struct _NativeSetIndex: Comparable { internal var offset: Int @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal init(offset: Int) { self.offset = offset } @@ -3523,7 +3384,6 @@ internal struct _NativeSetIndex: Comparable { extension _NativeSetIndex { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static func < ( lhs: _NativeSetIndex, rhs: _NativeSetIndex @@ -3531,7 +3391,6 @@ extension _NativeSetIndex { return lhs.offset < rhs.offset } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static func <= ( lhs: _NativeSetIndex, rhs: _NativeSetIndex @@ -3539,7 +3398,6 @@ extension _NativeSetIndex { return lhs.offset <= rhs.offset } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static func > ( lhs: _NativeSetIndex, rhs: _NativeSetIndex @@ -3547,7 +3405,6 @@ extension _NativeSetIndex { return lhs.offset > rhs.offset } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static func >= ( lhs: _NativeSetIndex, rhs: _NativeSetIndex @@ -3555,7 +3412,6 @@ extension _NativeSetIndex { return lhs.offset >= rhs.offset } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static func == ( lhs: _NativeSetIndex, rhs: _NativeSetIndex @@ -3590,7 +3446,6 @@ internal struct _CocoaSetIndex: Comparable { internal var currentKeyIndex: Int @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_ cocoaSet: _NSSet, startIndex: ()) { self.cocoaSet = cocoaSet self.allKeys = _stdlib_NSSet_allObjects(cocoaSet) @@ -3598,7 +3453,6 @@ internal struct _CocoaSetIndex: Comparable { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_ cocoaSet: _NSSet, endIndex: ()) { self.cocoaSet = cocoaSet self.allKeys = _stdlib_NSSet_allObjects(cocoaSet) @@ -3606,7 +3460,6 @@ internal struct _CocoaSetIndex: Comparable { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_ cocoaSet: _NSSet, _ allKeys: _HeapBuffer, _ currentKeyIndex: Int @@ -3620,7 +3473,6 @@ internal struct _CocoaSetIndex: Comparable { /// /// - Precondition: The next value is representable. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func successor() -> _CocoaSetIndex { // FIXME: swift-3-indexing-model: remove this method. _precondition( @@ -3632,7 +3484,6 @@ internal struct _CocoaSetIndex: Comparable { extension _CocoaSetIndex { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static func < ( lhs: _CocoaSetIndex, rhs: _CocoaSetIndex @@ -3640,7 +3491,6 @@ extension _CocoaSetIndex { return lhs.currentKeyIndex < rhs.currentKeyIndex } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static func <= ( lhs: _CocoaSetIndex, rhs: _CocoaSetIndex @@ -3648,7 +3498,6 @@ extension _CocoaSetIndex { return lhs.currentKeyIndex <= rhs.currentKeyIndex } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static func > ( lhs: _CocoaSetIndex, rhs: _CocoaSetIndex @@ -3656,7 +3505,6 @@ extension _CocoaSetIndex { return lhs.currentKeyIndex > rhs.currentKeyIndex } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static func >= ( lhs: _CocoaSetIndex, rhs: _CocoaSetIndex @@ -3664,7 +3512,6 @@ extension _CocoaSetIndex { return lhs.currentKeyIndex >= rhs.currentKeyIndex } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static func == ( lhs: _CocoaSetIndex, rhs: _CocoaSetIndex @@ -3709,7 +3556,6 @@ extension Set { internal typealias Value = Element @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_value: SetIndexRepresentation) { self._value = _value } @@ -3718,26 +3564,23 @@ extension Set { internal var _value: SetIndexRepresentation @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal static func _native(_ index: _NativeIndex) -> Index { return SetIndex(_value: ._native(index)) } #if _runtime(_ObjC) @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal static func _cocoa(_ index: _CocoaIndex) -> Index { return SetIndex(_value: ._cocoa(index)) } #endif @inlinable // FIXME(sil-serialize-all) - @usableFromInline @_transparent internal var _guaranteedNative: Bool { return _canBeClass(Key.self) == 0 && _canBeClass(Value.self) == 0 } - @usableFromInline // FIXME(sil-serialize-all) + @inlinable // FIXME(sil-serialize-all) @_transparent internal var _nativeIndex: _NativeIndex { switch _value { @@ -3752,7 +3595,6 @@ extension Set { #if _runtime(_ObjC) @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @_transparent internal var _cocoaIndex: _CocoaIndex { switch _value { @@ -3853,7 +3695,6 @@ final internal class _CocoaSetIterator: IteratorProtocol { internal let cocoaSet: _NSSet @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var _fastEnumerationStatePtr: UnsafeMutablePointer<_SwiftNSFastEnumerationState> { return _getUnsafePointerToStoredProperties(self).assumingMemoryBound( @@ -3861,7 +3702,6 @@ final internal class _CocoaSetIterator: IteratorProtocol { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var _fastEnumerationStackBufPtr: UnsafeMutablePointer<_CocoaFastEnumerationStackBuf> { return UnsafeMutableRawPointer(_fastEnumerationStatePtr + 1) @@ -3878,13 +3718,11 @@ final internal class _CocoaSetIterator: IteratorProtocol { internal var itemCount: Int = 0 @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal init(_ cocoaSet: _NSSet) { self.cocoaSet = cocoaSet } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal func next() -> Element? { if itemIndex < 0 { return nil @@ -3960,13 +3798,11 @@ public struct SetIterator: IteratorProtocol { internal var _state: SetIteratorRepresentation @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_state: SetIteratorRepresentation) { self._state = _state } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal static func _native( start: _NativeIndex, end: _NativeIndex, buffer: _NativeBuffer ) -> SetIterator { @@ -3975,7 +3811,6 @@ public struct SetIterator: IteratorProtocol { } #if _runtime(_ObjC) @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal static func _cocoa( _ iterator: _CocoaSetIterator ) -> SetIterator{ @@ -3984,14 +3819,12 @@ public struct SetIterator: IteratorProtocol { #endif @inlinable // FIXME(sil-serialize-all) - @usableFromInline @_transparent internal var _guaranteedNative: Bool { return _canBeClass(Element.self) == 0 } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal mutating func _nativeNext() -> Element? { switch _state { case ._native(let startIndex, let endIndex, let buffer): diff --git a/stdlib/public/core/Shims.swift b/stdlib/public/core/Shims.swift index 9ae0ec088738d..074bf9cbf9be4 100644 --- a/stdlib/public/core/Shims.swift +++ b/stdlib/public/core/Shims.swift @@ -18,7 +18,6 @@ import SwiftShims @inlinable -@usableFromInline internal func _makeSwiftNSFastEnumerationState() -> _SwiftNSFastEnumerationState { return _SwiftNSFastEnumerationState( diff --git a/stdlib/public/core/SliceBuffer.swift b/stdlib/public/core/SliceBuffer.swift index 4b51cec353fc5..165e7100d0979 100644 --- a/stdlib/public/core/SliceBuffer.swift +++ b/stdlib/public/core/SliceBuffer.swift @@ -21,7 +21,6 @@ internal struct _SliceBuffer internal typealias NativeBuffer = _ContiguousArrayBuffer @inlinable - @usableFromInline internal init( owner: AnyObject, subscriptBaseAddress: UnsafeMutablePointer, indices: Range, hasNativeBuffer: Bool @@ -35,7 +34,6 @@ internal struct _SliceBuffer } @inlinable - @usableFromInline internal init() { let empty = _ContiguousArrayBuffer() self.owner = empty.owner @@ -46,7 +44,6 @@ internal struct _SliceBuffer } @inlinable - @usableFromInline internal init(_buffer buffer: NativeBuffer, shiftedToStartIndex: Int) { let shift = buffer.startIndex - shiftedToStartIndex self.init( @@ -57,7 +54,6 @@ internal struct _SliceBuffer } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal func _invariantCheck() { let isNative = _hasNativeBuffer let isNativeStorage: Bool = owner is _ContiguousArrayStorageBase @@ -68,13 +64,11 @@ internal struct _SliceBuffer } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal var _hasNativeBuffer: Bool { return (endIndexAndFlags & 1) != 0 } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal var nativeBuffer: NativeBuffer { _sanityCheck(_hasNativeBuffer) return NativeBuffer( @@ -82,7 +76,6 @@ internal struct _SliceBuffer } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal var nativeOwner: AnyObject { _sanityCheck(_hasNativeBuffer, "Expect a native array") return owner @@ -95,7 +88,6 @@ internal struct _SliceBuffer /// `_ContiguousArrayBuffer` and /// `insertCount <= numericCast(newValues.count)`. @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal mutating func replaceSubrange( _ subrange: Range, with insertCount: Int, @@ -133,7 +125,6 @@ internal struct _SliceBuffer /// buffers address the same elements when they have the same /// identity and count. @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal var identity: UnsafeRawPointer { return UnsafeRawPointer(firstElementAddress) } @@ -145,13 +136,11 @@ internal struct _SliceBuffer internal let subscriptBaseAddress: UnsafeMutablePointer @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal var firstElementAddress: UnsafeMutablePointer { return subscriptBaseAddress + startIndex } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal var firstElementAddressIfContiguous: UnsafeMutablePointer? { return firstElementAddress } @@ -163,7 +152,6 @@ internal struct _SliceBuffer //===--- Non-essential bits ---------------------------------------------===// @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal mutating func requestUniqueMutableBackingBuffer( minimumCapacity: Int ) -> NativeBuffer? { @@ -204,7 +192,6 @@ internal struct _SliceBuffer } @inlinable - @usableFromInline internal mutating func isMutableAndUniquelyReferenced() -> Bool { // This is a performance optimization that ensures that the copy of self // that occurs at -Onone is destroyed before we call @@ -220,7 +207,6 @@ internal struct _SliceBuffer } @inlinable - @usableFromInline internal mutating func isMutableAndUniquelyReferencedOrPinned() -> Bool { // This is a performance optimization that ensures that the copy of self // that occurs at -Onone is destroyed before we call @@ -239,7 +225,6 @@ internal struct _SliceBuffer /// containing the same number of elements as `self`, return it. /// Otherwise, return `nil`. @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal func requestNativeBuffer() -> _ContiguousArrayBuffer? { _invariantCheck() if _fastPath(_hasNativeBuffer && nativeBuffer.count == count) { @@ -249,7 +234,6 @@ internal struct _SliceBuffer } @inlinable // FIXME(sil-serialize-all) - @usableFromInline @discardableResult internal func _copyContents( subRange bounds: Range, @@ -266,13 +250,11 @@ internal struct _SliceBuffer /// True, if the array is native and does not need a deferred type check. @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal var arrayPropertyIsNativeTypeChecked: Bool { return _hasNativeBuffer } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal var count: Int { get { return endIndex - startIndex @@ -290,14 +272,12 @@ internal struct _SliceBuffer /// Traps unless the given `index` is valid for subscripting, i.e. /// `startIndex ≤ index < endIndex` @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal func _checkValidSubscript(_ index : Int) { _precondition( index >= startIndex && index < endIndex, "Index out of bounds") } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal var capacity: Int { let count = self.count if _slowPath(!_hasNativeBuffer) { @@ -312,19 +292,16 @@ internal struct _SliceBuffer } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal mutating func isUniquelyReferenced() -> Bool { return isKnownUniquelyReferenced(&owner) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal mutating func isUniquelyReferencedOrPinned() -> Bool { return _isKnownUniquelyReferencedOrPinned(&owner) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal func getElement(_ i: Int) -> Element { _sanityCheck(i >= startIndex, "slice index is out of range (before startIndex)") _sanityCheck(i < endIndex, "slice index is out of range") @@ -336,7 +313,6 @@ internal struct _SliceBuffer /// - Precondition: `position` is a valid position in `self` and /// `position != endIndex`. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal subscript(position: Int) -> Element { get { return getElement(position) @@ -349,7 +325,6 @@ internal struct _SliceBuffer } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal subscript(bounds: Range) -> _SliceBuffer { get { _sanityCheck(bounds.lowerBound >= startIndex) @@ -379,7 +354,6 @@ internal struct _SliceBuffer /// `endIndex` is always reachable from `startIndex` by zero or more /// applications of `index(after:)`. @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal var endIndex: Int { get { return Int(endIndexAndFlags >> 1) @@ -395,7 +369,6 @@ internal struct _SliceBuffer /// Call `body(p)`, where `p` is an `UnsafeBufferPointer` over the /// underlying contiguous storage. @inlinable - @usableFromInline internal func withUnsafeBufferPointer( _ body: (UnsafeBufferPointer) throws -> R ) rethrows -> R { @@ -407,7 +380,6 @@ internal struct _SliceBuffer /// Call `body(p)`, where `p` is an `UnsafeMutableBufferPointer` /// over the underlying contiguous storage. @inlinable - @usableFromInline internal mutating func withUnsafeMutableBufferPointer( _ body: (UnsafeMutableBufferPointer) throws -> R ) rethrows -> R { @@ -419,7 +391,6 @@ internal struct _SliceBuffer extension _SliceBuffer { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func _copyToContiguousArray() -> ContiguousArray { if _hasNativeBuffer { let n = nativeBuffer diff --git a/stdlib/public/core/SmallString.swift b/stdlib/public/core/SmallString.swift index 353fead19c0f0..a94990761f39c 100644 --- a/stdlib/public/core/SmallString.swift +++ b/stdlib/public/core/SmallString.swift @@ -22,7 +22,7 @@ typealias _SmallUTF16StringBuffer = _FixedArray16 // Helper method for declaring something as not supported in 32-bit. Use inside // a function body inside a #if block so that callers don't have to be // conditional. -@_transparent @usableFromInline +@_transparent @inlinable func unsupportedOn32bit() -> Never { _conditionallyUnreachable() } // Trivial type declaration for type checking. Never present at runtime. @@ -46,7 +46,6 @@ struct _SmallUTF8String { // @usableFromInline var _storage: _RawBitPattern = (0,0) - @usableFromInline @inlinable @inline(__always) init() { @@ -161,7 +160,6 @@ extension _SmallUTF8String { // Small string read interface // extension _SmallUTF8String { - @usableFromInline @inlinable @inline(__always) func withUTF8CodeUnits( @@ -197,7 +195,6 @@ extension _SmallUTF8String { #endif } - @usableFromInline @inlinable @inline(__always) func withUnmanagedUTF16( @@ -212,7 +209,6 @@ extension _SmallUTF8String { #endif } - @usableFromInline @inlinable @inline(__always) func withUnmanagedASCII( @@ -275,7 +271,6 @@ extension _SmallUTF8String { } } - @usableFromInline @inlinable func _invariantCheck() { #if arch(i386) || arch(arm) @@ -304,7 +299,6 @@ extension _SmallUTF8String { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func _copy( into target: UnsafeMutableBufferPointer ) where TargetCodeUnit : FixedWidthInteger & UnsignedInteger { @@ -426,7 +420,6 @@ extension _SmallUTF8String { #endif } - @usableFromInline @inlinable func _appending(_ other: C) -> _SmallUTF8String? where C.Element == UInt16 { @@ -508,10 +501,10 @@ extension _SmallUTF8String { extension _SmallUTF8String { #if arch(i386) || arch(arm) @_fixed_layout @usableFromInline struct UnicodeScalarIterator { - @usableFromInline @inlinable @inline(__always) + @inlinable @inline(__always) func next() -> Unicode.Scalar? { unsupportedOn32bit() } } - @usableFromInline @inlinable @inline(__always) + @inlinable @inline(__always) func makeUnicodeScalarIterator() -> UnicodeScalarIterator { unsupportedOn32bit() } @@ -528,14 +521,12 @@ extension _SmallUTF8String { var _offset: Int @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) init(_ base: _SmallUTF8String) { (self.buffer, self.count) = base.transcoded self._offset = 0 } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) mutating func next() -> Unicode.Scalar? { if _slowPath(_offset == count) { return nil } let u0 = buffer[_offset] @@ -555,7 +546,6 @@ extension _SmallUTF8String { } } - @usableFromInline // FIXME(sil-serialize-all) @inlinable func makeUnicodeScalarIterator() -> UnicodeScalarIterator { return UnicodeScalarIterator(self) @@ -567,7 +557,6 @@ extension _SmallUTF8String { #else extension _SmallUTF8String { @inlinable - @usableFromInline @inline(__always) init(_rawBits: _RawBitPattern) { self._storage.low = _rawBits.low @@ -576,7 +565,6 @@ extension _SmallUTF8String { } @inlinable - @usableFromInline @inline(__always) init(low: UInt, high: UInt, count: Int) { self.init() @@ -587,24 +575,20 @@ extension _SmallUTF8String { } @inlinable - @usableFromInline internal var _rawBits: _RawBitPattern { @inline(__always) get { return _storage } } @inlinable - @usableFromInline internal var lowUnpackedBits: UInt { @inline(__always) get { return _storage.low } } @inlinable - @usableFromInline internal var highUnpackedBits: UInt { @inline(__always) get { return _storage.high & 0x00FF_FFFF_FFFF_FFFF } } @inlinable - @usableFromInline internal var unpackedBits: (low: UInt, high: UInt, count: Int) { @inline(__always) get { return (lowUnpackedBits, highUnpackedBits, count) } @@ -613,7 +597,6 @@ extension _SmallUTF8String { extension _SmallUTF8String { // Operate with a pointer to the entire struct, including unused capacity // and inline count. You should almost never call this directly. - @usableFromInline @inlinable @inline(__always) mutating func _withAllUnsafeMutableBytes( @@ -623,7 +606,6 @@ extension _SmallUTF8String { defer { self = copy } return try Swift.withUnsafeMutableBytes(of: ©._storage) { try body($0) } } - @usableFromInline @inlinable @inline(__always) func _withAllUnsafeBytes( @@ -632,7 +614,6 @@ extension _SmallUTF8String { var copy = self return try Swift.withUnsafeBytes(of: ©._storage) { try body($0) } } - @usableFromInline @inlinable @inline(__always) mutating func _withMutableExcessCapacityBytes( @@ -649,7 +630,6 @@ extension _SmallUTF8String { } extension _SmallUTF8String { - @usableFromInline @inlinable @inline(__always) func _uncheckedCodeUnit(at i: Int) -> UInt8 { @@ -660,7 +640,6 @@ extension _SmallUTF8String { return _storage.high._uncheckedGetByte(at: i &- 8) } } - @usableFromInline @inlinable @inline(__always) mutating func _uncheckedSetCodeUnit(at i: Int, to: UInt8) { @@ -671,7 +650,6 @@ extension _SmallUTF8String { extension _SmallUTF8String { @inlinable - @usableFromInline @inline(__always) internal func _uncheckedClamp(upperBound: Int) -> _SmallUTF8String { _sanityCheck(upperBound <= self.count) @@ -692,7 +670,6 @@ extension _SmallUTF8String { } @inlinable - @usableFromInline @inline(__always) internal func _uncheckedClamp(lowerBound: Int) -> _SmallUTF8String { _sanityCheck(lowerBound < self.count) @@ -713,7 +690,6 @@ extension _SmallUTF8String { } @inlinable - @usableFromInline @inline(__always) internal func _uncheckedClamp( lowerBound: Int, upperBound: Int @@ -731,7 +707,6 @@ extension _SmallUTF8String {//}: _StringVariant { typealias TranscodedBuffer = _SmallUTF16StringBuffer @inlinable - @usableFromInline @discardableResult func transcode( _uncheckedInto buffer: UnsafeMutableBufferPointer @@ -753,7 +728,6 @@ extension _SmallUTF8String {//}: _StringVariant { } @inlinable - @usableFromInline @inline(__always) func transcode(into buffer: UnsafeMutablePointer) -> Int { let ptr = UnsafeMutableRawPointer(buffer).assumingMemoryBound( @@ -764,7 +738,6 @@ extension _SmallUTF8String {//}: _StringVariant { } @inlinable - @usableFromInline var transcoded: (TranscodedBuffer, count: Int) { @inline(__always) get { // TODO: in-register zero-extension for ascii @@ -810,7 +783,6 @@ extension _SmallUTF8String {//}: _StringVariant { } } -@usableFromInline @inlinable @inline(__always) internal @@ -834,7 +806,6 @@ extension UInt { // // TODO: endianess awareness day @inlinable - @usableFromInline @inline(__always) func _uncheckedGetByte(at i: Int) -> UInt8 { _sanityCheck(i >= 0 && i < MemoryLayout.stride) diff --git a/stdlib/public/core/Sort.swift.gyb b/stdlib/public/core/Sort.swift.gyb index 3f610fd036535..6249649700fe2 100644 --- a/stdlib/public/core/Sort.swift.gyb +++ b/stdlib/public/core/Sort.swift.gyb @@ -34,7 +34,6 @@ else: }% @inlinable -@usableFromInline internal func _insertionSort( _ elements: inout C, subRange range: Range @@ -177,7 +176,6 @@ func _sort3( /// - Precondition: The count of `range` must be >= 3: /// `elements.distance(from: range.lowerBound, to: range.upperBound) >= 3` @inlinable -@usableFromInline internal func _partition( _ elements: inout C, subRange range: Range @@ -254,7 +252,6 @@ func _introSort( } @inlinable -@usableFromInline internal func _introSortImpl( _ elements: inout C, subRange range: Range @@ -301,7 +298,6 @@ internal func _introSortImpl( } @inlinable -@usableFromInline internal func _siftDown( _ elements: inout C, index: C.Index, @@ -344,7 +340,6 @@ internal func _siftDown( } @inlinable -@usableFromInline internal func _heapify( _ elements: inout C, subRange range: Range @@ -376,7 +371,6 @@ internal func _heapify( } @inlinable -@usableFromInline internal func _heapSort( _ elements: inout C, subRange range: Range diff --git a/stdlib/public/core/StaticString.swift b/stdlib/public/core/StaticString.swift index bfd33259020bb..afa995a50539d 100644 --- a/stdlib/public/core/StaticString.swift +++ b/stdlib/public/core/StaticString.swift @@ -167,7 +167,6 @@ public struct StaticString } @inlinable // FIXME(sil-serialize-all) - @usableFromInline @_transparent internal init( _start: Builtin.RawPointer, @@ -185,7 +184,6 @@ public struct StaticString } @inlinable // FIXME(sil-serialize-all) - @usableFromInline @_transparent internal init( unicodeScalar: Builtin.Int32 diff --git a/stdlib/public/core/Stride.swift.gyb b/stdlib/public/core/Stride.swift.gyb index db1a754fb1529..49cb8cfc050bc 100644 --- a/stdlib/public/core/Stride.swift.gyb +++ b/stdlib/public/core/Stride.swift.gyb @@ -282,7 +282,6 @@ public struct StrideToIterator { internal var _current: (index: Int?, value: Element) @inlinable - @usableFromInline internal init(_start: Element, end: Element, stride: Element.Stride) { self._start = _start _end = end @@ -323,7 +322,6 @@ public struct StrideTo { internal let _stride: Element.Stride @inlinable - @usableFromInline internal init(_start: Element, end: Element, stride: Element.Stride) { _precondition(stride != 0, "Stride size must not be zero") // At start, striding away from end is allowed; it just makes for an @@ -496,7 +494,6 @@ public struct StrideThroughIterator { internal var _didReturnEnd: Bool = false @inlinable - @usableFromInline internal init(_start: Element, end: Element, stride: Element.Stride) { self._start = _start _end = end @@ -543,7 +540,6 @@ public struct StrideThrough { internal let _stride: Element.Stride @inlinable - @usableFromInline internal init(_start: Element, end: Element, stride: Element.Stride) { _precondition(stride != 0, "Stride size must not be zero") self._start = _start diff --git a/stdlib/public/core/String.swift b/stdlib/public/core/String.swift index f34c1f6e44c27..0572d4b26a100 100644 --- a/stdlib/public/core/String.swift +++ b/stdlib/public/core/String.swift @@ -13,7 +13,6 @@ import SwiftShims @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) @_semantics("optimize.sil.specialize.generic.partial.never") internal func _withCStringAndLength< Source : Collection, @@ -54,7 +53,6 @@ extension _StringGuts { /// Invokes `body` on a null-terminated sequence of code units in the given /// encoding corresponding to the substring in `bounds`. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func _withCSubstring( in bounds: Range, encoding targetEncoding: TargetEncoding.Type, @@ -66,7 +64,6 @@ extension _StringGuts { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @_semantics("optimize.sil.specialize.generic.partial.never") internal func _withCSubstringAndLength< Result, TargetEncoding: Unicode.Encoding @@ -135,7 +132,6 @@ extension _StringGuts { extension String { @inlinable - @usableFromInline internal static func _fromCodeUnits< Input: Collection, Encoding: Unicode.Encoding @@ -631,7 +627,6 @@ extension String { extension String { @inlinable - @usableFromInline static func _fromUTF8CodeUnitSequence( _ input: C, repair: Bool ) -> String? where C.Element == UInt8 { @@ -643,7 +638,6 @@ extension String { } @inlinable - @usableFromInline static func _fromASCII( _ input: C ) -> String where C.Element == UInt8 { @@ -798,7 +792,6 @@ extension String { /// Returns the number of code units occupied by this string /// in the given encoding. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func _encodedLength< Encoding: Unicode.Encoding >(_ encoding: Encoding.Type) -> Int { @@ -821,7 +814,6 @@ extension String { // Related: Please document how NSString interacts // with unpaired surrogates @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func _encode( _ encoding: Encoding.Type, into processCodeUnit: (Encoding.CodeUnit) -> Void @@ -984,7 +976,6 @@ extension Sequence where Element: StringProtocol { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func _joined(separator: String = "") -> String { let separatorSize = separator._guts.count var width = separator._guts.byteWidth @@ -1047,18 +1038,15 @@ extension BidirectionalCollection where Iterator.Element == String { } #if _runtime(_ObjC) -@inlinable // FIXME(sil-serialize-all) @usableFromInline // FIXME(sil-serialize-all) @_silgen_name("swift_stdlib_NSStringLowercaseString") internal func _stdlib_NSStringLowercaseString(_ str: AnyObject) -> _CocoaString -@inlinable // FIXME(sil-serialize-all) @usableFromInline // FIXME(sil-serialize-all) @_silgen_name("swift_stdlib_NSStringUppercaseString") internal func _stdlib_NSStringUppercaseString(_ str: AnyObject) -> _CocoaString #else @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) internal func _nativeUnicodeLowercaseString(_ str: String) -> String { // TODO (TODO: JIRA): check for small @@ -1132,7 +1120,6 @@ extension String { /// from the ASCII value of that character and divide by 2. The bit is set iff /// that character is a lower case character. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var _asciiLowerCaseTable: UInt64 { @inline(__always) get { @@ -1142,7 +1129,6 @@ extension String { /// The same table for upper case characters. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var _asciiUpperCaseTable: UInt64 { @inline(__always) get { diff --git a/stdlib/public/core/StringBridge.swift b/stdlib/public/core/StringBridge.swift index 19c0973e7372f..a18da46ceaeee 100644 --- a/stdlib/public/core/StringBridge.swift +++ b/stdlib/public/core/StringBridge.swift @@ -113,12 +113,10 @@ internal func _cocoaStringSubscript( // @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) internal var kCFStringEncodingASCII : _swift_shims_CFStringEncoding { @inline(__always) get { return 0x0600 } } @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) internal var kCFStringEncodingUTF8 : _swift_shims_CFStringEncoding { @inline(__always) get { return 0x8000100 } } @@ -373,7 +371,6 @@ public final class _NSContiguousString : _SwiftNativeNSString, _NSStringCore { /// anything transitively reachable form this object. Doing so /// will result in undefined behavior. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @_semantics("self_no_escaping_closure") func _unsafeWithNotEscapedSelfPointer( _ body: (OpaquePointer) throws -> Result @@ -390,7 +387,6 @@ public final class _NSContiguousString : _SwiftNativeNSString, _NSStringCore { /// transitively reachable objects. Doing so will result in undefined /// behavior. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @_semantics("pair_no_escaping_closure") func _unsafeWithNotEscapedSelfPointerPair( _ rhs: _NSContiguousString, diff --git a/stdlib/public/core/StringCharacterView.swift b/stdlib/public/core/StringCharacterView.swift index 2422d9b24f6ef..263bb63d8b212 100644 --- a/stdlib/public/core/StringCharacterView.swift +++ b/stdlib/public/core/StringCharacterView.swift @@ -181,19 +181,16 @@ extension String { extension String._CharacterView : _SwiftStringView { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var _persistentContent : String { return _base } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var _wholeString : String { return _base } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var _encodedOffsetRange : Range { return _base._encodedOffsetRange } @@ -201,7 +198,6 @@ extension String._CharacterView : _SwiftStringView { extension String._CharacterView { @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal var _guts: _StringGuts { return _base._guts } @@ -211,7 +207,6 @@ extension String._CharacterView { internal typealias UnicodeScalarView = String.UnicodeScalarView @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal var unicodeScalars: UnicodeScalarView { return UnicodeScalarView(_base._guts, coreOffset: _baseOffset) } @@ -225,7 +220,6 @@ extension String._CharacterView : BidirectionalCollection { /// Translates a view index into an index in the underlying base string using /// this view's `_baseOffset`. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func _toBaseIndex(_ index: Index) -> Index { return Index( encodedOffset: index.encodedOffset - _baseOffset, @@ -235,7 +229,6 @@ extension String._CharacterView : BidirectionalCollection { /// Translates an index in the underlying base string into a view index using /// this view's `_baseOffset`. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func _toViewIndex(_ index: Index) -> Index { return Index( encodedOffset: index.encodedOffset + _baseOffset, diff --git a/stdlib/public/core/StringComparable.swift b/stdlib/public/core/StringComparable.swift index aa50ef72b5190..8a11f2710516a 100644 --- a/stdlib/public/core/StringComparable.swift +++ b/stdlib/public/core/StringComparable.swift @@ -20,7 +20,6 @@ extension _StringGuts { } @inlinable - @usableFromInline internal static func isEqual( _ left: _StringGuts, to right: _StringGuts ) -> Bool { @@ -32,7 +31,6 @@ extension _StringGuts { } @inlinable - @usableFromInline internal static func isEqual( _ left: _StringGuts, _ leftRange: Range, to right: _StringGuts, _ rightRange: Range @@ -45,7 +43,6 @@ extension _StringGuts { } @inlinable - @usableFromInline internal static func isLess( _ left: _StringGuts, than right: _StringGuts ) -> Bool { @@ -57,7 +54,6 @@ extension _StringGuts { } @inlinable - @usableFromInline internal static func isLess( _ left: _StringGuts, _ leftRange: Range, than right: _StringGuts, _ rightRange: Range @@ -70,7 +66,6 @@ extension _StringGuts { } @inlinable - @usableFromInline internal static func compare( _ left: _StringGuts, _ leftRange: Range, to right: _StringGuts, _ rightRange: Range @@ -92,7 +87,6 @@ extension _StringGuts { } @inlinable - @usableFromInline internal static func compare( _ left: _StringGuts, to right: _StringGuts ) -> Int { diff --git a/stdlib/public/core/StringComparison.swift b/stdlib/public/core/StringComparison.swift index d1fe8d84256f3..57e4d5fba7c2b 100644 --- a/stdlib/public/core/StringComparison.swift +++ b/stdlib/public/core/StringComparison.swift @@ -22,7 +22,6 @@ enum _GutsClassification: UInt { } extension _StringGuts { - @usableFromInline @inlinable var classification: _GutsClassification { if _isSmall { return .smallUTF8 } @@ -684,7 +683,6 @@ internal func _tryNormalize( extension _UnmanagedString where CodeUnit == UInt8 { @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal func compareASCII(to other: _UnmanagedString) -> Int { // FIXME Results should be the same across all platforms. if self.start == other.start { diff --git a/stdlib/public/core/StringGraphemeBreaking.swift b/stdlib/public/core/StringGraphemeBreaking.swift index c3ab22660fbc9..50a3567f24ade 100644 --- a/stdlib/public/core/StringGraphemeBreaking.swift +++ b/stdlib/public/core/StringGraphemeBreaking.swift @@ -14,15 +14,12 @@ import SwiftShims /// CR and LF are common special cases in grapheme breaking logic @inlinable // FIXME(sil-serialize-all) -@usableFromInline internal var _CR: UInt8 { return 0x0d } @inlinable // FIXME(sil-serialize-all) -@usableFromInline internal var _LF: UInt8 { return 0x0a } extension String.Index { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(encodedOffset: Int, characterStride stride: Int) { if _slowPath(stride == 0 || stride > UInt16.max) { // Don't store a 0 stride for the endIndex @@ -37,7 +34,6 @@ extension String.Index { } extension _StringVariant { - @usableFromInline @inlinable internal func _stride(at i: String.Index) -> Int { if case .character(let stride) = i._cache { @@ -48,21 +44,18 @@ extension _StringVariant { return characterStride(atOffset: i.encodedOffset) } - @usableFromInline @inlinable internal func characterStride(atOffset offset: Int) -> Int { let slice = self.checkedSlice(from: offset) return slice.measureFirstExtendedGraphemeCluster() } - @usableFromInline @inlinable internal func characterIndex(atOffset offset: Int) -> String.Index { let stride = self.characterStride(atOffset: offset) return String.Index(encodedOffset: offset, characterStride: stride) } - @usableFromInline @inlinable internal func characterIndex(after i: String.Index) -> String.Index { let offset = i.encodedOffset @@ -78,7 +71,6 @@ extension _StringVariant { characterStride: stride2) } - @usableFromInline @inlinable internal func characterIndex(before i: String.Index) -> String.Index { let offset = i.encodedOffset @@ -92,7 +84,6 @@ extension _StringVariant { characterStride: stride) } - @usableFromInline @inlinable internal func characterIndex( _ i: String.Index, @@ -111,7 +102,6 @@ extension _StringVariant { return i } - @usableFromInline @inlinable internal func characterIndex( _ i: String.Index, @@ -160,7 +150,6 @@ extension _StringVariant { } @inlinable - @usableFromInline internal func character(at i: String.Index) -> Character { let stride = _stride(at: i) let offset = i.encodedOffset @@ -180,7 +169,6 @@ extension _StringVariant { // paths of grapheme breaking that we have high confidence won't change. /// Returns the length of the first extended grapheme cluster in UTF-16 /// code units. - @usableFromInline @inlinable internal func measureFirstExtendedGraphemeCluster() -> Int { @@ -211,7 +199,6 @@ extension _StringVariant { // /// Returns the length of the last extended grapheme cluster in UTF-16 /// code units. - @usableFromInline @inlinable internal func measureLastExtendedGraphemeCluster() -> Int { @@ -324,7 +311,6 @@ extension _UnmanagedOpaqueString { extension Unicode.UTF16 { /// Fast check for a (stable) grapheme break between two UInt16 code units @inlinable // Safe to inline - @usableFromInline internal static func _quickCheckGraphemeBreakBetween( _ lhs: UInt16, _ rhs: UInt16 ) -> Bool { diff --git a/stdlib/public/core/StringGuts.swift b/stdlib/public/core/StringGuts.swift index 185acf87bc6b3..95eb11b569f29 100644 --- a/stdlib/public/core/StringGuts.swift +++ b/stdlib/public/core/StringGuts.swift @@ -49,7 +49,6 @@ struct _StringGuts { public typealias _RawBitPattern = (_StringObject._RawBitPattern, UInt) - @usableFromInline @inlinable internal var rawBits: _RawBitPattern { @inline(__always) @@ -67,7 +66,6 @@ struct _StringGuts { extension _StringGuts { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func _invariantCheck() { #if INTERNAL_CHECKS_ENABLED _object._invariantCheck() @@ -168,7 +166,6 @@ extension _StringGuts { return _object.isSingleByte } - @usableFromInline @inlinable internal var _isEmptySingleton: Bool { @@ -181,7 +178,6 @@ extension _StringGuts { return _object.byteWidth } - @usableFromInline @inlinable internal var _nativeCount: Int { @@ -197,7 +193,7 @@ extension _StringGuts { } // TODO(SSO): consider a small-checking variant - @usableFromInline + @inlinable @inline(__always) internal init(_large storage: _SwiftStringStorage) @@ -231,7 +227,6 @@ extension _StringGuts { Builtin.reinterpretCast(_unsafeBitPattern)) } - @usableFromInline @inlinable var _cocoaCount: Int { @inline(__always) @@ -244,7 +239,6 @@ extension _StringGuts { } } - @usableFromInline @inlinable var _cocoaRawStart: UnsafeRawPointer { @inline(__always) @@ -257,7 +251,6 @@ extension _StringGuts { } } - @usableFromInline @inlinable func _asContiguousCocoa( of codeUnit: CodeUnit.Type = CodeUnit.self @@ -311,7 +304,6 @@ extension _StringGuts { #endif // _runtime(_ObjC) extension _StringGuts { - @usableFromInline @inlinable internal var _unmanagedRawStart: UnsafeRawPointer { @inline(__always) get { @@ -320,7 +312,6 @@ extension _StringGuts { } } - @usableFromInline @inlinable internal var _unmanagedCount: Int { @inline(__always) get { @@ -329,7 +320,6 @@ extension _StringGuts { } } - @usableFromInline @inlinable @inline(__always) internal @@ -346,7 +336,6 @@ extension _StringGuts { } // TODO(SSO): consider a small-checking variant - @usableFromInline @inlinable init(_large s: _UnmanagedString) where CodeUnit : FixedWidthInteger & UnsignedInteger { @@ -363,7 +352,6 @@ extension _StringGuts { // Small strings extension _StringGuts { - @usableFromInline @inlinable internal var _smallUTF8Count: Int { @inline(__always) get { @@ -375,7 +363,6 @@ extension _StringGuts { } } - @usableFromInline @inlinable internal var _smallUTF8String: _SmallUTF8String { @inline(__always) get { @@ -388,7 +375,6 @@ extension _StringGuts { } } - @usableFromInline @inlinable @inline(__always) internal init(_ small: _SmallUTF8String) { @@ -403,7 +389,6 @@ extension _StringGuts { } extension _StringGuts { - @usableFromInline @inlinable internal var _unmanagedASCIIView: _UnmanagedString { @@ -425,7 +410,6 @@ extension _StringGuts { } } - @usableFromInline @inlinable internal var _unmanagedUTF16View: _UnmanagedString { @@ -449,7 +433,6 @@ extension _StringGuts { } extension _StringGuts { - @usableFromInline @inlinable internal var _isOpaque: Bool { @@ -457,7 +440,6 @@ extension _StringGuts { get { return _object.isOpaque } } - @usableFromInline @inlinable internal var _isContiguous: Bool { @@ -658,7 +640,6 @@ extension _StringGuts { @_specialize(where CodeUnit == UInt8) @_specialize(where CodeUnit == UInt16) @_specialize(where CodeUnit == UTF16.CodeUnit) - @usableFromInline @inlinable internal func _copyToNativeStorage( @@ -706,7 +687,6 @@ extension _StringGuts { _large: _copyToNativeStorage(of: UTF16.CodeUnit.self, from: range)) } - @usableFromInline @inlinable internal mutating func allocationParametersForMutableStorage( of type: CodeUnit.Type, @@ -738,7 +718,6 @@ extension _StringGuts { // Convert ourselves (if needed) to a native string with the specified storage // parameters and call `body` on the resulting native storage. - @usableFromInline @inlinable internal mutating func withMutableStorage( @@ -769,7 +748,6 @@ extension _StringGuts { return result } - @usableFromInline @inlinable @inline(__always) internal @@ -781,7 +759,6 @@ extension _StringGuts { of: UInt8.self, unusedCapacity: unusedCapacity, body) } - @usableFromInline @inlinable @inline(__always) internal @@ -798,19 +775,16 @@ extension _StringGuts { // String API // extension _StringGuts { - @usableFromInline @inlinable internal var _hasStoredCount: Bool { @inline(__always) get { return !_object.isSmallOrCocoa } } - @usableFromInline @inlinable internal var startIndex: Int { return 0 } - @usableFromInline @inlinable internal var endIndex: Int { @inline(__always) get { return count } @@ -915,7 +889,6 @@ extension _StringGuts { // Copy code units from a slice of this string into a buffer. - @usableFromInline @inlinable // FIXME(sil-serialize-all) internal func _copy( range: Range, @@ -1011,7 +984,6 @@ extension _StringGuts { _invariantCheck() } - @usableFromInline @inlinable internal mutating func append(_ other: _UnmanagedASCIIString) { @@ -1034,7 +1006,6 @@ extension _StringGuts { } } - @usableFromInline @inlinable internal mutating func append(_ other: _UnmanagedUTF16String) { @@ -1044,7 +1015,6 @@ extension _StringGuts { } } - @usableFromInline @inlinable internal mutating func append(_ other: _UnmanagedOpaqueString) { @@ -1055,7 +1025,6 @@ extension _StringGuts { } @inlinable - @usableFromInline internal mutating func append(_ other: S) { self.append(other._wholeString._guts, range: other._encodedOffsetRange) @@ -1145,7 +1114,6 @@ extension _StringGuts { // @_specialize(where C == Character._SmallUTF16) @inlinable - @usableFromInline mutating func append(contentsOf other: C) where C.Element == UInt16 { if self._isSmall { @@ -1278,7 +1246,6 @@ extension _StringGuts : Sequence { internal var _bufferIndex: Int = 0 @inlinable - @usableFromInline internal init(_ guts: _StringGuts, range: Range) { self._guts = guts self._endOffset = range.upperBound @@ -1324,7 +1291,6 @@ extension _StringGuts : Sequence { } @inlinable - @usableFromInline internal func makeIterator(in range: Range) -> Iterator { return Iterator(self, range: range) } @@ -1334,7 +1300,6 @@ extension _StringGuts { // TODO: Drop or unify with String._fromCodeUnits // @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static func fromCodeUnits( _ input: Input, @@ -1401,7 +1366,6 @@ extension _SwiftStringStorage { /// specified encoding. If any invalid sequences are found, they are replaced /// with REPLACEMENT CHARACTER (U+FFFD). @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func _initialize( fromCodeUnits input: Input, diff --git a/stdlib/public/core/StringGutsVisitor.swift b/stdlib/public/core/StringGutsVisitor.swift index 7cc2183d948e2..41fb9ee7f0e09 100644 --- a/stdlib/public/core/StringGutsVisitor.swift +++ b/stdlib/public/core/StringGutsVisitor.swift @@ -18,7 +18,6 @@ // else ARC. // extension String { - @usableFromInline @inlinable @inline(__always) func _visit( @@ -105,7 +104,6 @@ extension String { return opaque(view) } - @usableFromInline @inlinable @inline(__always) func _visit( @@ -195,7 +193,6 @@ extension String { } } -@usableFromInline @inlinable @inline(__always) internal @@ -210,7 +207,6 @@ func _visitGuts( range: range, ascii: ascii, utf16: utf16, opaque: opaque) } -@usableFromInline @inlinable @inline(__always) internal diff --git a/stdlib/public/core/StringHashable.swift b/stdlib/public/core/StringHashable.swift index cc4ab2792da60..c8a249271c99a 100644 --- a/stdlib/public/core/StringHashable.swift +++ b/stdlib/public/core/StringHashable.swift @@ -124,7 +124,6 @@ extension _UnmanagedOpaqueString { } extension _SmallUTF8String { - @usableFromInline @inlinable internal func computeHashValue(into hasher: inout _Hasher) { #if arch(i386) || arch(arm) diff --git a/stdlib/public/core/StringIndex.swift b/stdlib/public/core/StringIndex.swift index 44605155acce5..2831ddded3b0f 100644 --- a/stdlib/public/core/StringIndex.swift +++ b/stdlib/public/core/StringIndex.swift @@ -33,22 +33,18 @@ extension String { /// Convenience accessors extension String.Index._Cache { @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal var utf16: Void? { if case .utf16 = self { return () } else { return nil } } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal var utf8: String.Index._UTF8Buffer? { if case .utf8(let r) = self { return r } else { return nil } } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal var character: UInt16? { if case .character(let r) = self { return r } else { return nil } } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal var unicodeScalar: UnicodeScalar? { if case .unicodeScalar(let r) = self { return r } else { return nil } } @@ -88,21 +84,17 @@ extension String.Index { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal init(encodedOffset o: Int, transcodedOffset: Int = 0, _ c: _Cache) { _compoundOffset = UInt64(o << _Self._strideBits | transcodedOffset) _cache = c } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static var _strideBits : Int { return 2 } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static var _mask : UInt64 { return (1 &<< _Self._strideBits) &- 1 } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal mutating func _setEncodedOffset(_ x: Int) { _compoundOffset = UInt64(x << _Self._strideBits) } @@ -115,7 +107,6 @@ extension String.Index { /// The offset of this index within whatever encoding this is being viewed as @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal var _transcodedOffset : Int { get { return Int(_compoundOffset & _Self._mask) diff --git a/stdlib/public/core/StringLegacy.swift b/stdlib/public/core/StringLegacy.swift index 150e001d88528..1254207148445 100644 --- a/stdlib/public/core/StringLegacy.swift +++ b/stdlib/public/core/StringLegacy.swift @@ -66,7 +66,6 @@ extension String { // TODO: since this is generally useful, make public via evolution proposal. extension BidirectionalCollection { @inlinable - @usableFromInline internal func _ends( with suffix: Suffix, by areEquivalent: (Element,Element) -> Bool ) -> Bool where Suffix.Element == Element { @@ -82,7 +81,6 @@ extension BidirectionalCollection { extension BidirectionalCollection where Element: Equatable { @inlinable - @usableFromInline internal func _ends( with suffix: Suffix ) -> Bool where Suffix.Element == Element { @@ -297,7 +295,6 @@ extension String { extension _StringGuts { @inlinable - @usableFromInline func _repeated(_ n: Int) -> _StringGuts { _sanityCheck(n > 1) if self._isSmall { diff --git a/stdlib/public/core/StringObject.swift b/stdlib/public/core/StringObject.swift index ee4edfae4986c..ef2f5e199fac0 100644 --- a/stdlib/public/core/StringObject.swift +++ b/stdlib/public/core/StringObject.swift @@ -52,7 +52,6 @@ struct _StringObject { #endif #if arch(i386) || arch(arm) - @usableFromInline @inlinable @inline(__always) internal @@ -62,7 +61,6 @@ struct _StringObject { _invariantCheck() } #else - @usableFromInline @inlinable @inline(__always) internal @@ -80,7 +78,6 @@ extension _StringObject { public typealias _RawBitPattern = UInt #endif - @usableFromInline @inlinable internal var rawBits: _RawBitPattern { @@ -95,7 +92,6 @@ extension _StringObject { } } - @usableFromInline @inlinable @inline(__always) // TODO: private @@ -111,7 +107,6 @@ extension _StringObject { #endif } - @usableFromInline @inlinable @inline(__always) // TODO: private @@ -131,7 +126,6 @@ extension _StringObject { // we are giving up on compile-time constant folding of ARC of values. Thus, // this should only be called from the callee of a non-inlineable function // that has no knowledge of the value-ness of the object. - @usableFromInline @inlinable @inline(__always) // TODO: private @@ -181,7 +175,6 @@ extension _StringObject { // extension _StringObject { #if arch(i386) || arch(arm) - @usableFromInline @inlinable internal static var _isCocoaBit: UInt { @@ -191,7 +184,6 @@ extension _StringObject { } } - @usableFromInline @inlinable internal static var _isOpaqueBit: UInt { @@ -201,7 +193,6 @@ extension _StringObject { } } - @usableFromInline @inlinable internal static var _twoByteBit: UInt { @@ -211,7 +202,6 @@ extension _StringObject { } } #else // !(arch(i386) || arch(arm)) - @usableFromInline @inlinable internal static var _isValueBit: UInt { @@ -225,7 +215,6 @@ extension _StringObject { // After deciding isValue, which of the two variants (on both sides) are we. // That is, native vs objc or unsafe vs small. - @usableFromInline @inlinable internal static var _subVariantBit: UInt { @@ -235,7 +224,6 @@ extension _StringObject { } } - @usableFromInline @inlinable internal static var _isOpaqueBit: UInt { @@ -245,7 +233,6 @@ extension _StringObject { } } - @usableFromInline @inlinable internal static var _twoByteBit: UInt { @@ -256,7 +243,6 @@ extension _StringObject { } // There are 4 sub-variants depending on the isValue and subVariant bits - @usableFromInline @inlinable internal static var _variantMask: UInt { @@ -265,7 +251,6 @@ extension _StringObject { _isValueBit._value, _subVariantBit._value)) } } - @usableFromInline @inlinable internal static var _payloadMask: UInt { @@ -275,7 +260,6 @@ extension _StringObject { } } - @usableFromInline @inlinable internal var _variantBits: UInt { @@ -286,7 +270,6 @@ extension _StringObject { } #endif // arch(i386) || arch(arm) - @usableFromInline @inlinable internal var referenceBits: UInt { @@ -304,7 +287,6 @@ extension _StringObject { } } - @usableFromInline @inlinable internal var payloadBits: UInt { @@ -344,7 +326,6 @@ internal var _emptyStringAddressBits: UInt { extension _StringObject { #if arch(i386) || arch(arm) - @usableFromInline @inlinable internal var isEmptySingleton: Bool { @@ -357,7 +338,6 @@ extension _StringObject { } } - @usableFromInline @inlinable @inline(__always) internal @@ -365,7 +345,6 @@ extension _StringObject { self.init(.unmanagedSingleByte, _emptyStringAddressBits) } #else - @usableFromInline @inlinable internal static var _emptyStringBitPattern: UInt { @@ -373,7 +352,6 @@ extension _StringObject { get { return _smallUTF8TopNibble } } - @usableFromInline @inlinable internal var isEmptySingleton: Bool { @@ -381,7 +359,6 @@ extension _StringObject { get { return rawBits == _StringObject._emptyStringBitPattern } } - @usableFromInline @inlinable @inline(__always) internal @@ -405,24 +382,23 @@ extension _StringObject { #if arch(i386) || arch(arm) #else - @usableFromInline @inlinable internal + @inlinable internal static var _topNibbleMask: UInt { @inline(__always) get { return 0xF000_0000_0000_0000 } } - @usableFromInline @inlinable internal + @inlinable internal static var _smallUTF8TopNibble: UInt { @inline(__always) get { return 0xE000_0000_0000_0000 } } - @usableFromInline @inlinable internal + @inlinable internal static var _smallUTF8CountMask: UInt { @inline(__always) get { return 0x0F00_0000_0000_0000 } } #endif - @usableFromInline @inlinable internal var _isSmallUTF8: Bool { @@ -443,7 +419,6 @@ extension _StringObject { // keep the count. The StringObject represents the second word of a // SmallUTF8String. // - @usableFromInline @inlinable internal var asSmallUTF8SecondWord: UInt { @@ -458,7 +433,6 @@ extension _StringObject { } } - @usableFromInline @inlinable internal var smallUTF8Count: Int { @@ -475,7 +449,6 @@ extension _StringObject { } } - @usableFromInline @inlinable internal init(_smallUTF8SecondWord bits: UInt) { @@ -494,7 +467,6 @@ extension _StringObject { // TODO: private! // extension _StringObject { - @usableFromInline @inlinable internal // TODO: private! var asNativeObject: AnyObject { @@ -520,7 +492,6 @@ extension _StringObject { } #if _runtime(_ObjC) - @usableFromInline @inlinable internal // TODO: private! var asCocoaObject: _CocoaString { @@ -546,7 +517,6 @@ extension _StringObject { } #endif - @usableFromInline @inlinable internal // TODO: private! var asOpaqueObject: _OpaqueString { @@ -558,7 +528,6 @@ extension _StringObject { } } - @usableFromInline @inlinable internal var asUnmanagedRawStart: UnsafeRawPointer { @@ -583,7 +552,6 @@ extension _StringObject { // // Determine which of the 4 major variants we are // - @usableFromInline @inlinable internal var isNative: Bool { @@ -598,7 +566,6 @@ extension _StringObject { } } - @usableFromInline @inlinable internal var isCocoa: Bool { @@ -626,7 +593,6 @@ extension _StringObject { #endif } - @usableFromInline @inlinable internal var isValue: Bool { @@ -644,7 +610,6 @@ extension _StringObject { } } - @usableFromInline @inlinable internal var isUnmanaged: Bool { @@ -663,7 +628,6 @@ extension _StringObject { } } - @usableFromInline @inlinable internal var isSmall: Bool { @@ -682,7 +646,6 @@ extension _StringObject { } } - @usableFromInline @inlinable internal var isSmallOrCocoa: Bool { @@ -704,7 +667,6 @@ extension _StringObject { // // Frequently queried properties // - @usableFromInline @inlinable internal var isContiguous: Bool { @@ -725,7 +687,6 @@ extension _StringObject { } } - @usableFromInline @inlinable internal var isOpaque: Bool { @@ -733,7 +694,6 @@ extension _StringObject { get { return !isContiguous } } - @usableFromInline @inlinable internal var isContiguousCocoa: Bool { @@ -741,7 +701,6 @@ extension _StringObject { get { return isContiguous && isCocoa } } - @usableFromInline @inlinable internal var isNoncontiguousCocoa: Bool { @@ -776,7 +735,6 @@ extension _StringObject { get { return isSingleByte ? 1 : 2 } } - @usableFromInline @inlinable var bitWidth: Int { @inline(__always) @@ -797,7 +755,6 @@ extension _StringObject { get { return isContiguous && !isSingleByte } } - @usableFromInline @inlinable @inline(__always) internal @@ -825,7 +782,6 @@ extension _StringObject { extension _StringObject { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func _invariantCheck() { #if INTERNAL_CHECKS_ENABLED _sanityCheck(MemoryLayout<_StringObject>.size == 8) @@ -865,7 +821,6 @@ extension _StringObject { // Conveniently construct, tag, flag, etc. StringObjects // extension _StringObject { - @usableFromInline @inlinable @inline(__always) internal @@ -944,7 +899,6 @@ extension _StringObject { #endif } - @usableFromInline @inlinable @inline(__always) internal @@ -963,7 +917,6 @@ extension _StringObject { isTwoByte: !isSingleByte) } - @usableFromInline @inlinable @inline(__always) internal @@ -976,7 +929,6 @@ extension _StringObject { } #if _runtime(_ObjC) - @usableFromInline @inlinable @inline(__always) internal @@ -989,7 +941,6 @@ extension _StringObject { isSingleByte: isSingleByte) } #else - @usableFromInline @inlinable @inline(__always) internal @@ -1002,7 +953,6 @@ extension _StringObject { } #endif - @usableFromInline @inlinable @inline(__always) internal @@ -1018,7 +968,6 @@ extension _StringObject { _sanityCheck(isSingleByte == (CodeUnit.bitWidth == 8)) } - @usableFromInline @inlinable @inline(__always) internal diff --git a/stdlib/public/core/StringProtocol.swift b/stdlib/public/core/StringProtocol.swift index 1b5a87c5da60c..0dacf5a8fa8b0 100644 --- a/stdlib/public/core/StringProtocol.swift +++ b/stdlib/public/core/StringProtocol.swift @@ -162,7 +162,6 @@ internal protocol _SwiftStringView { extension _SwiftStringView { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var _ephemeralContent : String { return _persistentContent } } @@ -179,7 +178,6 @@ extension StringProtocol { extension String : _SwiftStringView { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var _persistentContent : String { return self } diff --git a/stdlib/public/core/StringRangeReplaceableCollection.swift b/stdlib/public/core/StringRangeReplaceableCollection.swift index 8ec331e0b64e6..1d6edc2a6fe61 100644 --- a/stdlib/public/core/StringRangeReplaceableCollection.swift +++ b/stdlib/public/core/StringRangeReplaceableCollection.swift @@ -90,7 +90,6 @@ extension String : StringProtocol, RangeReplaceableCollection { public var endIndex: Index { return Index(encodedOffset: _guts.count) } @inlinable - @usableFromInline @inline(__always) internal func _boundsCheck(_ index: Index) { _precondition(index.encodedOffset >= 0 && index.encodedOffset < _guts.count, @@ -98,7 +97,6 @@ extension String : StringProtocol, RangeReplaceableCollection { } @inlinable - @usableFromInline @inline(__always) internal func _boundsCheck(_ range: Range) { _precondition( @@ -108,7 +106,6 @@ extension String : StringProtocol, RangeReplaceableCollection { } @inlinable - @usableFromInline @inline(__always) internal func _boundsCheck(_ range: ClosedRange) { _precondition( @@ -118,7 +115,6 @@ extension String : StringProtocol, RangeReplaceableCollection { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func _index(atEncodedOffset offset: Int) -> Index { return _visitGuts(_guts, args: offset, ascii: { ascii, offset in return ascii.characterIndex(atOffset: offset) }, @@ -464,7 +460,6 @@ extension String { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func _stride(of i: Index) -> Int { if case .character(let stride) = i._cache { // TODO: should _fastPath the case somehow diff --git a/stdlib/public/core/StringStorage.swift b/stdlib/public/core/StringStorage.swift index 02a9a8eade54a..fc5095d88d3a1 100644 --- a/stdlib/public/core/StringStorage.swift +++ b/stdlib/public/core/StringStorage.swift @@ -29,7 +29,6 @@ class _SwiftRawStringStorage : _SwiftNativeNSString { } @inlinable - @usableFromInline @nonobjc internal var rawStart: UnsafeMutableRawPointer { _abstract() @@ -54,7 +53,6 @@ where CodeUnit : UnsignedInteger & FixedWidthInteger { /// Create uninitialized storage of at least the specified capacity. @inlinable - @usableFromInline @nonobjc internal static func create( capacity: Int, @@ -84,7 +82,6 @@ where CodeUnit : UnsignedInteger & FixedWidthInteger { } @inlinable - @usableFromInline @nonobjc internal override final var rawStart: UnsafeMutableRawPointer { return UnsafeMutableRawPointer(start) @@ -149,42 +146,36 @@ extension _SwiftStringStorage { // Basic properties @inlinable - @usableFromInline @nonobjc internal final var start: UnsafeMutablePointer { return UnsafeMutablePointer(Builtin.projectTailElems(self, CodeUnit.self)) } @inlinable - @usableFromInline @nonobjc internal final var end: UnsafeMutablePointer { return start + count } @inlinable - @usableFromInline @nonobjc internal final var capacityEnd: UnsafeMutablePointer { return start + capacity } @inlinable - @usableFromInline @nonobjc var usedBuffer: UnsafeMutableBufferPointer { return UnsafeMutableBufferPointer(start: start, count: count) } @inlinable - @usableFromInline @nonobjc var unusedBuffer: UnsafeMutableBufferPointer { return UnsafeMutableBufferPointer(start: end, count: capacity - count) } @inlinable - @usableFromInline @nonobjc var unmanagedView: _UnmanagedString { return _UnmanagedString(start: self.start, count: self.count) @@ -195,7 +186,6 @@ extension _SwiftStringStorage { // Append operations @inlinable - @usableFromInline @nonobjc internal final func _appendInPlace( _ other: _UnmanagedString @@ -208,7 +198,6 @@ extension _SwiftStringStorage { } @inlinable - @usableFromInline @nonobjc internal final func _appendInPlace(_ other: _UnmanagedOpaqueString) { let otherCount = Int(other.count) @@ -218,7 +207,6 @@ extension _SwiftStringStorage { } @inlinable - @usableFromInline @nonobjc internal final func _appendInPlace(contentsOf other: C) where C.Element == CodeUnit { @@ -232,7 +220,6 @@ extension _SwiftStringStorage { } @inlinable - @usableFromInline @_specialize(where C == Character._SmallUTF16, CodeUnit == UInt8) @nonobjc internal final func _appendInPlaceUTF16(contentsOf other: C) @@ -251,7 +238,6 @@ extension _SwiftStringStorage { extension _SwiftStringStorage { @inlinable - @usableFromInline @nonobjc internal final func _appendInPlace(_ other: _StringGuts, range: Range) { if _slowPath(other._isOpaque) { @@ -283,7 +269,6 @@ extension _SwiftStringStorage { } @inlinable - @usableFromInline @nonobjc internal final func _appendInPlace(_ other: _StringGuts) { if _slowPath(other._isOpaque) { @@ -313,14 +298,12 @@ extension _SwiftStringStorage { } @inlinable - @usableFromInline @nonobjc internal final func _appendInPlace(_ other: String) { self._appendInPlace(other._guts) } @inlinable - @usableFromInline @nonobjc internal final func _appendInPlace(_ other: S) { self._appendInPlace( diff --git a/stdlib/public/core/StringSwitch.swift b/stdlib/public/core/StringSwitch.swift index bd0e70a301f87..f708165d1d03a 100644 --- a/stdlib/public/core/StringSwitch.swift +++ b/stdlib/public/core/StringSwitch.swift @@ -45,7 +45,6 @@ internal typealias _StringSwitchCache = Dictionary @usableFromInline // FIXME(sil-serialize-all) internal struct _StringSwitchContext { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init( cases: [StaticString], cachePtr: UnsafeMutablePointer<_StringSwitchCache> @@ -95,7 +94,6 @@ func _findStringSwitchCaseWithCache( /// Builds the string switch case. @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) internal func _createStringTableCache(_ cacheRawPtr: Builtin.RawPointer) { let context = UnsafePointer<_StringSwitchContext>(cacheRawPtr).pointee var cache = _StringSwitchCache() diff --git a/stdlib/public/core/StringUTF16.swift b/stdlib/public/core/StringUTF16.swift index 413b1596222a3..2713adaa4e535 100644 --- a/stdlib/public/core/StringUTF16.swift +++ b/stdlib/public/core/StringUTF16.swift @@ -125,7 +125,6 @@ extension String { @_fixed_layout // FIXME(sil-serialize-all) public struct Indices { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init( _elements: String.UTF16View, _startIndex: Index, _endIndex: Index ) { @@ -189,7 +188,6 @@ extension String { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func _internalIndex(at i: Int) -> Int { return _guts.startIndex + i } @@ -256,13 +254,11 @@ extension String { #endif @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_ _guts: _StringGuts) { self.init(_guts, offset: 0, length: _guts.count) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_ _guts: _StringGuts, offset: Int, length: Int) { self._offset = offset self._length = length @@ -351,20 +347,16 @@ extension String { extension String.UTF16View : _SwiftStringView { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var _ephemeralContent : String { return _persistentContent } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var _persistentContent : String { return String(self._guts) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) var _wholeString : String { return String(_guts) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) var _encodedOffsetRange : Range { return _offset..<_offset+_length } @@ -459,7 +451,6 @@ extension String.UTF16View.Indices : BidirectionalCollection { public typealias SubSequence = String.UTF16View.Indices @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init( _elements: String.UTF16View, startIndex: Index, diff --git a/stdlib/public/core/StringUTF8.swift b/stdlib/public/core/StringUTF8.swift index a18c7f1f42cc5..b523234974e1c 100644 --- a/stdlib/public/core/StringUTF8.swift +++ b/stdlib/public/core/StringUTF8.swift @@ -116,7 +116,6 @@ extension String { internal let _legacyPartialCharacters: (start: Bool, end: Bool) @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init( _ _guts: _StringGuts, legacyOffsets: (Int, Int) = (0, 0), @@ -162,7 +161,6 @@ extension String { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal func _index(atEncodedOffset n: Int) -> Index { if _fastPath(_guts.isASCII) { return Index(encodedOffset: n) } let count = _guts.count @@ -281,7 +279,6 @@ extension String { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline @inline(__always) internal func _forwardDistance(from i: Index, to j: Index) -> Int { return j._transcodedOffset - i._transcodedOffset + @@ -372,7 +369,6 @@ extension String { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func _withUnsafeBufferPointerToUTF8( _ body: (UnsafeBufferPointer) throws -> R ) rethrows -> R { @@ -433,19 +429,16 @@ extension String { extension String.UTF8View : _SwiftStringView { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var _persistentContent : String { return String(self._guts) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) var _wholeString : String { return String(_guts) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) var _encodedOffsetRange : Range { return 0..<_guts.count } @@ -474,7 +467,6 @@ extension String.UTF8View.Iterator : IteratorProtocol { public typealias Element = String.UTF8View.Element @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_ utf8: String.UTF8View) { self._guts = utf8._guts self._nextOffset = 0 @@ -552,7 +544,6 @@ extension String.UTF8View.Iterator : IteratorProtocol { extension String.UTF8View { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static func _count(fromUTF16 source: Source) -> Int where Source.Element == Unicode.UTF16.CodeUnit { diff --git a/stdlib/public/core/StringUnicodeScalarView.swift b/stdlib/public/core/StringUnicodeScalarView.swift index 02f5b7cad195b..10e6d372c7ade 100644 --- a/stdlib/public/core/StringUnicodeScalarView.swift +++ b/stdlib/public/core/StringUnicodeScalarView.swift @@ -78,7 +78,6 @@ extension String { internal var _coreOffset: Int @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_ _guts: _StringGuts, coreOffset: Int = 0) { self._guts = _guts self._coreOffset = coreOffset @@ -89,7 +88,6 @@ extension String { /// Translates a `_guts` index into a `UnicodeScalarIndex` using this /// view's `_coreOffset`. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func _fromCoreIndex(_ i: Int) -> Index { return Index(encodedOffset: i + _coreOffset) } @@ -97,7 +95,6 @@ extension String { /// Translates a `UnicodeScalarIndex` into a `_guts` index using this /// view's `_coreOffset`. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func _toCoreIndex(_ i: Index) -> Int { return i.encodedOffset - _coreOffset } @@ -195,7 +192,6 @@ extension String { internal var _smallIterator: _SmallUTF8String.UnicodeScalarIterator? @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_ guts: _StringGuts) { if _slowPath(guts._isOpaque) { self.init(_opaque: guts) @@ -205,7 +201,6 @@ extension String { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @inline(__always) internal init(_concrete guts: _StringGuts) { _sanityCheck(!guts._isOpaque) @@ -303,7 +298,6 @@ extension String { extension _StringGuts { @inlinable - @usableFromInline internal func unicodeScalar(startingAt offset: Int) -> Unicode.Scalar { return _visitGuts(self, args: offset, ascii: { ascii, offset in @@ -316,7 +310,6 @@ extension _StringGuts { } @inlinable - @usableFromInline internal func unicodeScalar(endingAt offset: Int) -> Unicode.Scalar { return _visitGuts(self, args: offset, ascii: { ascii, offset in @@ -331,17 +324,14 @@ extension _StringGuts { extension String.UnicodeScalarView : _SwiftStringView { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var _persistentContent : String { return String(_guts) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) var _wholeString : String { return String(_guts) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) var _encodedOffsetRange : Range { return 0..<_guts.count } @@ -537,7 +527,6 @@ extension String.UnicodeScalarIndex { extension String.UnicodeScalarView { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func _isOnUnicodeScalarBoundary(_ i: Index) -> Bool { if _fastPath(_guts.isASCII) { return true } if i == startIndex || i == endIndex { @@ -552,7 +541,6 @@ extension String.UnicodeScalarView { // NOTE: Don't make this function inlineable. Grapheme cluster // segmentation uses a completely different algorithm in Unicode 9.0. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func _isOnGraphemeClusterBoundary(_ i: Index) -> Bool { if i == startIndex || i == endIndex { return true diff --git a/stdlib/public/core/StringVariant.swift b/stdlib/public/core/StringVariant.swift index d79617c6e526c..0a954e3e88b72 100644 --- a/stdlib/public/core/StringVariant.swift +++ b/stdlib/public/core/StringVariant.swift @@ -52,7 +52,6 @@ where extension _StringVariant { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func _copyToNativeStorage( of codeUnit: TargetCodeUnit.Type = TargetCodeUnit.self, unusedCapacity: Int = 0 @@ -66,7 +65,6 @@ extension _StringVariant { } @inlinable - @usableFromInline @inline(__always) func _boundsCheck(_ i: Index) { _precondition(i >= startIndex && i < endIndex, @@ -74,7 +72,6 @@ extension _StringVariant { } @inlinable - @usableFromInline @inline(__always) func _boundsCheck(_ range: Range) { _precondition(range.lowerBound >= startIndex, @@ -84,7 +81,6 @@ extension _StringVariant { } @inlinable - @usableFromInline @inline(__always) func _boundsCheck(offset i: Int) { _precondition(i >= 0 && i < count, @@ -92,7 +88,6 @@ extension _StringVariant { } @inlinable - @usableFromInline @inline(__always) func _boundsCheck(offsetRange range: Range) { _precondition(range.lowerBound >= 0 && range.upperBound <= count, @@ -100,28 +95,24 @@ extension _StringVariant { } @inlinable - @usableFromInline internal func codeUnit(atCheckedIndex index: Index) -> Element { _boundsCheck(index) return self[index] } @inlinable - @usableFromInline internal func codeUnit(atCheckedOffset offset: Int) -> Element { _boundsCheck(offset: offset) return self[offset] } @inlinable - @usableFromInline internal func checkedSlice(_ range: Range) -> Self { _boundsCheck(offsetRange: range) return self[range] } @inlinable - @usableFromInline internal func checkedSlice(from startOffset: Int) -> Self { let r: Range = startOffset.. Self { let r: Range = 0.. Int { _boundsCheck(offset: offset) if _slowPath(UTF16.isLeadSurrogate(self[offset])) { @@ -152,7 +141,6 @@ extension _StringVariant { } @inlinable - @usableFromInline func unicodeScalarWidth(endingAt offset: Int) -> Int { _boundsCheck(offset: offset - 1) if _slowPath(UTF16.isTrailSurrogate(self[offset - 1])) { @@ -164,7 +152,6 @@ extension _StringVariant { } @inlinable - @usableFromInline func unicodeScalar(startingAt offset: Int) -> Unicode.Scalar { let u0 = self.codeUnit(atCheckedOffset: offset) if _fastPath(UTF16._isScalar(u0)) { @@ -180,7 +167,6 @@ extension _StringVariant { } @inlinable - @usableFromInline func unicodeScalar(endingAt offset: Int) -> Unicode.Scalar { let u1 = self.codeUnit(atCheckedOffset: offset - 1) if _fastPath(UTF16._isScalar(u1)) { diff --git a/stdlib/public/core/Substring.swift.gyb b/stdlib/public/core/Substring.swift.gyb index 789afd86afb5e..2bb2f062d1549 100644 --- a/stdlib/public/core/Substring.swift.gyb +++ b/stdlib/public/core/Substring.swift.gyb @@ -108,13 +108,11 @@ public struct Substring : StringProtocol { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_slice: Slice) { self._slice = _slice } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_ guts: _StringGuts, _ offsetRange: Range) { self.init( _base: String(guts), @@ -134,7 +132,6 @@ public struct Substring : StringProtocol { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init( _base base: String, _ bounds: R ) where R.Bound == Index { @@ -307,7 +304,6 @@ public struct Substring : StringProtocol { extension Substring : _SwiftStringView { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var _persistentContent: String { return String(self) } @@ -395,7 +391,6 @@ extension Substring.${_View} : BidirectionalCollection { /// Creates an instance that slices `base` at `_bounds`. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_ base: String.${_View}, _bounds: Range) { _slice = Slice( base: String(base._guts).${_property}, @@ -404,13 +399,11 @@ extension Substring.${_View} : BidirectionalCollection { /// The entire String onto whose slice this view is a projection. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var _wholeString: String { return String(_slice._base._guts) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var _encodedOffsetRange: Range { return startIndex.encodedOffset.. Bool { return (index >= 0) && (index <= count) @@ -33,7 +32,6 @@ internal func _isValidArrayIndex(_ index: Int, count: Int) -> Bool { /// Returns `true` iff the given `index` is valid for subscripting, i.e. /// `0 ≤ index < count`. @inlinable // FIXME(sil-serialize-all) -@usableFromInline @_transparent internal func _isValidArraySubscript(_ index: Int, count: Int) -> Bool { return (index >= 0) && (index < count) @@ -47,16 +45,13 @@ internal class _SwiftNativeNSArrayWithContiguousStorage : _SwiftNativeNSArray { // Provides NSArray inheritance and native refcounting @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @nonobjc internal override init() {} @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) deinit {} // Operate on our contiguous storage @inlinable - @usableFromInline internal func withUnsafeBufferOfObjects( _ body: (UnsafeBufferPointer) throws -> R ) rethrows -> R { @@ -160,7 +155,6 @@ extension _SwiftNativeNSArrayWithContiguousStorage : _NSArrayCore { internal let _nativeStorage: _ContiguousArrayStorageBase @inlinable - @usableFromInline @nonobjc internal var _heapBufferBridgedPtr: UnsafeMutablePointer { return _getUnsafePointerToStoredProperties(self).assumingMemoryBound( @@ -170,7 +164,6 @@ extension _SwiftNativeNSArrayWithContiguousStorage : _NSArrayCore { internal typealias HeapBufferStorage = _HeapBufferStorage @inlinable - @usableFromInline internal var _heapBufferBridged: HeapBufferStorage? { if let ref = _stdlib_atomicLoadARCRef(object: _heapBufferBridgedPtr) { @@ -180,14 +173,12 @@ extension _SwiftNativeNSArrayWithContiguousStorage : _NSArrayCore { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline @nonobjc internal init(_nativeStorage: _ContiguousArrayStorageBase) { self._nativeStorage = _nativeStorage } @inlinable - @usableFromInline internal func _destroyBridgedStorage(_ hb: HeapBufferStorage?) { if let bridgedStorage = hb { let heapBuffer = _HeapBuffer(bridgedStorage) @@ -197,13 +188,11 @@ extension _SwiftNativeNSArrayWithContiguousStorage : _NSArrayCore { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) deinit { _destroyBridgedStorage(_heapBufferBridged) } @inlinable - @usableFromInline internal override func withUnsafeBufferOfObjects( _ body: (UnsafeBufferPointer) throws -> R ) rethrows -> R { @@ -265,11 +254,9 @@ extension _SwiftNativeNSArrayWithContiguousStorage : _NSArrayCore { @_fixed_layout internal class _SwiftNativeNSArrayWithContiguousStorage { @inlinable - @usableFromInline internal init() {} @inlinable - @usableFromInline deinit {} } #endif @@ -284,7 +271,6 @@ internal class _ContiguousArrayStorageBase final var countAndCapacity: _ArrayBody @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @nonobjc internal init(_doNotCallMeBase: ()) { _sanityCheckFailure("creating instance of _ContiguousArrayStorageBase") @@ -292,7 +278,6 @@ internal class _ContiguousArrayStorageBase #if _runtime(_ObjC) @inlinable - @usableFromInline internal override func withUnsafeBufferOfObjects( _ body: (UnsafeBufferPointer) throws -> R ) rethrows -> R { @@ -307,7 +292,6 @@ internal class _ContiguousArrayStorageBase /// `UnsafeBufferPointer` to the elements and return the result. /// Otherwise, return `nil`. @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal func _withVerbatimBridgedUnsafeBuffer( _ body: (UnsafeBufferPointer) throws -> R ) rethrows -> R? { @@ -316,7 +300,6 @@ internal class _ContiguousArrayStorageBase } @inlinable // FIXME(sil-serialize-all) - @usableFromInline @nonobjc internal func _getNonVerbatimBridgedCount() -> Int { _sanityCheckFailure( @@ -324,7 +307,6 @@ internal class _ContiguousArrayStorageBase } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal func _getNonVerbatimBridgedHeapBuffer() -> _HeapBuffer { _sanityCheckFailure( @@ -333,7 +315,6 @@ internal class _ContiguousArrayStorageBase #endif @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal func canStoreElements(ofDynamicType _: Any.Type) -> Bool { _sanityCheckFailure( "Concrete subclasses must implement canStoreElements(ofDynamicType:)") @@ -341,14 +322,12 @@ internal class _ContiguousArrayStorageBase /// A type that every element in the array is. @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal var staticElementType: Any.Type { _sanityCheckFailure( "Concrete subclasses must implement staticElementType") } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) deinit { _sanityCheck( self !== _emptyArrayStorage, "Deallocating empty array storage?!") diff --git a/stdlib/public/core/ThreadLocalStorage.swift b/stdlib/public/core/ThreadLocalStorage.swift index 3f29b75e00c2e..ea612ddaf1cbe 100644 --- a/stdlib/public/core/ThreadLocalStorage.swift +++ b/stdlib/public/core/ThreadLocalStorage.swift @@ -59,7 +59,6 @@ internal struct _ThreadLocalStorage { // private: Should only be called by _initializeThreadLocalStorage @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_uBreakIterator: OpaquePointer) { self.uBreakIterator = _uBreakIterator } @@ -67,7 +66,6 @@ internal struct _ThreadLocalStorage { // Get the current thread's TLS pointer. On first call for a given thread, // creates and initializes a new one. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static func getPointer() -> UnsafeMutablePointer<_ThreadLocalStorage> { @@ -81,7 +79,6 @@ internal struct _ThreadLocalStorage { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static func getUBreakIterator( start: UnsafePointer, count: Int32 @@ -99,7 +96,6 @@ internal struct _ThreadLocalStorage { // Destructor to register with pthreads. Responsible for deallocating any memory // owned. -@inlinable // FIXME(sil-serialize-all) @usableFromInline // FIXME(sil-serialize-all) @_silgen_name("_stdlib_destroyTLS") internal func _destroyTLS(_ ptr: UnsafeMutableRawPointer?) { @@ -128,7 +124,6 @@ internal let _tlsKey: __swift_thread_key_t = { }() @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) @inline(never) internal func _initializeThreadLocalStorage() -> UnsafeMutablePointer<_ThreadLocalStorage> diff --git a/stdlib/public/core/UIntBuffer.swift b/stdlib/public/core/UIntBuffer.swift index 3ac57e5be88af..6d02dfda16153 100644 --- a/stdlib/public/core/UIntBuffer.swift +++ b/stdlib/public/core/UIntBuffer.swift @@ -74,7 +74,6 @@ extension _UIntBuffer : Collection { internal var bitOffset: UInt8 @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal init(bitOffset: UInt8) { self.bitOffset = bitOffset } @inlinable // FIXME(sil-serialize-all) @@ -106,7 +105,6 @@ extension _UIntBuffer : Collection { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal var _elementWidth : UInt8 { return UInt8(truncatingIfNeeded: Element.bitWidth) } @@ -148,19 +146,16 @@ extension _UIntBuffer : RandomAccessCollection { extension FixedWidthInteger { @inline(__always) @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal func _fullShiftLeft(_ n: N) -> Self { return (self &<< ((n &+ 1) &>> 1)) &<< (n &>> 1) } @inline(__always) @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal func _fullShiftRight(_ n: N) -> Self { return (self &>> ((n &+ 1) &>> 1)) &>> (n &>> 1) } @inline(__always) @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal static func _lowBits(_ n: N) -> Self { return ~((~0 as Self)._fullShiftLeft(n)) } @@ -169,7 +164,6 @@ extension FixedWidthInteger { extension Range { @inline(__always) @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal func _contains_(_ other: Range) -> Bool { return other.clamped(to: self) == other } diff --git a/stdlib/public/core/UTF16.swift b/stdlib/public/core/UTF16.swift index 457df38a3540d..0be7f3c805dc1 100644 --- a/stdlib/public/core/UTF16.swift +++ b/stdlib/public/core/UTF16.swift @@ -21,7 +21,6 @@ extension Unicode.UTF16 : Unicode.Encoding { public typealias EncodedScalar = _UIntBuffer @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static var _replacementCodeUnit: CodeUnit { @inline(__always) get { return 0xfffd } } @@ -42,7 +41,6 @@ extension Unicode.UTF16 : Unicode.Encoding { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @inline(__always) internal static func _decodeSurrogates( _ lead: CodeUnit, diff --git a/stdlib/public/core/UTF32.swift b/stdlib/public/core/UTF32.swift index 4c8ef008da9e5..f6ada0636f1a3 100644 --- a/stdlib/public/core/UTF32.swift +++ b/stdlib/public/core/UTF32.swift @@ -21,7 +21,6 @@ extension Unicode.UTF32 : Unicode.Encoding { public typealias EncodedScalar = CollectionOfOne @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static var _replacementCodeUnit: CodeUnit { @inline(__always) get { return 0xFFFD } } diff --git a/stdlib/public/core/UTF8.swift b/stdlib/public/core/UTF8.swift index 4d02e9f3207e1..b2b1eb78abce1 100644 --- a/stdlib/public/core/UTF8.swift +++ b/stdlib/public/core/UTF8.swift @@ -178,7 +178,6 @@ extension UTF8.ReverseParser : Unicode.Parser, _UTFParser { /// buffer. @inline(never) @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal func _invalidLength() -> UInt8 { if _buffer._storage & 0b0__1111_0000__1100_0000 == 0b0__1110_0000__1000_0000 { @@ -256,7 +255,6 @@ extension Unicode.UTF8.ForwardParser : Unicode.Parser, _UTFParser { /// buffer. @inline(never) @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal func _invalidLength() -> UInt8 { if _buffer._storage & 0b0__1100_0000__1111_0000 == 0b0__1000_0000__1110_0000 { diff --git a/stdlib/public/core/UnfoldSequence.swift b/stdlib/public/core/UnfoldSequence.swift index 9bf3f6b266862..9d9a8fedca25a 100644 --- a/stdlib/public/core/UnfoldSequence.swift +++ b/stdlib/public/core/UnfoldSequence.swift @@ -114,7 +114,6 @@ public struct UnfoldSequence : Sequence, IteratorProtocol { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init(_state: State, _next: @escaping (inout State) -> Element?) { self._state = _state self._next = _next diff --git a/stdlib/public/core/Unicode.swift b/stdlib/public/core/Unicode.swift index 3106ce8d05a32..64ca5d12a0f08 100644 --- a/stdlib/public/core/Unicode.swift +++ b/stdlib/public/core/Unicode.swift @@ -384,7 +384,6 @@ extension Unicode.UTF16 : UnicodeCodec { /// units it spanned in the input. This function may consume more code /// units than required for this scalar. @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal mutating func _decodeOne( _ input: inout I ) -> (UnicodeDecodingResult, Int) where I.Element == CodeUnit { @@ -488,7 +487,6 @@ extension Unicode.UTF32 : UnicodeCodec { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static func _decode( _ input: inout I ) -> UnicodeDecodingResult where I.Element == CodeUnit { @@ -886,7 +884,6 @@ extension Unicode.Scalar { /// Create an instance with numeric value `value`, bypassing the regular /// precondition checks for code point validity. @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal init(_unchecked value: UInt32) { _sanityCheck(value < 0xD800 || value > 0xDFFF, "high- and low-surrogate code points are not valid Unicode scalar values") diff --git a/stdlib/public/core/UnicodeEncoding.swift b/stdlib/public/core/UnicodeEncoding.swift index 7d6bfc3b7d2c4..161ec464a0968 100644 --- a/stdlib/public/core/UnicodeEncoding.swift +++ b/stdlib/public/core/UnicodeEncoding.swift @@ -76,7 +76,6 @@ extension _UnicodeEncoding { /// `encodedReplacementCharacter` if the scalar can't be represented in this /// encoding. @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal static func _encode(_ content: Unicode.Scalar) -> EncodedScalar { return encode(content) ?? encodedReplacementCharacter } @@ -85,7 +84,6 @@ extension _UnicodeEncoding { /// `encodedReplacementCharacter` if the scalar can't be represented in this /// encoding. @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal static func _transcode( _ content: FromEncoding.EncodedScalar, from _: FromEncoding.Type ) -> EncodedScalar { @@ -94,7 +92,6 @@ extension _UnicodeEncoding { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal static func _transcode< Source: Sequence, SourceEncoding: Unicode.Encoding>( _ source: Source, diff --git a/stdlib/public/core/UnicodeParser.swift b/stdlib/public/core/UnicodeParser.swift index 653e1918f475e..8fba40f6c7a9e 100644 --- a/stdlib/public/core/UnicodeParser.swift +++ b/stdlib/public/core/UnicodeParser.swift @@ -27,14 +27,12 @@ extension Unicode { case error(length: Int) @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal var _valid: T? { if case .valid(let result) = self { return result } return nil } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal var _error: Int? { if case .error(let result) = self { return result } return nil @@ -61,7 +59,6 @@ public protocol _UnicodeParser { extension _UnicodeParser { @inlinable // FIXME(sil-serialize-all) - @usableFromInline @inline(__always) @discardableResult internal static func _parse( diff --git a/stdlib/public/core/UnicodeScalar.swift b/stdlib/public/core/UnicodeScalar.swift index 8851f7083a2d8..0074fed0ae991 100644 --- a/stdlib/public/core/UnicodeScalar.swift +++ b/stdlib/public/core/UnicodeScalar.swift @@ -35,7 +35,6 @@ extension Unicode { @_fixed_layout public struct Scalar { @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal init(_value: UInt32) { self._value = _value } @@ -280,7 +279,6 @@ extension Unicode.Scalar : // FIXME: Unicode makes this interesting. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var _isPrintableASCII: Bool { return (self >= Unicode.Scalar(0o040) && self <= Unicode.Scalar(0o176)) } @@ -400,8 +398,7 @@ extension Unicode.Scalar : Comparable { extension Unicode.Scalar { @_fixed_layout // FIXME(sil-serialize-all) public struct UTF16View { - @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) + @inlinable // FIXME(sil-serialize-all) internal init(value: Unicode.Scalar) { self.value = value } @@ -457,7 +454,6 @@ func _ascii16(_ c: Unicode.Scalar) -> UTF16.CodeUnit { extension Unicode.Scalar { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal static var _replacementCharacter: Unicode.Scalar { return Unicode.Scalar(_value: UTF32._replacementCodeUnit) } diff --git a/stdlib/public/core/Unmanaged.swift b/stdlib/public/core/Unmanaged.swift index 517a1f7e02d8a..a11b0e157e052 100644 --- a/stdlib/public/core/Unmanaged.swift +++ b/stdlib/public/core/Unmanaged.swift @@ -20,7 +20,6 @@ public struct Unmanaged { internal unowned(unsafe) var _value: Instance @inlinable // FIXME(sil-serialize-all) - @usableFromInline @_transparent internal init(_private: Instance) { _value = _private } diff --git a/stdlib/public/core/UnmanagedOpaqueString.swift b/stdlib/public/core/UnmanagedOpaqueString.swift index a39dd1dca545e..764d23a33bc13 100644 --- a/stdlib/public/core/UnmanagedOpaqueString.swift +++ b/stdlib/public/core/UnmanagedOpaqueString.swift @@ -41,7 +41,6 @@ internal struct _UnmanagedOpaqueString { #if _runtime(_ObjC) // FIXME unify @inlinable - @usableFromInline init(_ object: _CocoaString, range: Range, isSlice: Bool) { self.object = object self.range = range @@ -55,13 +54,11 @@ internal struct _UnmanagedOpaqueString { } @inlinable - @usableFromInline init(_ object: _CocoaString, count: Int) { self.init(object, range: 0.., isSlice: Bool) { self.object = object self.range = range @@ -74,7 +71,6 @@ internal struct _UnmanagedOpaqueString { } @inlinable - @usableFromInline init(_ object: _OpaqueString, count: Int) { self.init(object, range: 0.. Iterator { return Iterator(self, startingAt: range.lowerBound) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func makeIterator(startingAt position: Int) -> Iterator { return Iterator(self, startingAt: position) } @@ -119,14 +113,12 @@ extension _UnmanagedOpaqueString : Sequence { internal var _bufferIndex: Int8 = 0 @inlinable - @usableFromInline init(_ string: _UnmanagedOpaqueString, startingAt start: Int) { self._object = string.object self._range = start.. Element? { if _fastPath(_bufferIndex < _buffer.count) { @@ -172,21 +164,18 @@ extension _UnmanagedOpaqueString : RandomAccessCollection { @usableFromInline internal var _value: Int - @usableFromInline @inlinable @inline(__always) init(_ value: Int) { self._value = value } - @usableFromInline @inlinable @inline(__always) func distance(to other: Index) -> Int { return other._value - self._value } - @usableFromInline @inlinable @inline(__always) func advanced(by n: Int) -> Index { @@ -194,25 +183,21 @@ extension _UnmanagedOpaqueString : RandomAccessCollection { } } - @usableFromInline @inlinable var startIndex: Index { return Index(range.lowerBound) } - @usableFromInline @inlinable var endIndex: Index { return Index(range.upperBound) } - @usableFromInline @inlinable var count: Int { return range.count } - @usableFromInline @inlinable // FIXME(sil-serialize-all) subscript(position: Index) -> UTF16.CodeUnit { _sanityCheck(position._value >= range.lowerBound) @@ -224,7 +209,6 @@ extension _UnmanagedOpaqueString : RandomAccessCollection { #endif } - @usableFromInline @inlinable // FIXME(sil-serialize-all) subscript(bounds: Range) -> _UnmanagedOpaqueString { _sanityCheck(bounds.lowerBound._value >= range.lowerBound) @@ -240,13 +224,11 @@ extension _UnmanagedOpaqueString : _StringVariant { internal typealias CodeUnit = Encoding.CodeUnit @inlinable - @usableFromInline var isASCII: Bool { @inline(__always) get { return false } } @inlinable - @usableFromInline @inline(__always) func _boundsCheck(_ i: Index) { _precondition(i._value >= range.lowerBound && i._value < range.upperBound, @@ -254,7 +236,6 @@ extension _UnmanagedOpaqueString : _StringVariant { } @inlinable - @usableFromInline @inline(__always) func _boundsCheck(_ range: Range) { _precondition( @@ -264,7 +245,6 @@ extension _UnmanagedOpaqueString : _StringVariant { } @inlinable - @usableFromInline @inline(__always) func _boundsCheck(offset: Int) { _precondition(offset >= 0 && offset < range.count, @@ -272,14 +252,12 @@ extension _UnmanagedOpaqueString : _StringVariant { } @inlinable - @usableFromInline @inline(__always) func _boundsCheck(offsetRange range: Range) { _precondition(range.lowerBound >= 0 && range.upperBound <= count, "String index range is out of bounds") } - @usableFromInline @inlinable // FIXME(sil-serialize-all) subscript(offset: Int) -> UTF16.CodeUnit { _sanityCheck(offset >= 0 && offset < count) @@ -290,7 +268,6 @@ extension _UnmanagedOpaqueString : _StringVariant { #endif } - @usableFromInline @inlinable // FIXME(sil-serialize-all) subscript(offsetRange: Range) -> _UnmanagedOpaqueString { _sanityCheck(offsetRange.lowerBound >= 0) @@ -303,7 +280,6 @@ extension _UnmanagedOpaqueString : _StringVariant { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal subscript(offsetRange: PartialRangeUpTo) -> SubSequence { _sanityCheck(offsetRange.upperBound <= range.count) let b: Range = @@ -314,7 +290,6 @@ extension _UnmanagedOpaqueString : _StringVariant { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal subscript(offsetRange: PartialRangeThrough) -> SubSequence { _sanityCheck(offsetRange.upperBound <= range.count) let b: Range = @@ -325,7 +300,6 @@ extension _UnmanagedOpaqueString : _StringVariant { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal subscript(offsetRange: PartialRangeFrom) -> SubSequence { _sanityCheck(offsetRange.lowerBound < range.count) let b: Range = @@ -336,7 +310,6 @@ extension _UnmanagedOpaqueString : _StringVariant { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func _copy( into dest: UnsafeMutableBufferPointer ) { @@ -353,7 +326,6 @@ extension _UnmanagedOpaqueString : _StringVariant { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func _copy( into dest: UnsafeMutableBufferPointer ) diff --git a/stdlib/public/core/UnmanagedString.swift b/stdlib/public/core/UnmanagedString.swift index bde7218b0ce0e..583df043e5b6a 100644 --- a/stdlib/public/core/UnmanagedString.swift +++ b/stdlib/public/core/UnmanagedString.swift @@ -15,7 +15,6 @@ import SwiftShims internal typealias _UnmanagedASCIIString = _UnmanagedString internal typealias _UnmanagedUTF16String = _UnmanagedString -@usableFromInline @inlinable internal func memcpy_zext< @@ -30,7 +29,6 @@ func memcpy_zext< } } -@usableFromInline @inlinable internal func memcpy_trunc< @@ -68,7 +66,6 @@ struct _UnmanagedString internal var count: Int @inlinable - @usableFromInline init(start: UnsafePointer, count: Int) { _sanityCheck(CodeUnit.self == UInt8.self || CodeUnit.self == UInt16.self) self.start = start @@ -76,7 +73,6 @@ struct _UnmanagedString } @inlinable - @usableFromInline init(_ bufPtr: UnsafeBufferPointer) { self.init( start: bufPtr.baseAddress._unsafelyUnwrappedUnchecked, @@ -86,31 +82,26 @@ struct _UnmanagedString extension _UnmanagedString { @inlinable - @usableFromInline internal var end: UnsafePointer { return start + count } @inlinable - @usableFromInline internal var rawStart: UnsafeRawPointer { return UnsafeRawPointer(start) } @inlinable - @usableFromInline internal var rawEnd: UnsafeRawPointer { return UnsafeRawPointer(end) } @inlinable - @usableFromInline internal var buffer: UnsafeBufferPointer { return .init(start: start, count: count) } @inlinable - @usableFromInline internal var rawBuffer: UnsafeRawBufferPointer { return .init(start: rawStart, count: rawEnd - rawStart) } @@ -128,17 +119,14 @@ extension _UnmanagedString : RandomAccessCollection { internal typealias SubSequence = _UnmanagedString @inlinable - @usableFromInline internal var startIndex: Index { return start } @inlinable - @usableFromInline internal var endIndex: Index { return end } @inlinable - @usableFromInline internal subscript(position: Index) -> UTF16.CodeUnit { @inline(__always) get { @@ -148,7 +136,6 @@ extension _UnmanagedString : RandomAccessCollection { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal subscript(_ bounds: Range) -> SubSequence { _sanityCheck(bounds.lowerBound >= start && bounds.upperBound <= end) return _UnmanagedString(start: bounds.lowerBound, count: bounds.count) @@ -157,14 +144,12 @@ extension _UnmanagedString : RandomAccessCollection { extension _UnmanagedString : _StringVariant { @inlinable - @usableFromInline internal var isASCII: Bool { // NOTE: For now, single byte means ASCII. Might change in future return CodeUnit.bitWidth == 8 } @inlinable - @usableFromInline internal subscript(offset: Int) -> UTF16.CodeUnit { @inline(__always) get { @@ -174,7 +159,6 @@ extension _UnmanagedString : _StringVariant { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal subscript(offsetRange: Range) -> _UnmanagedString { _sanityCheck(offsetRange.lowerBound >= 0 && offsetRange.upperBound <= count) return _UnmanagedString( @@ -183,7 +167,6 @@ extension _UnmanagedString : _StringVariant { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal subscript(offsetRange: PartialRangeFrom) -> SubSequence { _sanityCheck(offsetRange.lowerBound >= 0) return _UnmanagedString( @@ -193,7 +176,6 @@ extension _UnmanagedString : _StringVariant { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal subscript(offsetRange: PartialRangeUpTo) -> SubSequence { _sanityCheck(offsetRange.upperBound <= count) return _UnmanagedString( @@ -203,7 +185,6 @@ extension _UnmanagedString : _StringVariant { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal subscript(offsetRange: PartialRangeThrough) -> SubSequence { _sanityCheck(offsetRange.upperBound < count) return _UnmanagedString( @@ -213,7 +194,6 @@ extension _UnmanagedString : _StringVariant { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func _copy( into target: UnsafeMutableBufferPointer ) where TargetCodeUnit : FixedWidthInteger & UnsignedInteger { @@ -251,14 +231,12 @@ extension _UnmanagedString : _StringVariant { var _offset: Int @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) init(_ base: _UnmanagedString) { self._base = base self._offset = 0 } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) mutating func next() -> Unicode.Scalar? { if _slowPath(_offset == _base.count) { return nil } let u0 = _base[_offset] @@ -278,7 +256,6 @@ extension _UnmanagedString : _StringVariant { } } - @usableFromInline // FIXME(sil-serialize-all) @inlinable func makeUnicodeScalarIterator() -> UnicodeScalarIterator { return UnicodeScalarIterator(self) diff --git a/stdlib/public/core/UnsafePointer.swift.gyb b/stdlib/public/core/UnsafePointer.swift.gyb index 073073c55b6a7..390cf3ea86956 100644 --- a/stdlib/public/core/UnsafePointer.swift.gyb +++ b/stdlib/public/core/UnsafePointer.swift.gyb @@ -1003,7 +1003,6 @@ extension ${Self} : CustomReflectable { extension ${Self} : CustomPlaygroundQuickLookable { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal var summary: String { let selfType = "${Self}" let ptrValue = UInt64(bitPattern: Int64(Int(Builtin.ptrtoint_Word(_rawValue)))) @@ -1055,7 +1054,6 @@ extension UInt { extension ${Self} { @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal static var _max : ${Self} { return ${Self}( bitPattern: 0 as Int &- MemoryLayout.stride diff --git a/stdlib/public/core/UnsafeRawBufferPointer.swift.gyb b/stdlib/public/core/UnsafeRawBufferPointer.swift.gyb index d5e2824df8818..9b9443aee822c 100644 --- a/stdlib/public/core/UnsafeRawBufferPointer.swift.gyb +++ b/stdlib/public/core/UnsafeRawBufferPointer.swift.gyb @@ -106,7 +106,6 @@ extension UnsafeRawBufferPointer { @usableFromInline internal var _position, _end: UnsafeRawPointer? - @usableFromInline @inlinable internal init(_position: UnsafeRawPointer?, _end: UnsafeRawPointer?) { self._position = _position diff --git a/stdlib/public/core/UnsafeRawPointer.swift.gyb b/stdlib/public/core/UnsafeRawPointer.swift.gyb index 4d914f3a7fbd1..f6771cfb4d6ee 100644 --- a/stdlib/public/core/UnsafeRawPointer.swift.gyb +++ b/stdlib/public/core/UnsafeRawPointer.swift.gyb @@ -995,7 +995,6 @@ extension Unsafe${Mutable}RawPointer : CustomReflectable { extension Unsafe${Mutable}RawPointer : CustomPlaygroundQuickLookable { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) @available(*, deprecated, message: "Unsafe${Mutable}RawPointer.customPlaygroundQuickLook will be removed in a future Swift version") internal var summary: String { let selfType = "${Self}" diff --git a/stdlib/public/core/ValidUTF8Buffer.swift b/stdlib/public/core/ValidUTF8Buffer.swift index 04687102005fe..907368850c0b1 100644 --- a/stdlib/public/core/ValidUTF8Buffer.swift +++ b/stdlib/public/core/ValidUTF8Buffer.swift @@ -25,13 +25,11 @@ public struct _ValidUTF8Buffer { internal var _biasedBits: Storage @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal init(_biasedBits: Storage) { self._biasedBits = _biasedBits } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal init(_containing e: Element) { _sanityCheck( e != 192 && e != 193 && !(245...255).contains(e), "invalid UTF8 byte") @@ -72,7 +70,6 @@ extension _ValidUTF8Buffer : Collection { internal var _biasedBits: Storage @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal init(_biasedBits: Storage) { self._biasedBits = _biasedBits } @inlinable // FIXME(sil-serialize-all) @@ -186,7 +183,6 @@ extension _ValidUTF8Buffer : RangeReplaceableCollection { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline internal func _isValid(_ i: Index) -> Bool { return i == endIndex || indices.contains(i) } diff --git a/stdlib/public/core/VarArgs.swift b/stdlib/public/core/VarArgs.swift index 46b792f333237..e51111e39825d 100644 --- a/stdlib/public/core/VarArgs.swift +++ b/stdlib/public/core/VarArgs.swift @@ -122,7 +122,6 @@ public func withVaList(_ args: [CVarArg], /// Invoke `body` with a C `va_list` argument derived from `builder`. @inlinable // FIXME(sil-serialize-all) -@usableFromInline // FIXME(sil-serialize-all) internal func _withVaList( _ builder: _VaListBuilder, _ body: (CVaListPointer) -> R @@ -377,7 +376,6 @@ final internal class _VaListBuilder { @usableFromInline internal struct Header { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init() {} @usableFromInline // FIXME(sil-serialize-all) @@ -392,18 +390,15 @@ final internal class _VaListBuilder { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init() { // prepare the register save area storage = ContiguousArray(repeating: 0, count: _registerSaveWords) } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) deinit {} @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func append(_ arg: CVarArg) { var encoded = arg._cVarArgEncoding @@ -445,7 +440,6 @@ final internal class _VaListBuilder { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func va_list() -> CVaListPointer { header.reg_save_area = storage._baseAddress header.overflow_arg_area @@ -476,11 +470,9 @@ final internal class _VaListBuilder { final internal class _VaListBuilder { @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init() {} @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func append(_ arg: CVarArg) { // Write alignment padding if necessary. // This is needed on architectures where the ABI alignment of some @@ -521,7 +513,6 @@ final internal class _VaListBuilder { // FIXME: this should be packaged into a better storage type @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func appendWords(_ words: [Int]) { let newCount = count + words.count if newCount > allocated { @@ -548,7 +539,6 @@ final internal class _VaListBuilder { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func rawSizeAndAlignment( _ wordCount: Int ) -> (Builtin.Word, Builtin.Word) { @@ -557,7 +547,6 @@ final internal class _VaListBuilder { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal func allocStorage(wordCount: Int) -> UnsafeMutablePointer { let (rawSize, rawAlignment) = rawSizeAndAlignment(wordCount) let rawStorage = Builtin.allocRaw(rawSize, rawAlignment) @@ -574,7 +563,6 @@ final internal class _VaListBuilder { } @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) deinit { if let allocatedStorage = storage { deallocStorage(wordCount: allocated, storage: allocatedStorage) diff --git a/stdlib/public/core/WriteBackMutableSlice.swift b/stdlib/public/core/WriteBackMutableSlice.swift index b7ca91f2056c4..5c7453c4c4e11 100644 --- a/stdlib/public/core/WriteBackMutableSlice.swift +++ b/stdlib/public/core/WriteBackMutableSlice.swift @@ -11,7 +11,6 @@ //===----------------------------------------------------------------------===// @inlinable -@usableFromInline internal func _writeBackMutableSlice( _ self_: inout C, bounds: Range, slice: Slice_ ) where diff --git a/stdlib/public/core/Zip.swift b/stdlib/public/core/Zip.swift index f5b5e98e2d329..6b05fd5aff77a 100644 --- a/stdlib/public/core/Zip.swift +++ b/stdlib/public/core/Zip.swift @@ -101,7 +101,6 @@ extension Zip2Sequence { /// Creates an instance around a pair of underlying iterators. @inlinable // FIXME(sil-serialize-all) - @usableFromInline // FIXME(sil-serialize-all) internal init( _ iterator1: Sequence1.Iterator, _ iterator2: Sequence2.Iterator From 34af7c20a53878663348cb0900ce299f64dfe65a Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Thu, 5 Apr 2018 23:40:59 -0700 Subject: [PATCH 5/6] CHANGELOG.md: Add SE-0193 --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index feed20444999e..065d4eac93458 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -61,6 +61,18 @@ Swift 5.0 Swift 4.2 --------- +* [SE-0193][] + + Various function-like declarations can now be marked as `@inlinable`, + making their bodies available for optimizations from other modules. + + Inlinable function bodies must only reference public declarations, unless + the referenced declaration is marked as `@usableFromInline`. + + Note that the presence of the attribute itself does not force inlining or + any other optimization to be performed, nor does it have any effect on + optimizations performed within a single module. + * The C `long double` type is now imported as `Float80` on i386 and x86_64 macOS and Linux. The tgmath functions in the Darwin and glibc modules now  support `Float80` as well as `Float` and `Double`. Several tgmath From e39b90787f942f7c8aafee48b16bc1179a76dc9c Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Thu, 5 Apr 2018 23:41:08 -0700 Subject: [PATCH 6/6] CHANGELOG.md: Fix formatting --- CHANGELOG.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 065d4eac93458..a0f2f721485e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -115,10 +115,10 @@ Swift 4.2 * [SE-0143][] - Runtime query of conditional conformances is now implemented. Therefore, - a dynamic cast such as `value as? P`, where the dynamic type of `value` - conditionally conforms to `P`, will succeed when the conditional - requirements are met. + Runtime query of conditional conformances is now implemented. Therefore, + a dynamic cast such as `value as? P`, where the dynamic type of `value` + conditionally conforms to `P`, will succeed when the conditional + requirements are met. **Add new entries to the top of this section, not here!**