Skip to content

Commit af7b2ee

Browse files
Merge remote-tracking branch 'apple/main' into katei/merge-main-2022-11-03
2 parents ea703a4 + d553d04 commit af7b2ee

File tree

980 files changed

+19056
-27678
lines changed

Some content is hidden

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

980 files changed

+19056
-27678
lines changed

.github/CODEOWNERS

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,40 @@
55
# Owners of ASTGen
66
lib/ASTGen @zoecarver @CodaFi
77

8+
# Dependency scanning
9+
include/swift/DependencyScan @artemcm
10+
lib/AST/ModuleLoader.cpp @artemcm
11+
lib/DependencyScan @artemcm
12+
lib/Frontend/ModuleInterfaceLoader.cpp @artemcm
13+
lib/Serialization/SerializedModuleLoader.cpp @artemcm
14+
test/ScanDependencies @artemcm
15+
16+
# Driver
17+
include/swift/Driver @artemcm
18+
lib/Driver @artemcm
19+
test/Driver @artemcm
20+
821
# Owners of the parser
922
include/swift/Parse @ahoppen @bnbarham @CodaFi @DougGregor @rintaro
1023
lib/Parse @ahoppen @bnbarham @CodaFi @DougGregor @rintaro
1124
test/Parse @ahoppen @bnbarham @CodaFi @DougGregor @rintaro
1225

26+
SwiftCompilerSources @eeckstein
27+
1328
# C++ Interop
1429
include/swift/ClangImporter @zoecarver @hyp @egorzhdan
1530
include/swift/PrintAsClang @zoecarver @hyp @egorzhdan
1631
lib/ClangImporter @zoecarver @hyp @egorzhdan
1732
lib/PrintAsClang @zoecarver @hyp @egorzhdan
1833
stdlib/public/Cxx @zoecarver @hyp @egorzhdan
1934
test/Interop @zoecarver @hyp @egorzhdan
35+
36+
# Threading implementation
37+
include/swift/Threading @al45tair
38+
lib/Threading @al45tair
39+
40+
# Windows support
41+
cmake/**/*Windows* @compnerd
42+
lib/Basic/Windows @compnerd
43+
stdlib/public/Windows @compnerd
44+
utils/*windows* @compnerd

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 35 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,44 @@
22
name: Bug report
33
about: Create a report to help us improve
44
title: ''
5-
labels: bug
5+
labels: bug, triage needed
66
assignees: ''
77

88
---
99

10-
**Describe the bug**
11-
A clear and concise description of what the bug is.
12-
13-
**Steps To Reproduce**
14-
Steps to reproduce the behavior:
15-
1.
16-
2.
17-
...
10+
<!--
11+
This repository tracks issues related to the implementation of the Swift
12+
compiler, standard library, runtime, and tools that provide IDE support for
13+
Swift (e.g. code completion). If the bug relates to the implementation of a
14+
proprietary (closed-source) Apple framework such as UIKit, SwiftUI, Combine,
15+
etc., please report it to https://feedbackassistant.apple.com instead.
16+
-->
17+
18+
**Description**
19+
<!-- Describe clearly and concisely what the bug is. -->
20+
21+
**Steps to reproduce**
22+
<!--
23+
Explain how to reproduce the problem (in steps if seen fit) and include either
24+
an inline test case (preferred) or a project that reproduces it. Consider
25+
reducing the sample to the smallest amount of code possible — a smaller test
26+
case is easier to reason about and more appealing to сontributors.
27+
-->
1828

1929
**Expected behavior**
20-
A clear and concise description of what you expected to happen.
21-
22-
**Screenshots**
23-
If applicable, add screenshots to help explain your problem.
24-
25-
**Environment (please fill out the following information)**
26-
- OS: [e.g. macOS 11.0]
27-
- Xcode Version/Tag/Branch:
28-
29-
30-
**Additional context**
31-
Add any other context about the problem here.
30+
<!-- Describe what you expected to happen. -->
31+
32+
<!-- If deemed helpful, add screenshots that showcase the problem. -->
33+
<!-- **Screenshots** -->
34+
35+
<!--
36+
Include information about the Swift compiler version and, if applicable, the
37+
Xcode version you are observing the problem in and the deployment target.
38+
-->
39+
**Environment**
40+
- Swift compiler version info <!-- replace with the output of 'swiftc -version' -->
41+
- Xcode version info <!-- replace with the output of 'xcodebuild -version' -->
42+
- Deployment target: <!-- e.g. iOS 12.3 -->
43+
44+
<!-- Add any other context about the problem as appropriate. -->
45+
<!-- **Additional context** -->
Lines changed: 39 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,49 @@
11
---
22
name: Feature request
3-
about: Suggest an idea for this project
3+
about: Share an idea
44
title: ''
5-
labels: New Feature
5+
labels: feature request, triage needed
66
assignees: ''
77

88
---
99

10-
**Is your feature request related to a problem? Please describe.**
11-
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
10+
<!--
11+
This repository tracks issues and requests related to the implementation of the
12+
Swift compiler, standard library, runtime, and tools that provide IDE support
13+
for Swift (e.g. code completion). If your feature request relates to the
14+
implementation of a proprietary (closed-source) Apple framework such as UIKit,
15+
SwiftUI, Combine, etc., please report it to https://feedbackassistant.apple.com
16+
instead.
1217
13-
**Describe the solution you'd like**
14-
A clear and concise description of what you want to happen.
18+
If you haven't found or started a thread on the Swift forums yet, consider
19+
socializing your idea in the "Discussion" subcategory
20+
(https://forums.swift.org/c/evolution/discuss) after submitting this request.
21+
This is an essential step toward the official review of any proposal concerning
22+
language or library design, and while GitHub issues do great for tracking
23+
purposes, the forums are far better ground for drawing attention to ideas and
24+
gauging interest from the community.
1525
16-
**Describe alternatives you've considered**
17-
A clear and concise description of any alternative solutions or features you've considered.
26+
For more information on how ideas are proposed, discussed, and reviewed, see
27+
https://swift.org/swift-evolution
28+
-->
1829

19-
**Additional context**
20-
Add any other context or screenshots about the feature request here.
30+
**Motivation**
31+
<!-- Describe the problem that your feature seeks to address. -->
32+
33+
**Solution**
34+
<!--
35+
Describe your solution to the problem. Provide examples and describe how
36+
they work.
37+
-->
38+
39+
**Alternatives considered**
40+
<!--
41+
Describe any alternative approaches or features that you have considered in
42+
addressing the problem, and why you chose this approach instead.
43+
-->
44+
45+
<!--
46+
Add any other context about your feature as appropriate. For example, link out
47+
to a discussion on the Swift forums (https://forums.swift.org).
48+
-->
49+
<!-- **Additional context** -->

CHANGELOG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,32 @@ _**Note:** This is in reverse chronological order, so newer entries are added to
44

55
## Swift 5.8
66

7+
* [#56139][]:
8+
9+
Сollection downcasts in cast patterns are now supported. For example:
10+
11+
```swift
12+
func collectionDowncast(_ arr: [Any]) {
13+
switch arr {
14+
case let ints as [Int]:
15+
// ...
16+
case is [Bool]:
17+
// ...
18+
}
19+
}
20+
```
21+
* [SE-0370][]:
22+
23+
The API of `UnsafeMutableRawPointer`, `UnsafeMutableBufferPointer`, `UnsafeMutableRawBufferPointer` were improved, adding previously missing initialization (and deinitialization) methods, including more performant initialization from `Collection` types.
24+
25+
For `UnsafeMutablePointer<T>` and `UnsafeMutableBufferPointer<T>`, method names containing the word "assign" were renamed to use the word "update", and many more were added. Every multi-element initialization method of `UnsafeMutablePointer` and `UnsafeMutableBufferPointer` now has a corresponding "update" method.
26+
27+
Slices of `UnsafeBufferPointer`, `UnsafeRawBufferPointer`, `UnsafeMutableBufferPointer` and `UnsafeMutableRawBufferPointer` now share the collection-like API of their base type. For example, given an initialized `b: UnsafeMutableBufferPointer<Int>`, the following lines are synonymous:
28+
```swift
29+
b.update(repeating: 0)
30+
b[b.startIndex..<b.endIndex].update(repeating: 0)
31+
```
32+
733
* [SE-0365][]:
834

935
Implicit `self` is now permitted for `weak self` captures, after `self` is unwrapped.
@@ -9584,6 +9610,7 @@ using the `.dynamicType` member to retrieve the type of an expression should mig
95849610
[SE-0358]: <https://github.com/apple/swift-evolution/blob/main/proposals/0358-primary-associated-types-in-stdlib.md>
95859611
[SE-0362]: <https://github.com/apple/swift-evolution/blob/main/proposals/0362-piecemeal-future-features.md>
95869612
[SE-0365]: <https://github.com/apple/swift-evolution/blob/main/proposals/0365-implicit-self-weak-capture.md>
9613+
[SE-0370]: <https://github.com/apple/swift-evolution/blob/main/proposals/0370-pointer-family-initialization-improvements.md>
95879614

95889615
[#42697]: <https://github.com/apple/swift/issues/42697>
95899616
[#42728]: <https://github.com/apple/swift/issues/42728>
@@ -9624,3 +9651,4 @@ using the `.dynamicType` member to retrieve the type of an expression should mig
96249651
[#54246]: <https://github.com/apple/swift/issues/54246>
96259652
[#57081]: <https://github.com/apple/swift/issues/57081>
96269653
[#57225]: <https://github.com/apple/swift/issues/57225>
9654+
[#56139]: <https://github.com/apple/swift/issues/56139>

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1176,7 +1176,7 @@ endif()
11761176
# declares the swift-stdlib-* set of targets. These targets will then
11771177
# implicitly depend on any targets declared with IS_STDLIB.
11781178
#
1179-
# https://bugs.swift.org/browse/SR-5975
1179+
# https://github.com/apple/swift/issues/48534
11801180
if(SWIFT_BUILD_STDLIB)
11811181
add_subdirectory(stdlib)
11821182
else()
@@ -1216,7 +1216,7 @@ if(SWIFT_INCLUDE_TOOLS)
12161216

12171217
# Always include this after including stdlib/!
12181218
# Refer to the large comment above the add_subdirectory(stdlib) call.
1219-
# https://bugs.swift.org/browse/SR-5975
1219+
# https://github.com/apple/swift/issues/48534
12201220
add_subdirectory(tools)
12211221

12221222
# Localization targets are configured in a way that assume the swift

SwiftCompilerSources/CMakeLists.txt

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#
1717
function(add_swift_compiler_module module)
1818
cmake_parse_arguments(ALSM
19-
"ADD_TO_SYNTAXPARSE"
19+
""
2020
""
2121
"DEPENDS;SOURCES"
2222
${ARGN})
@@ -35,7 +35,6 @@ function(add_swift_compiler_module module)
3535

3636
set_property(TARGET ${target_name} PROPERTY module_name ${module})
3737
set_property(TARGET ${target_name} PROPERTY module_depends ${ALSM_DEPENDS})
38-
set_property(TARGET ${target_name} PROPERTY add_to_syntaxparse ${ALSM_ADD_TO_SYNTAXPARSE})
3938

4039
get_property(modules GLOBAL PROPERTY swift_compiler_modules)
4140
set_property(GLOBAL PROPERTY swift_compiler_modules ${modules} ${module})
@@ -134,16 +133,13 @@ function(add_swift_compiler_modules_library name)
134133

135134
set(all_obj_files)
136135
set(all_module_targets)
137-
set(syntaxparse_obj_files)
138-
set(syntaxparse_module_targets)
139136
get_property(modules GLOBAL PROPERTY "swift_compiler_modules")
140137
foreach(module ${modules})
141138

142139
set(module_target "SwiftModule${module}")
143140
get_target_property(module ${module_target} "module_name")
144141
get_target_property(sources ${module_target} SOURCES)
145142
get_target_property(dependencies ${module_target} "module_depends")
146-
get_target_property(add_to_syntaxparse ${module_target} "add_to_syntaxparse")
147143
set(deps, "")
148144
if (dependencies)
149145
foreach(dep_module ${dependencies})
@@ -163,9 +159,6 @@ function(add_swift_compiler_modules_library name)
163159
set_property(TARGET ${module_target} PROPERTY "module_file" "${module_file}")
164160

165161
set(all_obj_files ${all_obj_files} ${module_obj_file})
166-
if (add_to_syntaxparse)
167-
set(syntaxparse_obj_files ${syntaxparse_obj_files} ${module_obj_file})
168-
endif()
169162
set(c_include_paths
170163
# LLVM modules and headers.
171164
"${LLVM_MAIN_INCLUDE_DIR}"
@@ -201,9 +194,6 @@ function(add_swift_compiler_modules_library name)
201194

202195
set("${module}_dep_target" ${dep_target})
203196
set(all_module_targets ${all_module_targets} ${dep_target})
204-
if (add_to_syntaxparse)
205-
set(syntaxparse_module_targets ${syntaxparse_module_targets} ${dep_target})
206-
endif()
207197
endforeach()
208198

209199
# Create a static library containing all module object files.
@@ -217,15 +207,6 @@ function(add_swift_compiler_modules_library name)
217207
add_dependencies(${name} ${all_module_targets})
218208
set_target_properties(${name} PROPERTIES LINKER_LANGUAGE CXX)
219209
set_property(GLOBAL APPEND PROPERTY SWIFT_BUILDTREE_EXPORTS ${name})
220-
221-
if (XCODE)
222-
set(syntaxparse_obj_files force_lib.c ${syntaxparse_obj_files})
223-
endif()
224-
add_library("${name}_SwiftSyntax" STATIC ${syntaxparse_obj_files})
225-
add_dependencies("${name}_SwiftSyntax" ${syntaxparse_module_targets})
226-
set_target_properties("${name}_SwiftSyntax" PROPERTIES LINKER_LANGUAGE CXX)
227-
set_property(GLOBAL APPEND PROPERTY SWIFT_BUILDTREE_EXPORTS "${name}_SwiftSyntax")
228-
229210
endfunction()
230211

231212

@@ -235,7 +216,6 @@ add_swift_host_library(swiftCompilerStub OBJECT stubs.cpp)
235216
if (NOT BOOTSTRAPPING_MODE)
236217

237218
add_library(swiftCompilerModules ALIAS swiftCompilerStub)
238-
add_library(swiftCompilerModules_SwiftSyntax ALIAS swiftCompilerStub)
239219

240220
else()
241221
# Note: "Swift" is not added intentionally here, because it would break

SwiftCompilerSources/Sources/AST/CMakeLists.txt

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

99
add_swift_compiler_module(AST
10-
ADD_TO_SYNTAXPARSE
1110
DEPENDS
1211
Basic
1312
SOURCES

SwiftCompilerSources/Sources/Basic/CMakeLists.txt

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

99
add_swift_compiler_module(Basic
10-
ADD_TO_SYNTAXPARSE
1110
SOURCES
1211
SourceLoc.swift
1312
Utils.swift)

SwiftCompilerSources/Sources/Basic/Utils.swift

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

1313
@_exported import BasicBridging
14-
import std
14+
import CxxStdlib
1515

1616
/// The assert function to be used in the compiler.
1717
///

SwiftCompilerSources/Sources/Optimizer/FunctionPasses/ComputeSideEffects.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ private extension PartialApplyInst {
463463
struct EscapesToApply : EscapeVisitor {
464464
func visitUse(operand: Operand, path: EscapePath) -> UseResult {
465465
switch operand.instruction {
466-
case is ApplySite:
466+
case is FullApplySite:
467467
// Any escape to apply - regardless if it's an argument or the callee operand - might cause
468468
// the closure to be called.
469469
return .abort

0 commit comments

Comments
 (0)