Skip to content

Commit 42aec09

Browse files
committed
---
yaml --- r: 293626 b: refs/heads/tensorflow c: b14cd91 h: refs/heads/master
1 parent ff17676 commit 42aec09

File tree

1,132 files changed

+279061
-344724
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,132 files changed

+279061
-344724
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: 4fa916bc2cf8044ce74739d86fe6fadaabf15a6a
819+
refs/heads/tensorflow: b14cd916a32029ba9eb98dee003f6be8291f1df4
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 & 169 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,12 +46,12 @@ Swift 5.1
19746
}
19847
```
19948

200-
* `weak` and `unowned` stored properties no longer inhibit the
201-
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.
20251

20352
* [SR-2688][]:
20453

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

20756
```swift
20857
class Foo {
@@ -213,12 +62,10 @@ Swift 5.1
21362

21463
* [SR-7601][]:
21564

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

21867
```swift
219-
class MyClass : NSObject {
220-
@objc func clone() -> Self { return self }
221-
}
68+
@objc func returnDynamicSelf() -> Self { return self }
22269
```
22370

22471
* [SR-2176][]:
@@ -262,8 +109,6 @@ Swift 5.1
262109
Swift 5.0
263110
---------
264111

265-
### 2019-03-25 (Xcode 10.2)
266-
267112
* [SE-0235][]:
268113

269114
The standard library now contains a `Result` type for manually propagating errors.
@@ -524,6 +369,8 @@ Swift 5.0
524369
}
525370
```
526371

372+
**Add new entries to the top of this section, not here!**
373+
527374
Swift 4.2
528375
---------
529376

@@ -7664,11 +7511,7 @@ Swift 1.0
76647511
[SE-0228]: <https://github.com/apple/swift-evolution/blob/master/proposals/0228-fix-expressiblebystringinterpolation.md>
76657512
[SE-0230]: <https://github.com/apple/swift-evolution/blob/master/proposals/0230-flatten-optional-try.md>
76667513
[SE-0235]: <https://github.com/apple/swift-evolution/blob/master/proposals/0235-add-result.md>
7667-
[SE-0242]: <https://github.com/apple/swift-evolution/blob/master/proposals/0242-default-values-memberwise.md>
7668-
[SE-0244]: <https://github.com/apple/swift-evolution/blob/master/proposals/0244-opaque-result-types.md>
76697514
[SE-0245]: <https://github.com/apple/swift-evolution/blob/master/proposals/0245-array-uninitialized-initializer.md>
7670-
[SE-0252]: <https://github.com/apple/swift-evolution/blob/master/proposals/0252-keypath-dynamic-member-lookup.md>
7671-
[SE-0254]: <https://github.com/apple/swift-evolution/blob/master/proposals/0254-static-subscripts.md>
76727515

76737516
[SR-106]: <https://bugs.swift.org/browse/SR-106>
76747517
[SR-419]: <https://bugs.swift.org/browse/SR-419>
@@ -7682,16 +7525,12 @@ Swift 1.0
76827525
[SR-2388]: <https://bugs.swift.org/browse/SR-2388>
76837526
[SR-2394]: <https://bugs.swift.org/browse/SR-2394>
76847527
[SR-2608]: <https://bugs.swift.org/browse/SR-2608>
7685-
[SR-2672]: <https://bugs.swift.org/browse/SR-2672>
76867528
[SR-2688]: <https://bugs.swift.org/browse/SR-2688>
76877529
[SR-4248]: <https://bugs.swift.org/browse/SR-4248>
76887530
[SR-5581]: <https://bugs.swift.org/browse/SR-5581>
76897531
[SR-5719]: <https://bugs.swift.org/browse/SR-5719>
7690-
[SR-6118]: <https://bugs.swift.org/browse/SR-6118>
76917532
[SR-7139]: <https://bugs.swift.org/browse/SR-7139>
76927533
[SR-7251]: <https://bugs.swift.org/browse/SR-7251>
76937534
[SR-7601]: <https://bugs.swift.org/browse/SR-7601>
76947535
[SR-7799]: <https://bugs.swift.org/browse/SR-7799>
76957536
[SR-8109]: <https://bugs.swift.org/browse/SR-8109>
7696-
[SR-8546]: <https://bugs.swift.org/browse/SR-8546>
7697-
[SR-9043]: <https://bugs.swift.org/browse/SR-9043>

branches/tensorflow/CMakeLists.txt

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -409,13 +409,30 @@ if(MSVC OR "${CMAKE_SIMULATE_ID}" STREQUAL MSVC)
409409
include(ClangClCompileRules)
410410
endif()
411411

412-
if(CMAKE_SYSTEM_NAME STREQUAL Darwin OR
413-
EXISTS ${SWIFT_PATH_TO_LIBDISPATCH_SOURCE})
412+
precondition(CMAKE_SYSTEM_NAME)
413+
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
414414
set(SWIFT_BUILD_SYNTAXPARSERLIB_default TRUE)
415415
set(SWIFT_BUILD_SOURCEKIT_default TRUE)
416+
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
417+
if(EXISTS ${SWIFT_PATH_TO_LIBDISPATCH_SOURCE})
418+
set(SWIFT_BUILD_SYNTAXPARSERLIB_default TRUE)
419+
set(SWIFT_BUILD_SOURCEKIT_default TRUE)
420+
else()
421+
set(SWIFT_BUILD_SYNTAXPARSERLIB_default FALSE)
422+
set(SWIFT_BUILD_SOURCEKIT_default FALSE)
423+
endif()
424+
elseif(CMAKE_SYSTEM_NAME STREQUAL Windows)
425+
if(EXISTS ${SWIFT_PATH_TO_LIBDISPATCH_SOURCE} AND
426+
CMAKE_CXX_COMPILER_ID STREQUAL Clang)
427+
set(SWIFT_BUILD_SYNTAXPARSERLIB_default TRUE)
428+
set(SWIFT_BUILD_SOURCEKIT_default TRUE)
429+
else()
430+
set(SWIFT_BUILD_SYNTAXPARSERLIB_default FALSE)
431+
set(SWIFT_BUILD_SOURCEKIT_default FALSE)
432+
endif()
416433
else()
417-
set(SWIFT_BUILD_SYNTAXPARSERLIB_default FALSE)
418-
set(SWIFT_BUILD_SOURCEKIT_default FALSE)
434+
set(SWIFT_BUILD_SYNTAXPARSERLIB_default FALSE)
435+
set(SWIFT_BUILD_SOURCEKIT_default FALSE)
419436
endif()
420437
option(SWIFT_BUILD_SYNTAXPARSERLIB
421438
"Build the Swift Syntax Parser library"
@@ -477,6 +494,12 @@ if(NOT SWIFT_LIPO)
477494
find_toolchain_tool(SWIFT_LIPO "${SWIFT_DARWIN_XCRUN_TOOLCHAIN}" lipo)
478495
endif()
479496

497+
if("${SWIFT_NATIVE_LLVM_TOOLS_PATH}" STREQUAL "")
498+
set(SWIFT_CROSS_COMPILING FALSE)
499+
else()
500+
set(SWIFT_CROSS_COMPILING TRUE)
501+
endif()
502+
480503
# Reset CMAKE_SYSTEM_PROCESSOR if not cross-compiling.
481504
# CMake refuses to use `uname -m` on OS X
482505
# http://public.kitware.com/Bug/view.php?id=10326
@@ -497,7 +520,7 @@ else()
497520
swift_common_unified_build_config(SWIFT)
498521
endif()
499522

500-
get_filename_component(SWIFT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR} REALPATH)
523+
set(SWIFT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
501524
set(SWIFT_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}")
502525
set(SWIFT_CMAKE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
503526
set(SWIFT_MAIN_INCLUDE_DIR "${SWIFT_SOURCE_DIR}/include")
@@ -572,8 +595,6 @@ else()
572595
set(SWIFT_HOST_VARIANT_SDK_default "WINDOWS")
573596
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Haiku")
574597
set(SWIFT_HOST_VARIANT_SDK_default "HAIKU")
575-
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Android")
576-
set(SWIFT_HOST_VARIANT_SDK_default "ANDROID")
577598
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
578599
set(SWIFT_HOST_VARIANT_SDK_default "OSX")
579600
else()
@@ -698,15 +719,6 @@ elseif("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "HAIKU")
698719
set(SWIFT_PRIMARY_VARIANT_SDK_default "${SWIFT_HOST_VARIANT_SDK}")
699720
set(SWIFT_PRIMARY_VARIANT_ARCH_default "${SWIFT_HOST_VARIANT_ARCH}")
700721

701-
elseif("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "ANDROID")
702-
703-
set(SWIFT_HOST_VARIANT "android" CACHE STRING
704-
"Deployment OS for Swift host tools (the compiler) [android].")
705-
706-
configure_sdk_unix("Android" "${SWIFT_HOST_VARIANT_ARCH}")
707-
set(SWIFT_PRIMARY_VARIANT_SDK_default "${SWIFT_HOST_VARIANT_SDK}")
708-
set(SWIFT_PRIMARY_VARIANT_ARCH_default "${SWIFT_HOST_VARIANT_ARCH}")
709-
710722
elseif("${SWIFT_HOST_VARIANT_SDK}" MATCHES "(OSX|IOS*|TVOS*|WATCHOS*)")
711723

712724
set(SWIFT_HOST_VARIANT "macosx" CACHE STRING
@@ -751,10 +763,7 @@ endif()
751763

752764
# Should we cross-compile the standard library for Android?
753765
is_sdk_requested(ANDROID swift_build_android)
754-
if(swift_build_android AND NOT "${SWIFT_HOST_VARIANT_SDK}" STREQUAL "ANDROID")
755-
if ("${SWIFT_ANDROID_NDK_PATH}" STREQUAL "")
756-
message(FATAL_ERROR "You must set SWIFT_ANDROID_NDK_PATH to cross-compile the Swift runtime for Android")
757-
endif()
766+
if(swift_build_android AND NOT "${SWIFT_ANDROID_NDK_PATH}" STREQUAL "")
758767
if (NOT ("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Darwin" OR "${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Linux"))
759768
message(FATAL_ERROR "A Darwin or Linux host is required to build the Swift runtime for Android")
760769
endif()

branches/tensorflow/benchmark/CMakeLists.txt

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,6 @@ set(BENCHOPTS_MULTITHREADED
253253
"-whole-module-optimization" "-num-threads" "4")
254254
set(BENCHOPTS_SINGLEFILE "")
255255

256-
option(SWIFT_BENCHMARK_USE_OS_LIBRARIES
257-
"Runtime link against the Swift libraries on the target (/usr/lib/swift)."
258-
FALSE)
259-
260256
configure_build()
261257

262258
#===-----------------------------------------------------------------------===#
@@ -272,18 +268,10 @@ configure_sdks()
272268
message("--")
273269
message("-- Swift Benchmark Suite:")
274270
message("-- SWIFT_BENCHMARK_BUILT_STANDALONE = ${SWIFT_BENCHMARK_BUILT_STANDALONE}")
275-
message("-- SWIFT_BENCHMARK_USE_OS_LIBRARIES = ${SWIFT_BENCHMARK_USE_OS_LIBRARIES}")
276-
message("-- SWIFT_EXEC = ${SWIFT_EXEC}")
277-
message("-- SWIFT_LIBRARY_PATH = ${SWIFT_LIBRARY_PATH}")
278-
if (SWIFT_RPATH_BASE)
279-
message("-- SWIFT_RPATH_BASE = ${SWIFT_RPATH_BASE}")
280-
endif()
281-
if (SWIFT_RPATH)
282-
message("-- SWIFT_RPATH = ${SWIFT_RPATH}")
283-
message("--- ** WARNING ** Benchmarking against Swift-in-the-OS")
284-
endif()
285-
message("-- CLANG_EXEC = ${CLANG_EXEC}")
271+
message("-- SWIFT_EXEC = ${SWIFT_EXEC}")
286272
message("-- SWIFT_BENCHMARK_EXTRA_FLAGS = ${SWIFT_BENCHMARK_EXTRA_FLAGS}")
273+
message("-- SWIFT_LIBRARY_PATH = ${SWIFT_LIBRARY_PATH}")
274+
message("-- CLANG_EXEC = ${CLANG_EXEC}")
287275
message("-- SWIFT_OPTIMIZATION_LEVELS = ${SWIFT_OPTIMIZATION_LEVELS}")
288276
message("-- ONLY_PLATFORMS = ${ONLY_PLATFORMS}")
289277
message("-- PAGE_ALIGNMENT_OPTION = ${PAGE_ALIGNMENT_OPTION}")

branches/tensorflow/benchmark/Naming.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ relative comparison across the different axis of variation.
8989

9090
</details><p><!-- spacer --></p></li>
9191
<li>
92-
<strong>Groups, variants and types are <code>UpperCase</code>, methods are
92+
<strong>Groups and types are <code>UpperCase</code>, methods are
9393
<code>lowerCase</code>.</strong>
9494
<details>
9595

0 commit comments

Comments
 (0)