Skip to content

Commit 37d57fa

Browse files
author
Nathan Hawes
committed
---
yaml --- r: 293247 b: refs/heads/tensorflow c: 9639bce h: refs/heads/master i: 293245: d51ef7a 293243: 85259d0 293239: 3493e1b 293231: c7da613 293215: 0e148c6 293183: 70b89fb 293119: fc1ba1e
1 parent 22ff855 commit 37d57fa

File tree

394 files changed

+5735
-13543
lines changed

Some content is hidden

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

394 files changed

+5735
-13543
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-04-25-a: 22f738a831d43aff2b9c9773bcb65
816816
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-05-08-a: 7d98cc16689baba5c8a3b90a9329bdcc1a12b4e9
817817
refs/heads/cherr42: a566ad54b073c2c56ac0a705d0a5bed9743135a5
818818
"refs/heads/codable_test_comment_fix": fc8f6824f7f347e1e8db55bff62db385c5728b5a
819-
refs/heads/tensorflow: 778f0f82f41145bb8c65c51d36df3c6b1c855804
819+
refs/heads/tensorflow: 9639bcededc22085b66dfa031a085ac80f04bb71
820820
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-11-a: 8126fd7a652e2f70ad6d76505239e34fb2ef3e1a
821821
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-12-a: b3fd3dd84df6717f2e2e9df58c6d7e99fed57086
822822
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-13-a: 71135119579039dc321c5f65d870050fe36efda2

branches/tensorflow/CHANGELOG.md

Lines changed: 6 additions & 161 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ CHANGELOG
66

77
| Contents |
88
| :--------------------- |
9-
| [Swift Next](#swift-next) |
109
| [Swift 5.1](#swift-51) |
1110
| [Swift 5.0](#swift-50) |
1211
| [Swift 4.2](#swift-42) |
@@ -23,160 +22,12 @@ CHANGELOG
2322

2423
</details>
2524

26-
Swift Next
27-
----------
28-
29-
* [SR-6118][]:
30-
31-
Subscripts can now declare default arguments:
32-
33-
```swift
34-
struct Subscriptable {
35-
subscript(x: Int, y: Int = 0) {
36-
...
37-
}
38-
}
39-
40-
let s = Subscriptable()
41-
print(s[0])
42-
```
43-
4425
Swift 5.1
4526
---------
4627

47-
* [SE-0244][]:
48-
49-
Functions can now hide their concrete return type by declaring what protocols
50-
it conforms to instead of specifying the exact return type:
51-
52-
```
53-
func makeMeACollection() -> some Collection {
54-
return [1, 2, 3]
55-
}
56-
```
57-
58-
Code that calls the function can use the interface of the protocol, but
59-
does not have visibility into the underlying type.
60-
61-
* [SE-0256][]:
62-
63-
Subscripts can now be declared `static` or (inside classes) `class`.
64-
65-
* [SE-0252][]:
66-
67-
The existing `@dynamicMemberLookup` attribute has been extended with a
68-
support for strongly-typed keypath implementations:
69-
70-
```swift
71-
@dynamicMemberLookup
72-
struct Lens<T> {
73-
let getter: () -> T
74-
let setter: (T) -> Void
75-
76-
var value: T {
77-
get {
78-
return getter()
79-
}
80-
set {
81-
setter(newValue)
82-
}
83-
}
84-
85-
subscript<U>(dynamicMember keyPath: WritableKeyPath<T, U>) -> Lens<U> {
86-
return Lens<U>(
87-
getter: { self.value[keyPath: keyPath] },
88-
setter: { self.value[keyPath: keyPath] = $0 })
89-
}
90-
}
91-
```
92-
93-
* [SR-8546][], [SR-9043][]:
94-
95-
More thorough checking has been implemented for restrictions around
96-
escaping closures capturing `inout` parameters or values of noescape type.
97-
While most code should not be affected, there are edge cases where
98-
the Swift 5.0 compiler would accept code violating these restrictions.
99-
This could result in runtime crashes or silent data corruption.
100-
101-
An example of invalid code which was incorrectly accepted by the Swift 5.0
102-
compiler is an `@escaping` closure calling a local function which
103-
references an `inout` parameter from an outer scope:
104-
105-
```swift
106-
struct BadCaptureExample {
107-
var escapingClosure: () -> ()
108-
109-
mutating func takesInOut(_ x: inout Int) {
110-
func localFunction() {
111-
x += 1
112-
}
113-
114-
escapingClosure = { localFunction() }
115-
}
116-
}
117-
```
118-
119-
The compiler now correctly diagnoses the above code by pointing out that
120-
the capture of `x` by `localFunction()` is invalid, since `localFunction()`
121-
is referenced from an `@escaping` closure.
122-
123-
This also addresses certain cases where the compiler incorrectly diagnosed
124-
certain code as invalid, when in fact no violation of restrictions had
125-
taken place. For example,
126-
127-
```swift
128-
func takesNoEscape(_ fn: () -> ()) {
129-
func localFunction() {
130-
fn()
131-
}
132-
133-
{ localFunction() }()
134-
}
135-
```
136-
137-
* [SR-2672][]:
138-
139-
Conversions between tuple types are now fully implemented.
140-
Previously, the following would diagnose an error:
141-
142-
```swift
143-
let values: (Int, Int) = (10, 15)
144-
let converted: (Int?, Any) = values
145-
146-
* [SE-0242][]:
147-
148-
The memberwise initializer for structures now provide default values for variables that hold default expressions.
149-
150-
```swift
151-
struct Dog {
152-
var name = "Generic dog name"
153-
var age = 0
154-
155-
// The synthesized memberwise initializer
156-
init(name: String = "Generic dog name", age: Int = 0)
157-
}
158-
159-
let sparky = Dog(name: "Sparky") // Dog(name: "Sparky", age: 0)
160-
```
161-
16228
* [SE-0068][]:
16329

164-
It is now possible to use `Self` to refer to the innermost nominal
165-
type inside struct, enum and class declarations. For example, the
166-
two method declarations inside this struct are equivalent:
167-
168-
```swift
169-
struct Box<Value> {
170-
func transform1() -> Self { return self }
171-
func transform2() -> Box<Value> { return self }
172-
}
173-
```
174-
175-
In classes, `Self` is the dynamic type of the `self` value, as before.
176-
Existing restrictions on `Self` in declaration types still apply;
177-
that is, `Self` can only appear as the return type of a method.
178-
However, `Self` can now be used inside the body of a method
179-
without limitation.
30+
`Self` can now be used inside member functions and for function arguments of structs and enums to refer to the containing type.
18031

18132
* [SR-7799][]:
18233

@@ -195,12 +46,12 @@ Swift 5.1
19546
}
19647
```
19748

198-
* `weak` and `unowned` stored properties no longer inhibit the
199-
automatic synthesis of `Equatable` or `Hashable` conformance.
49+
* `weak` and `unowned` variables can now be used inside types that
50+
declare `Equatable` or `Hashable` conformance.
20051

20152
* [SR-2688][]:
20253

203-
An `@autoclosure` parameter can now be declared with a typealias type.
54+
An `@autoclosure` closure can now be a typealias.
20455

20556
```swift
20657
class Foo {
@@ -211,12 +62,10 @@ Swift 5.1
21162

21263
* [SR-7601][]:
21364

214-
Methods declared `@objc` inside a class can now return `Self`:
65+
Functions marked with `@objc` can now return `Self`
21566

21667
```swift
217-
class MyClass : NSObject {
218-
@objc func clone() -> Self { return self }
219-
}
68+
@objc func returnDynamicSelf() -> Self { return self }
22069
```
22170

22271
* [SR-2176][]:
@@ -7662,7 +7511,6 @@ Swift 1.0
76627511
[SE-0228]: <https://github.com/apple/swift-evolution/blob/master/proposals/0228-fix-expressiblebystringinterpolation.md>
76637512
[SE-0230]: <https://github.com/apple/swift-evolution/blob/master/proposals/0230-flatten-optional-try.md>
76647513
[SE-0235]: <https://github.com/apple/swift-evolution/blob/master/proposals/0235-add-result.md>
7665-
[SE-0242]: <https://github.com/apple/swift-evolution/blob/master/proposals/0242-default-values-memberwise.md>
76667514
[SE-0245]: <https://github.com/apple/swift-evolution/blob/master/proposals/0245-array-uninitialized-initializer.md>
76677515

76687516
[SR-106]: <https://bugs.swift.org/browse/SR-106>
@@ -7677,7 +7525,6 @@ Swift 1.0
76777525
[SR-2388]: <https://bugs.swift.org/browse/SR-2388>
76787526
[SR-2394]: <https://bugs.swift.org/browse/SR-2394>
76797527
[SR-2608]: <https://bugs.swift.org/browse/SR-2608>
7680-
[SR-2672]: <https://bugs.swift.org/browse/SR-2672>
76817528
[SR-2688]: <https://bugs.swift.org/browse/SR-2688>
76827529
[SR-4248]: <https://bugs.swift.org/browse/SR-4248>
76837530
[SR-5581]: <https://bugs.swift.org/browse/SR-5581>
@@ -7687,5 +7534,3 @@ Swift 1.0
76877534
[SR-7601]: <https://bugs.swift.org/browse/SR-7601>
76887535
[SR-7799]: <https://bugs.swift.org/browse/SR-7799>
76897536
[SR-8109]: <https://bugs.swift.org/browse/SR-8109>
7690-
[SR-8546]: <https://bugs.swift.org/browse/SR-8546>
7691-
[SR-9043]: <https://bugs.swift.org/browse/SR-9043>

branches/tensorflow/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ else()
497497
swift_common_unified_build_config(SWIFT)
498498
endif()
499499

500-
get_filename_component(SWIFT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR} REALPATH)
500+
set(SWIFT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
501501
set(SWIFT_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}")
502502
set(SWIFT_CMAKE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
503503
set(SWIFT_MAIN_INCLUDE_DIR "${SWIFT_SOURCE_DIR}/include")

branches/tensorflow/benchmark/single-source/SetTests.swift

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -98,47 +98,6 @@ public let SetTests = [
9898
tags: [.validation, .api, .Set],
9999
setUpFunction: { blackHole([setP, setQ]) }),
100100

101-
BenchmarkInfo(
102-
name: "Set.isStrictSubset.Empty.Int",
103-
runFunction: { n in run_SetIsStrictSubsetInt(setE, setAB, true, 5000 * n) },
104-
tags: [.validation, .api, .Set],
105-
setUpFunction: { blackHole([setE, setAB]) }),
106-
BenchmarkInfo(
107-
name: "Set.isStrictSubset.Int.Empty",
108-
runFunction: { n in run_SetIsStrictSubsetInt(setAB, setE, false, 5000 * n) },
109-
tags: [.validation, .api, .Set],
110-
setUpFunction: { blackHole([setAB, setE]) }),
111-
BenchmarkInfo(
112-
name: "Set.isStrictSubset.Int0",
113-
runFunction: { n in run_SetIsStrictSubsetInt(setAB, setCD, false, 5000 * n) },
114-
tags: [.validation, .api, .Set],
115-
setUpFunction: { blackHole([setAB, setCD]) }),
116-
BenchmarkInfo(
117-
name: "Set.isStrictSubset.Box0",
118-
runFunction: { n in run_SetIsStrictSubsetBox(setOAB, setOCD, false, 5000 * n) },
119-
tags: [.validation, .api, .Set],
120-
setUpFunction: { blackHole([setOAB, setOCD]) }),
121-
BenchmarkInfo(
122-
name: "Set.isStrictSubset.Int25",
123-
runFunction: { n in run_SetIsStrictSubsetInt(setB, setAB, true, 50 * n) },
124-
tags: [.validation, .api, .Set],
125-
setUpFunction: { blackHole([setB, setAB]) }),
126-
BenchmarkInfo(
127-
name: "Set.isStrictSubset.Box25",
128-
runFunction: { n in run_SetIsStrictSubsetBox(setOB, setOAB, true, 50 * n) },
129-
tags: [.validation, .api, .Set],
130-
setUpFunction: { blackHole([setOB, setOAB]) }),
131-
BenchmarkInfo(
132-
name: "Set.isStrictSubset.Int50",
133-
runFunction: { n in run_SetIsStrictSubsetInt(setY, setXY, true, 50 * n) },
134-
tags: [.validation, .api, .Set],
135-
setUpFunction: { blackHole([setY, setXY]) }),
136-
BenchmarkInfo(
137-
name: "Set.isStrictSubset.Int100",
138-
runFunction: { n in run_SetIsStrictSubsetInt(setP, setQ, false, 50 * n) },
139-
tags: [.validation, .api, .Set],
140-
setUpFunction: { blackHole([setP, setQ]) }),
141-
142101
BenchmarkInfo(
143102
name: "Set.isDisjoint.Empty.Int",
144103
runFunction: { n in run_SetIsDisjointInt(setE, setAB, true, 5000 * n) },
@@ -374,18 +333,6 @@ public func run_SetIsSubsetInt(
374333
}
375334
}
376335

377-
@inline(never)
378-
public func run_SetIsStrictSubsetInt(
379-
_ a: Set<Int>,
380-
_ b: Set<Int>,
381-
_ r: Bool,
382-
_ n: Int) {
383-
for _ in 0 ..< n {
384-
let isStrictSubset = a.isStrictSubset(of: identity(b))
385-
CheckResults(isStrictSubset == r)
386-
}
387-
}
388-
389336
@inline(never)
390337
public func run_SetSymmetricDifferenceInt(
391338
_ a: Set<Int>,
@@ -474,18 +421,6 @@ func run_SetIsSubsetBox(
474421
}
475422
}
476423

477-
@inline(never)
478-
func run_SetIsStrictSubsetBox(
479-
_ a: Set<Box<Int>>,
480-
_ b: Set<Box<Int>>,
481-
_ r: Bool,
482-
_ n: Int) {
483-
for _ in 0 ..< n {
484-
let isStrictSubset = a.isStrictSubset(of: identity(b))
485-
CheckResults(isStrictSubset == r)
486-
}
487-
}
488-
489424
@inline(never)
490425
func run_SetSymmetricDifferenceBox(
491426
_ a: Set<Box<Int>>,

branches/tensorflow/cmake/modules/SwiftConfig.cmake.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
set(SWIFT_VERSION @SWIFT_VERSION@)
66
set(SWIFT_MAIN_SRC_DIR @SWIFT_SOURCE_DIR@)
77

8-
set(SWIFT_INCLUDE_DIRS "@SWIFT_INCLUDE_DIRS@")
8+
set(SWIFT_INCLUDE_DIRS "@SWIFT_INCLUDE_DIR@")
99
set(SWIFT_LIBRARY_DIRS "@SWIFT_CONFIG_LIBRARY_DIRS@")
1010

1111
# These variables are duplicated, but they must match the LLVM variables of the
@@ -25,4 +25,4 @@ endif()
2525
if(NOT TARGET swift)
2626
set(SWIFT_EXPORTED_TARGETS "@SWIFT_CONFIG_EXPORTS@")
2727
include("@SWIFT_EXPORTS_FILE@")
28-
endif()
28+
endif()

0 commit comments

Comments
 (0)