Skip to content

Commit 81f8b2a

Browse files
committed
[Volatile] Remove extensions on UnsafeMutablePointer
1 parent 90c8a8e commit 81f8b2a

File tree

2 files changed

+0
-91
lines changed

2 files changed

+0
-91
lines changed

stdlib/public/Volatile/Volatile.swift

Lines changed: 0 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -101,77 +101,3 @@ extension UnsafeVolatilePointer where Pointee == UInt64 {
101101
Builtin.atomicstore_monotonic_volatile_Int64(_rawPointer, value._value)
102102
}
103103
}
104-
105-
106-
107-
extension UnsafeMutablePointer where Pointee == UInt8 {
108-
/// Perform a 8-bit volatile load operation from the target pointer.
109-
///
110-
/// Do not use for inter-thread synchronization.
111-
@_transparent
112-
public func volatileLoad() -> Pointee {
113-
UnsafeVolatilePointer(bitPattern: UInt(bitPattern: self)).load()
114-
}
115-
116-
/// Perform a 8-bit volatile store operation on the target pointer.
117-
///
118-
/// Do not use for inter-thread synchronization.
119-
@_transparent
120-
public func volatileStore(_ value: Pointee) {
121-
UnsafeVolatilePointer(bitPattern: UInt(bitPattern: self)).store(value)
122-
}
123-
}
124-
125-
extension UnsafeMutablePointer where Pointee == UInt16 {
126-
/// Perform a 16-bit volatile load operation from the target pointer.
127-
///
128-
/// Do not use for inter-thread synchronization.
129-
@_transparent
130-
public func volatileLoad() -> Pointee {
131-
UnsafeVolatilePointer(bitPattern: UInt(bitPattern: self)).load()
132-
}
133-
134-
/// Perform a 16-bit volatile store operation on the target pointer.
135-
///
136-
/// Do not use for inter-thread synchronization.
137-
@_transparent
138-
public func volatileStore(_ value: Pointee) {
139-
UnsafeVolatilePointer(bitPattern: UInt(bitPattern: self)).store(value)
140-
}
141-
}
142-
143-
extension UnsafeMutablePointer where Pointee == UInt32 {
144-
/// Perform a 32-bit volatile load operation from the target pointer.
145-
///
146-
/// Do not use for inter-thread synchronization.
147-
@_transparent
148-
public func volatileLoad() -> Pointee {
149-
UnsafeVolatilePointer(bitPattern: UInt(bitPattern: self)).load()
150-
}
151-
152-
/// Perform a 32-bit volatile store operation on the target pointer.
153-
///
154-
/// Do not use for inter-thread synchronization.
155-
@_transparent
156-
public func volatileStore(_ value: Pointee) {
157-
UnsafeVolatilePointer(bitPattern: UInt(bitPattern: self)).store(value)
158-
}
159-
}
160-
161-
extension UnsafeMutablePointer where Pointee == UInt64 {
162-
/// Perform a 64-bit volatile load operation from the target pointer.
163-
///
164-
/// Do not use for inter-thread synchronization.
165-
@_transparent
166-
public func volatileLoad() -> Pointee {
167-
UnsafeVolatilePointer(bitPattern: UInt(bitPattern: self)).load()
168-
}
169-
170-
/// Perform a 64-bit volatile store operation on the target pointer.
171-
///
172-
/// Do not use for inter-thread synchronization.
173-
@_transparent
174-
public func volatileStore(_ value: Pointee) {
175-
UnsafeVolatilePointer(bitPattern: UInt(bitPattern: self)).store(value)
176-
}
177-
}

test/Volatile/volatile-repeat-loads.swift

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,3 @@ public func test_volatilepointer() -> UInt8 {
2121
// CHECK: [[RET:%.*]] = load atomic volatile i8, ptr {{.*}} monotonic, align 1
2222
// CHECK: ret i8 [[RET]]
2323
// CHECK: }
24-
25-
public func test_unsafepointer() -> UInt8 {
26-
let p = UnsafeMutablePointer<UInt8>(bitPattern: 0xf000baaa)!
27-
p.volatileStore(42)
28-
let a = p.volatileLoad()
29-
let b = p.volatileLoad()
30-
let c = p.volatileLoad()
31-
return c
32-
}
33-
34-
// CHECK: define {{.*}}i8 @"$s4main18test_unsafepointers5UInt8VyF"()
35-
// CHECK: store atomic volatile i8 42, ptr {{.*}} monotonic, align 1
36-
// CHECK: load atomic volatile i8, ptr {{.*}} monotonic, align 1
37-
// CHECK: load atomic volatile i8, ptr {{.*}} monotonic, align 1
38-
// CHECK: [[RET:%.*]] = load atomic volatile i8, ptr {{.*}} monotonic, align 1
39-
// CHECK: ret i8 [[RET]]
40-
// CHECK: }

0 commit comments

Comments
 (0)