@@ -905,14 +905,6 @@ extension UnsafeMutablePointer {
905
905
}
906
906
}
907
907
908
- #if true // Builtin.initialize doesn't support noncopyable types (rdar://123253877)
909
- extension UnsafeMutablePointer {
910
- @_alwaysEmitIntoClient
911
- public func initialize( to value: consuming Pointee ) {
912
- Builtin . initialize ( value, self . _rawValue)
913
- }
914
- }
915
- #else
916
908
extension UnsafeMutablePointer where Pointee: ~ Copyable {
917
909
/// Initializes this pointer's memory with a single instance of the given
918
910
/// value.
@@ -937,7 +929,6 @@ extension UnsafeMutablePointer {
937
929
Builtin . initialize ( value, self . _rawValue)
938
930
}
939
931
}
940
- #endif
941
932
942
933
extension UnsafeMutablePointer where Pointee: ~ Copyable {
943
934
/// Retrieves and returns the referenced instance, returning the pointer's
@@ -1055,37 +1046,6 @@ extension UnsafeMutablePointer {
1055
1046
}
1056
1047
}
1057
1048
1058
- #if true // Builtin.takeArray* don't support noncopyable types (rdar://123253877)
1059
- extension UnsafeMutablePointer {
1060
- @_alwaysEmitIntoClient
1061
- public func moveInitialize(
1062
- @_nonEphemeral from source: UnsafeMutablePointer , count: Int
1063
- ) {
1064
- _debugPrecondition (
1065
- count >= 0 , " UnsafeMutablePointer.moveInitialize with negative count " )
1066
- if self < source || self >= source + count {
1067
- // initialize forward from a disjoint or following overlapping range.
1068
- Builtin . takeArrayFrontToBack (
1069
- Pointee . self, self . _rawValue, source. _rawValue, count. _builtinWordValue)
1070
- // This builtin is equivalent to:
1071
- // for i in 0..<count {
1072
- // (self + i).initialize(to: (source + i).move())
1073
- // }
1074
- }
1075
- else if self != source {
1076
- // initialize backward from a non-following overlapping range.
1077
- Builtin . takeArrayBackToFront (
1078
- Pointee . self, self . _rawValue, source. _rawValue, count. _builtinWordValue)
1079
- // This builtin is equivalent to:
1080
- // var src = source + count
1081
- // var dst = self + count
1082
- // while dst != self {
1083
- // (--dst).initialize(to: (--src).move())
1084
- // }
1085
- }
1086
- }
1087
- }
1088
- #else
1089
1049
extension UnsafeMutablePointer where Pointee: ~ Copyable {
1090
1050
/// Moves instances from initialized source memory into the uninitialized
1091
1051
/// memory referenced by this pointer, leaving the source memory
@@ -1165,7 +1125,6 @@ extension UnsafeMutablePointer {
1165
1125
}
1166
1126
}
1167
1127
}
1168
- #endif
1169
1128
1170
1129
extension UnsafeMutablePointer {
1171
1130
/// Initializes the memory referenced by this pointer with the values
@@ -1201,26 +1160,6 @@ extension UnsafeMutablePointer {
1201
1160
}
1202
1161
}
1203
1162
1204
- #if true // Builtin.assignTakeArray doesn't support noncopyable types (rdar://123253877)
1205
- extension UnsafeMutablePointer {
1206
- @_alwaysEmitIntoClient
1207
- public func moveUpdate(
1208
- @_nonEphemeral from source: UnsafeMutablePointer , count: Int
1209
- ) {
1210
- _debugPrecondition (
1211
- count >= 0 , " UnsafeMutablePointer.moveUpdate(from:) with negative count " )
1212
- _debugPrecondition (
1213
- self + count <= source || source + count <= self ,
1214
- " moveUpdate overlapping range " )
1215
- Builtin . assignTakeArray (
1216
- Pointee . self, self . _rawValue, source. _rawValue, count. _builtinWordValue)
1217
- // These builtins are equivalent to:
1218
- // for i in 0..<count {
1219
- // self[i] = (source + i).move()
1220
- // }
1221
- }
1222
- }
1223
- #else
1224
1163
extension UnsafeMutablePointer where Pointee: ~ Copyable {
1225
1164
/// Update this pointer's initialized memory by moving the specified number
1226
1165
/// of instances the source pointer's memory, leaving the source memory
@@ -1288,21 +1227,7 @@ extension UnsafeMutablePointer {
1288
1227
moveUpdate ( from: source, count: count)
1289
1228
}
1290
1229
}
1291
- #endif
1292
1230
1293
- #if true // Builtin.destroyArray doesn't support noncopyable types (rdar://123253877)
1294
- extension UnsafeMutablePointer {
1295
- @_alwaysEmitIntoClient
1296
- @discardableResult
1297
- public func deinitialize( count: Int ) -> UnsafeMutableRawPointer {
1298
- _debugPrecondition ( count >= 0 , " UnsafeMutablePointer.deinitialize with negative count " )
1299
- // TODO: IRGen optimization when `count` value is statically known to be 1,
1300
- // then call `Builtin.destroy(Pointee.self, _rawValue)` instead.
1301
- Builtin . destroyArray ( Pointee . self, _rawValue, count. _builtinWordValue)
1302
- return UnsafeMutableRawPointer ( self )
1303
- }
1304
- }
1305
- #else
1306
1231
extension UnsafeMutablePointer where Pointee: ~ Copyable {
1307
1232
/// Deinitializes the specified number of values starting at this pointer.
1308
1233
///
@@ -1338,7 +1263,6 @@ extension UnsafeMutablePointer {
1338
1263
return UnsafeMutableRawPointer ( self )
1339
1264
}
1340
1265
}
1341
- #endif
1342
1266
1343
1267
extension UnsafeMutablePointer /* where Pointee: ~Copyable */ {
1344
1268
// FIXME: We want this to have the constraint above, but that triggers a .swiftinterface issue.
0 commit comments