Skip to content

Commit 8760b7c

Browse files
committed
Consistently use @usableFromInline and remove redundant @inlinables
1 parent 417828e commit 8760b7c

File tree

6 files changed

+12
-28
lines changed

6 files changed

+12
-28
lines changed

stdlib/public/core/Array.swift

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1604,7 +1604,6 @@ extension Array {
16041604
/// for the `withUnsafeBufferPointer(_:)` method. The pointer argument is
16051605
/// valid only for the duration of the method's execution.
16061606
/// - Returns: The return value, if any, of the `body` closure parameter.
1607-
@inlinable
16081607
@_alwaysEmitIntoClient
16091608
public func withUnsafeBufferPointer<R, E>(
16101609
_ body: (UnsafeBufferPointer<Element>) throws(E) -> R
@@ -1616,11 +1615,8 @@ extension Array {
16161615
// for ABI reasons.
16171616
@_semantics("array.withUnsafeMutableBufferPointer")
16181617
@_effects(notEscaping self.value**)
1619-
@inlinable // FIXME(inline-always)
1620-
@inline(__always) // Performance: This method should get inlined into the
1621-
// caller such that we can combine the partial apply with the apply in this
1622-
// function saving on allocating a closure context. This becomes unnecessary
1623-
// once we allocate noescape closures on the stack.
1618+
@usableFromInline
1619+
@inline(__always)
16241620
@_silgen_name("$sSa30withUnsafeMutableBufferPointeryqd__qd__SryxGzKXEKlF")
16251621
mutating func __abi_withUnsafeMutableBufferPointer<R>(
16261622
_ body: (inout UnsafeMutableBufferPointer<Element>) throws -> R

stdlib/public/core/ArrayBuffer.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ extension _ArrayBuffer {
569569

570570
// Superseded by the typed-throws version of this function, but retained
571571
// for ABI reasons.
572-
@inlinable
572+
@usableFromInline
573573
@_silgen_name("$ss12_ArrayBufferV010withUnsafeB7Pointeryqd__qd__SRyxGKXEKlF")
574574
internal func __abi_withUnsafeBufferPointer<R>(
575575
_ body: (UnsafeBufferPointer<Element>) throws -> R
@@ -585,7 +585,6 @@ extension _ArrayBuffer {
585585
/// Call `body(p)`, where `p` is an `UnsafeBufferPointer` over the
586586
/// underlying contiguous storage. If no such storage exists, it is
587587
/// created on-demand.
588-
@inlinable
589588
@_alwaysEmitIntoClient
590589
internal func withUnsafeBufferPointer<R, E>(
591590
_ body: (UnsafeBufferPointer<Element>) throws(E) -> R
@@ -600,7 +599,7 @@ extension _ArrayBuffer {
600599

601600
// Superseded by the typed-throws version of this function, but retained
602601
// for ABI reasons.
603-
@inlinable
602+
@usableFromInline
604603
@_silgen_name("$ss12_ArrayBufferV017withUnsafeMutableB7Pointeryqd__qd__SryxGKXEKlF")
605604
internal mutating func __abi_withUnsafeMutableBufferPointer<R>(
606605
_ body: (UnsafeMutableBufferPointer<Element>) throws -> R
@@ -612,7 +611,6 @@ extension _ArrayBuffer {
612611
/// over the underlying contiguous storage.
613612
///
614613
/// - Precondition: Such contiguous storage exists or the buffer is empty.
615-
@inlinable
616614
@_alwaysEmitIntoClient
617615
internal mutating func withUnsafeMutableBufferPointer<R, E>(
618616
_ body: (UnsafeMutableBufferPointer<Element>) throws(E) -> R

stdlib/public/core/ArraySlice.swift

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,7 +1203,6 @@ extension ArraySlice {
12031203
/// for the `withUnsafeBufferPointer(_:)` method. The pointer argument is
12041204
/// valid only for the duration of the method's execution.
12051205
/// - Returns: The return value, if any, of the `body` closure parameter.
1206-
@inlinable
12071206
@_alwaysEmitIntoClient
12081207
public func withUnsafeBufferPointer<R, E>(
12091208
_ body: (UnsafeBufferPointer<Element>) throws(E) -> R
@@ -1214,11 +1213,8 @@ extension ArraySlice {
12141213
// Superseded by the typed-throws version of this function, but retained
12151214
// for ABI reasons.
12161215
@_semantics("array.withUnsafeMutableBufferPointer")
1217-
@inlinable // FIXME(inline-always)
1218-
@inline(__always) // Performance: This method should get inlined into the
1219-
// caller such that we can combine the partial apply with the apply in this
1220-
// function saving on allocating a closure context. This becomes unnecessary
1221-
// once we allocate noescape closures on the stack.
1216+
@usableFromInline
1217+
@inline(__always)
12221218
@_silgen_name("$ss10ArraySliceV30withUnsafeMutableBufferPointeryqd__qd__SryxGzKXEKlF")
12231219
mutating func __abi_withUnsafeMutableBufferPointer<R>(
12241220
_ body: (inout UnsafeMutableBufferPointer<Element>) throws -> R

stdlib/public/core/ContiguousArray.swift

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,7 +1144,6 @@ extension ContiguousArray {
11441144
/// for the `withUnsafeBufferPointer(_:)` method. The pointer argument is
11451145
/// valid only for the duration of the method's execution.
11461146
/// - Returns: The return value, if any, of the `body` closure parameter.
1147-
@inlinable
11481147
@_alwaysEmitIntoClient
11491148
public func withUnsafeBufferPointer<R, E>(
11501149
_ body: (UnsafeBufferPointer<Element>) throws(E) -> R
@@ -1155,11 +1154,8 @@ extension ContiguousArray {
11551154
// Superseded by the typed-throws version of this function, but retained
11561155
// for ABI reasons.
11571156
@_semantics("array.withUnsafeMutableBufferPointer")
1158-
@inlinable // FIXME(inline-always)
1159-
@inline(__always) // Performance: This method should get inlined into the
1160-
// caller such that we can combine the partial apply with the apply in this
1161-
// function saving on allocating a closure context. This becomes unnecessary
1162-
// once we allocate noescape closures on the stack.
1157+
@usableFromInline
1158+
@inline(__always)
11631159
@_silgen_name("$ss15ContiguousArrayV30withUnsafeMutableBufferPointeryqd__qd__SryxGzKXEKlF")
11641160
mutating func __abi_withUnsafeMutableBufferPointer<R>(
11651161
_ body: (inout UnsafeMutableBufferPointer<Element>) throws -> R

stdlib/public/core/ContiguousArrayBuffer.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ internal struct _ContiguousArrayBuffer<Element>: _ArrayBufferProtocol {
446446

447447
// Superseded by the typed-throws version of this function, but retained
448448
// for ABI reasons.
449-
@inlinable
449+
@usableFromInline
450450
@_silgen_name("$ss22_ContiguousArrayBufferV010withUnsafeC7Pointeryqd__qd__SRyxGKXEKlF")
451451
internal func __abi_withUnsafeBufferPointer<R>(
452452
_ body: (UnsafeBufferPointer<Element>) throws -> R
@@ -458,7 +458,6 @@ internal struct _ContiguousArrayBuffer<Element>: _ArrayBufferProtocol {
458458

459459
/// Call `body(p)`, where `p` is an `UnsafeBufferPointer` over the
460460
/// underlying contiguous storage.
461-
@inlinable
462461
@_alwaysEmitIntoClient
463462
internal func withUnsafeBufferPointer<R, E>(
464463
_ body: (UnsafeBufferPointer<Element>) throws(E) -> R
@@ -470,7 +469,7 @@ internal struct _ContiguousArrayBuffer<Element>: _ArrayBufferProtocol {
470469

471470
// Superseded by the typed-throws version of this function, but retained
472471
// for ABI reasons.
473-
@inlinable
472+
@usableFromInline
474473
@_silgen_name("$ss22_ContiguousArrayBufferV017withUnsafeMutableC7Pointeryqd__qd__SryxGKXEKlF")
475474
internal mutating func __abi_withUnsafeMutableBufferPointer<R>(
476475
_ body: (UnsafeMutableBufferPointer<Element>) throws -> R

stdlib/public/core/SliceBuffer.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ internal struct _SliceBuffer<Element>
432432
//===--- misc -----------------------------------------------------------===//
433433
// Superseded by the typed-throws version of this function, but retained
434434
// for ABI reasons.
435-
@inlinable
435+
@usableFromInline
436436
@_silgen_name("$ss12_SliceBufferV010withUnsafeB7Pointeryqd__qd__SRyxGKXEKlF")
437437
internal func __abi_withUnsafeBufferPointer<R>(
438438
_ body: (UnsafeBufferPointer<Element>) throws -> R
@@ -444,7 +444,6 @@ internal struct _SliceBuffer<Element>
444444

445445
/// Call `body(p)`, where `p` is an `UnsafeBufferPointer` over the
446446
/// underlying contiguous storage.
447-
@inlinable
448447
@_alwaysEmitIntoClient
449448
internal func withUnsafeBufferPointer<R, E>(
450449
_ body: (UnsafeBufferPointer<Element>) throws(E) -> R
@@ -456,7 +455,7 @@ internal struct _SliceBuffer<Element>
456455

457456
// Superseded by the typed-throws version of this function, but retained
458457
// for ABI reasons.
459-
@inlinable
458+
@usableFromInline
460459
@_silgen_name("$ss12_SliceBufferV017withUnsafeMutableB7Pointeryqd__qd__SryxGKXEKlF")
461460
internal mutating func __abi_withUnsafeMutableBufferPointer<R>(
462461
_ body: (UnsafeMutableBufferPointer<Element>) throws -> R

0 commit comments

Comments
 (0)