Skip to content

Commit 28d06ba

Browse files
committed
---
yaml --- r: 294303 b: refs/heads/tensorflow c: 04976e1 h: refs/heads/master i: 294301: 6c56a19 294299: b71f7a5 294295: d5aef70 294287: 3b610e7 294271: 6cb8350
1 parent 1d57025 commit 28d06ba

File tree

1,158 files changed

+15372
-69841
lines changed

Some content is hidden

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

1,158 files changed

+15372
-69841
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: 174323516a0b5f4e590a3f59be5c5bebe2107e35
819+
refs/heads/tensorflow: 04976e1a75d37592d6d6d688de07a210d0c046ef
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: 8 additions & 172 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,162 +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-
44-
**Add new entries to the top of this section, not here!**
45-
4625
Swift 5.1
4726
---------
4827

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

166-
It is now possible to use `Self` to refer to the innermost nominal
167-
type inside struct, enum and class declarations. For example, the
168-
two method declarations inside this struct are equivalent:
169-
170-
```swift
171-
struct Box<Value> {
172-
func transform1() -> Self { return self }
173-
func transform2() -> Box<Value> { return self }
174-
}
175-
```
176-
177-
In classes, `Self` is the dynamic type of the `self` value, as before.
178-
Existing restrictions on `Self` in declaration types still apply;
179-
that is, `Self` can only appear as the return type of a method.
180-
However, `Self` can now be used inside the body of a method
181-
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.
18231

18332
* [SR-7799][]:
18433

@@ -197,14 +46,12 @@ Swift 5.1
19746
}
19847
```
19948

200-
* [SR-9827][]:
201-
202-
`weak` and `unowned` stored properties no longer inhibit the
203-
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.
20451

20552
* [SR-2688][]:
20653

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

20956
```swift
21057
class Foo {
@@ -215,12 +62,10 @@ Swift 5.1
21562

21663
* [SR-7601][]:
21764

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

22067
```swift
221-
class MyClass : NSObject {
222-
@objc func clone() -> Self { return self }
223-
}
68+
@objc func returnDynamicSelf() -> Self { return self }
22469
```
22570

22671
* [SR-2176][]:
@@ -264,8 +109,6 @@ Swift 5.1
264109
Swift 5.0
265110
---------
266111

267-
### 2019-03-25 (Xcode 10.2)
268-
269112
* [SE-0235][]:
270113

271114
The standard library now contains a `Result` type for manually propagating errors.
@@ -526,6 +369,8 @@ Swift 5.0
526369
}
527370
```
528371

372+
**Add new entries to the top of this section, not here!**
373+
529374
Swift 4.2
530375
---------
531376

@@ -7666,11 +7511,7 @@ Swift 1.0
76667511
[SE-0228]: <https://github.com/apple/swift-evolution/blob/master/proposals/0228-fix-expressiblebystringinterpolation.md>
76677512
[SE-0230]: <https://github.com/apple/swift-evolution/blob/master/proposals/0230-flatten-optional-try.md>
76687513
[SE-0235]: <https://github.com/apple/swift-evolution/blob/master/proposals/0235-add-result.md>
7669-
[SE-0242]: <https://github.com/apple/swift-evolution/blob/master/proposals/0242-default-values-memberwise.md>
7670-
[SE-0244]: <https://github.com/apple/swift-evolution/blob/master/proposals/0244-opaque-result-types.md>
76717514
[SE-0245]: <https://github.com/apple/swift-evolution/blob/master/proposals/0245-array-uninitialized-initializer.md>
7672-
[SE-0252]: <https://github.com/apple/swift-evolution/blob/master/proposals/0252-keypath-dynamic-member-lookup.md>
7673-
[SE-0254]: <https://github.com/apple/swift-evolution/blob/master/proposals/0254-static-subscripts.md>
76747515

76757516
[SR-106]: <https://bugs.swift.org/browse/SR-106>
76767517
[SR-419]: <https://bugs.swift.org/browse/SR-419>
@@ -7684,17 +7525,12 @@ Swift 1.0
76847525
[SR-2388]: <https://bugs.swift.org/browse/SR-2388>
76857526
[SR-2394]: <https://bugs.swift.org/browse/SR-2394>
76867527
[SR-2608]: <https://bugs.swift.org/browse/SR-2608>
7687-
[SR-2672]: <https://bugs.swift.org/browse/SR-2672>
76887528
[SR-2688]: <https://bugs.swift.org/browse/SR-2688>
76897529
[SR-4248]: <https://bugs.swift.org/browse/SR-4248>
76907530
[SR-5581]: <https://bugs.swift.org/browse/SR-5581>
76917531
[SR-5719]: <https://bugs.swift.org/browse/SR-5719>
7692-
[SR-6118]: <https://bugs.swift.org/browse/SR-6118>
76937532
[SR-7139]: <https://bugs.swift.org/browse/SR-7139>
76947533
[SR-7251]: <https://bugs.swift.org/browse/SR-7251>
76957534
[SR-7601]: <https://bugs.swift.org/browse/SR-7601>
76967535
[SR-7799]: <https://bugs.swift.org/browse/SR-7799>
76977536
[SR-8109]: <https://bugs.swift.org/browse/SR-8109>
7698-
[SR-8546]: <https://bugs.swift.org/browse/SR-8546>
7699-
[SR-9043]: <https://bugs.swift.org/browse/SR-9043>
7700-
[SR-9827]: <https://bugs.swift.org/browse/SR-9827>

branches/tensorflow/CMakeLists.txt

Lines changed: 18 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,6 @@ option(SWIFT_INCLUDE_DOCS
9393
"Create targets for building docs."
9494
TRUE)
9595

96-
set(_swift_include_apinotes_default FALSE)
97-
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
98-
set(_swift_include_apinotes_default TRUE)
99-
endif()
100-
101-
option(SWIFT_INCLUDE_APINOTES
102-
"Create targets for installing the remaining apinotes in the built toolchain."
103-
${_swift_include_apinotes_default})
104-
10596
#
10697
# Miscellaneous User-configurable options.
10798
#
@@ -506,7 +497,7 @@ else()
506497
swift_common_unified_build_config(SWIFT)
507498
endif()
508499

509-
get_filename_component(SWIFT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR} REALPATH)
500+
set(SWIFT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
510501
set(SWIFT_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}")
511502
set(SWIFT_CMAKE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
512503
set(SWIFT_MAIN_INCLUDE_DIR "${SWIFT_SOURCE_DIR}/include")
@@ -607,7 +598,7 @@ else()
607598
# FIXME: Only matches v6l/v7l - by far the most common variants
608599
elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "armv6l")
609600
set(SWIFT_HOST_VARIANT_ARCH_default "armv6")
610-
elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "armv7l|armv7-a")
601+
elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "armv7l")
611602
set(SWIFT_HOST_VARIANT_ARCH_default "armv7")
612603
elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "AMD64")
613604
set(SWIFT_HOST_VARIANT_ARCH_default "x86_64")
@@ -1007,17 +998,17 @@ if(SWIFT_NEED_EXPLICIT_LIBDISPATCH)
1007998
else()
1008999
set(SOURCEKIT_RUNTIME_DIR lib)
10091000
endif()
1010-
swift_install_in_component(FILES
1001+
swift_install_in_component(sourcekit-inproc
1002+
FILES
10111003
$<TARGET_FILE:dispatch>
10121004
$<TARGET_FILE:BlocksRuntime>
1013-
DESTINATION ${SOURCEKIT_RUNTIME_DIR}
1014-
COMPONENT sourcekit-inproc)
1005+
DESTINATION ${SOURCEKIT_RUNTIME_DIR})
10151006
if(SWIFT_HOST_VARIANT_SDK STREQUAL WINDOWS)
1016-
swift_install_in_component(FILES
1007+
swift_install_in_component(sourcekit-inproc
1008+
FILES
10171009
$<TARGET_LINKER_FILE:dispatch>
10181010
$<TARGET_LINKER_FILE:BlocksRuntime>
1019-
DESTINATION lib
1020-
COMPONENT sourcekit-inproc)
1011+
DESTINATION lib)
10211012
endif()
10221013

10231014

@@ -1049,18 +1040,14 @@ endif()
10491040
# created. This then will cause SwiftSyntax to fail to build.
10501041
#
10511042
# https://bugs.swift.org/browse/SR-5975
1052-
if(SWIFT_BUILD_STDLIB)
1053-
add_subdirectory(stdlib)
1054-
else()
1055-
# Some tools (e.g. swift-reflection-dump) rely on a host swiftReflection, so
1056-
# ensure we build that when building tools.
1057-
if(SWIFT_INCLUDE_TOOLS)
1058-
add_subdirectory(stdlib/public/Reflection)
1059-
endif()
1060-
endif()
1043+
add_subdirectory(stdlib)
10611044

1062-
if(SWIFT_INCLUDE_APINOTES)
1063-
add_subdirectory(apinotes)
1045+
if(SWIFT_BUILD_SDK_OVERLAY)
1046+
list_intersect("${SWIFT_APPLE_PLATFORMS}" "${SWIFT_SDKS}"
1047+
building_darwin_sdks)
1048+
if(building_darwin_sdks)
1049+
add_subdirectory(apinotes)
1050+
endif()
10641051
endif()
10651052

10661053
add_subdirectory(include)
@@ -1096,9 +1083,9 @@ endif()
10961083

10971084
add_subdirectory(cmake/modules)
10981085

1099-
swift_install_in_component(FILES "LICENSE.txt"
1100-
DESTINATION "share/swift"
1101-
COMPONENT license)
1086+
swift_install_in_component(license
1087+
FILES "LICENSE.txt"
1088+
DESTINATION "share/swift")
11021089

11031090
# Add a documentation target so that documentation shows up in the
11041091
# Xcode project.

branches/tensorflow/apinotes/CMakeLists.txt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,15 @@ add_custom_command(
2323
COMMAND
2424
"${CMAKE_COMMAND}" "-E" "copy_if_different" ${inputs} "${output_dir}/")
2525

26-
add_custom_target("copy_apinotes" ALL
26+
add_custom_target("copy_apinotes"
2727
DEPENDS "${outputs}" "${output_dir}"
2828
COMMENT "Copying API notes to ${output_dir}"
2929
SOURCES "${sources}")
3030

31-
swift_install_in_component(DIRECTORY "${output_dir}"
32-
DESTINATION "lib/swift/"
33-
COMPONENT compiler)
31+
# This is treated as an OPTIONAL target because if we don't build the SDK
32+
# overlay, the files will be missing anyway. It also allows us to build
33+
# single overlays without installing the API notes.
34+
swift_install_in_component(sdk-overlay
35+
DIRECTORY "${output_dir}"
36+
DESTINATION "lib/swift/"
37+
OPTIONAL)

0 commit comments

Comments
 (0)