Skip to content

Commit

Permalink
Delete _InternalSwiftSyntaxParser And Its Build Infrastructure
Browse files Browse the repository at this point in the history
This is the start of the removal of the C++ implementation of libSyntax
in favor of the new Swift Parser and Swift Syntax libraries. Now that
the Swift Parser has switched the SwiftSyntaxParser library over to
being a thin wrapper around the Swift Parser, there is no longer any
reason we need to retain any libSyntax infrastructure in the swift
compiler.

As a first step, delete the infrastructure that builds
lib_InternalSwiftSyntaxParser and convert any scripts that mention
it to instead mention the static mirror libraries. The --swiftsyntax
build-script flag has been retained and will now just execute the
SwiftSyntax and Swift Parser builds with the just-built tools.
  • Loading branch information
CodaFi committed Nov 2, 2022
1 parent dc3978f commit 2d07f38
Show file tree
Hide file tree
Showing 44 changed files with 44 additions and 1,653 deletions.
1 change: 0 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ filename =

./utils/80+-check,
./utils/backtrace-check,
./utils/build-parser-lib,
./utils/build-script,
./utils/check-incremental,
./utils/coverage/coverage-build-db,
Expand Down
11 changes: 2 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -572,13 +572,6 @@ option(SWIFT_ENABLE_GLOBAL_ISEL_ARM64
"Enable global isel on arm64"
FALSE)

cmake_dependent_option(SWIFT_BUILD_SYNTAXPARSERLIB
"Build the Swift Syntax Parser library" TRUE
"SWIFT_ENABLE_DISPATCH" FALSE)
cmake_dependent_option(SWIFT_BUILD_ONLY_SYNTAXPARSERLIB
"Only build the Swift Syntax Parser library" FALSE
"SWIFT_BUILD_SYNTAXPARSERLIB" FALSE)

cmake_dependent_option(SWIFT_BUILD_SOURCEKIT
"Build SourceKit" TRUE
"SWIFT_ENABLE_DISPATCH" FALSE)
Expand Down Expand Up @@ -637,13 +630,13 @@ set(SWIFT_BUILD_HOST_DISPATCH FALSE)
if(SWIFT_ENABLE_DISPATCH AND NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
# Only build libdispatch for the host if the host tools are being built and
# specifically if these two libraries that depend on it are built.
if(SWIFT_INCLUDE_TOOLS AND (SWIFT_BUILD_SYNTAXPARSERLIB OR SWIFT_BUILD_SOURCEKIT))
if(SWIFT_INCLUDE_TOOLS AND SWIFT_BUILD_SOURCEKIT)
set(SWIFT_BUILD_HOST_DISPATCH TRUE)
endif()

if(SWIFT_BUILD_HOST_DISPATCH OR SWIFT_CONCURRENCY_USES_DISPATCH)
if(NOT EXISTS "${SWIFT_PATH_TO_LIBDISPATCH_SOURCE}")
message(SEND_ERROR "SyntaxParserLib, SourceKit, and concurrency require libdispatch on non-Darwin hosts. Please specify SWIFT_PATH_TO_LIBDISPATCH_SOURCE")
message(SEND_ERROR "SourceKit and concurrency require libdispatch on non-Darwin hosts. Please specify SWIFT_PATH_TO_LIBDISPATCH_SOURCE")
endif()
endif()
endif()
Expand Down
1 change: 0 additions & 1 deletion cmake/caches/Linux-x86_64.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ set(SWIFT_INSTALL_COMPONENTS
sourcekit-inproc
swift-remote-mirror
swift-remote-mirror-headers
parser-lib
CACHE STRING "")

set(LLVM_DISTRIBUTION_COMPONENTS
Expand Down
1 change: 0 additions & 1 deletion cmake/caches/Runtime-Android-aarch64.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ set(SWIFT_INCLUDE_TESTS NO CACHE BOOL "")
set(SWIFT_INCLUDE_DOCS NO CACHE BOOL "")

# NOTE(compnerd) these are part of the toolchain, not the runtime.
set(SWIFT_BUILD_SYNTAXPARSERLIB NO CACHE BOOL "")
set(SWIFT_BUILD_SOURCEKIT NO CACHE BOOL "")

# NOTE(compnerd) build with the compiler specified, not a just built compiler.
Expand Down
1 change: 0 additions & 1 deletion cmake/caches/Runtime-Android-armv7.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ set(SWIFT_INCLUDE_TESTS NO CACHE BOOL "")
set(SWIFT_INCLUDE_DOCS NO CACHE BOOL "")

# NOTE(compnerd) these are part of the toolchain, not the runtime.
set(SWIFT_BUILD_SYNTAXPARSERLIB NO CACHE BOOL "")
set(SWIFT_BUILD_SOURCEKIT NO CACHE BOOL "")

# NOTE(compnerd) build with the compiler specified, not a just built compiler.
Expand Down
1 change: 0 additions & 1 deletion cmake/caches/Runtime-Linux-x86_64.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ set(SWIFT_INCLUDE_TESTS NO CACHE BOOL "")
set(SWIFT_INCLUDE_DOCS NO CACHE BOOL "")

# NOTE(compnerd) these are part of the toolchain, not the runtime.
set(SWIFT_BUILD_SYNTAXPARSERLIB NO CACHE BOOL "")
set(SWIFT_BUILD_SOURCEKIT NO CACHE BOOL "")

# NOTE(compnerd) build with the compiler specified, not a just built compiler.
Expand Down
1 change: 0 additions & 1 deletion cmake/caches/Runtime-WASI-wasm32.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ set(SWIFT_INCLUDE_TOOLS NO CACHE BOOL "")
set(SWIFT_INCLUDE_TESTS TRUE CACHE BOOL "")
set(SWIFT_INCLUDE_DOCS NO CACHE BOOL "")

set(SWIFT_BUILD_SYNTAXPARSERLIB NO CACHE BOOL "")
set(SWIFT_BUILD_SOURCEKIT NO CACHE BOOL "")
set(SWIFT_ENABLE_SOURCEKIT_TESTS NO CACHE BOOL "")

Expand Down
1 change: 0 additions & 1 deletion cmake/caches/Runtime-Windows-aarch64.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ set(SWIFT_INCLUDE_TESTS NO CACHE BOOL "")
set(SWIFT_INCLUDE_DOCS NO CACHE BOOL "")

# NOTE(compnerd) these are part of the toolchain, not the runtime.
set(SWIFT_BUILD_SYNTAXPARSERLIB NO CACHE BOOL "")
set(SWIFT_BUILD_SOURCEKIT NO CACHE BOOL "")

# NOTE(compnerd) build with the compiler specified, not a just built compiler.
Expand Down
1 change: 0 additions & 1 deletion cmake/caches/Runtime-Windows-i686.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ set(SWIFT_INCLUDE_TESTS NO CACHE BOOL "")
set(SWIFT_INCLUDE_DOCS NO CACHE BOOL "")

# NOTE(compnerd) these are part of the toolchain, not the runtime.
set(SWIFT_BUILD_SYNTAXPARSERLIB NO CACHE BOOL "")
set(SWIFT_BUILD_SOURCEKIT NO CACHE BOOL "")

# NOTE(compnerd) build with the compiler specified, not a just built compiler.
Expand Down
1 change: 0 additions & 1 deletion cmake/caches/Runtime-Windows-x86_64.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ set(SWIFT_INCLUDE_TESTS NO CACHE BOOL "")
set(SWIFT_INCLUDE_DOCS NO CACHE BOOL "")

# NOTE(compnerd) these are part of the toolchain, not the runtime.
set(SWIFT_BUILD_SYNTAXPARSERLIB NO CACHE BOOL "")
set(SWIFT_BUILD_SOURCEKIT NO CACHE BOOL "")

# NOTE(compnerd) build with the compiler specified, not a just built compiler.
Expand Down
1 change: 0 additions & 1 deletion cmake/caches/Windows-arm64.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ set(SWIFT_INSTALL_COMPONENTS
sourcekit-inproc
swift-remote-mirror
swift-remote-mirror-headers
parser-lib
CACHE STRING "")

set(LLVM_DISTRIBUTION_COMPONENTS
Expand Down
1 change: 0 additions & 1 deletion cmake/caches/Windows-x86_64.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ set(SWIFT_INSTALL_COMPONENTS
sourcekit-inproc
swift-remote-mirror
swift-remote-mirror-headers
parser-lib
CACHE STRING "")

set(LLVM_DISTRIBUTION_COMPONENTS
Expand Down
3 changes: 1 addition & 2 deletions cmake/modules/SwiftComponents.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,12 @@
# Swift code.
# * toolchain-tools -- a subset of tools that we will install to the OSS toolchain.
# * testsuite-tools -- extra tools required to run the Swift testsuite.
# * parser-lib -- Build the syntax parser library used by SwiftSyntax.
# * static-mirror-lib -- Build the static mirror library used by SwiftStaticMirror.
# * toolchain-dev-tools -- install development tools useful in a shared toolchain
# * llvm-toolchain-dev-tools -- install LLVM development tools useful in a shared toolchain
# * dev -- headers and libraries required to use Swift compiler as a library.
set(_SWIFT_DEFINED_COMPONENTS
"autolink-driver;back-deployment;compiler;clang-builtin-headers;clang-resource-dir-symlink;clang-builtin-headers-in-clang-resource-dir;stdlib;stdlib-experimental;sdk-overlay;parser-lib;static-mirror-lib;editor-integration;tools;testsuite-tools;toolchain-tools;toolchain-dev-tools;llvm-toolchain-dev-tools;dev;license;sourcekit-xpc-service;sourcekit-inproc;swift-remote-mirror;swift-remote-mirror-headers")
"autolink-driver;back-deployment;compiler;clang-builtin-headers;clang-resource-dir-symlink;clang-builtin-headers-in-clang-resource-dir;stdlib;stdlib-experimental;sdk-overlay;static-mirror-lib;editor-integration;tools;testsuite-tools;toolchain-tools;toolchain-dev-tools;llvm-toolchain-dev-tools;dev;license;sourcekit-xpc-service;sourcekit-inproc;swift-remote-mirror;swift-remote-mirror-headers")

# The default install components include all of the defined components, except
# for the following exceptions.
Expand Down
3 changes: 1 addition & 2 deletions docs/OpenBSD.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ These options are:
* `--skip-build-clang-tools-extra` and `--skip-build-compiler-rt`: to ensure LLVM builds cleanly,
* `--extra-cmake-options=`
* `-DCMAKE_DISABLE_FIND_PACKAGE_Backtrace=TRUE,-DCMAKE_DISABLE_FIND_PACKAGE_LibXml2=TRUE,-DLLVM_VERSION_SUFFIX=''`: to ensure LLVM builds cleanly,
* `-DSWIFT_ENABLE_DISPATCH=FALSE,-DSWIFT_BUILD_SOURCEKIT=OFF,-DSWIFT_BUILD_SYNTAXPARSERLIB=OFF,-DSWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY=OFF,-DSWIFT_IMPLICIT_CONCURRENCY_IMPORT=OFF,-DSWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED=OFF`: to ensure Swift does not attempt to build libdispatch, which is not yet supported on OpenBSD,
* `-DSWIFT_ENABLE_DISPATCH=FALSE,-DSWIFT_BUILD_SOURCEKIT=OFF,-DSWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY=OFF,-DSWIFT_IMPLICIT_CONCURRENCY_IMPORT=OFF,-DSWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED=OFF`: to ensure Swift does not attempt to build libdispatch, which is not yet supported on OpenBSD,
* `-DSWIFT_USE_LINKER=lld`: to specify that `lld` should be used over `gold`,
* `-DCMAKE_INSTALL_DIR=/usr/local"`: to set the correct platform install directory.

Expand All @@ -84,7 +84,6 @@ $ ./utils/build-script \
-DLLVM_VERSION_SUFFIX='',\
-DSWIFT_ENABLE_DISPATCH=OFF,\
-DSWIFT_BUILD_SOURCEKIT=OFF,\
-DSWIFT_BUILD_SYNTAXPARSERLIB=OFF,\
-DSWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY=OFF,\
-DSWIFT_IMPLICIT_CONCURRENCY_IMPORT=OFF,\
-DSWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED=OFF,\
Expand Down
77 changes: 0 additions & 77 deletions include/swift-c/SyntaxParser/SwiftSyntaxCDataTypes.h

This file was deleted.

0 comments on commit 2d07f38

Please sign in to comment.