Skip to content

Commit b1fbe4e

Browse files
committed
[BitwiseCopyable] Remove underscore.
1 parent 016489e commit b1fbe4e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+196
-152
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7735,7 +7735,7 @@ ERROR(non_bitwise_copyable_type_cxx_nontrivial,none,
77357735
ERROR(non_bitwise_copyable_c_type_nontrivial,none,
77367736
"type with unrepresentable fields cannot derive conformance to 'BitwiseCopyable'", ())
77377737
NOTE(note_non_bitwise_copyable_c_type_add_attr,none,
7738-
"annotate the type __attribute__((__swift_attr__(\"_BitwiseCopyable\")))",())
7738+
"annotate the type __attribute__((__swift_attr__(\"BitwiseCopyable\")))",())
77397739
ERROR(non_bitwise_copyable_type_member,none,
77407740
"%select{stored property %2|associated value %2}1 of "
77417741
"'BitwiseCopyable'-conforming %kind3 has non-bitwise-copyable type %0",

include/swift/AST/KnownProtocols.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ PROTOCOL(FloatingPoint)
150150
INVERTIBLE_PROTOCOL_WITH_NAME(Name, #Name)
151151
#include "swift/ABI/InvertibleProtocols.def"
152152

153-
REPRESSIBLE_PROTOCOL_(BitwiseCopyable)
153+
REPRESSIBLE_PROTOCOL(BitwiseCopyable)
154154

155155
EXPRESSIBLE_BY_LITERAL_PROTOCOL(ExpressibleByArrayLiteral, "Array", false)
156156
EXPRESSIBLE_BY_LITERAL_PROTOCOL(ExpressibleByBooleanLiteral, "BooleanLiteralType", true)

lib/ClangImporter/ImportDecl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8028,7 +8028,7 @@ ClangImporter::Implementation::importSwiftAttrAttributes(Decl *MappedDecl) {
80288028
continue;
80298029
}
80308030

8031-
if (swiftAttr->getAttribute() == "_BitwiseCopyable") {
8031+
if (swiftAttr->getAttribute() == "BitwiseCopyable") {
80328032
auto *protocol =
80338033
SwiftContext.getProtocol(KnownProtocolKind::BitwiseCopyable);
80348034
auto *nominal = dyn_cast<NominalTypeDecl>(MappedDecl);

lib/SIL/IR/TypeLowering.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3199,7 +3199,7 @@ void TypeConverter::verifyTrivialLowering(const TypeLowering &lowering,
31993199
// conforming.
32003200
if (!nominal) {
32013201
llvm::errs()
3202-
<< "Non-nominal type without conformance to _BitwiseCopyable:\n"
3202+
<< "Non-nominal type without conformance to BitwiseCopyable:\n"
32033203
<< ty << "\n"
32043204
<< "within " << substType << "\n"
32053205
<< "of " << origType << "\n";
@@ -3310,7 +3310,7 @@ void TypeConverter::verifyTrivialLowering(const TypeLowering &lowering,
33103310
return true;
33113311
});
33123312
if (hasNoConformingArchetypeNode) {
3313-
llvm::errs() << "Non-trivial type with _BitwiseCopyable conformance!?:\n"
3313+
llvm::errs() << "Non-trivial type with BitwiseCopyable conformance!?:\n"
33143314
<< substType << "\n";
33153315
conformance.print(llvm::errs());
33163316
llvm::errs() << "\n"

stdlib/public/core/CommandLine.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ internal func _swift_stdlib_getUnsafeArgvArgc(_: UnsafeMutablePointer<Int32>)
2121
/// Command-line arguments for the current process.
2222
#if $BitwiseCopyable && $ConformanceSuppression
2323
@frozen // namespace
24-
public enum CommandLine : ~_BitwiseCopyable {
24+
public enum CommandLine : ~BitwiseCopyable {
2525
}
2626
#else
2727
@frozen // namespace
2828
public enum CommandLine {
2929
}
3030
@available(*, unavailable)
31-
extension CommandLine : _BitwiseCopyable {}
31+
extension CommandLine : BitwiseCopyable {}
3232
#endif
3333

3434
extension CommandLine {

stdlib/public/core/KeyPath.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1857,12 +1857,12 @@ internal struct RawKeyPathComponent {
18571857
}
18581858
}
18591859

1860-
internal func _pop<T : _BitwiseCopyable>(from: inout UnsafeRawBufferPointer,
1860+
internal func _pop<T : BitwiseCopyable>(from: inout UnsafeRawBufferPointer,
18611861
as type: T.Type) -> T {
18621862
let buffer = _pop(from: &from, as: type, count: 1)
18631863
return buffer.baseAddress.unsafelyUnwrapped.pointee
18641864
}
1865-
internal func _pop<T : _BitwiseCopyable>(from: inout UnsafeRawBufferPointer,
1865+
internal func _pop<T : BitwiseCopyable>(from: inout UnsafeRawBufferPointer,
18661866
as: T.Type,
18671867
count: Int) -> UnsafeBufferPointer<T> {
18681868
from = MemoryLayout<T>._roundingUpBaseToAlignment(from)
@@ -3482,7 +3482,7 @@ internal struct InstantiateKeyPathBuffer: KeyPathPatternVisitor {
34823482
}
34833483
return (baseAddress, misalign)
34843484
}
3485-
mutating func pushDest<T : _BitwiseCopyable>(_ value: T) {
3485+
mutating func pushDest<T : BitwiseCopyable>(_ value: T) {
34863486
let size = MemoryLayout<T>.size
34873487
let (baseAddress, misalign) = adjustDestForAlignment(of: T.self)
34883488
_withUnprotectedUnsafeBytes(of: value) {

stdlib/public/core/MemoryLayout.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@
4141
/// alignment: MemoryLayout<Point>.alignment)
4242
#if $BitwiseCopyable && $ConformanceSuppression
4343
@frozen // namespace
44-
public enum MemoryLayout<T: ~Copyable>: ~_BitwiseCopyable, Copyable {}
44+
public enum MemoryLayout<T: ~Copyable>: ~BitwiseCopyable, Copyable {}
4545
#else
4646
@frozen // namespace
4747
public enum MemoryLayout<T: ~Copyable>: Copyable {}
4848
@available(*, unavailable)
49-
extension MemoryLayout: _BitwiseCopyable {}
49+
extension MemoryLayout: BitwiseCopyable {}
5050
#endif
5151

5252
extension MemoryLayout where T: ~Copyable {

stdlib/public/core/Misc.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,10 @@ func _rethrowsViaClosure(_ fn: () throws -> ()) rethrows {
175175
@_marker public protocol Escapable {}
176176

177177
#if $NoncopyableGenerics && $NonescapableTypes
178-
@_marker public protocol _BitwiseCopyable: ~Escapable { }
178+
@_marker public protocol BitwiseCopyable: ~Escapable { }
179179
#else
180-
@_marker public protocol _BitwiseCopyable { }
180+
@_marker public protocol BitwiseCopyable { }
181181
#endif
182+
183+
@available(*, unavailable)
184+
@_marker public protocol _BitwiseCopyable {}

stdlib/public/core/Optional.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ extension Optional: Copyable /* where Wrapped: Copyable */ {}
136136

137137
extension Optional: Sendable where Wrapped: ~Copyable & Sendable { }
138138

139-
extension Optional: _BitwiseCopyable where Wrapped: _BitwiseCopyable { }
139+
extension Optional: BitwiseCopyable where Wrapped: BitwiseCopyable { }
140140

141141
@_preInverseGenerics
142142
extension Optional: ExpressibleByNilLiteral where Wrapped: ~Copyable {

stdlib/public/core/Pointer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public protocol _Pointer:
3030
Strideable,
3131
_CustomDebugStringConvertibleOrNone,
3232
_CustomReflectableOrNone,
33-
_BitwiseCopyable
33+
BitwiseCopyable
3434
{
3535
/// A type that represents the distance between two pointers.
3636
typealias Distance = Int

stdlib/public/core/SIMDVector.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ prefix operator .!
3131
/// elementwise accesses. Computational operations are defined on the `SIMD`
3232
/// protocol, which refines this protocol, and on the concrete types that
3333
/// conform to `SIMD`.
34-
public protocol SIMDStorage : _BitwiseCopyable {
34+
public protocol SIMDStorage : BitwiseCopyable {
3535
/// The type of scalars in the vector space.
3636
#if $Embedded
3737
associatedtype Scalar: Hashable
@@ -64,7 +64,7 @@ extension SIMDStorage {
6464
}
6565

6666
/// A type that can be used as an element in a SIMD vector.
67-
public protocol SIMDScalar : _BitwiseCopyable {
67+
public protocol SIMDScalar : BitwiseCopyable {
6868
associatedtype SIMDMaskScalar: SIMDScalar & FixedWidthInteger & SignedInteger
6969
where SIMDMaskScalar.SIMDMaskScalar == SIMDMaskScalar
7070
associatedtype SIMD2Storage: SIMDStorage where SIMD2Storage.Scalar == Self
@@ -81,7 +81,7 @@ public protocol SIMD<Scalar>:
8181
SIMDStorage,
8282
Hashable,
8383
ExpressibleByArrayLiteral,
84-
_BitwiseCopyable
84+
BitwiseCopyable
8585
{
8686
/// The mask type resulting from pointwise comparisons of this vector type.
8787
associatedtype MaskStorage: SIMD
@@ -97,7 +97,7 @@ public protocol SIMD<Scalar>:
9797
Hashable,
9898
CustomStringConvertible,
9999
ExpressibleByArrayLiteral,
100-
_BitwiseCopyable
100+
BitwiseCopyable
101101
{
102102
/// The mask type resulting from pointwise comparisons of this vector type.
103103
associatedtype MaskStorage: SIMD

stdlib/public/core/Unicode.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ public func transcode<Input, InputEncoding, OutputEncoding>(
673673
/// A namespace for Unicode utilities.
674674
#if $BitwiseCopyable && $ConformanceSuppression
675675
@frozen
676-
public enum Unicode : ~_BitwiseCopyable {}
676+
public enum Unicode : ~BitwiseCopyable {}
677677
#else
678678
@frozen
679679
public enum Unicode {}

stdlib/public/core/UnsafeBufferPointerSlice.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ extension Slice where Base == UnsafeMutableRawBufferPointer {
381381
#if $BitwiseCopyable
382382
@inlinable
383383
@_alwaysEmitIntoClient
384-
public func loadUnaligned<T : _BitwiseCopyable>(
384+
public func loadUnaligned<T : BitwiseCopyable>(
385385
fromByteOffset offset: Int = 0,
386386
as type: T.Type
387387
) -> T {
@@ -620,7 +620,7 @@ extension Slice where Base == UnsafeRawBufferPointer {
620620
#if $BitwiseCopyable
621621
@inlinable
622622
@_alwaysEmitIntoClient
623-
public func loadUnaligned<T : _BitwiseCopyable>(
623+
public func loadUnaligned<T : BitwiseCopyable>(
624624
fromByteOffset offset: Int = 0,
625625
as type: T.Type
626626
) -> T {

stdlib/public/core/UnsafeRawBufferPointer.swift.gyb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ extension Unsafe${Mutable}RawBufferPointer {
440440
/// memory.
441441
#if $BitwiseCopyable
442442
@_alwaysEmitIntoClient
443-
public func loadUnaligned<T : _BitwiseCopyable>(
443+
public func loadUnaligned<T : BitwiseCopyable>(
444444
fromByteOffset offset: Int = 0,
445445
as type: T.Type
446446
) -> T {

stdlib/public/core/UnsafeRawPointer.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ extension UnsafeRawPointer {
480480
/// with the value in the range of memory referenced by this pointer.
481481
@inlinable
482482
@_alwaysEmitIntoClient
483-
public func loadUnaligned<T: _BitwiseCopyable>(
483+
public func loadUnaligned<T: BitwiseCopyable>(
484484
fromByteOffset offset: Int = 0,
485485
as type: T.Type
486486
) -> T {
@@ -1313,7 +1313,7 @@ extension UnsafeMutableRawPointer {
13131313
/// with the value in the range of memory referenced by this pointer.
13141314
@inlinable
13151315
@_alwaysEmitIntoClient
1316-
public func loadUnaligned<T: _BitwiseCopyable>(
1316+
public func loadUnaligned<T: BitwiseCopyable>(
13171317
fromByteOffset offset: Int = 0,
13181318
as type: T.Type
13191319
) -> T {
@@ -1400,7 +1400,7 @@ extension UnsafeMutableRawPointer {
14001400
/// - type: The type of `value`.
14011401
@inlinable
14021402
@_alwaysEmitIntoClient
1403-
public func storeBytes<T: _BitwiseCopyable>(
1403+
public func storeBytes<T: BitwiseCopyable>(
14041404
of value: T, toByteOffset offset: Int = 0, as type: T.Type
14051405
) {
14061406
#if $BuiltinStoreRaw

test/ConstExtraction/ExtractOpaqueGenericTypealias.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ struct Foo<L : Hashable> : myProto {
3333
// CHECK-NEXT: "line": 22,
3434
// CHECK-NEXT: "conformances": [
3535
// CHECK-NEXT: "ExtractOpaqueGenericTypealias.myProto",
36-
// CHECK-NEXT: "Swift.Sendable"
36+
// CHECK-NEXT: "Swift.Sendable",
37+
// CHECK-NEXT: "Swift.BitwiseCopyable"
3738
// CHECK-NEXT: ],
3839
// CHECK-NEXT: "associatedTypeAliases": [
3940
// CHECK-NEXT: {

test/Frontend/bitwise-copyable-flag.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55
// Verify that the BitwiseCopyable feature flag works both in asserts and noasserts builds.
66

7-
struct S : _BitwiseCopyable {
7+
struct S : BitwiseCopyable {
88
}

test/IDE/complete_member_basetypes.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ extension GenericS: BaseP1 where T == Int {}
8787

8888
func testConditionalConformanceNo(arg: GenericS<String>) {
8989
arg.#^TestConditionalConformanceNo^#
90-
// TestConditionalConformanceNo: LookedupTypeNames: ['Mod.GenericS', 'Swift.Sendable']
90+
// TestConditionalConformanceNo: LookedupTypeNames: ['Mod.GenericS', 'Swift.BitwiseCopyable', 'Swift.Sendable']
9191
}
9292

9393
func testConditionalConformanceYes(arg: GenericS<Int>) {
9494
arg.#^TestConditionalConformanceYes^#
95-
// TestConditionalConformanceYes: LookedupTypeNames: ['Mod.BaseP1', 'Mod.GenericS', 'Swift.Sendable']
95+
// TestConditionalConformanceYes: LookedupTypeNames: ['Mod.BaseP1', 'Mod.GenericS', 'Swift.BitwiseCopyable', 'Swift.Sendable']
9696

9797
}

test/IRGen/bitwise-copyable-derived-loadRaw.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
// Execute an unaligned load of SIMD16<UInt8> which conforms to a protocol derived from BitwiseCopyable.
66

7-
public protocol MyBitwiseCopyable : _BitwiseCopyable {}
7+
public protocol MyBitwiseCopyable : BitwiseCopyable {}
88

99
extension SIMD16 : MyBitwiseCopyable where Scalar.SIMD16Storage : MyBitwiseCopyable {}
1010
extension UInt8.SIMD16Storage : MyBitwiseCopyable {}

test/IRGen/bitwise-copyable-loadRaw.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
// Execute an unaligned load of SIMD16<UInt8> which retroactively conforms directly to BitwiseCopyable.
66

7-
extension SIMD16 : @retroactive _BitwiseCopyable where Scalar.SIMD16Storage : _BitwiseCopyable {}
7+
extension SIMD16 : @retroactive BitwiseCopyable where Scalar.SIMD16Storage : BitwiseCopyable {}
88

99
func doit() {
1010
let bytes: [UInt8] = Array(repeating: 0, count: 64)

test/IRGen/bitwise_copyable.swift

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

15-
struct Box<T : _BitwiseCopyable> : _BitwiseCopyable {
15+
struct Box<T : BitwiseCopyable> : BitwiseCopyable {
1616
var t: T
1717
}
1818

19-
struct Boxx<each T : _BitwiseCopyable> {
19+
struct Boxx<each T : BitwiseCopyable> {
2020
var ts: (repeat each T)
2121
}
2222

test/IRGen/bitwise_copyable_onone.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// RUN: %FileCheck %s
88

99

10-
// CHECK-LABEL: define{{.*}} ptr @"$s22bitwise_copyable_onone1EOy1AQzGAA1PRzs16_BitwiseCopyableAERQlWOh"(
10+
// CHECK-LABEL: define{{.*}} ptr @"$s22bitwise_copyable_onone1EOy1AQzGAA1PRzs15BitwiseCopyableAERQlWOh"(
1111
// CHECK-SAME: ptr %0,
1212
// CHECK-SAME: ptr %I.A,
1313
// CHECK-SAME: ptr %"E<I.A>"
@@ -21,7 +21,7 @@ protocol P {
2121
associatedtype A
2222
}
2323

24-
class C<I: P> where I.A: _BitwiseCopyable {
24+
class C<I: P> where I.A: BitwiseCopyable {
2525
func takeE(_ event: E<I.A>) {}
2626
func run(_ e: I.A) {
2727
takeE(.next(e))

test/IRGen/bitwise_copyable_resilient.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,22 @@ public struct Integer {
3232
//--- Downstream.swift
3333
import Library
3434

35-
func take<T: _BitwiseCopyable>(_ t: T) {}
35+
func take<T: BitwiseCopyable>(_ t: T) {}
3636

37-
struct S_Explicit_With_Oopsional<T> : _BitwiseCopyable {
37+
struct S_Explicit_With_Oopsional<T> : BitwiseCopyable {
3838
var o: Oopsional<T> // expected-error{{non_bitwise_copyable_type_member}}
3939
}
4040

4141
func passOopsional<T>(_ t: Oopsional<T>) { take(t) } // expected-error {{type_does_not_conform_decl_owner}}
4242
// expected-note@-7 {{where_requirement_failure_one_subst}}
4343

4444

45-
struct S_Explicit_With_Woopsional<T> : _BitwiseCopyable {
45+
struct S_Explicit_With_Woopsional<T> : BitwiseCopyable {
4646
var o: Woopsional<T> // expected-error{{non_bitwise_copyable_type_member}}
4747
}
4848

4949
func passWoopsional<T>(_ t: Woopsional<T>) { take(t) } // expected-error {{type_does_not_conform_decl_owner}}
5050
// expected-note@-15 {{where_requirement_failure_one_subst}}
5151

52-
extension Integer : @retroactive _BitwiseCopyable {} // expected-error {{bitwise_copyable_outside_module}}
52+
extension Integer : @retroactive BitwiseCopyable {} // expected-error {{bitwise_copyable_outside_module}}
5353

test/ModuleInterface/bitwise_copyable.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
@_moveOnly
99
public struct S_Implicit_Noncopyable {}
1010

11-
// CHECK-NOT: extension Test.S_Implicit_Noncopyable : Swift._BitwiseCopyable {}
11+
// CHECK-NOT: extension Test.S_Implicit_Noncopyable : Swift.BitwiseCopyable {}

0 commit comments

Comments
 (0)