Skip to content

Commit e4bea9a

Browse files
authored
---
yaml --- r: 294331 b: refs/heads/tensorflow c: b903f71 h: refs/heads/master i: 294329: 70915c6 294327: 7847c08
1 parent 80a470f commit e4bea9a

File tree

14 files changed

+64
-41
lines changed

14 files changed

+64
-41
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-04-25-a: 22f738a831d43aff2b9c9773bcb65
816816
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-05-08-a: 7d98cc16689baba5c8a3b90a9329bdcc1a12b4e9
817817
refs/heads/cherr42: a566ad54b073c2c56ac0a705d0a5bed9743135a5
818818
"refs/heads/codable_test_comment_fix": fc8f6824f7f347e1e8db55bff62db385c5728b5a
819-
refs/heads/tensorflow: 7b7c320bd59cb9b4954fef79ae67700dbee6c4e5
819+
refs/heads/tensorflow: b903f7191dde1e8e5b52281d78297d0f69b5d172
820820
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-11-a: 8126fd7a652e2f70ad6d76505239e34fb2ef3e1a
821821
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-12-a: b3fd3dd84df6717f2e2e9df58c6d7e99fed57086
822822
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-13-a: 71135119579039dc321c5f65d870050fe36efda2

branches/tensorflow/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ set_property(CACHE SWIFT_ANALYZE_CODE_COVERAGE PROPERTY
123123
# SWIFT_VERSION is deliberately /not/ cached so that an existing build directory
124124
# can be reused when a new version of Swift comes out (assuming the user hasn't
125125
# manually set it as part of their own CMake configuration).
126-
set(SWIFT_VERSION "5.0")
126+
set(SWIFT_VERSION "5.1")
127127

128128
set(SWIFT_VENDOR "" CACHE STRING
129129
"The vendor name of the Swift compiler")

branches/tensorflow/stdlib/private/StdlibCollectionUnittest/CheckCollectionInstance.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ public func checkOneLevelOfForwardCollection<
467467
}
468468
}
469469

470-
var allIndices = Array(collection.indices)
470+
let allIndices = Array(collection.indices)
471471

472472
if expectedArray.count >= 2 {
473473
for i in 0..<allIndices.count-1 {
@@ -693,7 +693,7 @@ public func checkOneLevelOfBidirectionalCollection<
693693
}
694694
}
695695

696-
var allIndices = Array(collection.indices)
696+
let allIndices = Array(collection.indices)
697697

698698
if expectedArray.count >= 2 {
699699
for i in 0..<allIndices.count-1 {
@@ -978,7 +978,7 @@ public func checkOneLevelOfRandomAccessCollection<
978978
}
979979
}
980980

981-
var allIndices = Array(collection.indices)
981+
let allIndices = Array(collection.indices)
982982

983983
if expectedArray.count >= 2 {
984984
for i in 0..<allIndices.count-1 {
@@ -1237,7 +1237,7 @@ public func checkOneLevelOfForwardCollection<
12371237
}
12381238
}
12391239

1240-
var allIndices = Array(collection.indices)
1240+
let allIndices = Array(collection.indices)
12411241

12421242
if expectedArray.count >= 2 {
12431243
for i in 0..<allIndices.count-1 {
@@ -1463,7 +1463,7 @@ public func checkOneLevelOfBidirectionalCollection<
14631463
}
14641464
}
14651465

1466-
var allIndices = Array(collection.indices)
1466+
let allIndices = Array(collection.indices)
14671467

14681468
if expectedArray.count >= 2 {
14691469
for i in 0..<allIndices.count-1 {
@@ -1748,7 +1748,7 @@ public func checkOneLevelOfRandomAccessCollection<
17481748
}
17491749
}
17501750

1751-
var allIndices = Array(collection.indices)
1751+
let allIndices = Array(collection.indices)
17521752

17531753
if expectedArray.count >= 2 {
17541754
for i in 0..<allIndices.count-1 {

branches/tensorflow/stdlib/public/Darwin/Foundation/JSONEncoder.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1128,7 +1128,7 @@ open class JSONDecoder {
11281128
let leadingUnderscoreRange = stringKey.startIndex..<firstNonUnderscore
11291129
let trailingUnderscoreRange = stringKey.index(after: lastNonUnderscore)..<stringKey.endIndex
11301130

1131-
var components = stringKey[keyRange].split(separator: "_")
1131+
let components = stringKey[keyRange].split(separator: "_")
11321132
let joinedString : String
11331133
if components.count == 1 {
11341134
// No underscores in key, leave the word as is - maybe already camel cased

branches/tensorflow/stdlib/public/Platform/tgmath.swift.gyb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import SwiftShims
1414

1515
// Generic functions implementable directly on FloatingPoint.
1616
@_transparent
17-
@available(swift, deprecated: 4.2, obsoleted: 5.1, renamed: "abs")
17+
@available(swift, deprecated: 4.2/*, obsoleted: 5.1*/, renamed: "abs")
1818
public func fabs<T: FloatingPoint>(_ x: T) -> T {
1919
return x.magnitude
2020
}
@@ -112,7 +112,7 @@ public func isnan<T: FloatingPoint>(_ value: T) -> Bool { fatalError() }
112112
@available(*, unavailable, message: "use the sign property.")
113113
public func signbit<T: FloatingPoint>(_ value: T) -> Int { fatalError() }
114114

115-
@available(swift, deprecated: 4.2, obsoleted: 5.1, message: "use the exponent property.")
115+
@available(swift, deprecated: 4.2/*, obsoleted: 5.1*/, message: "use the exponent property.")
116116
public func ilogb<T: BinaryFloatingPoint>(_ x: T) -> Int {
117117
return Int(x.exponent)
118118
}
@@ -352,7 +352,7 @@ public func remquo(_ x: ${T}, _ y: ${T}) -> (${T}, Int) {
352352
% if T == 'Float80':
353353
#if (arch(i386) || arch(x86_64)) && !os(Windows)
354354
% end
355-
@available(swift, deprecated: 4.2, obsoleted: 5.1, message:
355+
@available(swift, deprecated: 4.2/*, obsoleted: 5.1*/, message:
356356
"use ${T}(nan: ${T}.RawSignificand).")
357357
@_transparent
358358
public func nan(_ tag: String) -> ${T} {

branches/tensorflow/stdlib/public/core/ClosedRange.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,12 @@ extension ClosedRange where Bound: Strideable, Bound.Stride : SignedInteger {
444444
extension ClosedRange {
445445
@inlinable
446446
public func overlaps(_ other: ClosedRange<Bound>) -> Bool {
447-
return self.contains(other.lowerBound) || other.contains(lowerBound)
447+
// Disjoint iff the other range is completely before or after our range.
448+
// Unlike a `Range`, a `ClosedRange` can *not* be empty, so no check for
449+
// that case is needed here.
450+
let isDisjoint = other.upperBound < self.lowerBound
451+
|| self.upperBound < other.lowerBound
452+
return !isDisjoint
448453
}
449454

450455
@inlinable

branches/tensorflow/stdlib/public/core/Integers.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,8 @@ public protocol BinaryInteger :
716716
/// let x = Int8(bitPattern: 0b1111_1000)
717717
/// // x == -8
718718
/// // x.trailingZeroBitCount == 3
719+
///
720+
/// If the value is zero, then `trailingZeroBitCount` is equal to `bitWidth`.
719721
var trailingZeroBitCount: Int { get }
720722

721723
/// Returns the quotient of dividing the first value by the second.
@@ -2081,6 +2083,8 @@ where Magnitude : FixedWidthInteger & UnsignedInteger,
20812083
/// let x: Int8 = 0b0001_1111
20822084
/// // x == 31
20832085
/// // x.leadingZeroBitCount == 3
2086+
///
2087+
/// If the value is zero, then `leadingZeroBitCount` is equal to `bitWidth`.
20842088
var leadingZeroBitCount: Int { get }
20852089

20862090
/// Creates an integer from its big-endian representation, changing the byte

branches/tensorflow/stdlib/public/core/MigrationSupport.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ extension UnsafeMutableRawBufferPointer {
535535
// Note that the second overload is declared on a more specific protocol.
536536
// See: test/stdlib/StringFlatMap.swift for tests.
537537
extension Sequence {
538-
@available(swift, deprecated: 4.1, obsoleted: 5.1, renamed: "compactMap(_:)",
538+
@available(swift, deprecated: 4.1/*, obsoleted: 5.1 */, renamed: "compactMap(_:)",
539539
message: "Please use compactMap(_:) for the case where closure returns an optional value")
540540
public func flatMap<ElementOfResult>(
541541
_ transform: (Element) throws -> ElementOfResult?

branches/tensorflow/stdlib/public/core/Range.swift

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -943,14 +943,26 @@ extension Range {
943943
/// common; otherwise, `false`.
944944
@inlinable
945945
public func overlaps(_ other: Range<Bound>) -> Bool {
946-
return (!other.isEmpty && self.contains(other.lowerBound))
947-
|| (!self.isEmpty && other.contains(self.lowerBound))
946+
// Disjoint iff the other range is completely before or after our range.
947+
// Additionally either `Range` (unlike a `ClosedRange`) could be empty, in
948+
// which case it is disjoint with everything as overlap is defined as having
949+
// an element in common.
950+
let isDisjoint = other.upperBound <= self.lowerBound
951+
|| self.upperBound <= other.lowerBound
952+
|| self.isEmpty || other.isEmpty
953+
return !isDisjoint
948954
}
949955

950956
@inlinable
951957
public func overlaps(_ other: ClosedRange<Bound>) -> Bool {
952-
return self.contains(other.lowerBound)
953-
|| (!self.isEmpty && other.contains(self.lowerBound))
958+
// Disjoint iff the other range is completely before or after our range.
959+
// Additionally the `Range` (unlike the `ClosedRange`) could be empty, in
960+
// which case it is disjoint with everything as overlap is defined as having
961+
// an element in common.
962+
let isDisjoint = other.upperBound < self.lowerBound
963+
|| self.upperBound <= other.lowerBound
964+
|| self.isEmpty
965+
return !isDisjoint
954966
}
955967
}
956968

branches/tensorflow/test/IRGen/objc.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ class WeakObjC {
147147
// CHECK: i32 1, !"Objective-C Version", i32 2}
148148
// CHECK: i32 1, !"Objective-C Image Info Version", i32 0}
149149
// CHECK: i32 1, !"Objective-C Image Info Section", !"__DATA,__objc_imageinfo,regular,no_dead_strip"}
150-
// 83887872 == (5 << 24) | (0 << 16) | (7 << 8).
150+
// 83953408 == (5 << 24) | (1 << 16) | (7 << 8).
151151
// 5 and 0 is the current major.minor version. 7 is the Swift ABI version.
152-
// CHECK: i32 4, !"Objective-C Garbage Collection", i32 83887872}
152+
// CHECK: i32 4, !"Objective-C Garbage Collection", i32 83953408}
153153
// CHECK: i32 1, !"Swift Version", i32 7}

branches/tensorflow/test/Interpreter/SDK/SwiftNativeNSXXXCoding.swift

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,28 +31,30 @@ private func test<T: NSObject & NSCoding>(type: T.Type) {
3131
// Test all the classes listed in SwiftNativeNSXXXBase.mm.gyb except for
3232
// NSEnumerator (which doesn't conform to NSCoding).
3333

34-
testSuite.test("NSArray") {
35-
test(type: NSArray.self)
36-
}
34+
if #available(iOS 9999, macOS 9999, tvOS 9999, watchOS 9999, *) {
35+
testSuite.test("NSArray") {
36+
test(type: NSArray.self)
37+
}
3738

38-
testSuite.test("NSDictionary") {
39-
test(type: NSDictionary.self)
40-
}
39+
testSuite.test("NSDictionary") {
40+
test(type: NSDictionary.self)
41+
}
4142

42-
testSuite.test("NSSet") {
43-
test(type: NSSet.self)
44-
}
43+
testSuite.test("NSSet") {
44+
test(type: NSSet.self)
45+
}
4546

46-
testSuite.test("NSString") {
47-
test(type: NSString.self)
48-
}
47+
testSuite.test("NSString") {
48+
test(type: NSString.self)
49+
}
4950

50-
testSuite.test("NSData") {
51-
test(type: NSData.self)
52-
}
51+
testSuite.test("NSData") {
52+
test(type: NSData.self)
53+
}
5354

54-
testSuite.test("NSIndexSet") {
55-
test(type: NSIndexSet.self)
55+
testSuite.test("NSIndexSet") {
56+
test(type: NSIndexSet.self)
57+
}
5658
}
5759

5860
runAllTests()

branches/tensorflow/test/Serialization/Recovery/types-5-to-4.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import Lib
1616
func requiresConformance(_: B_RequiresConformance<B_ConformsToProto>) {}
1717
func requiresConformance(_: B_RequiresConformance<C_RelyOnConformanceImpl.Assoc>) {}
1818

19-
class Sub: Base {} // expected-error {{cannot inherit from class 'Base' (compiled with Swift 5.0) because it has overridable members that could not be loaded in Swift 4.1.50}}
20-
class Impl: Proto {} // expected-error {{type 'Impl' cannot conform to protocol 'Proto' (compiled with Swift 5.0) because it has requirements that could not be loaded in Swift 4.1.50}}
19+
class Sub: Base {} // expected-error {{cannot inherit from class 'Base' (compiled with Swift 5.1) because it has overridable members that could not be loaded in Swift 4.1.50}}
20+
class Impl: Proto {} // expected-error {{type 'Impl' cannot conform to protocol 'Proto' (compiled with Swift 5.1) because it has requirements that could not be loaded in Swift 4.1.50}}
2121

2222
#else // TEST
2323

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %sourcekitd-test -req=compiler-version | %FileCheck %s
22

33
// CHECK: key.version_major: 5
4-
// CHECK: key.version_minor: 0
4+
// CHECK: key.version_minor: 1
55
// CHECK: key.version_patch: 0

branches/tensorflow/utils/build_swift/defaults.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
CMAKE_GENERATOR = 'Ninja'
4141

4242
COMPILER_VENDOR = 'none'
43-
SWIFT_USER_VISIBLE_VERSION = CompilerVersion('5.0')
43+
SWIFT_USER_VISIBLE_VERSION = CompilerVersion('5.1')
4444
CLANG_USER_VISIBLE_VERSION = CompilerVersion('7.0.0')
4545
SWIFT_ANALYZE_CODE_COVERAGE = 'false'
4646

0 commit comments

Comments
 (0)