Skip to content

Commit 224a400

Browse files
committed
cleaning up attributes
1 parent d122fd6 commit 224a400

File tree

2 files changed

+12
-17
lines changed

2 files changed

+12
-17
lines changed

stdlib/public/BackDeployConcurrency/TaskLocal.swift

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public final class TaskLocal<Value: Sendable>: Sendable, CustomStringConvertible
102102
self.defaultValue = defaultValue
103103
}
104104

105-
@usableFromInline
105+
@_alwaysEmitIntoClient
106106
var key: Builtin.RawPointer {
107107
unsafeBitCast(self, to: Builtin.RawPointer.self)
108108
}
@@ -136,10 +136,10 @@ public final class TaskLocal<Value: Sendable>: Sendable, CustomStringConvertible
136136
/// If the value is a reference type, it will be retained for the duration of
137137
/// the operation closure.
138138
@discardableResult
139-
@inline(__always)
139+
@inlineable
140140
@_unsafeInheritExecutor
141141
@available(SwiftStdlib 5.1, *) // back deploy requires we declare the availability explicitly on this method
142-
@_backDeploy(before: macOS 9999, iOS 9999, watchOS 9999, tvOS 9999) // SwiftStdlib 5.8 but it doesn't work with _backDeploy
142+
@_backDeploy(before: SwiftStdlib 5.8)
143143
public func withValue<R>(_ valueDuringOperation: Value, operation: () async throws -> R,
144144
file: String = #file, line: UInt = #line) async rethrows -> R {
145145
// check if we're not trying to bind a value from an illegal context; this may crash
@@ -164,8 +164,8 @@ public final class TaskLocal<Value: Sendable>: Sendable, CustomStringConvertible
164164
///
165165
/// If the value is a reference type, it will be retained for the duration of
166166
/// the operation closure.
167+
@inlineable
167168
@discardableResult
168-
@inline(__always)
169169
public func withValue<R>(_ valueDuringOperation: Value, operation: () throws -> R,
170170
file: String = #file, line: UInt = #line) rethrows -> R {
171171
// check if we're not trying to bind a value from an illegal context; this may crash
@@ -177,7 +177,6 @@ public final class TaskLocal<Value: Sendable>: Sendable, CustomStringConvertible
177177
return try operation()
178178
}
179179

180-
@inline(__always)
181180
public var projectedValue: TaskLocal<Value> {
182181
get {
183182
self
@@ -219,27 +218,25 @@ public final class TaskLocal<Value: Sendable>: Sendable, CustomStringConvertible
219218
// ==== ------------------------------------------------------------------------
220219

221220
@available(SwiftStdlib 5.1, *)
222-
@usableFromInline
221+
@_alwaysEmitIntoClient
223222
@_silgen_name("swift_task_localValuePush")
224223
func _taskLocalValuePush<Value>(
225224
key: Builtin.RawPointer/*: Key*/,
226225
value: __owned Value
227226
) // where Key: TaskLocal
228227

229228
@available(SwiftStdlib 5.1, *)
230-
@usableFromInline
229+
@_alwaysEmitIntoClient
231230
@_silgen_name("swift_task_localValuePop")
232231
func _taskLocalValuePop()
233232

234233
@available(SwiftStdlib 5.1, *)
235-
@usableFromInline
236234
@_silgen_name("swift_task_localValueGet")
237235
func _taskLocalValueGet(
238236
key: Builtin.RawPointer/*Key*/
239237
) -> UnsafeMutableRawPointer? // where Key: TaskLocal
240238

241239
@available(SwiftStdlib 5.1, *)
242-
@usableFromInline
243240
@_silgen_name("swift_task_localsCopyTo")
244241
func _taskLocalsCopy(
245242
to target: Builtin.NativeObject

stdlib/public/Concurrency/TaskLocal.swift

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public final class TaskLocal<Value: Sendable>: Sendable, CustomStringConvertible
102102
self.defaultValue = defaultValue
103103
}
104104

105-
@usableFromInline
105+
@_alwaysEmitIntoClient
106106
var key: Builtin.RawPointer {
107107
unsafeBitCast(self, to: Builtin.RawPointer.self)
108108
}
@@ -135,10 +135,11 @@ public final class TaskLocal<Value: Sendable>: Sendable, CustomStringConvertible
135135
///
136136
/// If the value is a reference type, it will be retained for the duration of
137137
/// the operation closure.
138+
@inlineable
138139
@discardableResult
139140
@_unsafeInheritExecutor
140141
@available(SwiftStdlib 5.1, *) // back deploy requires we declare the availability explicitly on this method
141-
@_backDeploy(before: macOS 9999, iOS 9999, watchOS 9999, tvOS 9999) // SwiftStdlib 5.8 but it doesn't work with _backDeploy
142+
@_backDeploy(before: SwiftStdlib 5.8)
142143
public func withValue<R>(_ valueDuringOperation: Value, operation: () async throws -> R,
143144
file: String = #fileID, line: UInt = #line) async rethrows -> R {
144145
// check if we're not trying to bind a value from an illegal context; this may crash
@@ -163,8 +164,8 @@ public final class TaskLocal<Value: Sendable>: Sendable, CustomStringConvertible
163164
///
164165
/// If the value is a reference type, it will be retained for the duration of
165166
/// the operation closure.
167+
@inlineable
166168
@discardableResult
167-
@inline(__always)
168169
public func withValue<R>(_ valueDuringOperation: Value, operation: () throws -> R,
169170
file: String = #fileID, line: UInt = #line) rethrows -> R {
170171
// check if we're not trying to bind a value from an illegal context; this may crash
@@ -176,7 +177,6 @@ public final class TaskLocal<Value: Sendable>: Sendable, CustomStringConvertible
176177
return try operation()
177178
}
178179

179-
@inline(__always)
180180
public var projectedValue: TaskLocal<Value> {
181181
get {
182182
self
@@ -218,27 +218,25 @@ public final class TaskLocal<Value: Sendable>: Sendable, CustomStringConvertible
218218
// ==== ------------------------------------------------------------------------
219219

220220
@available(SwiftStdlib 5.1, *)
221-
@usableFromInline
221+
@_alwaysEmitIntoClient
222222
@_silgen_name("swift_task_localValuePush")
223223
func _taskLocalValuePush<Value>(
224224
key: Builtin.RawPointer/*: Key*/,
225225
value: __owned Value
226226
) // where Key: TaskLocal
227227

228228
@available(SwiftStdlib 5.1, *)
229-
@usableFromInline
229+
@_alwaysEmitIntoClient
230230
@_silgen_name("swift_task_localValuePop")
231231
func _taskLocalValuePop()
232232

233233
@available(SwiftStdlib 5.1, *)
234-
@usableFromInline
235234
@_silgen_name("swift_task_localValueGet")
236235
func _taskLocalValueGet(
237236
key: Builtin.RawPointer/*Key*/
238237
) -> UnsafeMutableRawPointer? // where Key: TaskLocal
239238

240239
@available(SwiftStdlib 5.1, *)
241-
@usableFromInline
242240
@_silgen_name("swift_task_localsCopyTo")
243241
func _taskLocalsCopy(
244242
to target: Builtin.NativeObject

0 commit comments

Comments
 (0)