Skip to content

Bump required toolchain to Swift 5.10 #119

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
name: Test
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
with:
linux_exclude_swift_versions: '[{"swift_version": "5.8"}]'
linux_exclude_swift_versions: '[{"swift_version": "5.8"}, {"swift_version": "5.9"}]'
windows_exclude_swift_versions: '[{"swift_version": "5.9"}]'

soundness:
Expand Down
7 changes: 2 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#[[
This source file is part of the Swift Atomics Open Source Project

Copyright (c) 2021 Apple Inc. and the Swift project authors
Copyright (c) 2021 - 2025 Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception

See https://swift.org/LICENSE.txt for license information
Expand Down Expand Up @@ -31,10 +31,7 @@ set(ATOMICS_C_FLAGS)
if(CMAKE_Swift_COMPILER_VERSION VERSION_GREATER_EQUAL 5.9)
list(APPEND ATOMICS_SWIFT_FLAGS
"-enable-experimental-feature BuiltinModule"
"-DATOMICS_NATIVE_BUILTINS"
"-Xcc" "-DATOMICS_NATIVE_BUILTINS=1")
list(APPEND ATOMICS_C_FLAGS
"-DATOMICS_NATIVE_BUILTINS=1")
)
endif()

add_subdirectory(Sources)
Expand Down
7 changes: 2 additions & 5 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// swift-tools-version:5.9
// swift-tools-version:5.10
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2020 - 2023 Apple Inc. and the Swift project authors
// Copyright (c) 2020 - 2025 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
Expand All @@ -18,10 +18,8 @@ var _swiftSettings: [SwiftSetting] = []

// Enable the use of native Swift compiler builtins instead of C atomics.
_cSettings += [
.define("ATOMICS_NATIVE_BUILTINS"),
]
_swiftSettings += [
.define("ATOMICS_NATIVE_BUILTINS"),
.enableExperimentalFeature("BuiltinModule")
]

Expand All @@ -48,7 +46,6 @@ let package = Package(
"Conformances/IntegerConformances.swift.gyb",
"Conformances/PointerConformances.swift.gyb",
"Primitives/Primitives.native.swift.gyb",
"Primitives/Primitives.shims.swift.gyb",
"Types/IntegerOperations.swift.gyb",
],
cSettings: _cSettings,
Expand Down
87 changes: 0 additions & 87 deletions [email protected]

This file was deleted.

87 changes: 0 additions & 87 deletions [email protected]

This file was deleted.

3 changes: 1 addition & 2 deletions Sources/Atomics/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#[[
This source file is part of the Swift Atomics Open Source Project

Copyright (c) 2021 - 2023 Apple Inc. and the Swift project authors
Copyright (c) 2021 - 2025 Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception

See https://swift.org/LICENSE.txt for license information
Expand All @@ -17,7 +17,6 @@ add_library(Atomics
"Types/autogenerated/IntegerOperations.swift"
"Unmanaged extensions.swift"
"Primitives/autogenerated/Primitives.native.swift"
"Primitives/autogenerated/Primitives.shims.swift"
"Conformances/RawRepresentable.swift"
"Conformances/OptionalRawRepresentable.swift"
"Conformances/autogenerated/IntegerConformances.swift"
Expand Down
30 changes: 1 addition & 29 deletions Sources/Atomics/Conformances/AtomicBool.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// This source file is part of the Swift Atomics open source project
//
// Copyright (c) 2020 - 2023 Apple Inc. and the Swift project authors
// Copyright (c) 2020 - 2025 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
Expand All @@ -16,7 +16,6 @@
}%
${autogenerated_warning()}

#if ATOMICS_NATIVE_BUILTINS
import Builtin

extension Bool {
Expand All @@ -26,9 +25,6 @@ extension Bool {
self = unsafeBitCast(builtin, to: Bool.self)
}
}
#else
import _AtomicsShims
#endif

extension Bool: AtomicValue {
@frozen
Expand All @@ -43,25 +39,16 @@ extension Bool: AtomicValue {

@_transparent @_alwaysEmitIntoClient
public init(_ value: Bool) {
#if ATOMICS_NATIVE_BUILTINS
_storage = value._atomicRepresentation
#else
_storage = _sa_prepare_Int8(value._atomicRepresentation)
#endif
}

@_transparent @_alwaysEmitIntoClient
public func dispose() -> Value {
#if ATOMICS_NATIVE_BUILTINS
return _storage._decodeBool
#else
return _sa_dispose_Int8(_storage)._decodeBool
#endif
}
}
}

#if ATOMICS_NATIVE_BUILTINS
extension Bool {
@_transparent @_alwaysEmitIntoClient
internal var _atomicRepresentation: _AtomicInt8Storage {
Expand All @@ -76,21 +63,6 @@ extension _AtomicInt8Storage {
(Int8(self._value) & 1) != 0
}
}
#else
extension Bool {
@_transparent @_alwaysEmitIntoClient
internal var _atomicRepresentation: Int8 {
self ? 1 : 0
}
}

extension Int8 {
@_transparent @_alwaysEmitIntoClient
internal var _decodeBool: Bool {
(self & 1) != 0
}
}
#endif

extension UnsafeMutablePointer
where Pointee == Bool.AtomicRepresentation {
Expand Down
Loading
Loading