Skip to content

Commit dc426fa

Browse files
authored
Merge pull request #2263 from rintaro/5.10-macros-darwin-swift
[5.10][CMake] Remove 'SWIFT_SYNTAX_ALWAYS_SINGLE_THREADED'
2 parents e445238 + 3b779e9 commit dc426fa

File tree

2 files changed

+1
-11
lines changed

2 files changed

+1
-11
lines changed

CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,6 @@ endif()
6666

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

69-
# Force single-threaded-only syntax trees to eliminate the Darwin
70-
# dependency in the compiler.
71-
add_compile_definitions(
72-
$<$<COMPILE_LANGUAGE:Swift>:SWIFT_SYNTAX_ALWAYS_SINGLE_THREADED>
73-
)
7469
if (SWIFTSYNTAX_ENABLE_ASSERTIONS)
7570
add_compile_definitions(
7671
$<$<COMPILE_LANGUAGE:Swift>:SWIFTSYNTAX_ENABLE_ASSERTIONS>

Sources/SwiftSyntax/SyntaxText.swift

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,13 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
#if !SWIFT_SYNTAX_ALWAYS_SINGLE_THREADED
1413
#if canImport(Darwin)
1514
@_implementationOnly import Darwin
1615
#elseif canImport(Glibc)
1716
@_implementationOnly import Glibc
1817
#elseif canImport(Musl)
1918
@_implementationOnly import Musl
2019
#endif
21-
#endif
2220

2321
/// Represent a string.
2422
///
@@ -267,10 +265,7 @@ private func compareMemory(
267265
_ count: Int
268266
) -> Bool {
269267
precondition(count >= 0)
270-
#if SWIFT_SYNTAX_ALWAYS_SINGLE_THREADED
271-
return UnsafeBufferPointer(start: s1, count: count)
272-
.elementsEqual(UnsafeBufferPointer(start: s2, count: count))
273-
#elseif canImport(Darwin)
268+
#if canImport(Darwin)
274269
return Darwin.memcmp(s1, s2, count) == 0
275270
#elseif canImport(Glibc)
276271
return Glibc.memcmp(s1, s2, count) == 0

0 commit comments

Comments
 (0)