Skip to content

Commit f064410

Browse files
committed
[SyntaxArena] Remove fake AtomicBool for CMake builds
_SwiftSyntaxCShims is not part of CMake builds
1 parent 7de7150 commit f064410

File tree

2 files changed

+4
-15
lines changed

2 files changed

+4
-15
lines changed

Sources/SwiftSyntax/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,7 @@ add_swift_syntax_library(SwiftSyntax
8181
generated/syntaxNodes/SyntaxNodesQRS.swift
8282
generated/syntaxNodes/SyntaxNodesTUVWXYZ.swift
8383
)
84+
85+
target_link_swift_syntax_libraries(SwiftSyntax PUBLIC
86+
_SwiftSyntaxCShims
87+
)

Sources/SwiftSyntax/SyntaxArena.swift

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
#if SWIFT_SYNTAX_BUILD_USING_CMAKE
14-
// The CMake bulid of swift-syntax does not build the _AtomicBool module because swift-syntax's CMake build is
15-
// Swift-only. Fake an `AtomicBool` type that is not actually atomic. This should be acceptable for the following
16-
// reasons:
17-
// - `AtomicBool` is only used for the `hasParent` assertion, so release compilers don't rely on it
18-
// - The compiler is single-threaded so it it is safe from race conditions on `AtomicBool`.
19-
fileprivate struct AtomicBool {
20-
var value: Bool
21-
22-
init(initialValue: Bool) {
23-
self.value = initialValue
24-
}
25-
}
26-
#else
2713
import _SwiftSyntaxCShims
28-
#endif
2914

3015
/// A syntax arena owns the memory for all syntax nodes within it.
3116
///

0 commit comments

Comments
 (0)