Skip to content

Commit bae0543

Browse files
author
Raj Barik
committed
---
yaml --- r: 274911 b: refs/heads/master c: 6d9f532 h: refs/heads/master i: 274909: ec413fb 274907: 9aa7e3b 274903: 438575a 274895: f1e51a2 274879: 3ae15bf
1 parent a49ed93 commit bae0543

File tree

553 files changed

+8560
-15856
lines changed

Some content is hidden

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

553 files changed

+8560
-15856
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 8732287cab3e5e437241db4453a91d5c1287f5cc
2+
refs/heads/master: 6d9f5327bf1ff4a49dfb3d2b93b431c255771e72
33
refs/heads/master-next: 75552d2b66023907022c17dfd899aae8b198add5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/CHANGELOG.md

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

2222
</details>
2323

24-
Swift 5.1
25-
---------
26-
27-
* Key path expressions can now include references to tuple elements.
28-
2924
Swift 5.0
3025
---------
3126

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-
5127
* Swift 3 mode has been removed. Supported values for the `-swift-version`
5228
flag are `4`, `4.2`, and `5`.
5329

@@ -7430,7 +7406,6 @@ Swift 1.0
74307406
[SE-0227]: <https://github.com/apple/swift-evolution/blob/master/proposals/0227-identity-keypath.md>
74317407
[SE-0228]: <https://github.com/apple/swift-evolution/blob/master/proposals/0228-fix-expressiblebystringinterpolation.md>
74327408
[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>
74347409

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

trunk/CMakeLists.txt

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -413,24 +413,13 @@ 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()
425416
else()
426417
set(SWIFT_BUILD_SYNTAXPARSERLIB_default FALSE)
427418
set(SWIFT_BUILD_SOURCEKIT_default FALSE)
428419
endif()
429420
option(SWIFT_BUILD_SYNTAXPARSERLIB
430421
"Build the Swift Syntax Parser library"
431422
${SWIFT_BUILD_SYNTAXPARSERLIB_default})
432-
option(SWIFT_BUILD_ONLY_SYNTAXPARSERLIB
433-
"Only build the Swift Syntax Parser library" FALSE)
434423
option(SWIFT_BUILD_SOURCEKIT
435424
"Build SourceKit"
436425
${SWIFT_BUILD_SOURCEKIT_default})
@@ -507,11 +496,15 @@ include(SwiftSharedCMakeConfig)
507496
# Support building Swift as a standalone project, using LLVM as an
508497
# external library.
509498
if(SWIFT_BUILT_STANDALONE)
510-
swift_common_standalone_build_config(SWIFT)
499+
swift_common_standalone_build_config(SWIFT SWIFT_CROSS_COMPILING)
511500
else()
512501
swift_common_unified_build_config(SWIFT)
513502
endif()
514503

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+
515508
set(SWIFT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
516509
set(SWIFT_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}")
517510
set(SWIFT_CMAKE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
@@ -909,18 +902,8 @@ if(SWIFT_NEED_EXPLICIT_LIBDISPATCH)
909902
set(SWIFT_LIBDISPATCH_C_COMPILER ${CMAKE_C_COMPILER})
910903
set(SWIFT_LIBDISPATCH_CXX_COMPILER ${CMAKE_CXX_COMPILER})
911904
elseif(${CMAKE_SYSTEM_NAME} STREQUAL ${CMAKE_HOST_SYSTEM_NAME})
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()
905+
set(SWIFT_LIBDISPATCH_C_COMPILER ${PATH_TO_CLANG_BUILD}/bin/clang)
906+
set(SWIFT_LIBDISPATCH_CXX_COMPILER ${PATH_TO_CLANG_BUILD}/bin/clang++)
924907
else()
925908
message(SEND_ERROR "libdispatch requires a newer clang compiler (${CMAKE_C_COMPILER_VERSION} < 3.9)")
926909
endif()

trunk/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
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-
|**[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)|
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)|
2423
|**[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)|
2524
|**[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)|
2625
|**[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)|

trunk/benchmark/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ set(SWIFT_BENCH_MODULES
7777
single-source/DictionaryRemove
7878
single-source/DictionarySubscriptDefault
7979
single-source/DictionarySwap
80+
single-source/DoubleWidthDivision
8081
single-source/DropFirst
8182
single-source/DropLast
8283
single-source/DropWhile

trunk/benchmark/single-source/ArrayInClass.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,11 @@ public let ArrayInClass = [
1717
runFunction: run_ArrayInClass,
1818
tags: [.validation, .api, .Array],
1919
setUpFunction: { ac = ArrayContainer() },
20-
tearDownFunction: { ac = nil },
21-
legacyFactor: 5),
20+
tearDownFunction: { ac = nil }),
2221
BenchmarkInfo(name: "DistinctClassFieldAccesses",
2322
runFunction: run_DistinctClassFieldAccesses,
24-
tags: [.validation, .api, .Array],
25-
setUpFunction: { workload = ClassWithArrs(N: 10_000) },
23+
tags: [.unstable, .api, .Array],
24+
setUpFunction: { workload = ClassWithArrs(N: 100_000) },
2625
tearDownFunction: { workload = nil }),
2726
]
2827

@@ -32,7 +31,7 @@ class ArrayContainer {
3231
final var arr : [Int]
3332

3433
init() {
35-
arr = [Int] (repeating: 0, count: 20_000)
34+
arr = [Int] (repeating: 0, count: 100_000)
3635
}
3736

3837
func runLoop(_ N: Int) {

trunk/benchmark/single-source/DictionaryOfAnyHashableStrings.swift

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,18 @@ public var DictionaryOfAnyHashableStrings = [
2121
name: "DictionaryOfAnyHashableStrings_insert",
2222
runFunction: run_DictionaryOfAnyHashableStrings_insert,
2323
tags: [.abstraction, .runtime, .cpubench],
24-
setUpFunction: { keys = buildKeys(50) },
25-
legacyFactor: 14
24+
setUpFunction: {
25+
keys = buildKeys(500)
26+
}
2627
),
2728
BenchmarkInfo(
2829
name: "DictionaryOfAnyHashableStrings_lookup",
2930
runFunction: run_DictionaryOfAnyHashableStrings_lookup,
3031
tags: [.abstraction, .runtime, .cpubench],
31-
setUpFunction: { keys = buildKeys(50); workload = buildWorkload() },
32-
legacyFactor: 24
32+
setUpFunction: {
33+
keys = buildKeys(500)
34+
workload = buildWorkload()
35+
}
3336
),
3437
]
3538

@@ -62,7 +65,7 @@ func buildWorkload() -> [AnyHashable: Any] {
6265
@inline(never)
6366
public func run_DictionaryOfAnyHashableStrings_insert(_ n: Int) {
6467
precondition(keys.count > 0)
65-
for _ in 1...n {
68+
for _ in 0 ... n {
6669
blackHole(buildWorkload())
6770
}
6871
}
@@ -71,7 +74,7 @@ public func run_DictionaryOfAnyHashableStrings_insert(_ n: Int) {
7174
public func run_DictionaryOfAnyHashableStrings_lookup(_ n: Int) {
7275
precondition(workload.count > 0)
7376
precondition(keys.count > 0)
74-
for _ in 1...n {
77+
for _ in 0 ... n {
7578
for i in 0 ..< keys.count {
7679
let key = keys[i]
7780
CheckResults((workload[key] as! Int) == i)
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
//===--- DoubleWidthDivision.swift ----------------------------------------===//
2+
//
3+
// This source file is part of the Swift.org open source project
4+
//
5+
// Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors
6+
// Licensed under Apache License v2.0 with Runtime Library Exception
7+
//
8+
// See https://swift.org/LICENSE.txt for license information
9+
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10+
//
11+
//===----------------------------------------------------------------------===//
12+
13+
// This test checks performance of division using DoubleWidth.
14+
15+
// FIXME: This needs to be disabled with an #if because it runs into pathological
16+
// compile time and code size problems.
17+
// [SR-6947] DoubleWidth compile time.
18+
// import Foundation
19+
import TestsUtils
20+
21+
public let DoubleWidthDivision = BenchmarkInfo(
22+
name: "DoubleWidthDivision",
23+
runFunction: disabled,
24+
tags: [.validation, .algorithm]
25+
)
26+
public func disabled(_ N: Int) {}
27+
28+
#if false
29+
30+
private typealias Int128 = DoubleWidth<Int64>
31+
private typealias Int256 = DoubleWidth<Int128>
32+
private typealias Int512 = DoubleWidth<Int256>
33+
private typealias Int1024 = DoubleWidth<Int512>
34+
35+
@inline(never)
36+
public func run_DoubleWidthDivision(_ N: Int) {
37+
var sum = 0
38+
for _ in 1...5*N {
39+
let (q, r) =
40+
(Int128(Int64.max) * 16)
41+
.quotientAndRemainder(dividingBy: numericCast(getInt(16)))
42+
sum += Int(q * r)
43+
44+
let (q1, r1) =
45+
(40 as Int128).dividingFullWidth(
46+
(high: numericCast(getInt(0)), low: numericCast(getInt(240))))
47+
sum += Int(q1 * r1)
48+
49+
let x =
50+
DoubleWidth<DoubleWidth<DoubleWidth<Int8>>>(
51+
Int64.max / numericCast(getInt(4)))
52+
let y = DoubleWidth<DoubleWidth<Int8>>(Int32.max)
53+
let (q2, r2) = y.dividingFullWidth((x.high, x.low))
54+
sum += Int(q2 - r2)
55+
56+
let xx = Int1024(x)
57+
let yy = Int512(y)
58+
let (q3, r3) = yy.dividingFullWidth((xx.high, xx.low))
59+
sum -= Int(q3 - r3)
60+
}
61+
CheckResults(sum == 0)
62+
}
63+
#endif

0 commit comments

Comments
 (0)