Skip to content

Commit 66e4487

Browse files
authored
Merge pull request swiftlang#69838 from rintaro/astgen-regex
[ASTGen] Move regex literal parsing from SwiftCompilerSources to ASTGen
2 parents 359c892 + 24b44e3 commit 66e4487

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

+155
-340
lines changed

SwiftCompilerSources/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,11 +245,8 @@ else()
245245
#define COMPILED_WITH_SWIFT
246246
247247
#include \"Basic/BasicBridging.h\"
248-
#include \"AST/ASTBridging.h\"
249248
#include \"SIL/SILBridging.h\"
250249
#include \"SILOptimizer/OptimizerBridging.h\"
251-
252-
#include \"Parse/RegexParserBridging.h\"
253250
")
254251
add_custom_command(
255252
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/HeaderDependencies.cpp"

SwiftCompilerSources/Package.swift

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -67,39 +67,22 @@ let package = Package(
6767
.library(
6868
name: "swiftCompilerModules",
6969
type: .static,
70-
targets: ["Basic", "AST", "Parse", "SIL", "Optimizer", "_CompilerRegexParser"]),
70+
targets: ["Basic", "SIL", "Optimizer"]),
7171
],
7272
dependencies: [
7373
],
7474
// Note that targets and their dependencies must align with
7575
// 'SwiftCompilerSources/Sources/CMakeLists.txt'
7676
targets: [
77-
.compilerModuleTarget(
78-
name: "_CompilerRegexParser",
79-
dependencies: [],
80-
path: "_RegexParser_Sources",
81-
swiftSettings: [
82-
// Workaround until `_CompilerRegexParser` is imported as implementation-only
83-
// by `_StringProcessing`.
84-
.unsafeFlags([
85-
"-Xfrontend",
86-
"-disable-implicit-string-processing-module-import"
87-
])]),
8877
.compilerModuleTarget(
8978
name: "Basic",
9079
dependencies: []),
91-
.compilerModuleTarget(
92-
name: "AST",
93-
dependencies: ["Basic"]),
94-
.compilerModuleTarget(
95-
name: "Parse",
96-
dependencies: ["Basic", "AST", "_CompilerRegexParser"]),
9780
.compilerModuleTarget(
9881
name: "SIL",
9982
dependencies: ["Basic"]),
10083
.compilerModuleTarget(
10184
name: "Optimizer",
102-
dependencies: ["Basic", "SIL", "Parse"]),
85+
dependencies: ["Basic", "SIL"]),
10386
],
10487
cxxLanguageStandard: .cxx17
10588
)

SwiftCompilerSources/Sources/AST/CMakeLists.txt

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

SwiftCompilerSources/Sources/AST/DiagnosticEngine.swift

Lines changed: 0 additions & 130 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/Context.swift

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

13-
import AST
1413
import SIL
1514
import OptimizerBridging
1615

@@ -41,12 +40,6 @@ extension Context {
4140
}
4241
}
4342

44-
extension Context {
45-
var diagnosticEngine: DiagnosticEngine {
46-
return DiagnosticEngine(bridged: _bridged.getDiagnosticEngine())
47-
}
48-
}
49-
5043
/// A context which allows mutation of a function's SIL.
5144
protocol MutatingContext : Context {
5245
// Called by all instruction mutations, including inserted new instructions.

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
registerOptimizerTests()
2422
}
2523

SwiftCompilerSources/Sources/Parse/CMakeLists.txt

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

0 commit comments

Comments
 (0)