Skip to content

Commit be5c241

Browse files
Merge pull request #33959 from apple/tensorflow-merge
Merge 2020-09-14 into tensorflow
2 parents c08d080 + 28ca98e commit be5c241

File tree

606 files changed

+17779
-17684
lines changed

Some content is hidden

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

606 files changed

+17779
-17684
lines changed

Brewfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
brew "cmake"
22
brew "ninja"
3+
brew "sccache"

CHANGELOG.md

Lines changed: 106 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,114 @@ CHANGELOG
44
<details>
55
<summary>Note: This is in reverse chronological order, so newer entries are added to the top.</summary>
66

7-
| Version | Released | Toolchain |
8-
| :--------------------- | :--------- | :---------- |
9-
| [Swift 5.3](#swift-53) | | |
10-
| [Swift 5.2](#swift-52) | 2020-03-24 | Xcode 11.4 |
11-
| [Swift 5.1](#swift-51) | 2019-09-20 | Xcode 11.0 |
12-
| [Swift 5.0](#swift-50) | 2019-03-25 | Xcode 10.2 |
13-
| [Swift 4.2](#swift-42) | 2018-09-17 | Xcode 10.0 |
14-
| [Swift 4.1](#swift-41) | 2018-03-29 | Xcode 9.3 |
15-
| [Swift 4.0](#swift-40) | 2017-09-19 | Xcode 9.0 |
16-
| [Swift 3.1](#swift-31) | 2017-03-27 | Xcode 8.3 |
17-
| [Swift 3.0](#swift-30) | 2016-09-13 | Xcode 8.0 |
18-
| [Swift 2.2](#swift-22) | 2016-03-21 | Xcode 7.3 |
19-
| [Swift 2.1](#swift-21) | 2015-10-21 | Xcode 7.1 |
20-
| [Swift 2.0](#swift-20) | 2015-09-17 | Xcode 7.0 |
21-
| [Swift 1.2](#swift-12) | 2015-04-08 | Xcode 6.3 |
22-
| [Swift 1.1](#swift-11) | 2014-12-02 | Xcode 6.1.1 |
23-
| [Swift 1.0](#swift-10) | 2014-09-15 | Xcode 6.0 |
7+
| Version | Released | Toolchain |
8+
| :------------------------ | :--------- | :---------- |
9+
| [Swift Next](#swift-next) |
10+
| [Swift 5.3](#swift-53) | | |
11+
| [Swift 5.2](#swift-52) | 2020-03-24 | Xcode 11.4 |
12+
| [Swift 5.1](#swift-51) | 2019-09-20 | Xcode 11.0 |
13+
| [Swift 5.0](#swift-50) | 2019-03-25 | Xcode 10.2 |
14+
| [Swift 4.2](#swift-42) | 2018-09-17 | Xcode 10.0 |
15+
| [Swift 4.1](#swift-41) | 2018-03-29 | Xcode 9.3 |
16+
| [Swift 4.0](#swift-40) | 2017-09-19 | Xcode 9.0 |
17+
| [Swift 3.1](#swift-31) | 2017-03-27 | Xcode 8.3 |
18+
| [Swift 3.0](#swift-30) | 2016-09-13 | Xcode 8.0 |
19+
| [Swift 2.2](#swift-22) | 2016-03-21 | Xcode 7.3 |
20+
| [Swift 2.1](#swift-21) | 2015-10-21 | Xcode 7.1 |
21+
| [Swift 2.0](#swift-20) | 2015-09-17 | Xcode 7.0 |
22+
| [Swift 1.2](#swift-12) | 2015-04-08 | Xcode 6.3 |
23+
| [Swift 1.1](#swift-11) | 2014-12-02 | Xcode 6.1.1 |
24+
| [Swift 1.0](#swift-10) | 2014-09-15 | Xcode 6.0 |
2425

2526
</details>
2627

28+
Swift Next
29+
----------
30+
31+
* [SE-0284][]:
32+
33+
Functions, subscripts, and initializers may now have more than one variadic parameter, as long as all parameters which follow variadic parameters are labeled. This makes declarations like the following valid:
34+
35+
```swift
36+
func foo(_ a: Int..., b: Double...) { }
37+
38+
struct Bar {
39+
subscript(a: Int..., b b: Int...) -> [Int] { a + b }
40+
41+
init(a: String..., b: Float...) { }
42+
}
43+
```
44+
45+
* [SE-0287][]:
46+
47+
Implicit member expressions now support chains of member accesses, making the following valid:
48+
49+
```swift
50+
let milky: UIColor = .white.withAlphaComponent(0.5)
51+
let milky2: UIColor = .init(named: "white")!.withAlphaComponent(0.5)
52+
let milkyChance: UIColor? = .init(named: "white")?.withAlphaComponent(0.5)
53+
```
54+
55+
As is the case with the existing implicit member expression syntax, the resulting type of the chain must be the same as the (implicit) base, so it is not well-formed to write:
56+
57+
```swift
58+
let cgMilky: CGColor = .white.withAlphaComponent(0.5).cgColor
59+
```
60+
61+
(Unless, of course, appropriate `white` and `withAlphaComponent` members were defined on `CGColor`.)
62+
63+
Members of a "chain" can be properties, method calls, subscript accesses, force unwraps, or optional chaining question marks. Furthermore, the type of each member along the chain is permitted to differ (again, as long as the base of the chain matches the resulting type) meaning the following successfully typechecks:
64+
65+
```swift
66+
struct Foo {
67+
static var foo = Foo()
68+
static var bar = Bar()
69+
70+
var anotherFoo: Foo { Foo() }
71+
func getFoo() -> Foo { Foo() }
72+
var optionalFoo: Foo? { Foo() }
73+
subscript() -> Foo { Foo() }
74+
}
75+
76+
struct Bar {
77+
var anotherFoo = Foo()
78+
}
79+
80+
let _: Foo? = .bar.anotherFoo.getFoo().optionalFoo?.optionalFoo![]
81+
```
82+
2783
Swift 5.3
2884
---------
2985

86+
* [SE-0279][] & [SE-0286][]:
87+
88+
Trailing closure syntax has been extended to allow additional labeled closures to follow the initial unlabeled closure:
89+
90+
```swift
91+
// Single trailing closure argument
92+
UIView.animate(withDuration: 0.3) {
93+
self.view.alpha = 0
94+
}
95+
// Multiple trailing closure arguments
96+
UIView.animate(withDuration: 0.3) {
97+
self.view.alpha = 0
98+
} completion: { _ in
99+
self.view.removeFromSuperview()
100+
}
101+
```
102+
103+
Additionally, trailing closure arguments now match the appropriate parameter according to a forward-scan rule (as opposed to the previous backward-scan rule):
104+
105+
```swift
106+
func takesClosures(first: () -> Void, second: (Int) -> Void = { _ in }) {}
107+
108+
takesClosures {
109+
print("First")
110+
}
111+
```
112+
113+
In the above example, the trailing closure argument matches parameter `first`, whereas pre-Swift-5.3 it would have matched `second`. In order to ease the transition to this new rule, cases in which the forward-scan and backward-scan match a single trailing closure to different parameters, the backward-scan result is preferred and a warning is emitted. This is expected to be upgraded to an error in the next major version of Swift.
114+
30115
* [SR-7083][]:
31116

32117
Property observers such as `willSet` and `didSet` are now supported on `lazy` properties:
@@ -8070,7 +8155,11 @@ Swift 1.0
80708155
[SE-0268]: <https://github.com/apple/swift-evolution/blob/master/proposals/0268-didset-semantics.md>
80718156
[SE-0269]: <https://github.com/apple/swift-evolution/blob/master/proposals/0269-implicit-self-explicit-capture.md>
80728157
[SE-0276]: <https://github.com/apple/swift-evolution/blob/master/proposals/0276-multi-pattern-catch-clauses.md>
8158+
[SE-0279]: <https://github.com/apple/swift-evolution/blob/master/proposals/0279-multiple-trailing-closures.md>
80738159
[SE-0280]: <https://github.com/apple/swift-evolution/blob/master/proposals/0280-enum-cases-as-protocol-witnesses.md>
8160+
[SE-0284]: <https://github.com/apple/swift-evolution/blob/master/proposals/0284-multiple-variadic-parameters.md>
8161+
[SE-0286]: <https://github.com/apple/swift-evolution/blob/master/proposals/0286-forward-scan-trailing-closures.md>
8162+
[SE-0287]: <https://github.com/apple/swift-evolution/blob/master/proposals/0287-implicit-member-chains.md>
80748163

80758164
[SR-75]: <https://bugs.swift.org/browse/SR-75>
80768165
[SR-106]: <https://bugs.swift.org/browse/SR-106>

CMakeLists.txt

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -648,22 +648,6 @@ if("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC" OR "${CMAKE_CXX_SIMULATE_ID}" STREQU
648648
set(SWIFT_COMPILER_IS_MSVC_LIKE TRUE)
649649
endif()
650650

651-
if(NOT SWIFT_COMPILER_IS_MSVC_LIKE)
652-
# CMake's default for CMAKE_CXX_FLAGS_RELEASE is "-O3 -DNDEBUG". Let's avoid "-O3" for consistency
653-
# between Release and RelWithDebInfo. Dropping -DNDEBUG from this setting is blocked by triggering
654-
# a test failure of Swift-Unit :: Syntax/./SwiftSyntaxTests/TypeSyntaxTests.MetatypeTypeWithAPIs
655-
# because unit tests don't currently explicitly set -DNDEBUG/-UNDEBUG.
656-
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG")
657-
658-
_compute_lto_flag("${SWIFT_TOOLS_ENABLE_LTO}" _lto_flag_out)
659-
if(_lto_flag_out)
660-
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_RELEASE} -gline-tables-only")
661-
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -gline-tables-only")
662-
endif()
663-
else()
664-
665-
endif()
666-
667651
#
668652
# Configure SDKs.
669653
#

0 commit comments

Comments
 (0)