Skip to content

[CMake] Remove 'SWIFT_SYNTAX_ALWAYS_SINGLE_THREADED' #2243

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 1 commit into from
Sep 28, 2023
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
5 changes: 0 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,6 @@ endif()

message(STATUS "Module triple: ${SWIFT_MODULE_TRIPLE}")

# Force single-threaded-only syntax trees to eliminate the Darwin
# dependency in the compiler.
add_compile_definitions(
$<$<COMPILE_LANGUAGE:Swift>:SWIFT_SYNTAX_ALWAYS_SINGLE_THREADED>
)
if (SWIFTSYNTAX_ENABLE_ASSERTIONS)
add_compile_definitions(
$<$<COMPILE_LANGUAGE:Swift>:SWIFTSYNTAX_ENABLE_ASSERTIONS>
Expand Down
7 changes: 1 addition & 6 deletions Sources/SwiftSyntax/SyntaxText.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@
//
//===----------------------------------------------------------------------===//

#if !SWIFT_SYNTAX_ALWAYS_SINGLE_THREADED
#if canImport(Darwin)
@_implementationOnly import Darwin
#elseif canImport(Glibc)
@_implementationOnly import Glibc
#elseif canImport(Musl)
@_implementationOnly import Musl
#endif
#endif

/// Represent a string.
///
Expand Down Expand Up @@ -267,10 +265,7 @@ private func compareMemory(
_ count: Int
) -> Bool {
precondition(count >= 0)
#if SWIFT_SYNTAX_ALWAYS_SINGLE_THREADED
return UnsafeBufferPointer(start: s1, count: count)
.elementsEqual(UnsafeBufferPointer(start: s2, count: count))
#elseif canImport(Darwin)
#if canImport(Darwin)
return Darwin.memcmp(s1, s2, count) == 0
#elseif canImport(Glibc)
return Glibc.memcmp(s1, s2, count) == 0
Expand Down