Skip to content

Commit c6477a5

Browse files
authored
Merge pull request swiftlang#69937 from rintaro/5.10-astgen-regex
[5.10][ASTGen] Move regex literal parsing from SwiftCompilerSources to ASTGen
2 parents de32e4d + 8ef2fa2 commit c6477a5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+166
-411
lines changed

CMakeLists.txt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,10 +270,6 @@ option(SWIFT_BUILD_PERF_TESTSUITE
270270
"Create in-tree targets for building swift performance benchmarks."
271271
FALSE)
272272

273-
option(SWIFT_BUILD_REGEX_PARSER_IN_COMPILER
274-
"Build the Swift regex parser as part of the compiler."
275-
TRUE)
276-
277273
option(SWIFT_INCLUDE_TESTS "Create targets for building/running tests." TRUE)
278274

279275
option(SWIFT_INCLUDE_TEST_BINARIES
@@ -696,6 +692,14 @@ option(SWIFT_BUILD_SWIFT_SYNTAX
696692
"Enable building swift syntax"
697693
FALSE)
698694

695+
option(SWIFT_BUILD_REGEX_PARSER_IN_COMPILER
696+
"Build the Swift regex parser as part of the compiler."
697+
TRUE)
698+
if(SWIFT_BUILD_REGEX_PARSER_IN_COMPILER AND NOT SWIFT_BUILD_SWIFT_SYNTAX)
699+
message(WARNING "Force setting SWIFT_BUILD_REGEX_PARSER_IN_COMPILER=OFF because Swift parser integration is disabled")
700+
set(SWIFT_BUILD_REGEX_PARSER_IN_COMPILER OFF)
701+
endif()
702+
699703
set(SWIFT_BUILD_HOST_DISPATCH FALSE)
700704
if(SWIFT_ENABLE_DISPATCH AND NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin")
701705
# Only build libdispatch for the host if the host tools are being built and

SwiftCompilerSources/CMakeLists.txt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -239,20 +239,13 @@ else()
239239
"
240240
#include \"Basic/BridgedSwiftObject.h\"
241241
#include \"Basic/BasicBridging.h\"
242-
#include \"Basic/SourceLoc.h\"
243-
244-
#include \"AST/ASTBridging.h\"
245-
#include \"AST/DiagnosticEngine.h\"
246-
#include \"AST/DiagnosticConsumer.h\"
247-
248242
#include \"SIL/SILBridging.h\"
249243
250244
#include \"SILOptimizer/OptimizerBridging.h\"
251-
252-
#include \"Parse/RegexParserBridging.h\"
253245
")
254246
add_custom_command(
255247
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/HeaderDependencies.cpp"
248+
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/HeaderDependencies.cpp.tmp"
256249
COMMAND ${CMAKE_COMMAND} -E copy_if_different
257250
"${CMAKE_CURRENT_BINARY_DIR}/HeaderDependencies.cpp.tmp"
258251
"${CMAKE_CURRENT_BINARY_DIR}/HeaderDependencies.cpp"

SwiftCompilerSources/Package.swift

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -48,39 +48,22 @@ let package = Package(
4848
.library(
4949
name: "swiftCompilerModules",
5050
type: .static,
51-
targets: ["Basic", "AST", "Parse", "SIL", "Optimizer", "_CompilerRegexParser"]),
51+
targets: ["Basic", "SIL", "Optimizer"]),
5252
],
5353
dependencies: [
5454
],
5555
// Note that targets and their dependencies must align with
5656
// 'SwiftCompilerSources/Sources/CMakeLists.txt'
5757
targets: [
58-
.compilerModuleTarget(
59-
name: "_CompilerRegexParser",
60-
dependencies: [],
61-
path: "_RegexParser_Sources",
62-
swiftSettings: [
63-
// Workaround until `_CompilerRegexParser` is imported as implementation-only
64-
// by `_StringProcessing`.
65-
.unsafeFlags([
66-
"-Xfrontend",
67-
"-disable-implicit-string-processing-module-import"
68-
])]),
6958
.compilerModuleTarget(
7059
name: "Basic",
7160
dependencies: []),
72-
.compilerModuleTarget(
73-
name: "AST",
74-
dependencies: ["Basic"]),
75-
.compilerModuleTarget(
76-
name: "Parse",
77-
dependencies: ["Basic", "AST", "_CompilerRegexParser"]),
7861
.compilerModuleTarget(
7962
name: "SIL",
8063
dependencies: ["Basic"]),
8164
.compilerModuleTarget(
8265
name: "Optimizer",
83-
dependencies: ["Basic", "SIL", "Parse"]),
66+
dependencies: ["Basic", "SIL"]),
8467
],
8568
cxxLanguageStandard: .cxx17
8669
)

SwiftCompilerSources/Sources/AST/CMakeLists.txt

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

SwiftCompilerSources/Sources/AST/DiagnosticEngine.swift

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

SwiftCompilerSources/Sources/Basic/SourceLoc.swift

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

13-
import ASTBridging
13+
import BasicBridging
1414

1515
public struct SourceLoc {
1616
/// Points into a source file.

SwiftCompilerSources/Sources/CMakeLists.txt

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

99
# NOTE: Subdirectories must be added in dependency order.
1010

11-
if(SWIFT_BUILD_REGEX_PARSER_IN_COMPILER)
12-
add_subdirectory(_RegexParser)
13-
endif()
1411
add_subdirectory(Basic)
15-
add_subdirectory(AST)
16-
add_subdirectory(Parse)
1712
add_subdirectory(SIL)
1813
add_subdirectory(Optimizer)

SwiftCompilerSources/Sources/Optimizer/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# See http://swift.org/CONTRIBUTORS.txt for Swift project authors
88

99
set(dependencies)
10-
list(APPEND dependencies Basic SIL Parse)
10+
list(APPEND dependencies Basic SIL)
1111

1212
add_swift_compiler_module(Optimizer DEPENDS ${dependencies})
1313

SwiftCompilerSources/Sources/Optimizer/PassManager/PassRegistration.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,12 @@
1212

1313
import SIL
1414
import OptimizerBridging
15-
import Parse
1615

1716
@_cdecl("initializeSwiftModules")
1817
public func initializeSwiftModules() {
1918
registerSILClasses()
2019
registerSwiftAnalyses()
2120
registerSwiftPasses()
22-
initializeSwiftParseModules()
2321
}
2422

2523
private func registerPass(

SwiftCompilerSources/Sources/Parse/CMakeLists.txt

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

0 commit comments

Comments
 (0)