Remove remaining @ininable from @_transparent (#17968)
diff --git a/stdlib/public/core/Array.swift b/stdlib/public/core/Array.swift
index e400396..a6d86ea 100644
--- a/stdlib/public/core/Array.swift
+++ b/stdlib/public/core/Array.swift
@@ -1339,8 +1339,7 @@
}
extension Array {
- @inlinable
- @_transparent
+ @usableFromInline @_transparent
internal func _cPointerArgs() -> (AnyObject?, UnsafeRawPointer?) {
let p = _baseAddressIfContiguous
if _fastPath(p != nil || isEmpty) {
diff --git a/stdlib/public/core/ArraySlice.swift b/stdlib/public/core/ArraySlice.swift
index 6448537..1117a43 100644
--- a/stdlib/public/core/ArraySlice.swift
+++ b/stdlib/public/core/ArraySlice.swift
@@ -1130,8 +1130,7 @@
}
extension ArraySlice {
- @inlinable
- @_transparent
+ @usableFromInline @_transparent
internal func _cPointerArgs() -> (AnyObject?, UnsafeRawPointer?) {
let p = _baseAddressIfContiguous
if _fastPath(p != nil || isEmpty) {
diff --git a/stdlib/public/core/AssertCommon.swift b/stdlib/public/core/AssertCommon.swift
index c4d0b60..e2a1b20 100644
--- a/stdlib/public/core/AssertCommon.swift
+++ b/stdlib/public/core/AssertCommon.swift
@@ -19,7 +19,6 @@
// FIXME: We could go farther with this simplification, e.g. avoiding
// UnsafeMutablePointer
-@inlinable // FIXME(sil-serialize-all)
@_transparent
public // @testable
func _isDebugAssertConfiguration() -> Bool {
@@ -39,7 +38,6 @@
return Int32(Builtin.assert_configuration()) == 1
}
-@inlinable // FIXME(sil-serialize-all)
@_transparent
public // @testable
func _isFastAssertConfiguration() -> Bool {
@@ -50,7 +48,6 @@
return Int32(Builtin.assert_configuration()) == 2
}
-@inlinable // FIXME(sil-serialize-all)
@_transparent
public // @testable
func _isStdlibInternalChecksEnabled() -> Bool {
@@ -61,8 +58,7 @@
#endif
}
-@inlinable // FIXME(sil-serialize-all)
-@_transparent
+@usableFromInline @_transparent
internal
func _fatalErrorFlags() -> UInt32 {
// The current flags are:
@@ -205,7 +201,6 @@
/// Prints a fatal error message when an unimplemented initializer gets
/// called by the Objective-C runtime.
-@inlinable // FIXME(sil-serialize-all)
@_transparent
public // COMPILER_INTRINSIC
func _unimplementedInitializer(className: StaticString,
diff --git a/stdlib/public/core/Bool.swift b/stdlib/public/core/Bool.swift
index 17be981..00ec51b 100644
--- a/stdlib/public/core/Bool.swift
+++ b/stdlib/public/core/Bool.swift
@@ -75,8 +75,7 @@
self._value = Builtin.trunc_Int8_Int1(zero._value)
}
- @inlinable // FIXME(sil-serialize-all)
- @_transparent
+ @usableFromInline @_transparent
internal init(_ v: Builtin.Int1) { self._value = v }
/// Creates an instance equal to the given Boolean value.
@@ -284,7 +283,6 @@
/// - Parameters:
/// - lhs: The left-hand side of the operation.
/// - rhs: The right-hand side of the operation.
- @inlinable // FIXME(sil-serialize-all)
@_transparent
@inline(__always)
public static func && (lhs: Bool, rhs: @autoclosure () throws -> Bool) rethrows
@@ -325,7 +323,6 @@
/// - Parameters:
/// - lhs: The left-hand side of the operation.
/// - rhs: The right-hand side of the operation.
- @inlinable // FIXME(sil-serialize-all)
@_transparent
@inline(__always)
public static func || (lhs: Bool, rhs: @autoclosure () throws -> Bool) rethrows
diff --git a/stdlib/public/core/BridgeObjectiveC.swift b/stdlib/public/core/BridgeObjectiveC.swift
index 958459c..58cce5e 100644
--- a/stdlib/public/core/BridgeObjectiveC.swift
+++ b/stdlib/public/core/BridgeObjectiveC.swift
@@ -341,8 +341,7 @@
// -- Pointer argument bridging
-@inlinable // FIXME(sil-serialize-all)
-@_transparent
+@usableFromInline @_transparent
internal var _nilNativeObject: AnyObject? {
return nil
}
@@ -438,7 +437,7 @@
///
/// - Warning: Accessing `pointee` as a type that is unrelated to
/// the underlying memory's bound type is undefined.
- @_transparent
+ @usableFromInline @_transparent
internal init<U>(_ from: UnsafePointer<U>) {
self._rawValue = from._rawValue
}
@@ -452,7 +451,7 @@
///
/// - Warning: Accessing `pointee` as a type that is unrelated to
/// the underlying memory's bound type is undefined.
- @_transparent
+ @usableFromInline @_transparent
internal init?<U>(_ from: UnsafePointer<U>?) {
guard let unwrapped = from else { return nil }
self.init(unwrapped)
@@ -540,8 +539,7 @@
@usableFromInline // FIXME(sil-serialize-all)
internal var _item15: UnsafeRawPointer?
- @inlinable // FIXME(sil-serialize-all)
- @_transparent
+ @usableFromInline @_transparent
internal var count: Int {
return 16
}
diff --git a/stdlib/public/core/Builtin.swift b/stdlib/public/core/Builtin.swift
index 74534d9..5013e92 100644
--- a/stdlib/public/core/Builtin.swift
+++ b/stdlib/public/core/Builtin.swift
@@ -43,7 +43,6 @@
}
/// Returns a tri-state of 0 = no, 1 = yes, 2 = maybe.
-@inlinable // FIXME(sil-serialize-all)
@_transparent
public // @testable
func _canBeClass<T>(_: T.Type) -> Int8 {
@@ -92,7 +91,6 @@
/// functions.
///
/// - Requires: `x` has type `U`.
-@inlinable // FIXME(sil-serialize-all)
@_transparent
public func _identityCast<T, U>(_ x: T, to expectedType: U.Type) -> U {
_precondition(T.self == expectedType, "_identityCast to wrong type")
@@ -209,7 +207,6 @@
/// Unwrapped `T` and `U` must be convertible to AnyObject. They may
/// be either a class or a class protocol. Either T, U, or both may be
/// optional references.
-@inlinable // FIXME(sil-serialize-all)
@_transparent
public func _unsafeReferenceCast<T, U>(_ x: T, to: U.Type) -> U {
return Builtin.castReference(x)
@@ -233,14 +230,12 @@
/// - x: An instance to cast to type `T`.
/// - type: The type `T` to which `x` is cast.
/// - Returns: The instance `x`, cast to type `T`.
-@inlinable // FIXME(sil-serialize-all)
@_transparent
public func unsafeDowncast<T : AnyObject>(_ x: AnyObject, to type: T.Type) -> T {
_debugPrecondition(x is T, "invalid unsafeDowncast")
return Builtin.castReference(x)
}
-@inlinable // FIXME(sil-serialize-all)
@_transparent
public func _unsafeUncheckedDowncast<T : AnyObject>(_ x: AnyObject, to type: T.Type) -> T {
_sanityCheck(x is T, "invalid unsafeDowncast")
@@ -268,15 +263,13 @@
// semantics of these function calls. This won't be necessary with
// mandatory generic inlining.
-@inlinable // FIXME(sil-serialize-all)
-@_transparent
+@usableFromInline @_transparent
@_semantics("branchhint")
internal func _branchHint(_ actual: Bool, expected: Bool) -> Bool {
return Bool(Builtin.int_expect_Int1(actual._value, expected._value))
}
/// Optimizer hint that `x` is expected to be `true`.
-@inlinable // FIXME(sil-serialize-all)
@_transparent
@_semantics("fastpath")
public func _fastPath(_ x: Bool) -> Bool {
@@ -284,7 +277,6 @@
}
/// Optimizer hint that `x` is expected to be `false`.
-@inlinable // FIXME(sil-serialize-all)
@_transparent
@_semantics("slowpath")
public func _slowPath(_ x: Bool) -> Bool {
@@ -293,7 +285,6 @@
/// Optimizer hint that the code where this function is called is on the fast
/// path.
-@inlinable // FIXME(sil-serialize-all)
@_transparent
public func _onFastPath() {
Builtin.onFastPath()
@@ -665,7 +656,6 @@
/// Returns `true` if `object` is uniquely referenced.
/// This provides sanity checks on top of the Builtin.
-@inlinable // FIXME(sil-serialize-all)
@_transparent
public // @testable
func _isUnique_native<T>(_ object: inout T) -> Bool {
@@ -682,7 +672,6 @@
/// Returns `true` if `object` is uniquely referenced or pinned.
/// This provides sanity checks on top of the Builtin.
-@inlinable // FIXME(sil-serialize-all)
@_transparent
public // @testable
func _isUniqueOrPinned_native<T>(_ object: inout T) -> Bool {
@@ -698,7 +687,6 @@
/// Returns `true` if type is a POD type. A POD type is a type that does not
/// require any special handling on copying or destruction.
-@inlinable // FIXME(sil-serialize-all)
@_transparent
public // @testable
func _isPOD<T>(_ type: T.Type) -> Bool {
@@ -706,7 +694,6 @@
}
/// Returns `true` if type is nominally an Optional type.
-@inlinable // FIXME(sil-serialize-all)
@_transparent
public // @testable
func _isOptional<T>(_ type: T.Type) -> Bool {
@@ -850,7 +837,6 @@
///
/// - Parameter value: The value for which to find the dynamic type.
/// - Returns: The dynamic type, which is a metatype instance.
-@inlinable // FIXME(sil-serialize-all)
@_transparent
@_semantics("typechecker.type(of:)")
public func type<T, Metatype>(of value: T) -> Metatype {
@@ -943,7 +929,6 @@
/// - body: A closure that is executed immediately with an escapable copy of
/// `closure` as its argument.
/// - Returns: The return value, if any, of the `body` closure.
-@inlinable // FIXME(sil-serialize-all)
@_transparent
@_semantics("typechecker.withoutActuallyEscaping(_:do:)")
public func withoutActuallyEscaping<ClosureType, ResultType>(
@@ -959,7 +944,6 @@
Builtin.unreachable()
}
-@inlinable // FIXME(sil-serialize-all)
@_transparent
@_semantics("typechecker._openExistential(_:do:)")
public func _openExistential<ExistentialType, ContainedType, ResultType>(
diff --git a/stdlib/public/core/CTypes.swift b/stdlib/public/core/CTypes.swift
index a2cbaa97..514b723 100644
--- a/stdlib/public/core/CTypes.swift
+++ b/stdlib/public/core/CTypes.swift
@@ -109,8 +109,7 @@
@usableFromInline
internal var _rawValue: Builtin.RawPointer
- @inlinable // FIXME(sil-serialize-all)
- @_transparent
+ @usableFromInline @_transparent
internal init(_ v: Builtin.RawPointer) {
self._rawValue = v
}
diff --git a/stdlib/public/core/CocoaArray.swift b/stdlib/public/core/CocoaArray.swift
index c22c131..daf0d2a 100644
--- a/stdlib/public/core/CocoaArray.swift
+++ b/stdlib/public/core/CocoaArray.swift
@@ -77,8 +77,7 @@
: nil
}
- @inlinable // FIXME(sil-serialize-all)
- @_transparent
+ @usableFromInline @_transparent
internal init(_ buffer: _NSArrayCore) {
self.buffer = buffer
}
diff --git a/stdlib/public/core/Dictionary.swift b/stdlib/public/core/Dictionary.swift
index f9f9f4a..04d45a1 100644
--- a/stdlib/public/core/Dictionary.swift
+++ b/stdlib/public/core/Dictionary.swift
@@ -2580,8 +2580,7 @@
}
}
- @inlinable // FIXME(sil-serialize-all)
- @_transparent
+ @usableFromInline @_transparent
internal static func bucketCount(
forCapacity capacity: Int,
maxLoadFactorInverse: Double
@@ -3246,8 +3245,7 @@
case cocoa(CocoaBuffer)
#endif
- @inlinable // FIXME(sil-serialize-all)
- @_transparent
+ @usableFromInline @_transparent
internal var guaranteedNative: Bool {
return _canBeClass(Key.self) == 0 || _canBeClass(Value.self) == 0
}
@@ -4394,14 +4392,12 @@
}
#endif
- @inlinable // FIXME(sil-serialize-all)
- @_transparent
+ @usableFromInline @_transparent
internal var _guaranteedNative: Bool {
return _canBeClass(Key.self) == 0 && _canBeClass(Value.self) == 0
}
- @inlinable // FIXME(sil-serialize-all)
- @_transparent
+ @usableFromInline @_transparent
internal var _nativeIndex: _NativeIndex {
switch _value {
case ._native(let nativeIndex):
@@ -4414,8 +4410,7 @@
}
#if _runtime(_ObjC)
- @inlinable // FIXME(sil-serialize-all)
- @_transparent
+ @usableFromInline @_transparent
internal var _cocoaIndex: _CocoaIndex {
switch _value {
case ._native:
@@ -4649,8 +4644,7 @@
}
#endif
- @inlinable // FIXME(sil-serialize-all)
- @_transparent
+ @usableFromInline @_transparent
internal var _guaranteedNative: Bool {
return _canBeClass(Key.self) == 0 || _canBeClass(Value.self) == 0
}
diff --git a/stdlib/public/core/FloatingPointTypes.swift.gyb b/stdlib/public/core/FloatingPointTypes.swift.gyb
index dcb78de..b55e45e 100644
--- a/stdlib/public/core/FloatingPointTypes.swift.gyb
+++ b/stdlib/public/core/FloatingPointTypes.swift.gyb
@@ -317,28 +317,23 @@
@usableFromInline // FIXME(sil-serialize-all)
internal var _storage: (UInt64, UInt16, /* pad */ UInt16, UInt16, UInt16)
- @inlinable // FIXME(sil-serialize-all)
- @_transparent
+ @usableFromInline @_transparent
internal var explicitSignificand: UInt64 { return _storage.0 }
- @inlinable // FIXME(sil-serialize-all)
- @_transparent
+ @usableFromInline @_transparent
internal var signAndExponent: UInt16 { return _storage.1 }
- @inlinable // FIXME(sil-serialize-all)
- @_transparent
+ @usableFromInline @_transparent
internal var sign: FloatingPointSign {
return FloatingPointSign(rawValue: Int(signAndExponent &>> 15))!
}
- @inlinable // FIXME(sil-serialize-all)
- @_transparent
+ @usableFromInline @_transparent
internal var exponentBitPattern: UInt {
return UInt(signAndExponent) & 0x7fff
}
- @inlinable // FIXME(sil-serialize-all)
- @_transparent
+ @usableFromInline @_transparent
internal init(explicitSignificand: UInt64, signAndExponent: UInt16) {
_storage = (explicitSignificand, signAndExponent, 0, 0, 0)
}
diff --git a/stdlib/public/core/Hashing.swift b/stdlib/public/core/Hashing.swift
index 1e2cf7d..1412a21 100644
--- a/stdlib/public/core/Hashing.swift
+++ b/stdlib/public/core/Hashing.swift
@@ -61,8 +61,7 @@
/// The inverse of the default hash table load factor. Factored out so that it
/// can be used in multiple places in the implementation and stay consistent.
/// Should not be used outside `Dictionary` implementation.
-@inlinable // FIXME(sil-serialize-all)
-@_transparent
+@usableFromInline @_transparent
internal var _hashContainerDefaultMaxLoadFactorInverse: Double {
return 1.0 / 0.75
}
diff --git a/stdlib/public/core/Integers.swift.gyb b/stdlib/public/core/Integers.swift.gyb
index a81d8ff..46c9689 100644
--- a/stdlib/public/core/Integers.swift.gyb
+++ b/stdlib/public/core/Integers.swift.gyb
@@ -2103,7 +2103,6 @@
/// - Parameters:
/// - lhs: An integer to compare.
/// - rhs: Another integer to compare.
- @inlinable // FIXME(sil-serialize-all)
@_transparent
//@inline(__always)
public static func <= <Other : BinaryInteger>(lhs: Self, rhs: Other) -> Bool {
@@ -2120,7 +2119,6 @@
/// - Parameters:
/// - lhs: An integer to compare.
/// - rhs: Another integer to compare.
- @inlinable // FIXME(sil-serialize-all)
@_transparent
//@inline(__always)
public static func >= <Other : BinaryInteger>(lhs: Self, rhs: Other) -> Bool {
@@ -2137,7 +2135,6 @@
/// - Parameters:
/// - lhs: An integer to compare.
/// - rhs: Another integer to compare.
- @inlinable // FIXME(sil-serialize-all)
@_transparent
//@inline(__always)
public static func > <Other : BinaryInteger>(lhs: Self, rhs: Other) -> Bool {
@@ -2656,7 +2653,6 @@
return lhs
}
- @inlinable // FIXME(sil-serialize-all)
@_transparent
@_semantics("optimize.sil.specialize.generic.partial.never")
public static func ${x.nonMaskingOperator}= <
diff --git a/stdlib/public/core/Runtime.swift.gyb b/stdlib/public/core/Runtime.swift.gyb
index 659888f..5ff332f 100644
--- a/stdlib/public/core/Runtime.swift.gyb
+++ b/stdlib/public/core/Runtime.swift.gyb
@@ -82,7 +82,6 @@
}
% end # optional
-@inlinable // FIXME(sil-serialize-all)
@_transparent
@discardableResult
public // @testable
diff --git a/stdlib/public/core/Set.swift b/stdlib/public/core/Set.swift
index ed12bc3..6b5982d 100644
--- a/stdlib/public/core/Set.swift
+++ b/stdlib/public/core/Set.swift
@@ -2150,8 +2150,7 @@
}
}
- @inlinable // FIXME(sil-serialize-all)
- @_transparent
+ @usableFromInline @_transparent
internal static func bucketCount(
forCapacity capacity: Int,
maxLoadFactorInverse: Double
@@ -2749,8 +2748,7 @@
case cocoa(CocoaBuffer)
#endif
- @inlinable // FIXME(sil-serialize-all)
- @_transparent
+ @usableFromInline @_transparent
internal var guaranteedNative: Bool {
return _canBeClass(Key.self) == 0 || _canBeClass(Value.self) == 0
}
@@ -3669,14 +3667,12 @@
}
#endif
- @inlinable // FIXME(sil-serialize-all)
- @_transparent
+ @usableFromInline @_transparent
internal var _guaranteedNative: Bool {
return _canBeClass(Key.self) == 0 && _canBeClass(Value.self) == 0
}
- @inlinable // FIXME(sil-serialize-all)
- @_transparent
+ @usableFromInline @_transparent
internal var _nativeIndex: _NativeIndex {
switch _value {
case ._native(let nativeIndex):
@@ -3689,8 +3685,7 @@
}
#if _runtime(_ObjC)
- @inlinable // FIXME(sil-serialize-all)
- @_transparent
+ @usableFromInline @_transparent
internal var _cocoaIndex: _CocoaIndex {
switch _value {
case ._native:
@@ -3927,8 +3922,7 @@
}
#endif
- @inlinable // FIXME(sil-serialize-all)
- @_transparent
+ @usableFromInline @_transparent
internal var _guaranteedNative: Bool {
return _canBeClass(Element.self) == 0
}
diff --git a/stdlib/public/core/StaticString.swift b/stdlib/public/core/StaticString.swift
index fa19e4f..b7d17c2 100644
--- a/stdlib/public/core/StaticString.swift
+++ b/stdlib/public/core/StaticString.swift
@@ -160,8 +160,7 @@
self = ""
}
- @inlinable // FIXME(sil-serialize-all)
- @_transparent
+ @usableFromInline @_transparent
internal init(
_start: Builtin.RawPointer,
utf8CodeUnitCount: Builtin.Word,
@@ -177,8 +176,7 @@
: (0x0 as UInt8)._value
}
- @inlinable // FIXME(sil-serialize-all)
- @_transparent
+ @usableFromInline @_transparent
internal init(
unicodeScalar: Builtin.Int32
) {
diff --git a/stdlib/public/core/UnicodeScalarProperties.swift b/stdlib/public/core/UnicodeScalarProperties.swift
index 092ef1e..f73f41a 100644
--- a/stdlib/public/core/UnicodeScalarProperties.swift
+++ b/stdlib/public/core/UnicodeScalarProperties.swift
@@ -26,6 +26,7 @@
self._value = __swift_stdlib_UChar32(bitPattern: _scalar._value)
}
+ @usableFromInline
internal var _value: __swift_stdlib_UChar32
}
@@ -40,7 +41,7 @@
/// ICU-specific).
extension Unicode.Scalar.Properties {
- @_transparent
+ @usableFromInline @_transparent
internal func _hasBinaryProperty(
_ property: __swift_stdlib_UProperty
) -> Bool {
@@ -671,7 +672,7 @@
/// The UTF-16 encoding of the scalar, represented as a tuple of 2 elements.
///
/// If the scalar only encodes to one code unit, the second element is zero.
- @_transparent
+ @usableFromInline @_transparent
internal var _utf16CodeUnits: (UTF16.CodeUnit, UTF16.CodeUnit) {
let utf16 = UnicodeScalar(UInt32(_value))!.utf16
return (utf16[0], utf16.count > 1 ? utf16[1] : 0)
diff --git a/stdlib/public/core/Unmanaged.swift b/stdlib/public/core/Unmanaged.swift
index 45c2acc..08e0b0e 100644
--- a/stdlib/public/core/Unmanaged.swift
+++ b/stdlib/public/core/Unmanaged.swift
@@ -19,8 +19,7 @@
@usableFromInline
internal unowned(unsafe) var _value: Instance
- @inlinable // FIXME(sil-serialize-all)
- @_transparent
+ @usableFromInline @_transparent
internal init(_private: Instance) { _value = _private }
/// Unsafely turns an opaque C pointer into an unmanaged class reference.
diff --git a/stdlib/public/core/UnsafeRawBufferPointer.swift.gyb b/stdlib/public/core/UnsafeRawBufferPointer.swift.gyb
index cb3b501..c9317fa 100644
--- a/stdlib/public/core/UnsafeRawBufferPointer.swift.gyb
+++ b/stdlib/public/core/UnsafeRawBufferPointer.swift.gyb
@@ -661,7 +661,6 @@
/// - Returns: A typed buffer of the newly bound memory. The memory in this
/// region is bound to `T`, but has not been modified in any other way.
/// The typed buffer references `self.count / MemoryLayout<T>.stride` instances of `T`.
- @inlinable // FIXME(sil-serialize-all)
@_transparent
@discardableResult
public func bindMemory<T>(
diff --git a/stdlib/public/core/UnsafeRawPointer.swift b/stdlib/public/core/UnsafeRawPointer.swift
index d1b8ad4..488d99b 100644
--- a/stdlib/public/core/UnsafeRawPointer.swift
+++ b/stdlib/public/core/UnsafeRawPointer.swift
@@ -280,7 +280,6 @@
/// region is bound to `T`, but has not been modified in any other way.
/// The number of bytes in this region is
/// `count * MemoryLayout<T>.stride`.
- @inlinable // FIXME(sil-serialize-all)
@_transparent
@discardableResult
public func bindMemory<T>(
@@ -627,7 +626,6 @@
/// region is bound to `T`, but has not been modified in any other way.
/// The number of bytes in this region is
/// `count * MemoryLayout<T>.stride`.
- @inlinable // FIXME(sil-serialize-all)
@_transparent
@discardableResult
public func bindMemory<T>(
diff --git a/test/Prototypes/DoubleWidth.swift.gyb b/test/Prototypes/DoubleWidth.swift.gyb
index 138013b..83ad9ac 100644
--- a/test/Prototypes/DoubleWidth.swift.gyb
+++ b/test/Prototypes/DoubleWidth.swift.gyb
@@ -92,8 +92,7 @@
// For that reason, we'll include an internal initializer that takes two
// separate arguments.
@inlinable // FIXME(sil-serialize-all)
- @usableFromInline
- @_transparent
+ @usableFromInline @_transparent
internal init(_ _high: High, _ low: Low) {
self.init((_high, low))
}
@@ -562,9 +561,7 @@
/// "Masking" notionally involves repeatedly incrementing or decrementing this
/// value by `self.bitWidth` until the result is contained in the range
/// `0..<self.bitWidth`.
- @inlinable // FIXME(sil-serialize-all)
- @usableFromInline
- @_transparent
+ @usableFromInline @_transparent
internal func _masked() -> DoubleWidth {
// FIXME(integers): test types with bit widths that aren't powers of 2
if DoubleWidth.bitWidth.nonzeroBitCount == 1 {