Skip to content

Commit b77b544

Browse files
Remove remaining @ininable from @_transparent (#17968)
1 parent 7082f65 commit b77b544

20 files changed

+37
-98
lines changed

stdlib/public/core/Array.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,8 +1339,7 @@ extension Array: CustomStringConvertible, CustomDebugStringConvertible {
13391339
}
13401340

13411341
extension Array {
1342-
@inlinable
1343-
@_transparent
1342+
@usableFromInline @_transparent
13441343
internal func _cPointerArgs() -> (AnyObject?, UnsafeRawPointer?) {
13451344
let p = _baseAddressIfContiguous
13461345
if _fastPath(p != nil || isEmpty) {

stdlib/public/core/ArraySlice.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,8 +1130,7 @@ extension ArraySlice: CustomStringConvertible, CustomDebugStringConvertible {
11301130
}
11311131

11321132
extension ArraySlice {
1133-
@inlinable
1134-
@_transparent
1133+
@usableFromInline @_transparent
11351134
internal func _cPointerArgs() -> (AnyObject?, UnsafeRawPointer?) {
11361135
let p = _baseAddressIfContiguous
11371136
if _fastPath(p != nil || isEmpty) {

stdlib/public/core/AssertCommon.swift

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import SwiftShims
1919
// FIXME: We could go farther with this simplification, e.g. avoiding
2020
// UnsafeMutablePointer
2121

22-
@inlinable // FIXME(sil-serialize-all)
2322
@_transparent
2423
public // @testable
2524
func _isDebugAssertConfiguration() -> Bool {
@@ -39,7 +38,6 @@ internal func _isReleaseAssertConfiguration() -> Bool {
3938
return Int32(Builtin.assert_configuration()) == 1
4039
}
4140

42-
@inlinable // FIXME(sil-serialize-all)
4341
@_transparent
4442
public // @testable
4543
func _isFastAssertConfiguration() -> Bool {
@@ -50,7 +48,6 @@ func _isFastAssertConfiguration() -> Bool {
5048
return Int32(Builtin.assert_configuration()) == 2
5149
}
5250

53-
@inlinable // FIXME(sil-serialize-all)
5451
@_transparent
5552
public // @testable
5653
func _isStdlibInternalChecksEnabled() -> Bool {
@@ -61,8 +58,7 @@ func _isStdlibInternalChecksEnabled() -> Bool {
6158
#endif
6259
}
6360

64-
@inlinable // FIXME(sil-serialize-all)
65-
@_transparent
61+
@usableFromInline @_transparent
6662
internal
6763
func _fatalErrorFlags() -> UInt32 {
6864
// The current flags are:
@@ -205,7 +201,6 @@ internal func _fatalErrorMessage(
205201

206202
/// Prints a fatal error message when an unimplemented initializer gets
207203
/// called by the Objective-C runtime.
208-
@inlinable // FIXME(sil-serialize-all)
209204
@_transparent
210205
public // COMPILER_INTRINSIC
211206
func _unimplementedInitializer(className: StaticString,

stdlib/public/core/Bool.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ public struct Bool {
7575
self._value = Builtin.trunc_Int8_Int1(zero._value)
7676
}
7777

78-
@inlinable // FIXME(sil-serialize-all)
79-
@_transparent
78+
@usableFromInline @_transparent
8079
internal init(_ v: Builtin.Int1) { self._value = v }
8180

8281
/// Creates an instance equal to the given Boolean value.
@@ -284,7 +283,6 @@ extension Bool {
284283
/// - Parameters:
285284
/// - lhs: The left-hand side of the operation.
286285
/// - rhs: The right-hand side of the operation.
287-
@inlinable // FIXME(sil-serialize-all)
288286
@_transparent
289287
@inline(__always)
290288
public static func && (lhs: Bool, rhs: @autoclosure () throws -> Bool) rethrows
@@ -325,7 +323,6 @@ extension Bool {
325323
/// - Parameters:
326324
/// - lhs: The left-hand side of the operation.
327325
/// - rhs: The right-hand side of the operation.
328-
@inlinable // FIXME(sil-serialize-all)
329326
@_transparent
330327
@inline(__always)
331328
public static func || (lhs: Bool, rhs: @autoclosure () throws -> Bool) rethrows

stdlib/public/core/BridgeObjectiveC.swift

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,7 @@ public func _getBridgedNonVerbatimObjectiveCType<T>(_: T.Type) -> Any.Type?
341341

342342
// -- Pointer argument bridging
343343

344-
@inlinable // FIXME(sil-serialize-all)
345-
@_transparent
344+
@usableFromInline @_transparent
346345
internal var _nilNativeObject: AnyObject? {
347346
return nil
348347
}
@@ -438,7 +437,7 @@ public struct AutoreleasingUnsafeMutablePointer<Pointee /* TODO : class */>
438437
///
439438
/// - Warning: Accessing `pointee` as a type that is unrelated to
440439
/// the underlying memory's bound type is undefined.
441-
@_transparent
440+
@usableFromInline @_transparent
442441
internal init<U>(_ from: UnsafePointer<U>) {
443442
self._rawValue = from._rawValue
444443
}
@@ -452,7 +451,7 @@ public struct AutoreleasingUnsafeMutablePointer<Pointee /* TODO : class */>
452451
///
453452
/// - Warning: Accessing `pointee` as a type that is unrelated to
454453
/// the underlying memory's bound type is undefined.
455-
@_transparent
454+
@usableFromInline @_transparent
456455
internal init?<U>(_ from: UnsafePointer<U>?) {
457456
guard let unwrapped = from else { return nil }
458457
self.init(unwrapped)
@@ -540,8 +539,7 @@ internal struct _CocoaFastEnumerationStackBuf {
540539
@usableFromInline // FIXME(sil-serialize-all)
541540
internal var _item15: UnsafeRawPointer?
542541

543-
@inlinable // FIXME(sil-serialize-all)
544-
@_transparent
542+
@usableFromInline @_transparent
545543
internal var count: Int {
546544
return 16
547545
}

stdlib/public/core/Builtin.swift

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ internal func _roundUp(_ offset: Int, toAlignment alignment: Int) -> Int {
4343
}
4444

4545
/// Returns a tri-state of 0 = no, 1 = yes, 2 = maybe.
46-
@inlinable // FIXME(sil-serialize-all)
4746
@_transparent
4847
public // @testable
4948
func _canBeClass<T>(_: T.Type) -> Int8 {
@@ -92,7 +91,6 @@ public func unsafeBitCast<T, U>(_ x: T, to type: U.Type) -> U {
9291
/// functions.
9392
///
9493
/// - Requires: `x` has type `U`.
95-
@inlinable // FIXME(sil-serialize-all)
9694
@_transparent
9795
public func _identityCast<T, U>(_ x: T, to expectedType: U.Type) -> U {
9896
_precondition(T.self == expectedType, "_identityCast to wrong type")
@@ -209,7 +207,6 @@ internal func _isClassOrObjCExistential<T>(_ x: T.Type) -> Bool {
209207
/// Unwrapped `T` and `U` must be convertible to AnyObject. They may
210208
/// be either a class or a class protocol. Either T, U, or both may be
211209
/// optional references.
212-
@inlinable // FIXME(sil-serialize-all)
213210
@_transparent
214211
public func _unsafeReferenceCast<T, U>(_ x: T, to: U.Type) -> U {
215212
return Builtin.castReference(x)
@@ -233,14 +230,12 @@ public func _unsafeReferenceCast<T, U>(_ x: T, to: U.Type) -> U {
233230
/// - x: An instance to cast to type `T`.
234231
/// - type: The type `T` to which `x` is cast.
235232
/// - Returns: The instance `x`, cast to type `T`.
236-
@inlinable // FIXME(sil-serialize-all)
237233
@_transparent
238234
public func unsafeDowncast<T : AnyObject>(_ x: AnyObject, to type: T.Type) -> T {
239235
_debugPrecondition(x is T, "invalid unsafeDowncast")
240236
return Builtin.castReference(x)
241237
}
242238

243-
@inlinable // FIXME(sil-serialize-all)
244239
@_transparent
245240
public func _unsafeUncheckedDowncast<T : AnyObject>(_ x: AnyObject, to type: T.Type) -> T {
246241
_sanityCheck(x is T, "invalid unsafeDowncast")
@@ -268,23 +263,20 @@ public func _getUnsafePointerToStoredProperties(_ x: AnyObject)
268263
// semantics of these function calls. This won't be necessary with
269264
// mandatory generic inlining.
270265

271-
@inlinable // FIXME(sil-serialize-all)
272-
@_transparent
266+
@usableFromInline @_transparent
273267
@_semantics("branchhint")
274268
internal func _branchHint(_ actual: Bool, expected: Bool) -> Bool {
275269
return Bool(Builtin.int_expect_Int1(actual._value, expected._value))
276270
}
277271

278272
/// Optimizer hint that `x` is expected to be `true`.
279-
@inlinable // FIXME(sil-serialize-all)
280273
@_transparent
281274
@_semantics("fastpath")
282275
public func _fastPath(_ x: Bool) -> Bool {
283276
return _branchHint(x, expected: true)
284277
}
285278

286279
/// Optimizer hint that `x` is expected to be `false`.
287-
@inlinable // FIXME(sil-serialize-all)
288280
@_transparent
289281
@_semantics("slowpath")
290282
public func _slowPath(_ x: Bool) -> Bool {
@@ -293,7 +285,6 @@ public func _slowPath(_ x: Bool) -> Bool {
293285

294286
/// Optimizer hint that the code where this function is called is on the fast
295287
/// path.
296-
@inlinable // FIXME(sil-serialize-all)
297288
@_transparent
298289
public func _onFastPath() {
299290
Builtin.onFastPath()
@@ -665,7 +656,6 @@ internal func _isUniqueOrPinned<T>(_ object: inout T) -> Bool {
665656

666657
/// Returns `true` if `object` is uniquely referenced.
667658
/// This provides sanity checks on top of the Builtin.
668-
@inlinable // FIXME(sil-serialize-all)
669659
@_transparent
670660
public // @testable
671661
func _isUnique_native<T>(_ object: inout T) -> Bool {
@@ -682,7 +672,6 @@ func _isUnique_native<T>(_ object: inout T) -> Bool {
682672

683673
/// Returns `true` if `object` is uniquely referenced or pinned.
684674
/// This provides sanity checks on top of the Builtin.
685-
@inlinable // FIXME(sil-serialize-all)
686675
@_transparent
687676
public // @testable
688677
func _isUniqueOrPinned_native<T>(_ object: inout T) -> Bool {
@@ -698,15 +687,13 @@ func _isUniqueOrPinned_native<T>(_ object: inout T) -> Bool {
698687

699688
/// Returns `true` if type is a POD type. A POD type is a type that does not
700689
/// require any special handling on copying or destruction.
701-
@inlinable // FIXME(sil-serialize-all)
702690
@_transparent
703691
public // @testable
704692
func _isPOD<T>(_ type: T.Type) -> Bool {
705693
return Bool(Builtin.ispod(type))
706694
}
707695

708696
/// Returns `true` if type is nominally an Optional type.
709-
@inlinable // FIXME(sil-serialize-all)
710697
@_transparent
711698
public // @testable
712699
func _isOptional<T>(_ type: T.Type) -> Bool {
@@ -850,7 +837,6 @@ func _trueAfterDiagnostics() -> Builtin.Int1 {
850837
///
851838
/// - Parameter value: The value for which to find the dynamic type.
852839
/// - Returns: The dynamic type, which is a metatype instance.
853-
@inlinable // FIXME(sil-serialize-all)
854840
@_transparent
855841
@_semantics("typechecker.type(of:)")
856842
public func type<T, Metatype>(of value: T) -> Metatype {
@@ -943,7 +929,6 @@ public func type<T, Metatype>(of value: T) -> Metatype {
943929
/// - body: A closure that is executed immediately with an escapable copy of
944930
/// `closure` as its argument.
945931
/// - Returns: The return value, if any, of the `body` closure.
946-
@inlinable // FIXME(sil-serialize-all)
947932
@_transparent
948933
@_semantics("typechecker.withoutActuallyEscaping(_:do:)")
949934
public func withoutActuallyEscaping<ClosureType, ResultType>(
@@ -959,7 +944,6 @@ public func withoutActuallyEscaping<ClosureType, ResultType>(
959944
Builtin.unreachable()
960945
}
961946

962-
@inlinable // FIXME(sil-serialize-all)
963947
@_transparent
964948
@_semantics("typechecker._openExistential(_:do:)")
965949
public func _openExistential<ExistentialType, ContainedType, ResultType>(

stdlib/public/core/CTypes.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,7 @@ public struct OpaquePointer {
109109
@usableFromInline
110110
internal var _rawValue: Builtin.RawPointer
111111

112-
@inlinable // FIXME(sil-serialize-all)
113-
@_transparent
112+
@usableFromInline @_transparent
114113
internal init(_ v: Builtin.RawPointer) {
115114
self._rawValue = v
116115
}

stdlib/public/core/CocoaArray.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ internal struct _CocoaArrayWrapper : RandomAccessCollection {
7777
: nil
7878
}
7979

80-
@inlinable // FIXME(sil-serialize-all)
81-
@_transparent
80+
@usableFromInline @_transparent
8281
internal init(_ buffer: _NSArrayCore) {
8382
self.buffer = buffer
8483
}

stdlib/public/core/Dictionary.swift

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2580,8 +2580,7 @@ extension _NativeDictionaryBuffer where Key: Hashable
25802580
}
25812581
}
25822582

2583-
@inlinable // FIXME(sil-serialize-all)
2584-
@_transparent
2583+
@usableFromInline @_transparent
25852584
internal static func bucketCount(
25862585
forCapacity capacity: Int,
25872586
maxLoadFactorInverse: Double
@@ -3246,8 +3245,7 @@ internal enum _VariantDictionaryBuffer<Key: Hashable, Value>: _HashBuffer {
32463245
case cocoa(CocoaBuffer)
32473246
#endif
32483247

3249-
@inlinable // FIXME(sil-serialize-all)
3250-
@_transparent
3248+
@usableFromInline @_transparent
32513249
internal var guaranteedNative: Bool {
32523250
return _canBeClass(Key.self) == 0 || _canBeClass(Value.self) == 0
32533251
}
@@ -4394,14 +4392,12 @@ extension Dictionary {
43944392
}
43954393
#endif
43964394

4397-
@inlinable // FIXME(sil-serialize-all)
4398-
@_transparent
4395+
@usableFromInline @_transparent
43994396
internal var _guaranteedNative: Bool {
44004397
return _canBeClass(Key.self) == 0 && _canBeClass(Value.self) == 0
44014398
}
44024399

4403-
@inlinable // FIXME(sil-serialize-all)
4404-
@_transparent
4400+
@usableFromInline @_transparent
44054401
internal var _nativeIndex: _NativeIndex {
44064402
switch _value {
44074403
case ._native(let nativeIndex):
@@ -4414,8 +4410,7 @@ extension Dictionary {
44144410
}
44154411

44164412
#if _runtime(_ObjC)
4417-
@inlinable // FIXME(sil-serialize-all)
4418-
@_transparent
4413+
@usableFromInline @_transparent
44194414
internal var _cocoaIndex: _CocoaIndex {
44204415
switch _value {
44214416
case ._native:
@@ -4649,8 +4644,7 @@ public struct DictionaryIterator<Key: Hashable, Value>: IteratorProtocol {
46494644
}
46504645
#endif
46514646

4652-
@inlinable // FIXME(sil-serialize-all)
4653-
@_transparent
4647+
@usableFromInline @_transparent
46544648
internal var _guaranteedNative: Bool {
46554649
return _canBeClass(Key.self) == 0 || _canBeClass(Value.self) == 0
46564650
}

stdlib/public/core/FloatingPointTypes.swift.gyb

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -317,28 +317,23 @@ extension ${Self}: BinaryFloatingPoint {
317317
@usableFromInline // FIXME(sil-serialize-all)
318318
internal var _storage: (UInt64, UInt16, /* pad */ UInt16, UInt16, UInt16)
319319
320-
@inlinable // FIXME(sil-serialize-all)
321-
@_transparent
320+
@usableFromInline @_transparent
322321
internal var explicitSignificand: UInt64 { return _storage.0 }
323322
324-
@inlinable // FIXME(sil-serialize-all)
325-
@_transparent
323+
@usableFromInline @_transparent
326324
internal var signAndExponent: UInt16 { return _storage.1 }
327325
328-
@inlinable // FIXME(sil-serialize-all)
329-
@_transparent
326+
@usableFromInline @_transparent
330327
internal var sign: FloatingPointSign {
331328
return FloatingPointSign(rawValue: Int(signAndExponent &>> 15))!
332329
}
333330
334-
@inlinable // FIXME(sil-serialize-all)
335-
@_transparent
331+
@usableFromInline @_transparent
336332
internal var exponentBitPattern: UInt {
337333
return UInt(signAndExponent) & 0x7fff
338334
}
339335
340-
@inlinable // FIXME(sil-serialize-all)
341-
@_transparent
336+
@usableFromInline @_transparent
342337
internal init(explicitSignificand: UInt64, signAndExponent: UInt16) {
343338
_storage = (explicitSignificand, signAndExponent, 0, 0, 0)
344339
}

stdlib/public/core/Hashing.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ internal protocol _HashBuffer {
6161
/// The inverse of the default hash table load factor. Factored out so that it
6262
/// can be used in multiple places in the implementation and stay consistent.
6363
/// Should not be used outside `Dictionary` implementation.
64-
@inlinable // FIXME(sil-serialize-all)
65-
@_transparent
64+
@usableFromInline @_transparent
6665
internal var _hashContainerDefaultMaxLoadFactorInverse: Double {
6766
return 1.0 / 0.75
6867
}

0 commit comments

Comments
 (0)