Skip to content

Commit 26772a9

Browse files
authored
---
yaml --- r: 274175 b: refs/heads/master-next c: 86d14a8 h: refs/heads/master i: 274173: 856a118 274171: 3ba04bc 274167: f6d2a3c 274159: 4cf6b54 274143: f8dd054 274111: 28be98e 274047: 8a7f8d4 273919: 5b43b13
1 parent a4155ae commit 26772a9

File tree

661 files changed

+17009
-8142
lines changed

Some content is hidden

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

661 files changed

+17009
-8142
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
refs/heads/master: cbef630f19f869ab5279731179bd731f12b3b9d5
3-
refs/heads/master-next: 7bc3dfb223ab325b45d1c9527dce4d1ae43b5e61
3+
refs/heads/master-next: 86d14a8be85a5f6ee908c4a5396fc38fe8877fbc
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea
66
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-b: 66d897bfcf64a82cb9a87f5e663d889189d06d07

branches/master-next/CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,33 @@ CHANGELOG
2121

2222
</details>
2323

24+
Swift 5.1
25+
---------
26+
27+
* Key path expressions can now include references to tuple elements.
28+
2429
Swift 5.0
2530
---------
2631

32+
* [SE-0235][]:
33+
34+
The standard library now contains a `Result` type for manually propagating errors.
35+
36+
```swift
37+
enum Result<Success, Failure: Error> {
38+
case success(Success)
39+
case failure(Failure)
40+
}
41+
```
42+
43+
This type serves a complementary role to that of throwing functions and initializers.
44+
Use `Result` in situations where automatic error propagation or `try`-`catch`
45+
blocks are undesirable, such as in asynchronous code or when accumulating the
46+
results of successive error-producing operations.
47+
48+
* `Error` now conforms to itself. This allows for the use of `Error` itself as
49+
the argument for a generic parameter constrained to `Error`.
50+
2751
* Swift 3 mode has been removed. Supported values for the `-swift-version`
2852
flag are `4`, `4.2`, and `5`.
2953

@@ -7406,6 +7430,7 @@ Swift 1.0
74067430
[SE-0227]: <https://github.com/apple/swift-evolution/blob/master/proposals/0227-identity-keypath.md>
74077431
[SE-0228]: <https://github.com/apple/swift-evolution/blob/master/proposals/0228-fix-expressiblebystringinterpolation.md>
74087432
[SE-0230]: <https://github.com/apple/swift-evolution/blob/master/proposals/0230-flatten-optional-try.md>
7433+
[SE-0235]: <https://github.com/apple/swift-evolution/blob/master/proposals/0235-add-result.md>
74097434

74107435
[SR-106]: <https://bugs.swift.org/browse/SR-106>
74117436
[SR-419]: <https://bugs.swift.org/browse/SR-419>

branches/master-next/CMakeLists.txt

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -413,13 +413,24 @@ elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
413413
set(SWIFT_BUILD_SYNTAXPARSERLIB_default FALSE)
414414
set(SWIFT_BUILD_SOURCEKIT_default FALSE)
415415
endif()
416+
elseif(CMAKE_SYSTEM_NAME STREQUAL Windows)
417+
if(EXISTS ${SWIFT_PATH_TO_LIBDISPATCH_SOURCE} AND
418+
CMAKE_CXX_COMPILER_ID STREQUAL Clang)
419+
set(SWIFT_BUILD_SYNTAXPARSERLIB_default TRUE)
420+
set(SWIFT_BUILD_SOURCEKIT_default TRUE)
421+
else()
422+
set(SWIFT_BUILD_SYNTAXPARSERLIB_default FALSE)
423+
set(SWIFT_BUILD_SOURCEKIT_default FALSE)
424+
endif()
416425
else()
417426
set(SWIFT_BUILD_SYNTAXPARSERLIB_default FALSE)
418427
set(SWIFT_BUILD_SOURCEKIT_default FALSE)
419428
endif()
420429
option(SWIFT_BUILD_SYNTAXPARSERLIB
421430
"Build the Swift Syntax Parser library"
422431
${SWIFT_BUILD_SYNTAXPARSERLIB_default})
432+
option(SWIFT_BUILD_ONLY_SYNTAXPARSERLIB
433+
"Only build the Swift Syntax Parser library" FALSE)
423434
option(SWIFT_BUILD_SOURCEKIT
424435
"Build SourceKit"
425436
${SWIFT_BUILD_SOURCEKIT_default})
@@ -496,15 +507,11 @@ include(SwiftSharedCMakeConfig)
496507
# Support building Swift as a standalone project, using LLVM as an
497508
# external library.
498509
if(SWIFT_BUILT_STANDALONE)
499-
swift_common_standalone_build_config(SWIFT SWIFT_CROSS_COMPILING)
510+
swift_common_standalone_build_config(SWIFT)
500511
else()
501512
swift_common_unified_build_config(SWIFT)
502513
endif()
503514

504-
if(NOT EXISTS "${CLANG_MAIN_INCLUDE_DIR}/clang/AST/Decl.h")
505-
message(FATAL_ERROR "Clang is missing from llvm/tools subdirectory.")
506-
endif()
507-
508515
set(SWIFT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
509516
set(SWIFT_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}")
510517
set(SWIFT_CMAKE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
@@ -902,8 +909,18 @@ if(SWIFT_NEED_EXPLICIT_LIBDISPATCH)
902909
set(SWIFT_LIBDISPATCH_C_COMPILER ${CMAKE_C_COMPILER})
903910
set(SWIFT_LIBDISPATCH_CXX_COMPILER ${CMAKE_CXX_COMPILER})
904911
elseif(${CMAKE_SYSTEM_NAME} STREQUAL ${CMAKE_HOST_SYSTEM_NAME})
905-
set(SWIFT_LIBDISPATCH_C_COMPILER ${PATH_TO_CLANG_BUILD}/bin/clang)
906-
set(SWIFT_LIBDISPATCH_CXX_COMPILER ${PATH_TO_CLANG_BUILD}/bin/clang++)
912+
get_target_property(CLANG_LOCATION clang LOCATION)
913+
get_filename_component(CLANG_LOCATION ${CLANG_LOCATION} DIRECTORY)
914+
915+
if(CMAKE_SYSTEM_NAME STREQUAL Windows)
916+
set(SWIFT_LIBDISPATCH_C_COMPILER
917+
${CLANG_LOCATION}/clang-cl${CMAKE_EXECUTABLE_SUFFIX})
918+
set(SWIFT_LIBDISPATCH_CXX_COMPILER
919+
${CLANG_LOCATION}/clang-cl${CMAKE_EXECUTABLE_SUFFIX})
920+
else()
921+
set(SWIFT_LIBDISPATCH_C_COMPILER ${CLANG_LOCATION}/clang)
922+
set(SWIFT_LIBDISPATCH_CXX_COMPILER ${CLANG_LOCATION}/clang++)
923+
endif()
907924
else()
908925
message(SEND_ERROR "libdispatch requires a newer clang compiler (${CMAKE_C_COMPILER_VERSION} < 3.9)")
909926
endif()

branches/master-next/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
|**[Ubuntu 16.04](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/x86_64_ubuntu_16_04.json)** | x86_64 |[![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04)|
2020
|**[Ubuntu 16.04 ](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/ppc64le_ubuntu_16_04.json)** | PPC64LE |[![Build Status](https://ci-external.swift.org/job/oss-swift-4.1-RA-linux-ubuntu-16.04-ppc64le/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-4.1-RA-linux-ubuntu-16.04-ppc64le)|
2121
|**[Ubuntu 16.04 ](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/aarch64_ubuntu_16.04.json)** | AArch64 |[![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-aarch64/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-aarch64)|
22-
|**[Ubuntu 16.04 (Android)](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/x86_64_ubuntu_16_04_LTS_android.json)** | x86_64 |[![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-android/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-android)|
22+
|**[Android](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/x86_64_ubuntu_16_04_LTS_android.json)** | ARMv7 |[![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-android/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-android)|
23+
|**[Android](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/x86_64_ubuntu_16_04_LTS_android.json)** | AArch64 |[![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-android-arm64/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-android-arm64)|
2324
|**[Ubuntu 16.04 (TensorFlow)](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/x86_64_ubuntu_16_04_tensorflow.json)** | x86_64 |[![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-tensorflow/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-tensorflow)|
2425
|**[macOS 10.13 (TensorFlow)](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/x86_64_macos_high_sierra_tensorflow.json)** | x86_64 |[![Build Status](https://ci-external.swift.org/job/oss-swift-RA-macOS-tensorflow/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-macOS-tensorflow)|
2526
|**[Ubuntu 16.04 (TensorFlow with GPU)](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/x86_64_ubuntu_16_04_tensorflow_gpu.json)** | x86_64 |[![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-tensorflow-gpu/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-tensorflow-gpu)|

branches/master-next/benchmark/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ set(SWIFT_BENCH_MODULES
8989
single-source/FloatingPointPrinting
9090
single-source/Hanoi
9191
single-source/Hash
92-
single-source/HashQuadratic
9392
single-source/Histogram
9493
single-source/InsertCharacter
9594
single-source/Integrate

branches/master-next/benchmark/Naming.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ benchmark is testing individual method on a concrete type.
2828
````
2929
⛔️ Dictionary2
3030
✅ AngryPhonebook
31-
✅ Dictionary.AnyHashable.String.update
3231
✅ Array.append.Array.Int
32+
✅ Dictionary.AnyHashable.String.update
3333
````
3434

3535
Benchmark names are used to run individual tests when passed as command line
@@ -42,8 +42,8 @@ optional chaining etc.
4242

4343
````
4444
✅ Array.append.Array.Int?
45-
✅ Flatten.Array.Tuple4.for-in.reserved
4645
✅ Bridging.NSArray.as!.Array.NSString
46+
✅ Flatten.Array.Tuple4.for-in.Reserve
4747
````
4848

4949
Note: Special characters that could be interpreted by the shell require escaping

branches/master-next/benchmark/scripts/Benchmark_Driver

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ class BenchmarkDriver(object):
200200
with open(log_file, 'w') as f:
201201
f.write(output)
202202

203-
RESULT = '{:>3} {:<25} {:>7} {:>7} {:>6} {:>10} {:>6} {:>7} {:>10}'
203+
RESULT = '{:>3} {:<40} {:>7} {:>7} {:>6} {:>10} {:>6} {:>7} {:>10}'
204204

205205
def run_and_log(self, csv_console=True):
206206
"""Run benchmarks and continuously log results to the console.

branches/master-next/benchmark/scripts/compare_perf_tests.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -363,9 +363,9 @@ def _reset(self):
363363
# Parse lines like this
364364
# #,TEST,SAMPLES,MIN(μs),MAX(μs),MEAN(μs),SD(μs),MEDIAN(μs)
365365
results_re = re.compile(
366-
r'( *\d+[, \t]+[\w.]+[, \t]+' + # #,TEST
367-
r'[, \t]+'.join([r'\d+'] * 2) + # at least 2...
368-
r'(?:[, \t]+\d*)*)') # ...or more numeric columns
366+
r'( *\d+[, \t]+[\w.\-\?!]+[, \t]+' + # #,TEST
367+
r'[, \t]+'.join([r'\d+'] * 2) + # at least 2...
368+
r'(?:[, \t]+\d*)*)') # ...or more numeric columns
369369

370370
def _append_result(self, result):
371371
columns = result.split(',') if ',' in result else result.split()

branches/master-next/benchmark/scripts/test_Benchmark_Driver.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -366,10 +366,10 @@ def mock_run(test):
366366
self.assertEqual(log, header + csv_log)
367367
self.assertEqual(
368368
out.getvalue(),
369-
' # TEST SAMPLES MIN(μs) Q1(μs)' +
370-
' MEDIAN(μs) Q3(μs) MAX(μs) MAX_RSS(B)\n' +
371-
' 3 b1 5 101 102' +
372-
' 103 104 105 888\n' +
369+
' # TEST SAMPLES MIN(μs)' +
370+
' Q1(μs) MEDIAN(μs) Q3(μs) MAX(μs) MAX_RSS(B)\n' +
371+
' 3 b1 5 101' +
372+
' 102 103 104 105 888\n' +
373373
'\n' +
374374
'Total performance tests executed: 1\n')
375375

branches/master-next/benchmark/scripts/test_compare_perf_tests.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,14 +445,20 @@ class TestLogParser(unittest.TestCase):
445445
def test_parse_results_csv(self):
446446
"""Ignores uknown lines, extracts data from supported formats."""
447447
log = """#,TEST,SAMPLES,MIN(us),MAX(us),MEAN(us),SD(us),MEDIAN(us)
448-
34,BitCount,20,3,4,4,0,4
448+
7,Array.append.Array.Int?,20,10,10,10,0,10
449+
21,Bridging.NSArray.as!.Array.NSString,20,11,11,11,0,11
450+
42,Flatten.Array.Tuple4.lazy.for-in.Reserve,20,3,4,4,0,4
449451
450452
Total performance tests executed: 1
451453
"""
452454
parser = LogParser()
453455
results = parser.parse_results(log.splitlines())
454456
self.assertTrue(isinstance(results[0], PerformanceTestResult))
455-
self.assertEqual(results[0].name, 'BitCount')
457+
self.assertEquals(results[0].name, 'Array.append.Array.Int?')
458+
self.assertEquals(results[1].name,
459+
'Bridging.NSArray.as!.Array.NSString')
460+
self.assertEquals(results[2].name,
461+
'Flatten.Array.Tuple4.lazy.for-in.Reserve')
456462

457463
def test_parse_results_tab_delimited(self):
458464
log = '34\tBitCount\t20\t3\t4\t4\t0\t4'

branches/master-next/benchmark/single-source/ArrayLiteral.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import TestsUtils
1717

1818
public let ArrayLiteral = [
19-
BenchmarkInfo(name: "ArrayLiteral", runFunction: run_ArrayLiteral, tags: [.validation, .api, .Array]),
19+
BenchmarkInfo(name: "ArrayLiteral2", runFunction: run_ArrayLiteral, tags: [.validation, .api, .Array]),
2020
BenchmarkInfo(name: "ArrayValueProp", runFunction: run_ArrayValueProp, tags: [.validation, .api, .Array]),
2121
BenchmarkInfo(name: "ArrayValueProp2", runFunction: run_ArrayValueProp2, tags: [.validation, .api, .Array]),
2222
BenchmarkInfo(name: "ArrayValueProp3", runFunction: run_ArrayValueProp3, tags: [.validation, .api, .Array]),
@@ -31,7 +31,7 @@ func makeArray() -> [Int] {
3131
@inline(never)
3232
public func run_ArrayLiteral(_ N: Int) {
3333
for _ in 1...10000*N {
34-
_ = makeArray()
34+
blackHole(makeArray())
3535
}
3636
}
3737

branches/master-next/benchmark/single-source/ArraySetElement.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ import TestsUtils
1818
public var ArraySetElement = BenchmarkInfo(
1919
name: "ArraySetElement",
2020
runFunction: run_ArraySetElement,
21-
tags: [.runtime, .cpubench, .unstable],
22-
legacyFactor: 10
21+
tags: [.runtime, .cpubench]
2322
)
2423

2524
// This is an effort to defeat isUniquelyReferenced optimization. Ideally
@@ -31,7 +30,7 @@ func storeArrayElement(_ array: inout [Int], _ i: Int) {
3130

3231
public func run_ArraySetElement(_ N: Int) {
3332
var array = [Int](repeating: 0, count: 10000)
34-
for _ in 0..<N {
33+
for _ in 0..<10*N {
3534
for i in 0..<array.count {
3635
storeArrayElement(&array, i)
3736
}

branches/master-next/benchmark/single-source/Codable.swift

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -107,18 +107,6 @@ public func setup_json() {
107107
JSONTester = CodablePerfTester(encoder: JSONEncoder(), decoder: JSONDecoder())
108108
}
109109

110-
#if !_runtime(_ObjC)
111-
// If we do not have an objc-runtime, then we do not have a definition for
112-
// autoreleasepool. Add in our own fake autoclosure for it that is inline
113-
// always. That should be able to be eaten through by the optimizer no problem.
114-
@inline(__always)
115-
public func autoreleasepool<Result>(
116-
invoking body: () throws -> Result
117-
) rethrows -> Result {
118-
return try body()
119-
}
120-
#endif
121-
122110
@inline(never)
123111
public func run_JSONPerfEncode(_ N: Int) {
124112
autoreleasepool {

0 commit comments

Comments
 (0)