Skip to content

Bump compiler version to Swift 5.1 #24671

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ set_property(CACHE SWIFT_ANALYZE_CODE_COVERAGE PROPERTY
# SWIFT_VERSION is deliberately /not/ cached so that an existing build directory
# can be reused when a new version of Swift comes out (assuming the user hasn't
# manually set it as part of their own CMake configuration).
set(SWIFT_VERSION "5.0")
set(SWIFT_VERSION "5.1")

set(SWIFT_VENDOR "" CACHE STRING
"The vendor name of the Swift compiler")
Expand Down
6 changes: 3 additions & 3 deletions stdlib/public/Platform/tgmath.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import SwiftShims

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

@available(swift, deprecated: 4.2, obsoleted: 5.1, message: "use the exponent property.")
@available(swift, deprecated: 4.2/*, obsoleted: 5.1*/, message: "use the exponent property.")
public func ilogb<T: BinaryFloatingPoint>(_ x: T) -> Int {
return Int(x.exponent)
}
Expand Down Expand Up @@ -352,7 +352,7 @@ public func remquo(_ x: ${T}, _ y: ${T}) -> (${T}, Int) {
% if T == 'Float80':
#if (arch(i386) || arch(x86_64)) && !os(Windows)
% end
@available(swift, deprecated: 4.2, obsoleted: 5.1, message:
@available(swift, deprecated: 4.2/*, obsoleted: 5.1*/, message:
"use ${T}(nan: ${T}.RawSignificand).")
@_transparent
public func nan(_ tag: String) -> ${T} {
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/core/MigrationSupport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ extension UnsafeMutableRawBufferPointer {
// Note that the second overload is declared on a more specific protocol.
// See: test/stdlib/StringFlatMap.swift for tests.
extension Sequence {
@available(swift, deprecated: 4.1, obsoleted: 5.1, renamed: "compactMap(_:)",
@available(swift, deprecated: 4.1/*, obsoleted: 5.1 */, renamed: "compactMap(_:)",
message: "Please use compactMap(_:) for the case where closure returns an optional value")
public func flatMap<ElementOfResult>(
_ transform: (Element) throws -> ElementOfResult?
Expand Down
4 changes: 2 additions & 2 deletions test/IRGen/objc.swift
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ class WeakObjC {
// CHECK: i32 1, !"Objective-C Version", i32 2}
// CHECK: i32 1, !"Objective-C Image Info Version", i32 0}
// CHECK: i32 1, !"Objective-C Image Info Section", !"__DATA,__objc_imageinfo,regular,no_dead_strip"}
// 83887872 == (5 << 24) | (0 << 16) | (7 << 8).
// 83953408 == (5 << 24) | (1 << 16) | (7 << 8).
// 5 and 0 is the current major.minor version. 7 is the Swift ABI version.
// CHECK: i32 4, !"Objective-C Garbage Collection", i32 83887872}
// CHECK: i32 4, !"Objective-C Garbage Collection", i32 83953408}
// CHECK: i32 1, !"Swift Version", i32 7}
4 changes: 2 additions & 2 deletions test/Serialization/Recovery/types-5-to-4.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import Lib
func requiresConformance(_: B_RequiresConformance<B_ConformsToProto>) {}
func requiresConformance(_: B_RequiresConformance<C_RelyOnConformanceImpl.Assoc>) {}

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}}
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}}
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}}
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}}

#else // TEST

Expand Down
2 changes: 1 addition & 1 deletion test/SourceKit/Misc/compiler_version.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: %sourcekitd-test -req=compiler-version | %FileCheck %s

// CHECK: key.version_major: 5
// CHECK: key.version_minor: 0
// CHECK: key.version_minor: 1
// CHECK: key.version_patch: 0
2 changes: 1 addition & 1 deletion utils/build_swift/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
CMAKE_GENERATOR = 'Ninja'

COMPILER_VENDOR = 'none'
SWIFT_USER_VISIBLE_VERSION = CompilerVersion('5.0')
SWIFT_USER_VISIBLE_VERSION = CompilerVersion('5.1')
CLANG_USER_VISIBLE_VERSION = CompilerVersion('7.0.0')
SWIFT_ANALYZE_CODE_COVERAGE = 'false'

Expand Down