Skip to content

Commit 39dc72e

Browse files
committed
---
yaml --- r: 341967 b: refs/heads/rxwei-patch-1 c: 731ec39 h: refs/heads/master i: 341965: 920a23f 341963: f303441 341959: ec2c2c4 341951: 4c2deab
1 parent 6ff2837 commit 39dc72e

File tree

214 files changed

+2862
-5156
lines changed

Some content is hidden

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

214 files changed

+2862
-5156
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: 6d73ed368ebb1f1abe616c437dae1a9864d44aed
1018+
refs/heads/rxwei-patch-1: 731ec39c2436afeadb0d5045adcd39fc74224dea
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/benchmark/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ set(SWIFT_BENCH_MODULES
7979
single-source/DictionarySubscriptDefault
8080
single-source/DictionarySwap
8181
single-source/Diffing
82-
single-source/DiffingMyers
8382
single-source/DropFirst
8483
single-source/DropLast
8584
single-source/DropWhile
@@ -106,6 +105,7 @@ set(SWIFT_BENCH_MODULES
106105
single-source/Memset
107106
single-source/MonteCarloE
108107
single-source/MonteCarloPi
108+
single-source/Myers
109109
single-source/NSDictionaryCastToSwift
110110
single-source/NSError
111111
single-source/NSStringConversion

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

Lines changed: 81 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,55 +15,111 @@ import TestsUtils
1515
let t: [BenchmarkCategory] = [.api]
1616
public let Diffing = [
1717
BenchmarkInfo(
18-
name: "Diffing.Same",
19-
runFunction: { diff($0, from: longPangram, to: longPangram) },
18+
name: "DiffSame",
19+
runFunction: run_DiffSame,
2020
tags: t,
21-
setUpFunction: { blackHole(longPangram) }),
21+
legacyFactor: 10),
2222
BenchmarkInfo(
23-
name: "Diffing.PangramToAlphabet",
24-
runFunction: { diff($0, from: longPangram, to: alphabets) },
23+
name: "DiffPangramToAlphabet",
24+
runFunction: run_DiffPangramToAlphabet,
2525
tags: t,
26-
setUpFunction: { blackHole((longPangram, alphabets)) }),
26+
legacyFactor: 10),
2727
BenchmarkInfo(
28-
name: "Diffing.Pangrams",
29-
runFunction: { diff($0, from:typingPangram, to: longPangram) },
28+
name: "DiffPangrams",
29+
runFunction: run_DiffPangrams,
3030
tags: t,
31-
setUpFunction: { blackHole((longPangram, typingPangram)) }),
31+
legacyFactor: 10),
3232
BenchmarkInfo(
33-
name: "Diffing.ReversedAlphabets",
34-
runFunction: { diff($0, from:alphabets, to: alphabetsReversed) },
33+
name: "DiffReversedAlphabets",
34+
runFunction: run_DiffReversedAlphabets,
3535
tags: t,
36-
setUpFunction: { blackHole((alphabets, alphabetsReversed)) }),
36+
legacyFactor: 10),
3737
BenchmarkInfo(
38-
name: "Diffing.ReversedLorem",
39-
runFunction: { diff($0, from: loremIpsum, to: loremReversed) },
38+
name: "DiffReversedLorem",
39+
runFunction: run_DiffReversedLorem,
4040
tags: t,
41-
setUpFunction: { blackHole((loremIpsum, loremReversed)) }),
41+
legacyFactor: 10),
4242
BenchmarkInfo(
43-
name: "Diffing.Disparate",
44-
runFunction: { diff($0, from: numbersAndSymbols, to: alphabets) },
43+
name: "DiffDisparate",
44+
runFunction: run_DiffDisparate,
4545
tags: t,
46-
setUpFunction: { blackHole((numbersAndSymbols, alphabets)) }),
46+
legacyFactor: 10),
4747
BenchmarkInfo(
48-
name: "Diffing.Similar",
49-
runFunction: { diff($0, from: unabridgedLorem, to: loremIpsum) },
48+
name: "DiffSimilar",
49+
runFunction: run_DiffSimilar,
5050
tags: t,
51-
setUpFunction: { blackHole((unabridgedLorem, loremIpsum)) }),
51+
legacyFactor: 10),
5252
]
5353

5454
let numbersAndSymbols = Array("0123456789`~!@#$%^&*()+=_-\"'?/<,>.\\{}'")
5555
let alphabets = Array("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
56-
let alphabetsReversed = Array(alphabets.reversed())
56+
let alphabetsReversed = Array("ZYXWVUTSRQPONMLKJIHGFEDCBAzyxwvutsrqponmlkjihgfedcba")
5757
let longPangram = Array("This pangram contains four As, one B, two Cs, one D, thirty Es, six Fs, five Gs, seven Hs, eleven Is, one J, one K, two Ls, two Ms, eighteen Ns, fifteen Os, two Ps, one Q, five Rs, twenty-seven Ss, eighteen Ts, two Us, seven Vs, eight Ws, two Xs, three Ys, & one Z")
5858
let typingPangram = Array("The quick brown fox jumps over the lazy dog")
5959
let loremIpsum = Array("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.")
6060
let unabridgedLorem = Array("Lorem ipsum, quia dolor sit amet consectetur adipisci[ng] velit, sed quia non-numquam [do] eius modi tempora inci[di]dunt, ut labore et dolore magnam aliqua.")
61-
let loremReversed = Array(loremIpsum.reversed())
61+
let loremReverse = Array(".auqila angam erolod te erobal tu tnudidicni ropmet domsuie od des ,tile gnicsipida rutetcesnoc ,tema tis rolod muspi meroL")
6262

63-
@inline(never) func diff(_ N: Int, from older: [Character], to newer: [Character]) {
63+
64+
@inline(never)
65+
public func run_DiffSame(_ N: Int) {
66+
if #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) {
67+
for _ in 1...N {
68+
let _ = longPangram.difference(from: longPangram)
69+
}
70+
}
71+
}
72+
73+
@inline(never)
74+
public func run_DiffPangramToAlphabet(_ N: Int) {
75+
if #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) {
76+
for _ in 1...N {
77+
let _ = longPangram.difference(from: alphabets)
78+
}
79+
}
80+
}
81+
82+
@inline(never)
83+
public func run_DiffPangrams(_ N: Int) {
84+
if #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) {
85+
for _ in 1...N {
86+
let _ = longPangram.difference(from: typingPangram)
87+
}
88+
}
89+
}
90+
91+
@inline(never)
92+
public func run_DiffReversedAlphabets(_ N: Int) {
93+
if #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) {
94+
for _ in 1...N {
95+
let _ = alphabets.difference(from: alphabetsReversed)
96+
}
97+
}
98+
}
99+
100+
@inline(never)
101+
public func run_DiffReversedLorem(_ N: Int) {
102+
if #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) {
103+
for _ in 1...N {
104+
let _ = loremIpsum.difference(from: loremReverse)
105+
}
106+
}
107+
}
108+
109+
@inline(never)
110+
public func run_DiffDisparate(_ N: Int) {
111+
if #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) {
112+
for _ in 1...N {
113+
let _ = alphabets.difference(from: numbersAndSymbols)
114+
}
115+
}
116+
}
117+
118+
@inline(never)
119+
public func run_DiffSimilar(_ N: Int) {
64120
if #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) {
65121
for _ in 1...N {
66-
blackHole(newer.difference(from: older))
122+
let _ = loremIpsum.difference(from: unabridgedLorem)
67123
}
68124
}
69125
}

branches/rxwei-patch-1/benchmark/single-source/DiffingMyers.swift renamed to branches/rxwei-patch-1/benchmark/single-source/Myers.swift

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===--- DiffingMyers.swift -----------------------------------------------===//
1+
//===--- Myers.swift -------------------------------------------===//
22
//
33
// This source file is part of the Swift.org open source project
44
//
@@ -12,25 +12,18 @@
1212

1313
import TestsUtils
1414

15-
// The DiffingMyers test benchmarks Swift's performance running the algorithm
16-
// described in Myers (1986). The Diffing benchmark tracks the performance
17-
// of `Collection.difference(from:to:)`.
15+
public let Myers = [
16+
BenchmarkInfo(name: "Myers", runFunction: run_Myers, tags: [.algorithm]),
17+
]
1818

19-
public let DiffingMyers = BenchmarkInfo(
20-
name: "Diffing.Myers.Similar",
21-
runFunction: run_Myers,
22-
tags: [.algorithm],
23-
setUpFunction: { blackHole((loremIpsum, unabridgedLorem)) })
24-
25-
26-
let loremIpsum = Array("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.")
27-
let unabridgedLorem = Array("Lorem ipsum, quia dolor sit amet consectetur adipisci[ng] velit, sed quia non-numquam [do] eius modi tempora inci[di]dunt, ut labore et dolore magnam aliqua.")
19+
let loremShort = Array("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.")
20+
let loremLong = Array("Sed ut perspiciatis, unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam eaque ipsa, quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt, explicabo. Nemo enim ipsam voluptatem, quia voluptas sit, aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos, qui ratione voluptatem sequi nesciunt, neque porro quisquam est, qui dolorem ipsum, quia dolor sit amet consectetur adipisci[ng] velit, sed quia non-numquam [do] eius modi tempora inci[di]dunt, ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum[d] exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit, qui in ea voluptate velit esse, quam nihil molestiae consequatur, vel illum, qui dolorem eum fugiat, quo voluptas nulla pariatur?")
2821

2922
@inline(never)
3023
public func run_Myers(N: Int) {
3124
if #available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) {
3225
for _ in 1...N {
33-
blackHole(myers(from: unabridgedLorem, to: loremIpsum, using: ==))
26+
let _ = myers(from: loremShort, to: loremLong, using: ==)
3427
}
3528
}
3629
}
@@ -200,4 +193,4 @@ fileprivate func myers<C,D>(
200193
return CollectionDifference(_formChanges(from: a, to: b, using:_descent(from: a, to: b)))!
201194
}
202195
}
203-
}
196+
}

branches/rxwei-patch-1/benchmark/utils/main.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ import DictionaryRemove
6767
import DictionarySubscriptDefault
6868
import DictionarySwap
6969
import Diffing
70-
import DiffingMyers
7170
import DropFirst
7271
import DropLast
7372
import DropWhile
@@ -94,6 +93,7 @@ import MapReduce
9493
import Memset
9594
import MonteCarloE
9695
import MonteCarloPi
96+
import Myers
9797
import NibbleSort
9898
import NIOChannelPipeline
9999
import NSDictionaryCastToSwift
@@ -243,7 +243,6 @@ registerBenchmark(DictionaryRemove)
243243
registerBenchmark(DictionarySubscriptDefault)
244244
registerBenchmark(DictionarySwap)
245245
registerBenchmark(Diffing)
246-
registerBenchmark(DiffingMyers)
247246
registerBenchmark(DropFirst)
248247
registerBenchmark(DropLast)
249248
registerBenchmark(DropWhile)
@@ -271,6 +270,7 @@ registerBenchmark(MapReduce)
271270
registerBenchmark(Memset)
272271
registerBenchmark(MonteCarloE)
273272
registerBenchmark(MonteCarloPi)
273+
registerBenchmark(Myers)
274274
registerBenchmark(NSDictionaryCastToSwift)
275275
registerBenchmark(NSErrorTest)
276276
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)

branches/rxwei-patch-1/cmake/modules/AddSwift.cmake

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1512,9 +1512,10 @@ function(add_swift_host_library name)
15121512

15131513
if(NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
15141514
swift_install_in_component(TARGETS ${name}
1515-
ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT dev
1516-
LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT dev
1517-
RUNTIME DESTINATION bin COMPONENT dev)
1515+
ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
1516+
LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
1517+
RUNTIME DESTINATION bin
1518+
COMPONENT dev)
15181519
endif()
15191520

15201521
swift_is_installing_component(dev is_installing)
@@ -2138,15 +2139,10 @@ function(add_swift_target_library name)
21382139

21392140
if(sdk STREQUAL WINDOWS AND CMAKE_SYSTEM_NAME STREQUAL Windows)
21402141
swift_install_in_component(TARGETS ${name}-windows-${SWIFT_PRIMARY_VARIANT_ARCH}
2141-
RUNTIME
2142-
DESTINATION "bin"
2143-
COMPONENT "${SWIFTLIB_INSTALL_IN_COMPONENT}"
2144-
LIBRARY
2145-
DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/${resource_dir}/${resource_dir_sdk_subdir}/${SWIFT_PRIMARY_VARIANT_ARCH}"
2146-
COMPONENT "${SWIFTLIB_INSTALL_IN_COMPONENT}"
2147-
ARCHIVE
2148-
DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/${resource_dir}/${resource_dir_sdk_subdir}/${SWIFT_PRIMARY_VARIANT_ARCH}"
2149-
COMPONENT "${SWIFTLIB_INSTALL_IN_COMPONENT}"
2142+
RUNTIME DESTINATION "bin"
2143+
LIBRARY DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/${resource_dir}/${resource_dir_sdk_subdir}/${SWIFT_PRIMARY_VARIANT_ARCH}"
2144+
ARCHIVE DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/${resource_dir}/${resource_dir_sdk_subdir}/${SWIFT_PRIMARY_VARIANT_ARCH}"
2145+
COMPONENT "${SWIFTLIB_INSTALL_IN_COMPONENT}"
21502146
PERMISSIONS ${file_permissions})
21512147
else()
21522148
swift_install_in_component(FILES "${UNIVERSAL_LIBRARY_NAME}"
@@ -2427,9 +2423,8 @@ function(add_swift_host_tool executable)
24272423
${ASHT_UNPARSED_ARGUMENTS})
24282424

24292425
swift_install_in_component(TARGETS ${executable}
2430-
RUNTIME
2431-
DESTINATION bin
2432-
COMPONENT ${ASHT_SWIFT_COMPONENT})
2426+
RUNTIME DESTINATION bin
2427+
COMPONENT ${ASHT_SWIFT_COMPONENT})
24332428

24342429
swift_is_installing_component(${ASHT_SWIFT_COMPONENT} is_installing)
24352430

branches/rxwei-patch-1/include/swift/AST/ASTTypeIDZone.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
//===----------------------------------------------------------------------===//
1717
SWIFT_TYPEID_NAMED(NominalTypeDecl *, NominalTypeDecl)
1818
SWIFT_TYPEID_NAMED(VarDecl *, VarDecl)
19-
SWIFT_TYPEID_NAMED(Decl *, Decl)
2019
SWIFT_TYPEID(Type)
2120
SWIFT_TYPEID(PropertyWrapperBackingPropertyInfo)
2221
SWIFT_TYPEID(PropertyWrapperTypeInfo)

branches/rxwei-patch-1/include/swift/AST/Builtins.def

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -314,11 +314,6 @@ BUILTIN_SIL_OPERATION(BeginUnpairedModifyAccess, "beginUnpairedModifyAccess",
314314
/// be a pointer to an UnsafeValueBuffer that records an in progress access.
315315
BUILTIN_SIL_OPERATION(EndUnpairedAccess, "endUnpairedAccess", Special)
316316

317-
/// condfail(Int1) -> ()
318-
/// Triggers a runtime failure if the condition is true.
319-
/// This builtin is deprecated. Use condfail_message instead.
320-
BUILTIN_SIL_OPERATION(LegacyCondFail, "condfail", Special)
321-
322317
/// fixLifetime(T) -> ()
323318
/// Fixes the lifetime of any heap references in a value.
324319
BUILTIN_SIL_OPERATION(FixLifetime, "fixLifetime", Special)
@@ -405,9 +400,9 @@ BUILTIN_RUNTIME_CALL(IsOptionalType, "isOptional", "")
405400
BUILTIN(Id, Name, Attrs)
406401
#endif
407402

408-
/// condfail_message(Int1, RawPointer) -> ()
403+
/// condfail(Int1, RawPointer) -> ()
409404
/// Triggers a runtime failure if the condition is true.
410-
BUILTIN_MISC_OPERATION(CondFailMessage, "condfail_message", "", Special)
405+
BUILTIN_MISC_OPERATION(CondFail, "condfail", "", Special)
411406

412407
/// Sizeof has type T.Type -> Int
413408
BUILTIN_MISC_OPERATION(Sizeof, "sizeof", "n", Special)

0 commit comments

Comments
 (0)