Skip to content

Commit f9ad81e

Browse files
committed
[BitwiseCopyable] Remove #ifs.
1 parent b1fbe4e commit f9ad81e

File tree

6 files changed

+0
-33
lines changed

6 files changed

+0
-33
lines changed

stdlib/public/core/CommandLine.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,9 @@ internal func _swift_stdlib_getUnsafeArgvArgc(_: UnsafeMutablePointer<Int32>)
1919
-> UnsafeMutablePointer<UnsafeMutablePointer<Int8>?>
2020

2121
/// Command-line arguments for the current process.
22-
#if $BitwiseCopyable && $ConformanceSuppression
2322
@frozen // namespace
2423
public enum CommandLine : ~BitwiseCopyable {
2524
}
26-
#else
27-
@frozen // namespace
28-
public enum CommandLine {
29-
}
30-
@available(*, unavailable)
31-
extension CommandLine : BitwiseCopyable {}
32-
#endif
3325

3426
extension CommandLine {
3527
/// The backing static variable for argument count may come either from the

stdlib/public/core/MemoryLayout.swift

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,8 @@
3939
/// let pointPointer = UnsafeMutableRawPointer.allocate(
4040
/// byteCount: count * MemoryLayout<Point>.stride,
4141
/// alignment: MemoryLayout<Point>.alignment)
42-
#if $BitwiseCopyable && $ConformanceSuppression
4342
@frozen // namespace
4443
public enum MemoryLayout<T: ~Copyable>: ~BitwiseCopyable, Copyable {}
45-
#else
46-
@frozen // namespace
47-
public enum MemoryLayout<T: ~Copyable>: Copyable {}
48-
@available(*, unavailable)
49-
extension MemoryLayout: BitwiseCopyable {}
50-
#endif
5144

5245
extension MemoryLayout where T: ~Copyable {
5346
/// The contiguous memory footprint of `T`, in bytes.

stdlib/public/core/Unicode.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -671,11 +671,5 @@ public func transcode<Input, InputEncoding, OutputEncoding>(
671671
}
672672

673673
/// A namespace for Unicode utilities.
674-
#if $BitwiseCopyable && $ConformanceSuppression
675674
@frozen
676675
public enum Unicode : ~BitwiseCopyable {}
677-
#else
678-
@frozen
679-
public enum Unicode {}
680-
#endif
681-

stdlib/public/core/UnsafeBufferPointerSlice.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,6 @@ extension Slice where Base == UnsafeMutableRawBufferPointer {
378378
/// with `type`.
379379
/// - Returns: A new instance of type `T`, copied from the buffer pointer's
380380
/// memory.
381-
#if $BitwiseCopyable
382381
@inlinable
383382
@_alwaysEmitIntoClient
384383
public func loadUnaligned<T : BitwiseCopyable>(
@@ -388,7 +387,6 @@ extension Slice where Base == UnsafeMutableRawBufferPointer {
388387
let buffer = Base(rebasing: self)
389388
return buffer.loadUnaligned(fromByteOffset: offset, as: T.self)
390389
}
391-
#endif
392390
@inlinable
393391
@_alwaysEmitIntoClient
394392
public func loadUnaligned<T>(
@@ -617,7 +615,6 @@ extension Slice where Base == UnsafeRawBufferPointer {
617615
/// with `type`.
618616
/// - Returns: A new instance of type `T`, copied from the buffer pointer's
619617
/// memory.
620-
#if $BitwiseCopyable
621618
@inlinable
622619
@_alwaysEmitIntoClient
623620
public func loadUnaligned<T : BitwiseCopyable>(
@@ -627,7 +624,6 @@ extension Slice where Base == UnsafeRawBufferPointer {
627624
let buffer = Base(rebasing: self)
628625
return buffer.loadUnaligned(fromByteOffset: offset, as: T.self)
629626
}
630-
#endif
631627
@inlinable
632628
@_alwaysEmitIntoClient
633629
public func loadUnaligned<T>(

stdlib/public/core/UnsafeRawBufferPointer.swift.gyb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,6 @@ extension Unsafe${Mutable}RawBufferPointer {
438438
/// with `type`.
439439
/// - Returns: A new instance of type `T`, copied from the buffer pointer's
440440
/// memory.
441-
#if $BitwiseCopyable
442441
@_alwaysEmitIntoClient
443442
public func loadUnaligned<T : BitwiseCopyable>(
444443
fromByteOffset offset: Int = 0,
@@ -449,7 +448,6 @@ extension Unsafe${Mutable}RawBufferPointer {
449448
"${Self}.load out of bounds")
450449
return baseAddress!.loadUnaligned(fromByteOffset: offset, as: T.self)
451450
}
452-
#endif
453451

454452
@_alwaysEmitIntoClient
455453
public func loadUnaligned<T>(

stdlib/public/core/UnsafeRawPointer.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,6 @@ extension UnsafeRawPointer {
455455

456456
// FIXME(NCG): Add a borrow analogue of `load`, like `withBorrow(fromByteOffset:as:_:)`
457457

458-
#if $BitwiseCopyable
459458
/// Returns a new instance of the given type, constructed from the raw memory
460459
/// at the specified offset.
461460
///
@@ -486,7 +485,6 @@ extension UnsafeRawPointer {
486485
) -> T {
487486
return Builtin.loadRaw((self + offset)._rawValue)
488487
}
489-
#endif
490488

491489
/// Returns a new instance of the given type, constructed from the raw memory
492490
/// at the specified offset.
@@ -1288,7 +1286,6 @@ extension UnsafeMutableRawPointer {
12881286
// FIXME(NCG): Add a consuming analogue of `load`, like `move(fromByteOffset:as:_:)`
12891287
// FIXME(NCG): Add a borrow analogue of `load`, like `withBorrow(fromByteOffset:as:_:)`
12901288

1291-
#if $BitwiseCopyable
12921289
/// Returns a new instance of the given type, constructed from the raw memory
12931290
/// at the specified offset.
12941291
///
@@ -1319,7 +1316,6 @@ extension UnsafeMutableRawPointer {
13191316
) -> T {
13201317
return Builtin.loadRaw((self + offset)._rawValue)
13211318
}
1322-
#endif
13231319

13241320
/// Returns a new instance of the given type, constructed from the raw memory
13251321
/// at the specified offset.
@@ -1362,7 +1358,6 @@ extension UnsafeMutableRawPointer {
13621358
}
13631359
}
13641360

1365-
#if $BitwiseCopyable
13661361
/// Stores the given value's bytes into raw memory at the specified offset.
13671362
///
13681363
/// The type `T` to be stored must be a trivial type. The memory
@@ -1409,7 +1404,6 @@ extension UnsafeMutableRawPointer {
14091404
fatalError("Unsupported swift compiler!")
14101405
#endif
14111406
}
1412-
#endif
14131407

14141408
/// Stores the given value's bytes into raw memory at the specified offset.
14151409
///

0 commit comments

Comments
 (0)