Skip to content

Commit 272c466

Browse files
committed
Update master to build with Xcode 12 beta
1 parent 1d4f617 commit 272c466

Some content is hidden

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

45 files changed

+123
-94
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
@@ -1120,6 +1120,8 @@ function(_add_swift_target_library_single target name)
11201120
list(APPEND library_search_directories "$ENV{SDKROOT}/usr/lib/swift")
11211121
endif()
11221122

1123+
list(APPEND library_search_directories "${SWIFT_SDK_${sdk}_ARCH_${arch}_PATH}/usr/lib/swift")
1124+
11231125
# Add variant-specific flags.
11241126
if(SWIFTLIB_SINGLE_TARGET_LIBRARY)
11251127
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/CollectionAlgorithms.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ extension Collection {
231231
/// returns `true`.
232232
///
233233
/// - Complexity: O(*n*), where *n* is the length of the collection.
234-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
234+
@available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
235235
public func subranges(where predicate: (Element) throws -> Bool) rethrows
236236
-> RangeSet<Index>
237237
{
@@ -267,7 +267,7 @@ extension Collection where Element: Equatable {
267267
/// `element`.
268268
///
269269
/// - Complexity: O(*n*), where *n* is the length of the collection.
270-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
270+
@available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
271271
public func subranges(of element: Element) -> RangeSet<Index> {
272272
subranges(where: { $0 == element })
273273
}

stdlib/public/core/DiscontiguousSlice.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
/// A collection wrapper that provides access to the elements of a collection,
1414
/// indexed by a set of indices.
15-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
15+
@available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
1616
@frozen
1717
public struct DiscontiguousSlice<Base: Collection> {
1818
/// The collection that the indexed collection wraps.
@@ -22,7 +22,7 @@ public struct DiscontiguousSlice<Base: Collection> {
2222
public var subranges: RangeSet<Base.Index>
2323
}
2424

25-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
25+
@available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
2626
extension DiscontiguousSlice {
2727
/// A position in an `DiscontiguousSlice`.
2828
@frozen
@@ -39,10 +39,10 @@ extension DiscontiguousSlice {
3939
}
4040
}
4141

42-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
42+
@available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
4343
extension DiscontiguousSlice.Index: Hashable where Base.Index: Hashable {}
4444

45-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
45+
@available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
4646
extension DiscontiguousSlice: Collection {
4747
public typealias SubSequence = Self
4848

@@ -83,7 +83,7 @@ extension DiscontiguousSlice: Collection {
8383
}
8484
}
8585

86-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
86+
@available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
8787
extension DiscontiguousSlice {
8888
public var count: Int {
8989
var c = 0
@@ -102,7 +102,7 @@ extension DiscontiguousSlice {
102102
}
103103
}
104104

105-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
105+
@available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
106106
extension DiscontiguousSlice: BidirectionalCollection
107107
where Base: BidirectionalCollection
108108
{
@@ -122,7 +122,7 @@ extension DiscontiguousSlice: BidirectionalCollection
122122
}
123123
}
124124

125-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
125+
@available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
126126
extension DiscontiguousSlice: MutableCollection where Base: MutableCollection {
127127
public subscript(i: Index) -> Base.Element {
128128
get {
@@ -145,7 +145,7 @@ extension Collection {
145145
/// - Returns: A collection of the elements at the positions in `subranges`.
146146
///
147147
/// - Complexity: O(1)
148-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
148+
@available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
149149
public subscript(subranges: RangeSet<Index>) -> DiscontiguousSlice<Self> {
150150
DiscontiguousSlice(base: self, subranges: subranges)
151151
}
@@ -162,7 +162,7 @@ extension MutableCollection {
162162
/// - Complexity: O(1) to access the elements, O(*m*) to mutate the
163163
/// elements at the positions in `subranges`, where *m* is the number of
164164
/// elements indicated by `subranges`.
165-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
165+
@available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
166166
public subscript(subranges: RangeSet<Index>) -> DiscontiguousSlice<Self> {
167167
get {
168168
DiscontiguousSlice(base: self, subranges: subranges)
@@ -196,7 +196,7 @@ extension Collection {
196196
/// - Returns: A collection of the elements that are not in `subranges`.
197197
///
198198
/// - Complexity: O(*n*), where *n* is the length of the collection.
199-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
199+
@available(macOS 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
200200
public func removingSubranges(
201201
_ subranges: RangeSet<Index>
202202
) -> DiscontiguousSlice<Self> {

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
@@ -40,7 +40,7 @@ RawSignificand = 'UInt' + str(SignificandSize)
4040

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

4646
if Self == 'Float16':

0 commit comments

Comments
 (0)