Skip to content

Commit d860460

Browse files
committed
Rename AtomicValue to AtomicRepresentable
1 parent b68e864 commit d860460

File tree

12 files changed

+439
-440
lines changed

12 files changed

+439
-440
lines changed

stdlib/public/Synchronization/Atomic.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import Builtin
1717
@frozen
1818
@_rawLayout(like: Value.AtomicRepresentation)
1919
@_staticExclusiveOnly
20-
public struct Atomic<Value: AtomicValue>: ~Copyable {
20+
public struct Atomic<Value: AtomicRepresentable>: ~Copyable {
2121
@available(SwiftStdlib 5.11, *)
2222
@_alwaysEmitIntoClient
2323
@_transparent

stdlib/public/Synchronization/AtomicBool.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
import Builtin
1414

1515
//===----------------------------------------------------------------------===//
16-
// Bool AtomicValue conformance
16+
// Bool AtomicRepresentable conformance
1717
//===----------------------------------------------------------------------===//
1818

1919
@available(SwiftStdlib 5.11, *)
20-
extension Bool: AtomicValue {
20+
extension Bool: AtomicRepresentable {
2121
/// The storage representation type that `Self` encodes to and decodes from
2222
/// which is a suitable type when used in atomic operations.
2323
@available(SwiftStdlib 5.11, *)

stdlib/public/Synchronization/AtomicFloats.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
//===----------------------------------------------------------------------===//
14-
// Float16 AtomicValue conformance
14+
// Float16 AtomicRepresentable conformance
1515
//===----------------------------------------------------------------------===//
1616

1717
#if !((os(macOS) || targetEnvironment(macCatalyst)) && arch(x86_64))
1818

1919
@available(SwiftStdlib 5.11, *)
20-
extension Float16: AtomicValue {
20+
extension Float16: AtomicRepresentable {
2121
/// The storage representation type that `Self` encodes to and decodes from
2222
/// which is a suitable type when used in atomic operations.
2323
@available(SwiftStdlib 5.11, *)
@@ -65,11 +65,11 @@ extension Float16: AtomicValue {
6565
#endif
6666

6767
//===----------------------------------------------------------------------===//
68-
// Float AtomicValue conformance
68+
// Float AtomicRepresentable conformance
6969
//===----------------------------------------------------------------------===//
7070

7171
@available(SwiftStdlib 5.11, *)
72-
extension Float: AtomicValue {
72+
extension Float: AtomicRepresentable {
7373
/// The storage representation type that `Self` encodes to and decodes from
7474
/// which is a suitable type when used in atomic operations.
7575
@available(SwiftStdlib 5.11, *)
@@ -115,13 +115,13 @@ extension Float: AtomicValue {
115115
}
116116

117117
//===----------------------------------------------------------------------===//
118-
// Double AtomicValue conformance
118+
// Double AtomicRepresentable conformance
119119
//===----------------------------------------------------------------------===//
120120

121121
#if (_pointerBitWidth(_32) && _hasAtomicBitWidth(_64)) || _pointerBitWidth(_64)
122122

123123
@available(SwiftStdlib 5.11, *)
124-
extension Double: AtomicValue {
124+
extension Double: AtomicRepresentable {
125125
/// The storage representation type that `Self` encodes to and decodes from
126126
/// which is a suitable type when used in atomic operations.
127127
@available(SwiftStdlib 5.11, *)

stdlib/public/Synchronization/AtomicIntegers.swift.gyb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ import Builtin
1717
% for (intType, intStorage, builtinInt) in intTypes:
1818

1919
//===----------------------------------------------------------------------===//
20-
// ${intType} AtomicValue conformance
20+
// ${intType} AtomicRepresentable conformance
2121
//===----------------------------------------------------------------------===//
2222

2323
% if intType == "Int64" or intType == "UInt64":
2424
#if (_pointerBitWidth(_32) && _hasAtomicBitWidth(_64)) || _pointerBitWidth(_64)
2525
% end
2626

2727
@available(SwiftStdlib 5.11, *)
28-
extension ${intType}: AtomicValue {
28+
extension ${intType}: AtomicRepresentable {
2929
/// The storage representation type that `Self` encodes to and decodes from
3030
/// which is a suitable type when used in atomic operations.
3131
% if intType == "Int" or intType == "UInt":

stdlib/public/Synchronization/AtomicOptional.swift

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
/// An atomic value that also supports atomic operations when wrapped
14-
/// in an `Optional`. Atomic optional wrappable types come with a
15-
/// standalone atomic representation for their optional-wrapped
16-
/// variants.
14+
/// in an `Optional`. Atomic optional representable types come with a standalone
15+
/// atomic representation for their optional-wrapped variants.
1716
@available(SwiftStdlib 5.11, *)
18-
public protocol AtomicOptionalWrappable: AtomicValue {
17+
public protocol AtomicOptionalRepresentable: AtomicRepresentable {
1918
/// The storage representation type that encodes to and decodes from
2019
/// `Optional<Self>` which is a suitable type when used in atomic operations
2120
/// on `Optional`.
@@ -52,14 +51,14 @@ public protocol AtomicOptionalWrappable: AtomicValue {
5251
}
5352

5453
//===----------------------------------------------------------------------===//
55-
// RawRepresentable AtomicOptionalWrappable conformance
54+
// RawRepresentable AtomicOptionalRepresentable conformance
5655
//===----------------------------------------------------------------------===//
5756

5857
@available(SwiftStdlib 5.11, *)
5958
extension RawRepresentable
6059
where
61-
Self: AtomicOptionalWrappable,
62-
RawValue: AtomicOptionalWrappable
60+
Self: AtomicOptionalRepresentable,
61+
RawValue: AtomicOptionalRepresentable
6362
{
6463
/// The storage representation type that encodes to and decodes from
6564
/// `Optional<Self>` which is a suitable type when used in atomic operations
@@ -118,11 +117,11 @@ where
118117
}
119118

120119
//===----------------------------------------------------------------------===//
121-
// Optional AtomicValue conformance
120+
// Optional AtomicRepresentable conformance
122121
//===----------------------------------------------------------------------===//
123122

124123
@available(SwiftStdlib 5.11, *)
125-
extension Optional: AtomicValue where Wrapped: AtomicOptionalWrappable {
124+
extension Optional: AtomicRepresentable where Wrapped: AtomicOptionalRepresentable {
126125
/// The storage representation type that `Self` encodes to and decodes from
127126
/// which is a suitable type when used in atomic operations.
128127
@available(SwiftStdlib 5.11, *)

stdlib/public/Synchronization/AtomicPointers.swift

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
//===----------------------------------------------------------------------===//
14-
// UnsafePointer AtomicValue and AtomicOptionalWrappable conformance
14+
// UnsafePointer AtomicRepresentable and AtomicOptionalRepresentable conformance
1515
//===----------------------------------------------------------------------===//
1616

1717
@available(SwiftStdlib 5.11, *)
18-
extension UnsafePointer: AtomicValue {
18+
extension UnsafePointer: AtomicRepresentable {
1919
/// The storage representation type that `Self` encodes to and decodes from
2020
/// which is a suitable type when used in atomic operations.
2121
@available(SwiftStdlib 5.11, *)
@@ -65,7 +65,7 @@ extension UnsafePointer: AtomicValue {
6565
}
6666

6767
@available(SwiftStdlib 5.11, *)
68-
extension UnsafePointer: AtomicOptionalWrappable {
68+
extension UnsafePointer: AtomicOptionalRepresentable {
6969
/// The storage representation type that encodes to and decodes from
7070
/// `Optional<Self>` which is a suitable type when used in atomic operations
7171
/// on `Optional`.
@@ -117,11 +117,11 @@ extension UnsafePointer: AtomicOptionalWrappable {
117117
}
118118

119119
//===----------------------------------------------------------------------===//
120-
// UnsafeMutablePointer AtomicOptionalWrappable conformance
120+
// UnsafeMutablePointer AtomicRepresentable and AtomicOptionalRepresentable conformance
121121
//===----------------------------------------------------------------------===//
122122

123123
@available(SwiftStdlib 5.11, *)
124-
extension UnsafeMutablePointer: AtomicValue {
124+
extension UnsafeMutablePointer: AtomicRepresentable {
125125
/// The storage representation type that `Self` encodes to and decodes from
126126
/// which is a suitable type when used in atomic operations.
127127
@available(SwiftStdlib 5.11, *)
@@ -171,7 +171,7 @@ extension UnsafeMutablePointer: AtomicValue {
171171
}
172172

173173
@available(SwiftStdlib 5.11, *)
174-
extension UnsafeMutablePointer: AtomicOptionalWrappable {
174+
extension UnsafeMutablePointer: AtomicOptionalRepresentable {
175175
/// The storage representation type that encodes to and decodes from
176176
/// `Optional<Self>` which is a suitable type when used in atomic operations
177177
/// on `Optional`.
@@ -223,11 +223,11 @@ extension UnsafeMutablePointer: AtomicOptionalWrappable {
223223
}
224224

225225
//===----------------------------------------------------------------------===//
226-
// UnsafeRawPointer AtomicOptionalWrappable conformance
226+
// UnsafeRawPointer AtomicRepresentable and AtomicOptionalRepresentable conformance
227227
//===----------------------------------------------------------------------===//
228228

229229
@available(SwiftStdlib 5.11, *)
230-
extension UnsafeRawPointer: AtomicValue {
230+
extension UnsafeRawPointer: AtomicRepresentable {
231231
/// The storage representation type that `Self` encodes to and decodes from
232232
/// which is a suitable type when used in atomic operations.
233233
@available(SwiftStdlib 5.11, *)
@@ -277,7 +277,7 @@ extension UnsafeRawPointer: AtomicValue {
277277
}
278278

279279
@available(SwiftStdlib 5.11, *)
280-
extension UnsafeRawPointer: AtomicOptionalWrappable {
280+
extension UnsafeRawPointer: AtomicOptionalRepresentable {
281281
/// The storage representation type that encodes to and decodes from
282282
/// `Optional<Self>` which is a suitable type when used in atomic operations
283283
/// on `Optional`.
@@ -329,11 +329,11 @@ extension UnsafeRawPointer: AtomicOptionalWrappable {
329329
}
330330

331331
//===----------------------------------------------------------------------===//
332-
// UnsafeMutableRawPointer AtomicOptionalWrappable conformance
332+
// UnsafeMutableRawPointer AtomicRepresentable and AtomicOptionalRepresentable conformance
333333
//===----------------------------------------------------------------------===//
334334

335335
@available(SwiftStdlib 5.11, *)
336-
extension UnsafeMutableRawPointer: AtomicValue {
336+
extension UnsafeMutableRawPointer: AtomicRepresentable {
337337
/// The storage representation type that `Self` encodes to and decodes from
338338
/// which is a suitable type when used in atomic operations.
339339
@available(SwiftStdlib 5.11, *)
@@ -383,7 +383,7 @@ extension UnsafeMutableRawPointer: AtomicValue {
383383
}
384384

385385
@available(SwiftStdlib 5.11, *)
386-
extension UnsafeMutableRawPointer: AtomicOptionalWrappable {
386+
extension UnsafeMutableRawPointer: AtomicOptionalRepresentable {
387387
/// The storage representation type that encodes to and decodes from
388388
/// `Optional<Self>` which is a suitable type when used in atomic operations
389389
/// on `Optional`.
@@ -435,11 +435,11 @@ extension UnsafeMutableRawPointer: AtomicOptionalWrappable {
435435
}
436436

437437
//===----------------------------------------------------------------------===//
438-
// Unmanaged AtomicOptionalWrappable conformance
438+
// Unmanaged AtomicRepresentable and AtomicOptionalRepresentable conformance
439439
//===----------------------------------------------------------------------===//
440440

441441
@available(SwiftStdlib 5.11, *)
442-
extension Unmanaged: AtomicValue {
442+
extension Unmanaged: AtomicRepresentable {
443443
/// The storage representation type that `Self` encodes to and decodes from
444444
/// which is a suitable type when used in atomic operations.
445445
@available(SwiftStdlib 5.11, *)
@@ -489,7 +489,7 @@ extension Unmanaged: AtomicValue {
489489
}
490490

491491
@available(SwiftStdlib 5.11, *)
492-
extension Unmanaged: AtomicOptionalWrappable {
492+
extension Unmanaged: AtomicOptionalRepresentable {
493493
/// The storage representation type that encodes to and decodes from
494494
/// `Optional<Self>` which is a suitable type when used in atomic operations
495495
/// on `Optional`.
@@ -549,11 +549,11 @@ extension Unmanaged: AtomicOptionalWrappable {
549549
}
550550

551551
//===----------------------------------------------------------------------===//
552-
// OpaquePointer AtomicOptionalWrappable conformance
552+
// OpaquePointer AtomicRepresentable and AtomicOptionalRepresentable conformance
553553
//===----------------------------------------------------------------------===//
554554

555555
@available(SwiftStdlib 5.11, *)
556-
extension OpaquePointer: AtomicValue {
556+
extension OpaquePointer: AtomicRepresentable {
557557
/// The storage representation type that `Self` encodes to and decodes from
558558
/// which is a suitable type when used in atomic operations.
559559
@available(SwiftStdlib 5.11, *)
@@ -603,7 +603,7 @@ extension OpaquePointer: AtomicValue {
603603
}
604604

605605
@available(SwiftStdlib 5.11, *)
606-
extension OpaquePointer: AtomicOptionalWrappable {
606+
extension OpaquePointer: AtomicOptionalRepresentable {
607607
/// The storage representation type that encodes to and decodes from
608608
/// `Optional<Self>` which is a suitable type when used in atomic operations
609609
/// on `Optional`.
@@ -655,11 +655,11 @@ extension OpaquePointer: AtomicOptionalWrappable {
655655
}
656656

657657
//===----------------------------------------------------------------------===//
658-
// ObjectIdentifier AtomicOptionalWrappable conformance
658+
// ObjectIdentifier AtomicRepresentable and AtomicOptionalRepresentable conformance
659659
//===----------------------------------------------------------------------===//
660660

661661
@available(SwiftStdlib 5.11, *)
662-
extension ObjectIdentifier: AtomicValue {
662+
extension ObjectIdentifier: AtomicRepresentable {
663663
/// The storage representation type that `Self` encodes to and decodes from
664664
/// which is a suitable type when used in atomic operations.
665665
@available(SwiftStdlib 5.11, *)
@@ -711,7 +711,7 @@ extension ObjectIdentifier: AtomicValue {
711711
}
712712

713713
@available(SwiftStdlib 5.11, *)
714-
extension ObjectIdentifier: AtomicOptionalWrappable {
714+
extension ObjectIdentifier: AtomicOptionalRepresentable {
715715
/// The storage representation type that encodes to and decodes from
716716
/// `Optional<Self>` which is a suitable type when used in atomic operations
717717
/// on `Optional`.
@@ -767,13 +767,13 @@ extension ObjectIdentifier: AtomicOptionalWrappable {
767767
}
768768

769769
//===----------------------------------------------------------------------===//
770-
// UnsafeBufferPointer AtomicValue conformance
770+
// UnsafeBufferPointer AtomicRepresentable conformance
771771
//===----------------------------------------------------------------------===//
772772

773773
#if (_pointerBitWidth(_32) && _hasAtomicBitWidth(_64)) || (_pointerBitWidth(_64) && _hasAtomicBitWidth(_128))
774774

775775
@available(SwiftStdlib 5.11, *)
776-
extension UnsafeBufferPointer: AtomicValue {
776+
extension UnsafeBufferPointer: AtomicRepresentable {
777777
/// The storage representation type that `Self` encodes to and decodes from
778778
/// which is a suitable type when used in atomic operations.
779779
@available(SwiftStdlib 5.11, *)
@@ -833,13 +833,13 @@ extension UnsafeBufferPointer: AtomicValue {
833833
#endif
834834

835835
//===----------------------------------------------------------------------===//
836-
// UnsafeMutableBufferPointer AtomicValue conformance
836+
// UnsafeMutableBufferPointer AtomicRepresentable conformance
837837
//===----------------------------------------------------------------------===//
838838

839839
#if (_pointerBitWidth(_32) && _hasAtomicBitWidth(_64)) || (_pointerBitWidth(_64) && _hasAtomicBitWidth(_128))
840840

841841
@available(SwiftStdlib 5.11, *)
842-
extension UnsafeMutableBufferPointer: AtomicValue {
842+
extension UnsafeMutableBufferPointer: AtomicRepresentable {
843843
/// The storage representation type that `Self` encodes to and decodes from
844844
/// which is a suitable type when used in atomic operations.
845845
@available(SwiftStdlib 5.11, *)
@@ -899,13 +899,13 @@ extension UnsafeMutableBufferPointer: AtomicValue {
899899
#endif
900900

901901
//===----------------------------------------------------------------------===//
902-
// UnsafeRawBufferPointer AtomicValue conformance
902+
// UnsafeRawBufferPointer AtomicRepresentable conformance
903903
//===----------------------------------------------------------------------===//
904904

905905
#if (_pointerBitWidth(_32) && _hasAtomicBitWidth(_64)) || (_pointerBitWidth(_64) && _hasAtomicBitWidth(_128))
906906

907907
@available(SwiftStdlib 5.11, *)
908-
extension UnsafeRawBufferPointer: AtomicValue {
908+
extension UnsafeRawBufferPointer: AtomicRepresentable {
909909
/// The storage representation type that `Self` encodes to and decodes from
910910
/// which is a suitable type when used in atomic operations.
911911
@available(SwiftStdlib 5.11, *)
@@ -965,13 +965,13 @@ extension UnsafeRawBufferPointer: AtomicValue {
965965
#endif
966966

967967
//===----------------------------------------------------------------------===//
968-
// UnsafeMutableRawBufferPointer AtomicValue conformance
968+
// UnsafeMutableRawBufferPointer AtomicRepresentable conformance
969969
//===----------------------------------------------------------------------===//
970970

971971
#if (_pointerBitWidth(_32) && _hasAtomicBitWidth(_64)) || (_pointerBitWidth(_64) && _hasAtomicBitWidth(_128))
972972

973973
@available(SwiftStdlib 5.11, *)
974-
extension UnsafeMutableRawBufferPointer: AtomicValue {
974+
extension UnsafeMutableRawBufferPointer: AtomicRepresentable {
975975
/// The storage representation type that `Self` encodes to and decodes from
976976
/// which is a suitable type when used in atomic operations.
977977
@available(SwiftStdlib 5.11, *)

0 commit comments

Comments
 (0)