Skip to content

Commit e4056d7

Browse files
authored
---
yaml --- r: 341325 b: refs/heads/rxwei-patch-1 c: 9ee0a29 h: refs/heads/master i: 341323: f397956
1 parent cff5905 commit e4056d7

24 files changed

+42
-31
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: d4a7e5e582984c7b4586c769f63fb5eb6df07aa1
1018+
refs/heads/rxwei-patch-1: 9ee0a293b7781ff869d1cf6f6cb7576ce49f9314
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/benchmark/single-source/AngryPhonebook.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
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
1716

1817
public let AngryPhonebook = BenchmarkInfo(
1918
name: "AngryPhonebook",

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

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

16-
import Foundation
1716
import TestsUtils
1817

1918
#if swift(>=4.2)
@@ -110,7 +109,7 @@ extension MockBinaryInteger : BinaryInteger {
110109
var trailingZeroBitCount: Int {
111110
return _value.trailingZeroBitCount
112111
}
113-
112+
114113
func isMultiple(of other: MockBinaryInteger<T>) -> Bool {
115114
return _value.isMultiple(of: other._value)
116115
}
@@ -211,4 +210,3 @@ public func run_BinaryFloatingPointConversionFromBinaryInteger(_ N: Int) {
211210
}
212211

213212
#endif
214-

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

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

13-
import Foundation
1413
import TestsUtils
1514

1615
public let BinaryFloatingPointPropertiesBinade = BenchmarkInfo(

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

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

1918
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,17 +16,16 @@
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 90, the `sort` method can not be
19+
// is not known to the call site at line 89, 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 89-91 can not be inlined in `bucketSort` (due to
22+
// `public` and the lines 88-90 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 90 for `InsertionSort` on integers.
26+
// specialize line 89 for `InsertionSort` on integers.
2727

2828
import TestsUtils
29-
import Foundation
3029

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

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

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

16-
import Foundation
1716
import TestsUtils
1817

1918
public let ByteSwap = BenchmarkInfo(

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

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

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

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

1313
import TestsUtils
14-
import Foundation
1514

1615
public let Calculator = BenchmarkInfo(
1716
name: "Calculator",
@@ -53,4 +52,3 @@ public func run_Calculator(_ N: Int) {
5352
}
5453
CheckResults(c == 0)
5554
}
56-

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
// This test checks performance of Swift hanoi tower.
1414
// <rdar://problem/22151932>
15-
import Foundation
1615
import TestsUtils
1716

1817
public let Hanoi = BenchmarkInfo(

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

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

1313
import TestsUtils
14-
import Foundation
15-
1614

1715
// A micro benchmark for checking the speed of string-based enums.
1816
public let OpenClose = BenchmarkInfo(
@@ -38,4 +36,3 @@ public func run_OpenClose(_ N: Int) {
3836
}
3937
CheckResults(c == 0)
4038
}
41-

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616

1717
import TestsUtils
18-
import Foundation
1918

2019
public let ProtocolDispatch2 = BenchmarkInfo(
2120
name: "ProtocolDispatch2",

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
//
1616
// Description:
1717
// Create a sorted sparse RGB histogram from an array of 300 RGB values.
18-
import Foundation
1918
import TestsUtils
2019

2120
public let RGBHistogram = [

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22
//
33
// Originally written by @owensd. Used with his permission.
44

5-
import Foundation
5+
#if os(Linux)
6+
import Glibc
7+
#elseif os(Windows)
8+
import MSVCRT
9+
#else
10+
import Darwin
11+
#endif
612
import TestsUtils
713

814
public var Radix2CooleyTukey = [

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

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

1313
import TestsUtils
14-
import Foundation
1514

1615
public let ReduceInto = [
1716
BenchmarkInfo(name: "FilterEvenUsingReduce", runFunction: run_FilterEvenUsingReduce, tags: [.validation, .api], legacyFactor: 10),

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
// This test checks performance and correctness of Swift sortInPlace on an
1414
// array of letters.
15-
import Foundation
1615
import TestsUtils
1716

1817
public let SortLettersInPlace = BenchmarkInfo(

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

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

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

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

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
import TestsUtils
1414
#if os(Linux)
1515
import Glibc
16+
#elseif os(Windows)
17+
import MSVCRT
1618
#else
1719
import Darwin
1820
#endif
@@ -89,4 +91,3 @@ public func run_Walsh(_ N: Int) {
8991
InverseWalshTransform(&data2)
9092
}
9193
}
92-

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
import Foundation
13+
#if os(Linux)
14+
import Glibc
15+
#elseif os(Windows)
16+
import MSVCRT
17+
#else
18+
import Darwin
19+
#endif
1420

1521
enum ArgumentError: Error {
1622
case missingValue(String)

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
#if os(Linux)
1414
import Glibc
15+
#elseif os(Windows)
16+
import MSVCRT
1517
#else
1618
import Darwin
1719
import LibProc

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
#if os(Linux)
1414
import Glibc
15+
#elseif os(Windows)
16+
import MSVCRT
1517
#else
1618
import Darwin
1719
#endif

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,8 @@ macro(configure_sdk_unix name architectures)
252252
"${SWIFT_ANDROID_NDK_PATH}/toolchains/${SWIFT_SDK_ANDROID_ARCH_${arch}_NDK_TRIPLE}-${SWIFT_ANDROID_NDK_GCC_VERSION}/prebuilt/${_swift_android_prebuilt_build}")
253253
endif()
254254
else()
255-
if(NOT SWIFT_SDK_${prefix}_ARCH_${arch}_PATH)
256-
set(SWIFT_SDK_${prefix}_ARCH_${arch}_PATH "/")
257-
endif()
255+
set(SWIFT_SDK_${prefix}_ARCH_${arch}_PATH "/" CACHE STRING "CMAKE_SYSROOT for ${prefix} ${arch}")
256+
258257
if("${prefix}" STREQUAL "HAIKU")
259258
set(SWIFT_SDK_HAIKU_ARCH_${arch}_LIBC_INCLUDE_DIRECTORY "/system/develop/headers/posix" CACHE STRING "Path to C library headers")
260259
set(SWIFT_SDK_HAIKU_ARCH_${arch}_LIBC_ARCHITECTURE_INCLUDE_DIRECTORY "/system/develop/headers" CACHE STRING "Path to C library architecture headers")

branches/rxwei-patch-1/test/IRGen/opaque_result_type_access_path.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-build-swift -Xfrontend -disable-availability-checking -module-name=test %s -o %t/a.out
2+
// RUN: %target-build-swift -module-name=test %s -o %t/a.out
33
// RUN: %target-run %t/a.out | %FileCheck %s
44
// REQUIRES: executable_test
55
// REQUIRES: CPU=arm64 || CPU=x86_64
@@ -31,14 +31,19 @@ extension X : P where T : P {
3131
}
3232
}
3333

34+
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
3435
func bar() -> some P {
3536
return 27
3637
}
3738

39+
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
3840
func foo() -> some P {
3941
return X(bar())
4042
}
4143

4244
// CHECK: 27
45+
if #available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *) {
4346
print(foo().get())
44-
47+
} else {
48+
print(27)
49+
}

0 commit comments

Comments
 (0)