Skip to content

Commit 7b009ec

Browse files
author
Greg Parker
committed
Merge remote-tracking branch 'origin/master' into master-next
2 parents aff8d06 + 5d8fa8f commit 7b009ec

File tree

629 files changed

+21495
-10880
lines changed

Some content is hidden

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

629 files changed

+21495
-10880
lines changed

.dir-locals.el

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
((x (dir-locals-find-file default-directory))
77
(this-directory (if (listp x) (car x) (file-name-directory x))))
88
(unless (or (featurep 'swift-project-settings)
9-
(tramp-tramp-file-p this-directory))
9+
(and (fboundp 'tramp-tramp-file-p)
10+
(tramp-tramp-file-p this-directory)))
1011
(add-to-list 'load-path
1112
(concat this-directory "utils")
1213
:append)

CODE_OWNERS.TXT

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ N: Erik Eckstein
1515
E: eeckstein@apple.com
1616
D: SILOptimizer
1717

18-
N: David Farler
19-
E: dfarler@apple.com
20-
D: Markup, lib/Syntax, Swift Linux port
18+
N: Xi Ge
19+
E: xi_ge@apple.com
20+
D: Markup, Migrator, lib/Syntax
2121

2222
N: Doug Gregor
2323
E: dgregor@apple.com

apinotes/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ set(SWIFT_API_NOTES_INPUTS
3030
MediaPlayer
3131
MessageUI
3232
Metal
33+
ModelIO
3334
MultipeerConnectivity
3435
NetworkExtension
3536
NotificationCenter
@@ -39,6 +40,7 @@ set(SWIFT_API_NOTES_INPUTS
3940
QuickLook
4041
SafariServices
4142
SceneKit
43+
ScreenSaver
4244
ScriptingBridge
4345
SpriteKit
4446
StoreKit

apinotes/ModelIO.apinotes

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
Name: ModelIO
3+
Classes:
4+
- Name: MDLAnimatedScalar
5+
Methods:
6+
- Selector: 'floatAtTime:'
7+
MethodKind: Instance
8+
SwiftName: 'floatValue(atTime:)'
9+
- Selector: 'doubleAtTime:'
10+
MethodKind: Instance
11+
SwiftName: 'doubleValue(atTime:)'
12+
- Name: MDLAnimatedVector2
13+
Methods:
14+
- Selector: 'float2AtTime:'
15+
MethodKind: Instance
16+
SwiftName: 'float2Value(atTime:)'
17+
- Selector: 'double2AtTime:'
18+
MethodKind: Instance
19+
SwiftName: 'double2Value(atTime:)'
20+
- Name: MDLAnimatedVector3
21+
Methods:
22+
- Selector: 'float3AtTime:'
23+
MethodKind: Instance
24+
SwiftName: 'float3Value(atTime:)'
25+
- Selector: 'double3AtTime:'
26+
MethodKind: Instance
27+
SwiftName: 'double3Value(atTime:)'
28+
- Name: MDLAnimatedVector4
29+
Methods:
30+
- Selector: 'float4AtTime:'
31+
MethodKind: Instance
32+
SwiftName: 'float4Value(atTime:)'
33+
- Selector: 'double4AtTime:'
34+
MethodKind: Instance
35+
SwiftName: 'double4Value(atTime:)'
36+
- Name: MDLAnimatedMatrix4x4
37+
Methods:
38+
- Selector: 'float4x4AtTime:'
39+
MethodKind: Instance
40+
SwiftName: 'float4x4Value(atTime:)'
41+
- Selector: 'double4x4AtTime:'
42+
MethodKind: Instance
43+
SwiftName: 'double4x4Value(atTime:)'

apinotes/ScreenSaver.apinotes

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
Name: ScreenSaver
3+
SwiftVersions:
4+
- Version: 3
5+
Classes:
6+
- Name: ScreenSaverView
7+
Properties:
8+
- Name: hasConfigureSheet
9+
PropertyKind: Instance
10+
SwiftImportAsAccessors: true
11+
- Name: configureSheet
12+
PropertyKind: Instance
13+
SwiftImportAsAccessors: true

benchmark/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ set(SWIFT_BENCH_MODULES
5050
single-source/ErrorHandling
5151
single-source/ExistentialPerformance
5252
single-source/Fibonacci
53-
single-source/GlobalClass
5453
single-source/Hanoi
5554
single-source/Hash
5655
single-source/HashQuadratic

benchmark/scripts/Benchmark_Driver

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,13 @@ def get_tests(driver_path, args):
124124
if args.benchmarks or args.filters:
125125
driver.append('--run-all')
126126
tests = subprocess.check_output(driver).split()[2:]
127-
tests.extend(map(str, range(1, len(tests) + 1))) # ordinal numbers
128127
if args.filters:
129128
regexes = [re.compile(pattern) for pattern in args.filters]
130129
return sorted(list(set([name for pattern in regexes
131130
for name in tests if pattern.match(name)])))
132131
if not args.benchmarks:
133132
return tests
133+
tests.extend(map(str, range(1, len(tests) + 1))) # ordinal numbers
134134
return sorted(list(set(tests).intersection(set(args.benchmarks))))
135135

136136

benchmark/single-source/BitCount.swift

+6-4
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@ func countBitSet(_ num: Int) -> Int {
3131

3232
@inline(never)
3333
public func run_BitCount(_ N: Int) {
34-
for _ in 1...100*N {
34+
var sum = 0
35+
for _ in 1...1000*N {
3536
// Check some results.
36-
CheckResults(countBitSet(1) == 1)
37-
CheckResults(countBitSet(2) == 1)
38-
CheckResults(countBitSet(2457) == 6)
37+
sum = sum &+ countBitSet(getInt(1))
38+
&+ countBitSet(getInt(2))
39+
&+ countBitSet(getInt(2457))
3940
}
41+
CheckResults(sum == 8 * 1000 * N)
4042
}

benchmark/single-source/ByteSwap.swift

+9-4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import Foundation
1717
import TestsUtils
1818

1919
// a naive O(n) implementation of byteswap.
20+
@inline(never)
2021
func byteswap_n(_ a: UInt64) -> UInt64 {
2122
#if swift(>=4)
2223
return ((a & 0x00000000000000FF) &<< 56) |
@@ -40,6 +41,7 @@ func byteswap_n(_ a: UInt64) -> UInt64 {
4041
}
4142

4243
// a O(logn) implementation of byteswap.
44+
@inline(never)
4345
func byteswap_logn(_ a: UInt64) -> UInt64 {
4446
var a = a
4547
a = (a & 0x00000000FFFFFFFF) << 32 | (a & 0xFFFFFFFF00000000) >> 32
@@ -50,10 +52,13 @@ func byteswap_logn(_ a: UInt64) -> UInt64 {
5052

5153
@inline(never)
5254
public func run_ByteSwap(_ N: Int) {
53-
for _ in 1...100*N {
55+
var s: UInt64 = 0
56+
for _ in 1...10000*N {
5457
// Check some results.
55-
CheckResults(byteswap_logn(byteswap_n(2457)) == 2457)
56-
CheckResults(byteswap_logn(byteswap_n(9129)) == 9129)
57-
CheckResults(byteswap_logn(byteswap_n(3333)) == 3333)
58+
let x : UInt64 = UInt64(getInt(0))
59+
s = s &+ byteswap_logn(byteswap_n(x &+ 2457))
60+
&+ byteswap_logn(byteswap_n(x &+ 9129))
61+
&+ byteswap_logn(byteswap_n(x &+ 3333))
5862
}
63+
CheckResults(s == (2457 &+ 9129 &+ 3333) &* 10000 &* N)
5964
}

benchmark/single-source/DictionaryGroup.swift

+9-5
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,16 @@
1212

1313
import TestsUtils
1414

15+
let count = 10_000
16+
let result = count / 10
17+
1518
@inline(never)
1619
public func run_DictionaryGroup(_ N: Int) {
17-
let count = 100 * N
18-
let result = count / 10
20+
for _ in 1...N {
1921
let dict = Dictionary(grouping: 0..<count, by: { $0 % 10 })
2022
CheckResults(dict.count == 10)
2123
CheckResults(dict[0]!.count == result)
24+
}
2225
}
2326

2427
class Box<T : Hashable> : Hashable {
@@ -39,9 +42,10 @@ class Box<T : Hashable> : Hashable {
3942

4043
@inline(never)
4144
public func run_DictionaryGroupOfObjects(_ N: Int) {
42-
let count = 20 * N
43-
let result = count / 10
44-
let dict = Dictionary(grouping: (0..<count).map { Box($0) }, by: { Box($0.value % 10) })
45+
let objects = (0..<count).map { Box($0) }
46+
for _ in 1...N {
47+
let dict = Dictionary(grouping: objects, by: { Box($0.value % 10) })
4548
CheckResults(dict.count == 10)
4649
CheckResults(dict[Box(0)]!.count == result)
50+
}
4751
}

benchmark/single-source/GlobalClass.swift

-33
This file was deleted.

benchmark/single-source/StringBuilder.swift

+12-12
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
import TestsUtils
1414

1515
@inline(never)
16-
func buildString() -> String {
17-
var sb = "a"
16+
func buildString(_ i: String) -> String {
17+
var sb = i
1818
for str in ["b","c","d","pizza"] {
1919
sb += str
2020
}
@@ -24,26 +24,26 @@ func buildString() -> String {
2424
@inline(never)
2525
public func run_StringBuilder(_ N: Int) {
2626
for _ in 1...5000*N {
27-
_ = buildString()
27+
_ = buildString(getString("a"))
2828
}
2929
}
3030

3131
@inline(never)
32-
func addString() -> String {
33-
let s = "a" + "b" + "c" + "d" + "pizza"
32+
func addString(_ i: String) -> String {
33+
let s = i + "b" + "c" + "d" + "pizza"
3434
return s
3535
}
3636

3737
@inline(never)
3838
public func run_StringAdder(_ N: Int) {
3939
for _ in 1...5000*N {
40-
_ = addString()
40+
_ = addString(getString("a"))
4141
}
4242
}
4343

4444
@inline(never)
45-
func buildStringUTF16() -> String {
46-
var sb = "a"
45+
func buildStringUTF16(_ i: String) -> String {
46+
var sb = i
4747
for str in ["🎉","c","d","pizza"] {
4848
sb += str
4949
}
@@ -53,14 +53,14 @@ func buildStringUTF16() -> String {
5353
@inline(never)
5454
public func run_StringUTF16Builder(_ N: Int) {
5555
for _ in 1...5000*N {
56-
_ = buildStringUTF16()
56+
_ = buildStringUTF16("a")
5757
}
5858
}
5959

6060

6161
@inline(never)
62-
func buildStringLong() -> String {
63-
var sb = "👻"
62+
func buildStringLong(_ i: String) -> String {
63+
var sb = i
6464
let long = "Swift is a multi-paradigm, compiled programming language created for iOS, OS X, watchOS, tvOS and Linux development by Apple Inc. Swift is designed to work with Apple's Cocoa and Cocoa Touch frameworks and the large body of existing Objective-C code written for Apple products. Swift is intended to be more resilient to erroneous code (\"safer\") than Objective-C and also more concise. It is built with the LLVM compiler framework included in Xcode 6 and later and uses the Objective-C runtime, which allows C, Objective-C, C++ and Swift code to run within a single program."
6565
sb += long
6666
return sb
@@ -71,7 +71,7 @@ func buildStringLong() -> String {
7171
@inline(never)
7272
public func run_StringBuilderLong(_ N: Int) {
7373
for _ in 1...5000*N {
74-
_ = buildStringLong()
74+
_ = buildStringLong("👻")
7575
}
7676
}
7777

0 commit comments

Comments
 (0)