Skip to content

Commit 9010644

Browse files
committed
[stdlib] Remove a bunch of unused functions from Runtime.swift.gyb
<rdar://problem/45746339>
1 parent 6636815 commit 9010644

File tree

3 files changed

+30
-74
lines changed

3 files changed

+30
-74
lines changed

stdlib/public/core/Runtime.swift.gyb

+1-74
Original file line numberDiff line numberDiff line change
@@ -103,80 +103,7 @@ func _stdlib_atomicInitializeARCRef(
103103
}
104104

105105
% for bits in [ 32, 64 ]:
106-
107-
@_transparent
108-
public // @testable
109-
func _stdlib_atomicCompareExchangeStrongUInt${bits}(
110-
object target: UnsafeMutablePointer<UInt${bits}>,
111-
expected: UnsafeMutablePointer<UInt${bits}>,
112-
desired: UInt${bits}) -> Bool {
113-
114-
let (oldValue, won) = Builtin.cmpxchg_seqcst_seqcst_Int${bits}(
115-
target._rawValue, expected.pointee._value, desired._value)
116-
expected.pointee._value = oldValue
117-
return Bool(won)
118-
}
119-
120-
@_transparent
121-
public // @testable
122-
func _stdlib_atomicCompareExchangeStrongInt${bits}(
123-
object target: UnsafeMutablePointer<Int${bits}>,
124-
expected: UnsafeMutablePointer<Int${bits}>,
125-
desired: Int${bits}) -> Bool {
126-
127-
let (oldValue, won) = Builtin.cmpxchg_seqcst_seqcst_Int${bits}(
128-
target._rawValue, expected.pointee._value, desired._value)
129-
expected.pointee._value = oldValue
130-
return Bool(won)
131-
}
132-
133-
@_transparent
134-
public // @testable
135-
func _swift_stdlib_atomicStoreUInt${bits}(
136-
object target: UnsafeMutablePointer<UInt${bits}>,
137-
desired: UInt${bits}) {
138-
139-
Builtin.atomicstore_seqcst_Int${bits}(target._rawValue, desired._value)
140-
}
141-
142-
@inlinable // FIXME(sil-serialize-all)
143-
internal func _swift_stdlib_atomicStoreInt${bits}(
144-
object target: UnsafeMutablePointer<Int${bits}>,
145-
desired: Int${bits}) {
146-
147-
Builtin.atomicstore_seqcst_Int${bits}(target._rawValue, desired._value)
148-
}
149-
150-
@inlinable // FIXME(sil-serialize-all)
151-
public // @testable
152-
func _swift_stdlib_atomicLoadUInt${bits}(
153-
object target: UnsafeMutablePointer<UInt${bits}>) -> UInt${bits} {
154-
155-
let value = Builtin.atomicload_seqcst_Int${bits}(target._rawValue)
156-
return UInt${bits}(value)
157-
}
158-
159-
@inlinable // FIXME(sil-serialize-all)
160-
internal func _swift_stdlib_atomicLoadInt${bits}(
161-
object target: UnsafeMutablePointer<Int${bits}>) -> Int${bits} {
162-
163-
let value = Builtin.atomicload_seqcst_Int${bits}(target._rawValue)
164-
return Int${bits}(value)
165-
}
166-
167106
% for operation in ['Add', 'And', 'Or', 'Xor']:
168-
// Warning: no overflow checking.
169-
@_transparent
170-
public // @testable
171-
func _swift_stdlib_atomicFetch${operation}UInt${bits}(
172-
object target: UnsafeMutablePointer<UInt${bits}>,
173-
operand: UInt${bits}) -> UInt${bits} {
174-
175-
let value = Builtin.atomicrmw_${operation.lower()}_seqcst_Int${bits}(
176-
target._rawValue, operand._value)
177-
178-
return UInt${bits}(value)
179-
}
180107

181108
// Warning: no overflow checking.
182109
@inlinable // FIXME(sil-serialize-all)
@@ -189,8 +116,8 @@ internal func _swift_stdlib_atomicFetch${operation}Int${bits}(
189116

190117
return Int${bits}(value)
191118
}
192-
% end
193119

120+
% end
194121
% end
195122

196123
@inlinable // FIXME(sil-serialize-all)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Func _stdlib_atomicCompareExchangeStrongInt32(object:expected:desired:) has been removed
2+
Func _stdlib_atomicCompareExchangeStrongInt64(object:expected:desired:) has been removed
3+
Func _stdlib_atomicCompareExchangeStrongUInt32(object:expected:desired:) has been removed
4+
Func _stdlib_atomicCompareExchangeStrongUInt64(object:expected:desired:) has been removed
5+
Func _swift_stdlib_atomicFetchAddUInt32(object:operand:) has been removed
6+
Func _swift_stdlib_atomicFetchAddUInt64(object:operand:) has been removed
7+
Func _swift_stdlib_atomicFetchAndUInt32(object:operand:) has been removed
8+
Func _swift_stdlib_atomicFetchAndUInt64(object:operand:) has been removed
9+
Func _swift_stdlib_atomicFetchOrUInt32(object:operand:) has been removed
10+
Func _swift_stdlib_atomicFetchOrUInt64(object:operand:) has been removed
11+
Func _swift_stdlib_atomicFetchXorUInt32(object:operand:) has been removed
12+
Func _swift_stdlib_atomicFetchXorUInt64(object:operand:) has been removed
13+
Func _swift_stdlib_atomicLoadInt32(object:) has been removed
14+
Func _swift_stdlib_atomicLoadInt64(object:) has been removed
15+
Func _swift_stdlib_atomicLoadUInt32(object:) has been removed
16+
Func _swift_stdlib_atomicLoadUInt64(object:) has been removed
17+
Func _swift_stdlib_atomicStoreInt32(object:desired:) has been removed
18+
Func _swift_stdlib_atomicStoreInt64(object:desired:) has been removed
19+
Func _swift_stdlib_atomicStoreUInt32(object:desired:) has been removed
20+
Func _swift_stdlib_atomicStoreUInt64(object:desired:) has been removed

validation-test/stdlib/Prototypes/PersistentVector.swift.gyb

+9
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,15 @@ func deallocBytes(
125125
pointer.deallocate()
126126
}
127127

128+
@_transparent
129+
func _swift_stdlib_atomicStoreUInt64(
130+
object target: UnsafeMutablePointer<UInt64>,
131+
desired: UInt64
132+
) {
133+
Builtin.atomicstore_seqcst_Int64(target._rawValue, desired._value)
134+
}
135+
136+
128137
func _swift_stdlib_atomicStoreInt(
129138
object target: UnsafeMutablePointer<Int>,
130139
desired: Int) {

0 commit comments

Comments
 (0)