Skip to content

Commit f303441

Browse files
committed
---
yaml --- r: 341963 b: refs/heads/rxwei-patch-1 c: 3b1e881 h: refs/heads/master i: 341961: 863e032 341959: ec2c2c4
1 parent 6507b55 commit f303441

File tree

753 files changed

+9443
-15989
lines changed

Some content is hidden

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

753 files changed

+9443
-15989
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,7 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-08-18-a: b10b1fce14385faa6d44f6b933e95
10151015
refs/heads/rdar-43033749-fix-batch-mode-no-diags-swift-5.0-branch: a14e64eaad30de89f0f5f0b2a782eed7ecdcb255
10161016
refs/heads/revert-19006-error-bridging-integer-type: 8a9065a3696535305ea53fe9b71f91cbe6702019
10171017
refs/heads/revert-19050-revert-19006-error-bridging-integer-type: ecf752d54b05dd0a20f510f0bfa54a3fec3bcaca
1018-
refs/heads/rxwei-patch-1: 2fdae648b786292f1c2b010165b87e8c421a12bc
1018+
refs/heads/rxwei-patch-1: 3b1e8812856b9763bdd548e298588c7208eddcba
10191019
refs/heads/shahmishal-patch-1: e58ec0f7488258d42bef51bc3e6d7b3dc74d7b2a
10201020
refs/heads/typelist-existential: 4046359efd541fb5c72d69a92eefc0a784df8f5e
10211021
refs/tags/swift-4.2-DEVELOPMENT-SNAPSHOT-2018-08-20-a: 4319ba09e4fb8650ee86061075c74a016b6baab9

branches/rxwei-patch-1/CHANGELOG.md

Lines changed: 16 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,27 @@ CHANGELOG
2626
Swift Next
2727
----------
2828

29-
* [SR-4206][]:
29+
* [SR-8974][]:
3030

31-
A method override is no longer allowed to have a generic signature with
32-
requirements not imposed by the base method. For example:
31+
Duplicate tuple element labels are no longer allowed, because it leads
32+
to incorrect behavior. For example:
3333

3434
```
35-
protocol P {}
36-
37-
class Base {
38-
func foo<T>(arg: T) {}
39-
}
40-
41-
class Derived: Base {
42-
override func foo<T: P>(arg: T) {}
43-
}
35+
let dupLabels: (foo: Int, foo: Int) = (foo: 1, foo: 2)
36+
37+
enum Foo { case bar(x: Int, x: Int) }
38+
let f: Foo = .bar(x: 0, x: 1)
4439
```
4540

46-
will now be diagnosed as an error.
41+
will now be diagnosed as an error.
42+
43+
Note: You can still use duplicate labels when declaring functions and
44+
subscripts, as long as the internal labels are different. For example:
45+
46+
```
47+
func foo(bar x: Int, bar y: Int) {}
48+
subscript(a x: Int, a y: Int) -> Int {}
49+
```
4750

4851
* [SR-6118][]:
4952

@@ -65,28 +68,6 @@ Swift Next
6568
Swift 5.1
6669
---------
6770

68-
* [SR-8974][]:
69-
70-
Duplicate tuple element labels are no longer allowed, because it leads
71-
to incorrect behavior. For example:
72-
73-
```
74-
let dupLabels: (foo: Int, foo: Int) = (foo: 1, foo: 2)
75-
76-
enum Foo { case bar(x: Int, x: Int) }
77-
let f: Foo = .bar(x: 0, x: 1)
78-
```
79-
80-
will now be diagnosed as an error.
81-
82-
Note: You can still use duplicate argument labels when declaring functions and
83-
subscripts, as long as the internal parameter names are different. For example:
84-
85-
```
86-
func foo(bar x: Int, bar y: Int) {}
87-
subscript(a x: Int, a y: Int) -> Int {}
88-
```
89-
9071
* [SE-0244][]:
9172

9273
Functions can now hide their concrete return type by declaring what protocols
@@ -7727,7 +7708,6 @@ Swift 1.0
77277708
[SR-2608]: <https://bugs.swift.org/browse/SR-2608>
77287709
[SR-2672]: <https://bugs.swift.org/browse/SR-2672>
77297710
[SR-2688]: <https://bugs.swift.org/browse/SR-2688>
7730-
[SR-4206]: <https://bugs.swift.org/browse/SR-4206>
77317711
[SR-4248]: <https://bugs.swift.org/browse/SR-4248>
77327712
[SR-5581]: <https://bugs.swift.org/browse/SR-5581>
77337713
[SR-5719]: <https://bugs.swift.org/browse/SR-5719>

branches/rxwei-patch-1/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
|**[Debian 9.1 (Raspberry Pi)](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/armv7_debian_stretch.json)** | ARMv7 | [![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-debian-9_1/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-debian-9_1)|
1818
|**[Fedora 27](https://github.com/apple/swift-community-hosted-continuous-integration/blob/master/nodes/x86_64_fedora_27.json)** | x86_64 |[![Build Status](https://ci-external.swift.org/job/oss-swift-RA-linux-fedora-27/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-RA-linux-fedora-27)|
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)|
20-
|**[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-5.1-RA-linux-ubuntu-16.04-ppc64le/lastCompletedBuild/badge/icon)](https://ci-external.swift.org/job/oss-swift-5.1-RA-linux-ubuntu-16.04-ppc64le)|
20+
|**[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)|
2222
|**[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)|
2323
|**[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)|

branches/rxwei-patch-1/benchmark/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,6 @@ set(SWIFT_BENCH_MODULES
7878
single-source/DictionaryRemove
7979
single-source/DictionarySubscriptDefault
8080
single-source/DictionarySwap
81-
single-source/Diffing
82-
single-source/DiffingMyers
8381
single-source/DropFirst
8482
single-source/DropLast
8583
single-source/DropWhile

branches/rxwei-patch-1/benchmark/single-source/AngryPhonebook.swift

Lines changed: 6 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -13,60 +13,13 @@
1313
// This test is based on single-source/Phonebook, with
1414
// to test uppercase and lowercase ASCII string fast paths.
1515
import TestsUtils
16+
import Foundation
1617

17-
let t: [BenchmarkCategory] = [.validation, .api, .String]
18-
19-
public let AngryPhonebook = [
20-
BenchmarkInfo(
21-
name: "AngryPhonebook",
22-
runFunction: run_AngryPhonebook,
23-
tags: t,
24-
legacyFactor: 7),
25-
26-
// Small String Workloads
27-
BenchmarkInfo(
28-
name: "AngryPhonebook.ASCII.Small",
29-
runFunction: { angryPhonebook($0, ascii) },
30-
tags: t,
31-
setUpFunction: { blackHole(ascii) }),
32-
BenchmarkInfo(
33-
name: "AngryPhonebook.Strasse.Small",
34-
runFunction: { angryPhonebook($0, strasse) },
35-
tags: t,
36-
setUpFunction: { blackHole(strasse) }),
37-
BenchmarkInfo(
38-
name: "AngryPhonebook.Armenian.Small",
39-
runFunction: { angryPhonebook($0, armenian) },
40-
tags: t,
41-
setUpFunction: { blackHole(armenian) }),
42-
BenchmarkInfo(
43-
name: "AngryPhonebook.Cyrillic.Small",
44-
runFunction: { angryPhonebook($0, cyrillic) },
45-
tags: t,
46-
setUpFunction: { blackHole(cyrillic) }),
47-
48-
// Regular String Workloads
49-
BenchmarkInfo(
50-
name: "AngryPhonebook.ASCII",
51-
runFunction: { angryPhonebook($0, precomposed: longASCII) },
52-
tags: t,
53-
setUpFunction: { blackHole(longASCII) }),
54-
BenchmarkInfo(
55-
name: "AngryPhonebook.Strasse",
56-
runFunction: { angryPhonebook($0, precomposed: longStrasse) },
57-
tags: t,
58-
setUpFunction: { blackHole(longStrasse) }),
59-
BenchmarkInfo(
60-
name: "AngryPhonebook.Armenian",
61-
runFunction: { angryPhonebook($0, precomposed: longArmenian) },
62-
tags: t,
63-
setUpFunction: { blackHole(longArmenian) }),
64-
BenchmarkInfo(
65-
name: "AngryPhonebook.Cyrillic",
66-
runFunction: { angryPhonebook($0, precomposed: longCyrillic) },
67-
tags: t,
68-
setUpFunction: { blackHole(longCyrillic) })
69-
]
18+
public let AngryPhonebook = BenchmarkInfo(
19+
name: "AngryPhonebook",
20+
runFunction: run_AngryPhonebook,
21+
tags: [.validation, .api, .String],
22+
legacyFactor: 7)
7023

7124
let words = [
7225
"James", "John", "Robert", "Michael", "William", "David", "Richard", "Joseph",
@@ -86,67 +39,3 @@ public func run_AngryPhonebook(_ N: Int) {
8639
}
8740
}
8841
}
89-
90-
// Workloads for various scripts. Always 20 names for 400 pairings.
91-
// To keep the performance of various scripts roughly comparable, aim for
92-
// a total length of approximately 120 characters.
93-
// E.g.: `ascii.joined(separator: "").count == 124`
94-
// Every name should fit in 15-bytes UTF-8 encoded, to excercise the small
95-
// string optimization.
96-
// E.g.: `armenian.allSatisfy { $0._guts.isSmall } == true`
97-
98-
// Workload Size Statistics
99-
// SMALL | UTF-8 | UTF-16 | REGULAR | UTF-8 | UTF-16
100-
// ---------|-------|--------|--------------|---------|--------
101-
// ascii | 124 B | 248 B | longASCII | 6158 B | 12316 B
102-
// strasse | 140 B | 240 B | longStrasse | 6798 B | 11996 B
103-
// armenian | 232 B | 232 B | longArmenian | 10478 B | 11676 B
104-
// cyrillic | 238 B | 238 B | longCyrillic | 10718 B | 11916 B
105-
106-
let ascii = Array(words.prefix(20))
107-
// Pathological case, uppercase: ß -> SS
108-
let strasse = Array(repeating: "Straße", count: 20)
109-
110-
let armenian = [
111-
"Արմեն", "Աննա", "Հարութ", "Միքայել", "Մարիա", "Դավիթ", "Վարդան",
112-
"Նարինե", "Տիգրան", "Տաթևիկ", "Թագուհի", "Թամարա", "Ազնաուր", "Գրիգոր",
113-
"Կոմիտաս", "Հայկ", "Գառնիկ", "Վահրամ", "Վահագն", "Գևորգ"]
114-
115-
let cyrillic = [
116-
"Ульяна", "Аркадий", "Аня", "Даниил", "Дмитрий", "Эдуард", "Юрій", "Давид",
117-
"Анна", "Дмитрий", "Евгений", "Борис", "Ксения", "Артур", "Аполлон",
118-
"Соломон", "Николай", "Кристи", "Надежда", "Спартак"]
119-
120-
/// Precompose the phonebook into one large string of comma separated names.
121-
func phonebook(_ names: [String]) -> String {
122-
names.map { firstName in
123-
names.map { lastName in
124-
firstName + " " + lastName
125-
}.joined(separator: ", ")
126-
}.joined(separator: ", ")
127-
}
128-
129-
let longASCII = phonebook(ascii)
130-
let longStrasse = phonebook(strasse)
131-
let longArmenian = phonebook(armenian)
132-
let longCyrillic = phonebook(cyrillic)
133-
134-
@inline(never)
135-
public func angryPhonebook(_ N: Int, _ names: [String]) {
136-
assert(names.count == 20)
137-
// Permute the names.
138-
for _ in 1...N {
139-
for firstname in names {
140-
for lastname in names {
141-
blackHole((firstname.uppercased(), lastname.lowercased()))
142-
}
143-
}
144-
}
145-
}
146-
147-
@inline(never)
148-
public func angryPhonebook(_ N: Int, precomposed names: String) {
149-
for _ in 1...N {
150-
blackHole((names.uppercased(), names.lowercased()))
151-
}
152-
}

branches/rxwei-patch-1/benchmark/single-source/BinaryFloatingPointConversionFromBinaryInteger.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
// This test checks performance of generic binary floating-point conversion from
1414
// a binary integer.
1515

16+
import Foundation
1617
import TestsUtils
1718

1819
#if swift(>=4.2)
@@ -109,7 +110,7 @@ extension MockBinaryInteger : BinaryInteger {
109110
var trailingZeroBitCount: Int {
110111
return _value.trailingZeroBitCount
111112
}
112-
113+
113114
func isMultiple(of other: MockBinaryInteger<T>) -> Bool {
114115
return _value.isMultiple(of: other._value)
115116
}
@@ -210,3 +211,4 @@ public func run_BinaryFloatingPointConversionFromBinaryInteger(_ N: Int) {
210211
}
211212

212213
#endif
214+

branches/rxwei-patch-1/benchmark/single-source/BinaryFloatingPointProperties.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
import Foundation
1314
import TestsUtils
1415

1516
public let BinaryFloatingPointPropertiesBinade = BenchmarkInfo(

branches/rxwei-patch-1/benchmark/single-source/BitCount.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
// This test checks performance of Swift bit count.
1414
// and mask operator.
1515
// rdar://problem/22151678
16+
import Foundation
1617
import TestsUtils
1718

1819
public let BitCount = BenchmarkInfo(

branches/rxwei-patch-1/benchmark/single-source/BucketSort.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,17 @@
1616
// https://github.com/raywenderlich/swift-algorithm-club/tree/master/Bucket%20Sort
1717
//
1818
// It sorts an array of generic `SortableItem`s. If the type of `sortingAlgo`
19-
// is not known to the call site at line 89, the `sort` method can not be
19+
// is not known to the call site at line 90, the `sort` method can not be
2020
// specialized to integer array sorting, which will lead to a huge performance
2121
// loss. Since `SortingAlgorithm` and `InsertionSort` are declared to be
22-
// `public` and the lines 88-90 can not be inlined in `bucketSort` (due to
22+
// `public` and the lines 89-91 can not be inlined in `bucketSort` (due to
2323
// inlining heuristic limitations), compiler without ExistentialSpecializer
2424
// optimization can not achieve this feat. With ExistentialSpecializer which
2525
// enables generic specialization recursively in a call chain, we're able to
26-
// specialize line 89 for `InsertionSort` on integers.
26+
// specialize line 90 for `InsertionSort` on integers.
2727

2828
import TestsUtils
29+
import Foundation
2930

3031
public let BucketSort = BenchmarkInfo(
3132
name: "BucketSort",
@@ -116,8 +117,7 @@ let items: [Int] = {
116117
let buckets: [Bucket<Int>] = {
117118
let bucketCount = 10
118119
let maxValue = items.max()!.convertToInt()
119-
let maxCapacity = Int(
120-
(Double(maxValue + 1) / Double(bucketCount)).rounded(.up))
120+
let maxCapacity = Int(ceil(Double(maxValue + 1) / Double(bucketCount)))
121121
return (0..<bucketCount).map { _ in Bucket<Int>(capacity: maxCapacity) }
122122
}()
123123

branches/rxwei-patch-1/benchmark/single-source/ByteSwap.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
// This test checks performance of Swift byte swap.
1414
// rdar://problem/22151907
1515

16+
import Foundation
1617
import TestsUtils
1718

1819
public let ByteSwap = BenchmarkInfo(

branches/rxwei-patch-1/benchmark/single-source/CString.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
import TestsUtils
1414
#if os(Linux)
1515
import Glibc
16-
#elseif os(Windows)
17-
import MSVCRT
1816
#else
1917
import Darwin
2018
#endif

branches/rxwei-patch-1/benchmark/single-source/Calculator.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
import TestsUtils
14+
import Foundation
1415

1516
public let Calculator = BenchmarkInfo(
1617
name: "Calculator",
@@ -52,3 +53,4 @@ public func run_Calculator(_ N: Int) {
5253
}
5354
CheckResults(c == 0)
5455
}
56+

0 commit comments

Comments
 (0)