Skip to content

Commit 2357443

Browse files
committed
Merge remote-tracking branch 'origin/release/5.10' into 5.10-xcode-15-1-b2-test
2 parents c452d4e + d7d6188 commit 2357443

File tree

435 files changed

+7475
-3137
lines changed

Some content is hidden

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

435 files changed

+7475
-3137
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/InstructionSimplification/SimplifyBeginCOWMutation.swift

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,13 @@ private extension BeginCOWMutationInst {
7474
return false
7575
}
7676
let buffer = instanceResult
77-
if buffer.nonDebugUses.contains(where: { !($0.instruction is EndCOWMutationInst) }) {
77+
guard buffer.nonDebugUses.allSatisfy({
78+
if let endCOW = $0.instruction as? EndCOWMutationInst {
79+
return !endCOW.doKeepUnique
80+
}
81+
return false
82+
}) else
83+
{
7884
return false
7985
}
8086

@@ -91,7 +97,8 @@ private extension BeginCOWMutationInst {
9197
if !uniquenessResult.nonDebugUses.isEmpty {
9298
return false
9399
}
94-
guard let endCOW = instance as? EndCOWMutationInst else {
100+
guard let endCOW = instance as? EndCOWMutationInst,
101+
!endCOW.doKeepUnique else {
95102
return false
96103
}
97104
if endCOW.nonDebugUses.contains(where: { $0.instruction != self }) {

SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/SimplifyBuiltin.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,13 @@ private func typesOfValuesAreEqual(_ lhs: Value, _ rhs: Value, in function: Func
184184
return nil
185185
}
186186

187-
let lhsTy = lhsExistential.metatype.type.instanceTypeOfMetatype(in: function)
188-
let rhsTy = rhsExistential.metatype.type.instanceTypeOfMetatype(in: function)
187+
let lhsMetatype = lhsExistential.metatype.type
188+
let rhsMetatype = rhsExistential.metatype.type
189+
if lhsMetatype.isDynamicSelfMetatype != rhsMetatype.isDynamicSelfMetatype {
190+
return nil
191+
}
192+
let lhsTy = lhsMetatype.instanceTypeOfMetatype(in: function)
193+
let rhsTy = rhsMetatype.instanceTypeOfMetatype(in: function)
189194

190195
// Do we know the exact types? This is not the case e.g. if a type is passed as metatype
191196
// to the function.

0 commit comments

Comments
 (0)