Skip to content

Commit 490b14e

Browse files
authored
Merge pull request #119 from lorentey/update-supported-toolchains
Bump required toolchain to Swift 5.10
2 parents 239a74d + 040c295 commit 490b14e

24 files changed

+37
-3918
lines changed

.github/workflows/pull_request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
name: Test
1010
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
1111
with:
12-
linux_exclude_swift_versions: '[{"swift_version": "5.8"}]'
12+
linux_exclude_swift_versions: '[{"swift_version": "5.8"}, {"swift_version": "5.9"}]'
1313
windows_exclude_swift_versions: '[{"swift_version": "5.9"}]'
1414

1515
soundness:

CMakeLists.txt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#[[
22
This source file is part of the Swift Atomics Open Source Project
33
4-
Copyright (c) 2021 Apple Inc. and the Swift project authors
4+
Copyright (c) 2021 - 2025 Apple Inc. and the Swift project authors
55
Licensed under Apache License v2.0 with Runtime Library Exception
66
77
See https://swift.org/LICENSE.txt for license information
@@ -31,10 +31,7 @@ set(ATOMICS_C_FLAGS)
3131
if(CMAKE_Swift_COMPILER_VERSION VERSION_GREATER_EQUAL 5.9)
3232
list(APPEND ATOMICS_SWIFT_FLAGS
3333
"-enable-experimental-feature BuiltinModule"
34-
"-DATOMICS_NATIVE_BUILTINS"
35-
"-Xcc" "-DATOMICS_NATIVE_BUILTINS=1")
36-
list(APPEND ATOMICS_C_FLAGS
37-
"-DATOMICS_NATIVE_BUILTINS=1")
34+
)
3835
endif()
3936

4037
add_subdirectory(Sources)

Package.swift

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
// swift-tools-version:5.9
1+
// swift-tools-version:5.10
22
//===----------------------------------------------------------------------===//
33
//
44
// This source file is part of the Swift.org open source project
55
//
6-
// Copyright (c) 2020 - 2023 Apple Inc. and the Swift project authors
6+
// Copyright (c) 2020 - 2025 Apple Inc. and the Swift project authors
77
// Licensed under Apache License v2.0 with Runtime Library Exception
88
//
99
// See https://swift.org/LICENSE.txt for license information
@@ -18,10 +18,8 @@ var _swiftSettings: [SwiftSetting] = []
1818

1919
// Enable the use of native Swift compiler builtins instead of C atomics.
2020
_cSettings += [
21-
.define("ATOMICS_NATIVE_BUILTINS"),
2221
]
2322
_swiftSettings += [
24-
.define("ATOMICS_NATIVE_BUILTINS"),
2523
.enableExperimentalFeature("BuiltinModule")
2624
]
2725

@@ -48,7 +46,6 @@ let package = Package(
4846
"Conformances/IntegerConformances.swift.gyb",
4947
"Conformances/PointerConformances.swift.gyb",
5048
"Primitives/Primitives.native.swift.gyb",
51-
"Primitives/Primitives.shims.swift.gyb",
5249
"Types/IntegerOperations.swift.gyb",
5350
],
5451
cSettings: _cSettings,

[email protected]

Lines changed: 0 additions & 87 deletions
This file was deleted.

[email protected]

Lines changed: 0 additions & 87 deletions
This file was deleted.

Sources/Atomics/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#[[
22
This source file is part of the Swift Atomics Open Source Project
33
4-
Copyright (c) 2021 - 2023 Apple Inc. and the Swift project authors
4+
Copyright (c) 2021 - 2025 Apple Inc. and the Swift project authors
55
Licensed under Apache License v2.0 with Runtime Library Exception
66
77
See https://swift.org/LICENSE.txt for license information
@@ -17,7 +17,6 @@ add_library(Atomics
1717
"Types/autogenerated/IntegerOperations.swift"
1818
"Unmanaged extensions.swift"
1919
"Primitives/autogenerated/Primitives.native.swift"
20-
"Primitives/autogenerated/Primitives.shims.swift"
2120
"Conformances/RawRepresentable.swift"
2221
"Conformances/OptionalRawRepresentable.swift"
2322
"Conformances/autogenerated/IntegerConformances.swift"

Sources/Atomics/Conformances/AtomicBool.swift.gyb

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift Atomics open source project
44
//
5-
// Copyright (c) 2020 - 2023 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2020 - 2025 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information
@@ -16,7 +16,6 @@
1616
}%
1717
${autogenerated_warning()}
1818

19-
#if ATOMICS_NATIVE_BUILTINS
2019
import Builtin
2120

2221
extension Bool {
@@ -26,9 +25,6 @@ extension Bool {
2625
self = unsafeBitCast(builtin, to: Bool.self)
2726
}
2827
}
29-
#else
30-
import _AtomicsShims
31-
#endif
3228

3329
extension Bool: AtomicValue {
3430
@frozen
@@ -43,25 +39,16 @@ extension Bool: AtomicValue {
4339

4440
@_transparent @_alwaysEmitIntoClient
4541
public init(_ value: Bool) {
46-
#if ATOMICS_NATIVE_BUILTINS
4742
_storage = value._atomicRepresentation
48-
#else
49-
_storage = _sa_prepare_Int8(value._atomicRepresentation)
50-
#endif
5143
}
5244

5345
@_transparent @_alwaysEmitIntoClient
5446
public func dispose() -> Value {
55-
#if ATOMICS_NATIVE_BUILTINS
5647
return _storage._decodeBool
57-
#else
58-
return _sa_dispose_Int8(_storage)._decodeBool
59-
#endif
6048
}
6149
}
6250
}
6351

64-
#if ATOMICS_NATIVE_BUILTINS
6552
extension Bool {
6653
@_transparent @_alwaysEmitIntoClient
6754
internal var _atomicRepresentation: _AtomicInt8Storage {
@@ -76,21 +63,6 @@ extension _AtomicInt8Storage {
7663
(Int8(self._value) & 1) != 0
7764
}
7865
}
79-
#else
80-
extension Bool {
81-
@_transparent @_alwaysEmitIntoClient
82-
internal var _atomicRepresentation: Int8 {
83-
self ? 1 : 0
84-
}
85-
}
86-
87-
extension Int8 {
88-
@_transparent @_alwaysEmitIntoClient
89-
internal var _decodeBool: Bool {
90-
(self & 1) != 0
91-
}
92-
}
93-
#endif
9466

9567
extension UnsafeMutablePointer
9668
where Pointee == Bool.AtomicRepresentation {

0 commit comments

Comments
 (0)