Skip to content

Commit 5746b27

Browse files
committed
Remove _CSwiftSyntax.
Since we stopped using `AtomicCounter`, `SwiftSyntax` does not depends on `_CSwiftSyntax` anymore. `CNodes` for `SwiftSyntaxParser` is provided by `_InternalSwiftSyntaxParser` module.
1 parent c226bdc commit 5746b27

File tree

14 files changed

+1
-167
lines changed

14 files changed

+1
-167
lines changed

CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ project(SwiftSyntax LANGUAGES C Swift)
1313
set(SWIFT_VERSION 5)
1414
set(CMAKE_Swift_LANGUAGE_VERSION ${SWIFT_VERSION})
1515

16-
# ensure Swift compiler can find _CSwiftSyntax
17-
add_compile_options($<$<COMPILE_LANGUAGE:Swift>:-I$<SEMICOLON>${CMAKE_CURRENT_SOURCE_DIR}/Sources/_CSwiftSyntax/include>)
18-
1916
set(CMAKE_Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/swift)
2017

2118
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)

Package.swift

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,6 @@ let package = Package(
5252
.executable(name: "generate-swift-syntax-builder", targets: ["generate-swift-syntax-builder"])
5353
],
5454
targets: [
55-
.target(
56-
name: "_CSwiftSyntax",
57-
exclude: [
58-
"CMakeLists.txt",
59-
"README.md"
60-
]
61-
),
6255
.target(
6356
name: "SwiftDiagnostics",
6457
dependencies: ["SwiftSyntax"],
@@ -68,7 +61,7 @@ let package = Package(
6861
),
6962
.target(
7063
name: "SwiftSyntax",
71-
dependencies: ["_CSwiftSyntax"],
64+
dependencies: [],
7265
exclude: [
7366
"CMakeLists.txt",
7467
"Misc.swift.gyb",

Sources/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
# See http://swift.org/LICENSE.txt for license information
77
# See http://swift.org/CONTRIBUTORS.txt for Swift project authors
88

9-
add_subdirectory(_CSwiftSyntax)
109
add_subdirectory(SwiftSyntax)
1110
add_subdirectory(SwiftDiagnostics)
1211
add_subdirectory(SwiftParser)

Sources/SwiftSyntax/AtomicCounter.swift

Lines changed: 0 additions & 21 deletions
This file was deleted.

Sources/SwiftSyntax/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
add_library(SwiftSyntax STATIC
1010
AbsolutePosition.swift
11-
AtomicCounter.swift
1211
BumpPtrAllocator.swift
1312
IncrementalParseTransition.swift
1413
SourceLength.swift
@@ -56,9 +55,6 @@ add_library(SwiftSyntax STATIC
5655
gyb_generated/syntax_nodes/SyntaxTypeNodes.swift
5756
)
5857

59-
target_link_libraries(SwiftSyntax PRIVATE
60-
_CSwiftSyntax)
61-
6258
set_property(GLOBAL APPEND PROPERTY SWIFTSYNTAX_EXPORTS SwiftSyntax)
6359

6460
# NOTE: workaround for CMake not setting up include flags yet

Sources/SwiftSyntaxParser/RawSyntax+CSwiftSyntax.swift renamed to Sources/SwiftSyntaxParser/RawSyntax+CNodes.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
@_implementationOnly import _CSwiftSyntax
1413
@_spi(RawSyntax) import SwiftSyntax
1514

1615
extension RawSyntax {

Sources/_CSwiftSyntax/CMakeLists.txt

Lines changed: 0 additions & 12 deletions
This file was deleted.

Sources/_CSwiftSyntax/README.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

Sources/_CSwiftSyntax/include/atomic-counter.h

Lines changed: 0 additions & 3 deletions
This file was deleted.

Sources/_CSwiftSyntax/include/c-syntax-nodes.h

Lines changed: 0 additions & 77 deletions
This file was deleted.

Sources/_CSwiftSyntax/include/module.modulemap

Lines changed: 0 additions & 3 deletions
This file was deleted.

Sources/_CSwiftSyntax/src/atomic-counter.c

Lines changed: 0 additions & 6 deletions
This file was deleted.

build-script.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -546,22 +546,6 @@ def check_generated_files_match(self_generated_dir: str,
546546
check_call(command)
547547

548548

549-
def verify_c_syntax_nodes_match() -> None:
550-
print("** Validating that the C data types match **")
551-
552-
swift_syntax_c_definitions = os.path.join(
553-
SOURCES_DIR, "_CSwiftSyntax", "include", "c-syntax-nodes.h")
554-
swiftc_c_definitions = os.path.join(
555-
SWIFT_DIR, "include", "swift-c", "SyntaxParser",
556-
"SwiftSyntaxCDataTypes.h")
557-
558-
check_call([
559-
"diff",
560-
swift_syntax_c_definitions,
561-
swiftc_c_definitions,
562-
])
563-
564-
565549
def run_tests(
566550
toolchain: str, build_dir: Optional[str], multiroot_data_file: Optional[str],
567551
release: bool, filecheck_exec: Optional[str], skip_lit_tests: bool, verbose: bool
@@ -748,8 +732,6 @@ def verify_source_code_command(args: argparse.Namespace) -> None:
748732
release=args.release,
749733
verbose=args.verbose,
750734
)
751-
752-
verify_c_syntax_nodes_match()
753735
except subprocess.CalledProcessError:
754736
printerr(
755737
"FAIL: Gyb-generated files committed to repository do " +

utils/group.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
],
5454
"Internal": [
5555
"SyntaxArena.swift",
56-
"AtomicCounter.swift",
5756
"SyntaxVerifier.swift",
5857
"BumpPtrAllocator.swift",
5958
]

0 commit comments

Comments
 (0)