Skip to content

Commit 74e085a

Browse files
authored
Merge pull request #2243 from rintaro/macros-darwin-swift
[CMake] Remove 'SWIFT_SYNTAX_ALWAYS_SINGLE_THREADED'
2 parents e0e5ad8 + 2de0be5 commit 74e085a

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
@@ -82,11 +82,6 @@ if("${SWIFT_HOST_MODULE_TRIPLE}" STREQUAL "")
8282
endif()
8383
message(STATUS "Module triple: ${SWIFT_HOST_MODULE_TRIPLE}")
8484

85-
# Force single-threaded-only syntax trees to eliminate the Darwin
86-
# dependency in the compiler.
87-
add_compile_definitions(
88-
$<$<COMPILE_LANGUAGE:Swift>:SWIFT_SYNTAX_ALWAYS_SINGLE_THREADED>
89-
)
9085
if (SWIFTSYNTAX_ENABLE_ASSERTIONS)
9186
add_compile_definitions(
9287
$<$<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)