[ASTGen] Move regex literal parsing from SwiftCompilerSources to ASTGen

ASTGen always builds with the host Swift compiler, without requiring
bootstrapping, and is enabled in more places. Move the regex literal
parsing logic there so it is enabled in more host environments, and
makes use of CMake's Swift support. Enable all of the regex literal
tests when ASTGen is built, to ensure everything is working.

Remove the "AST" and "Parse" Swift modules from SwiftCompilerSources,
because they are no longer needed.
This commit is contained in:
Rintaro Ishizaki
2023-11-13 19:35:44 -08:00
parent 23effda44d
commit 47f18d492e
49 changed files with 144 additions and 331 deletions

View File

@@ -67,39 +67,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
)