Skip to content

Commit 90e8740

Browse files
committed
Update 5.3 to build with Xcode 12 beta
1 parent 703f2c3 commit 90e8740

39 files changed

+99
-68
lines changed

benchmark/cmake/modules/AddSwiftBenchmarkSuite.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,8 +660,11 @@ function (swift_benchmark_compile_archopts)
660660
"-m${triple_platform}-version-min=${ver}"
661661
"-lobjc"
662662
"-L${SWIFT_LIBRARY_PATH}/${BENCH_COMPILE_ARCHOPTS_PLATFORM}"
663+
"-L${sdk}/usr/lib/swift"
663664
"-Xlinker" "-rpath"
664665
"-Xlinker" "${SWIFT_LINK_RPATH}"
666+
"-Xlinker" "-rpath"
667+
"-Xlinker" "/usr/lib/swift"
665668
${bench_library_objects}
666669
${bench_driver_objects}
667670
${ld64_add_ast_path_opts}

stdlib/cmake/modules/AddSwiftStdlib.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,6 +1101,8 @@ function(_add_swift_target_library_single target name)
11011101
list(APPEND library_search_directories "$ENV{SDKROOT}/usr/lib/swift")
11021102
endif()
11031103

1104+
list(APPEND library_search_directories "${SWIFT_SDK_${sdk}_ARCH_${arch}_PATH}/usr/lib/swift")
1105+
11041106
# Add variant-specific flags.
11051107
if(SWIFTLIB_SINGLE_TARGET_LIBRARY)
11061108
set(build_type "${SWIFT_STDLIB_BUILD_TYPE}")

stdlib/public/Differentiation/FloatingPointDifferentiation.swift.gyb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ bits = self_type.bits
2121

2222
def Availability(bits):
2323
if bits == 16:
24-
return '@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)'
24+
return '@available(macOS 10.16, iOS 14.0, tvOS 14.0, watchOS 7.0, *)'
2525
return ''
2626
}%
2727

stdlib/public/core/Availability.swift

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,20 @@ public func _stdlib_isOSVersionAtLeast(
4242
return false._value
4343
#endif
4444
}
45+
46+
#if os(macOS)
47+
// This is a magic entry point known to the compiler. It is called in
48+
// generated code for API availability checking.
49+
@_semantics("availability.osversion")
50+
@_effects(readnone)
51+
public func _stdlib_isOSVersionAtLeastOrVariantVersionAtLeast(
52+
_ major: Builtin.Word,
53+
_ minor: Builtin.Word,
54+
_ patch: Builtin.Word,
55+
_ variantMajor: Builtin.Word,
56+
_ variantMinor: Builtin.Word,
57+
_ variantPatch: Builtin.Word
58+
) -> Builtin.Int1 {
59+
return _stdlib_isOSVersionAtLeast(major, minor, patch)
60+
}
61+
#endif

stdlib/public/core/CTypes.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public typealias CLong = Int
5757
public typealias CLongLong = Int64
5858

5959
/// The C '_Float16' type.
60-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
60+
@available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
6161
public typealias CFloat16 = Float16
6262

6363
/// The C 'float' type.

stdlib/public/core/Codable.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4730,7 +4730,7 @@ extension RawRepresentable where RawValue == Float, Self: Decodable {
47304730
}
47314731
}
47324732

4733-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
4733+
@available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
47344734
extension Float16: Codable {
47354735
/// Creates a new instance by decoding from the given decoder.
47364736
///

stdlib/public/core/FloatingPointParsing.swift.gyb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ internal func _isspace_clocale(_ u: UTF16.CodeUnit) -> Bool {
4646

4747
//===--- Parsing ----------------------------------------------------------===//
4848
%if bits == 16:
49-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
49+
@available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
5050
%end
5151
extension ${Self}: LosslessStringConvertible {
5252
/// Creates a new instance from the given string.
@@ -134,7 +134,7 @@ extension ${Self}: LosslessStringConvertible {
134134
%if bits == 16:
135135
self.init(Substring(text))
136136
%else:
137-
if #available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *) {
137+
if #available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *) {
138138
self.init(Substring(text))
139139
} else {
140140
self = 0.0
@@ -164,7 +164,7 @@ extension ${Self}: LosslessStringConvertible {
164164
// In particular, we still have to export
165165
// _swift_stdlib_strtoXYZ_clocale()
166166
// as ABI to support old compiled code that still requires it.
167-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
167+
@available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
168168
public init?(_ text: Substring) {
169169
self = 0.0
170170
let success = withUnsafeMutablePointer(to: &self) { p -> Bool in

stdlib/public/core/FloatingPointTypes.swift.gyb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ RawSignificand = 'UInt' + str(SignificandSize)
3939

4040
def Availability(bits):
4141
if bits == 16:
42-
return '@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)'
42+
return '@available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *)'
4343
return ''
4444

4545
if Self == 'Float16':

stdlib/public/core/IntegerTypes.swift.gyb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,7 +1152,7 @@ public struct ${Self}
11521152
/// `source` must be representable in this type after rounding toward
11531153
/// zero.
11541154
% if FloatType == 'Float16':
1155-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
1155+
@available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
11561156
% end
11571157
@_transparent
11581158
public init(_ source: ${FloatType}) {
@@ -1182,7 +1182,7 @@ public struct ${Self}
11821182
///
11831183
/// - Parameter source: A floating-point value to convert to an integer.
11841184
% if FloatType == 'Float16':
1185-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
1185+
@available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
11861186
% end
11871187
@_transparent
11881188
public init?(exactly source: ${FloatType}) {

stdlib/public/core/Misc.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,13 @@ func _typeName(_ type: Any.Type, qualified: Bool = true) -> String {
7878
UnsafeBufferPointer(start: stringPtr, count: count)).0
7979
}
8080

81-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
81+
@available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
8282
@_silgen_name("swift_getMangledTypeName")
8383
public func _getMangledTypeName(_ type: Any.Type)
8484
-> (UnsafePointer<UInt8>, Int)
8585

8686
/// Returns the mangled name for a given type.
87-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
87+
@available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
8888
public // SPI
8989
func _mangledTypeName(_ type: Any.Type) -> String? {
9090
let (stringPtr, count) = _getMangledTypeName(type)

0 commit comments

Comments
 (0)