Skip to content
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
12 changes: 8 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,6 @@ option(SWIFT_BUILD_PERF_TESTSUITE
"Create in-tree targets for building swift performance benchmarks."
FALSE)

option(SWIFT_BUILD_REGEX_PARSER_IN_COMPILER
"Build the Swift regex parser as part of the compiler."
TRUE)

option(SWIFT_INCLUDE_TESTS "Create targets for building/running tests." TRUE)

option(SWIFT_INCLUDE_TEST_BINARIES
Expand Down Expand Up @@ -696,6 +692,14 @@ option(SWIFT_BUILD_SWIFT_SYNTAX
"Enable building swift syntax"
FALSE)

option(SWIFT_BUILD_REGEX_PARSER_IN_COMPILER
"Build the Swift regex parser as part of the compiler."
TRUE)
if(SWIFT_BUILD_REGEX_PARSER_IN_COMPILER AND NOT SWIFT_BUILD_SWIFT_SYNTAX)
message(WARNING "Force setting SWIFT_BUILD_REGEX_PARSER_IN_COMPILER=OFF because Swift parser integration is disabled")
set(SWIFT_BUILD_REGEX_PARSER_IN_COMPILER OFF)
endif()

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
Expand Down
9 changes: 1 addition & 8 deletions SwiftCompilerSources/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -239,20 +239,13 @@ else()
"
#include \"Basic/BridgedSwiftObject.h\"
#include \"Basic/BasicBridging.h\"
#include \"Basic/SourceLoc.h\"

#include \"AST/ASTBridging.h\"
#include \"AST/DiagnosticEngine.h\"
#include \"AST/DiagnosticConsumer.h\"

#include \"SIL/SILBridging.h\"

#include \"SILOptimizer/OptimizerBridging.h\"

#include \"Parse/RegexParserBridging.h\"
")
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/HeaderDependencies.cpp"
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/HeaderDependencies.cpp.tmp"
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_CURRENT_BINARY_DIR}/HeaderDependencies.cpp.tmp"
"${CMAKE_CURRENT_BINARY_DIR}/HeaderDependencies.cpp"
Expand Down
21 changes: 2 additions & 19 deletions SwiftCompilerSources/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,39 +48,22 @@ let package = Package(
.library(
name: "swiftCompilerModules",
type: .static,
targets: ["Basic", "AST", "Parse", "SIL", "Optimizer", "_CompilerRegexParser"]),
targets: ["Basic", "SIL", "Optimizer"]),
],
dependencies: [
],
// Note that targets and their dependencies must align with
// 'SwiftCompilerSources/Sources/CMakeLists.txt'
targets: [
.compilerModuleTarget(
name: "_CompilerRegexParser",
dependencies: [],
path: "_RegexParser_Sources",
swiftSettings: [
// Workaround until `_CompilerRegexParser` is imported as implementation-only
// by `_StringProcessing`.
.unsafeFlags([
"-Xfrontend",
"-disable-implicit-string-processing-module-import"
])]),
.compilerModuleTarget(
name: "Basic",
dependencies: []),
.compilerModuleTarget(
name: "AST",
dependencies: ["Basic"]),
.compilerModuleTarget(
name: "Parse",
dependencies: ["Basic", "AST", "_CompilerRegexParser"]),
.compilerModuleTarget(
name: "SIL",
dependencies: ["Basic"]),
.compilerModuleTarget(
name: "Optimizer",
dependencies: ["Basic", "SIL", "Parse"]),
dependencies: ["Basic", "SIL"]),
],
cxxLanguageStandard: .cxx17
)
14 changes: 0 additions & 14 deletions SwiftCompilerSources/Sources/AST/CMakeLists.txt

This file was deleted.

122 changes: 0 additions & 122 deletions SwiftCompilerSources/Sources/AST/DiagnosticEngine.swift

This file was deleted.

2 changes: 1 addition & 1 deletion SwiftCompilerSources/Sources/Basic/SourceLoc.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
//
//===----------------------------------------------------------------------===//

import ASTBridging
import BasicBridging

public struct SourceLoc {
/// Points into a source file.
Expand Down
5 changes: 0 additions & 5 deletions SwiftCompilerSources/Sources/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@

# NOTE: Subdirectories must be added in dependency order.

if(SWIFT_BUILD_REGEX_PARSER_IN_COMPILER)
add_subdirectory(_RegexParser)
endif()
add_subdirectory(Basic)
add_subdirectory(AST)
add_subdirectory(Parse)
add_subdirectory(SIL)
add_subdirectory(Optimizer)
2 changes: 1 addition & 1 deletion SwiftCompilerSources/Sources/Optimizer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# See http://swift.org/CONTRIBUTORS.txt for Swift project authors

set(dependencies)
list(APPEND dependencies Basic SIL Parse)
list(APPEND dependencies Basic SIL)

add_swift_compiler_module(Optimizer DEPENDS ${dependencies})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@

import SIL
import OptimizerBridging
import Parse

@_cdecl("initializeSwiftModules")
public func initializeSwiftModules() {
registerSILClasses()
registerSwiftAnalyses()
registerSwiftPasses()
initializeSwiftParseModules()
}

private func registerPass(
Expand Down
19 changes: 0 additions & 19 deletions SwiftCompilerSources/Sources/Parse/CMakeLists.txt

This file was deleted.

16 changes: 0 additions & 16 deletions SwiftCompilerSources/Sources/Parse/Parse.swift

This file was deleted.

20 changes: 0 additions & 20 deletions SwiftCompilerSources/Sources/_RegexParser/CMakeLists.txt

This file was deleted.

1 change: 0 additions & 1 deletion SwiftCompilerSources/_RegexParser_Sources

This file was deleted.

3 changes: 0 additions & 3 deletions SwiftCompilerSources/stubs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
extern "C" {

void initializeSwiftModules();
void initializeSwiftParseModules();

}

void initializeSwiftModules() {}
void initializeSwiftParseModules() {}
14 changes: 10 additions & 4 deletions cmake/modules/AddSwift.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -537,20 +537,26 @@ function(_add_swift_runtime_link_flags target relpath_to_lib_dir bootstrapping)
set_property(TARGET ${target} APPEND_STRING PROPERTY
LINK_FLAGS " -lobjc ")

elseif(SWIFT_HOST_VARIANT_SDK MATCHES "LINUX|ANDROID|OPENBSD|FREEBSD")
elseif(SWIFT_HOST_VARIANT_SDK MATCHES "LINUX|ANDROID|OPENBSD|FREEBSD|WINDOWS")
set(swiftrt "swiftImageRegistrationObject${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_OBJECT_FORMAT}-${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}-${SWIFT_HOST_VARIANT_ARCH}")
if(ASRLF_BOOTSTRAPPING_MODE MATCHES "HOSTTOOLS|CROSSCOMPILE")
# At build time and run time, link against the swift libraries in the
# installed host toolchain.
get_filename_component(swift_bin_dir ${SWIFT_EXEC_FOR_SWIFT_MODULES} DIRECTORY)
get_filename_component(swift_dir ${swift_bin_dir} DIRECTORY)
if(SWIFT_PATH_TO_SWIFT_SDK)
set(swift_dir "${SWIFT_PATH_TO_SWIFT_SDK}/usr")
else()
get_filename_component(swift_bin_dir ${SWIFT_EXEC_FOR_SWIFT_MODULES} DIRECTORY)
get_filename_component(swift_dir ${swift_bin_dir} DIRECTORY)
endif()
set(host_lib_dir "${swift_dir}/lib/swift/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}")
set(swiftrt "${host_lib_dir}/${SWIFT_HOST_VARIANT_ARCH}/swiftrt.o")
set(host_lib_arch_dir "${host_lib_dir}/${SWIFT_HOST_VARIANT_ARCH}")

set(swiftrt "${host_lib_arch_dir}/swiftrt${CMAKE_C_OUTPUT_EXTENSION}")
target_link_libraries(${target} PRIVATE ${swiftrt})
target_link_libraries(${target} PRIVATE "swiftCore")

target_link_directories(${target} PRIVATE ${host_lib_dir})
target_link_directories(${target} PRIVATE ${host_lib_arch_dir})

# At runtime, use swiftCore in the current toolchain.
# For building stdlib, LD_LIBRARY_PATH will be set to builder's stdlib
Expand Down
5 changes: 0 additions & 5 deletions include/module.modulemap
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,3 @@ module OptimizerBridging {
header "swift/SILOptimizer/OptimizerBridging.h"
export *
}

module _RegexParserBridging {
header "swift/Parse/RegexParserBridging.h"
export *
}
7 changes: 0 additions & 7 deletions include/swift/AST/DiagnosticsParse.def
Original file line number Diff line number Diff line change
Expand Up @@ -2065,13 +2065,6 @@ ERROR(expected_closure_literal,none,
ERROR(expected_multiple_closures_block_rbrace,none,
"expected '}' at the end of a trailing closures block", ())

//------------------------------------------------------------------------------
// MARK: diagnostics emitted by Swift libraries
//------------------------------------------------------------------------------

ERROR(foreign_diagnostic,none,
"%0", (StringRef))

//------------------------------------------------------------------------------
// MARK: macros
//------------------------------------------------------------------------------
Expand Down
Loading