Merge pull request #80680 from slavapestov/compatibility-span-6.2

[6.2] Cherry-pick recent CompatibilitySpan work
This commit is contained in:
Slava Pestov
2025-04-23 01:00:29 -04:00
committed by GitHub
17 changed files with 266 additions and 70 deletions

View File

@@ -1,4 +1,7 @@
file(STRINGS "${SwiftCore_SWIFTC_SOURCE_DIR}/utils/availability-macros.def" availability_defs)
configure_file("${SwiftCore_SWIFTC_SOURCE_DIR}/utils/availability-macros.def"
"${CMAKE_CURRENT_BINARY_DIR}/availability-macros.def"
COPYONLY)
file(STRINGS "${CMAKE_CURRENT_BINARY_DIR}/availability-macros.def" availability_defs)
list(FILTER availability_defs EXCLUDE REGEX "^\\s*(#.*)?$")
foreach(def ${availability_defs})
add_compile_options("$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -define-availability -Xfrontend \"${def}\">")

View File

@@ -301,7 +301,8 @@ target_compile_options(swiftCore PRIVATE
$<$<COMPILE_LANGUAGE:Swift>:-nostdimport>
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -group-info-path -Xfrontend ${CMAKE_CURRENT_SOURCE_DIR}/GroupInfo.json>"
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -disable-objc-attr-requires-foundation-module>"
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -require-explicit-availability=ignore>")
"$<$<COMPILE_LANGUAGE:Swift>:SHELL:-Xfrontend -require-explicit-availability=ignore>"
"$<$<AND:$<PLATFORM_ID:Darwin>,$<COMPILE_LANGUAGE:Swift>>:SHELL:-Xfrontend -previous-module-installname-map-file -Xfrontend ${CMAKE_CURRENT_SOURCE_DIR}/PreviousModuleInstallName.json>")
if(NOT "${CMAKE_BUILD_TYPE}" STREQUAL "MinSizeRel")
# Using these in MinSizeRel would result in a 15% increase in the binary size
target_compile_options(swiftCore PRIVATE

View File

@@ -152,7 +152,10 @@ RUNTIME_VERSION(
RUNTIME_VERSION(
(6, 1),
FUTURE
PLATFORM(macOS, (15, 4, 0))
PLATFORM(iOS, (18, 4, 0))
PLATFORM(watchOS, (11, 4, 0))
PLATFORM(visionOS,(2, 4, 0))
)
RUNTIME_VERSION(

View File

@@ -721,6 +721,8 @@ endfunction()
# [DONT_EMBED_BITCODE]
# [IS_STDLIB]
# [IS_STDLIB_CORE]
# [ONLY_SWIFTMODULE]
# [NO_SWIFTMODULE]
# [IS_SDK_OVERLAY]
# [IS_FRAGILE]
# INSTALL_IN_COMPONENT comp
@@ -742,9 +744,6 @@ endfunction()
# STATIC
# Build a static library.
#
# ONLY_SWIFTMODULE
# Do not build either static or shared, build just the .swiftmodule.
#
# SDK sdk
# SDK to build for.
#
@@ -784,6 +783,12 @@ endfunction()
# IS_STDLIB_CORE
# Compile as the standard library core.
#
# ONLY_SWIFTMODULE
# Do not build either static or shared, build just the .swiftmodule.
#
# NO_SWIFTMODULE
# Only build either static or shared, and skip the .swiftmodule.
#
# IS_SDK_OVERLAY
# Treat the library as a part of the Swift SDK overlay.
#
@@ -811,6 +816,7 @@ function(add_swift_target_library_single target name)
SHARED
STATIC
ONLY_SWIFTMODULE
NO_SWIFTMODULE
NO_LINK_NAME
INSTALL_WITH_SHARED
IS_FRAGILE)
@@ -1035,6 +1041,7 @@ function(add_swift_target_library_single target name)
${SWIFTLIB_SINGLE_IS_SDK_OVERLAY_keyword}
${SWIFTLIB_SINGLE_IS_FRAGILE_keyword}
${SWIFTLIB_SINGLE_ONLY_SWIFTMODULE_keyword}
${SWIFTLIB_SINGLE_NO_SWIFTMODULE_keyword}
${embed_bitcode_arg}
${SWIFTLIB_SINGLE_STATIC_keyword}
${SWIFTLIB_SINGLE_NO_LINK_NAME_keyword}
@@ -1686,6 +1693,8 @@ endfunction()
# [INSTALL]
# [IS_STDLIB]
# [IS_STDLIB_CORE]
# [ONLY_SWIFTMODULE]
# [NO_SWIFTMODULE]
# [INSTALL_WITH_SHARED]
# INSTALL_IN_COMPONENT comp
# DEPLOYMENT_VERSION_OSX version
@@ -1794,6 +1803,12 @@ endfunction()
# IS_STDLIB_CORE
# Compile as the Swift standard library core.
#
# ONLY_SWIFTMODULE
# Do not build either static or shared, build just the .swiftmodule.
#
# NO_SWIFTMODULE
# Only build either static or shared, and skip the .swiftmodule.
#
# IS_SDK_OVERLAY
# Treat the library as a part of the Swift SDK overlay.
#
@@ -1882,6 +1897,8 @@ function(add_swift_target_library name)
IS_STDLIB_CORE
IS_SWIFT_ONLY
NOSWIFTRT
ONLY_SWIFTMODULE
NO_SWIFTMODULE
OBJECT_LIBRARY
SHARED
STATIC
@@ -2493,6 +2510,8 @@ function(add_swift_target_library name)
${SWIFTLIB_IS_STDLIB_CORE_keyword}
${SWIFTLIB_IS_SDK_OVERLAY_keyword}
${SWIFTLIB_NOSWIFTRT_keyword}
${SWIFTLIB_ONLY_SWIFTMODULE_keyword}
${SWIFTLIB_NO_SWIFTMODULE_keyword}
DARWIN_INSTALL_NAME_DIR "${SWIFTLIB_DARWIN_INSTALL_NAME_DIR}"
INSTALL_IN_COMPONENT "${SWIFTLIB_INSTALL_IN_COMPONENT}"
DEPLOYMENT_VERSION_OSX "${SWIFTLIB_DEPLOYMENT_VERSION_OSX}"

View File

@@ -49,7 +49,7 @@ function(handle_swift_sources
dependency_sibgen_target_out_var_name
sourcesvar externalvar name)
cmake_parse_arguments(SWIFTSOURCES
"IS_MAIN;IS_STDLIB;IS_STDLIB_CORE;IS_SDK_OVERLAY;EMBED_BITCODE;STATIC;NO_LINK_NAME;IS_FRAGILE;ONLY_SWIFTMODULE"
"IS_MAIN;IS_STDLIB;IS_STDLIB_CORE;IS_SDK_OVERLAY;EMBED_BITCODE;STATIC;NO_LINK_NAME;IS_FRAGILE;ONLY_SWIFTMODULE;NO_SWIFTMODULE"
"SDK;ARCHITECTURE;INSTALL_IN_COMPONENT;DEPLOYMENT_VERSION_OSX;DEPLOYMENT_VERSION_IOS;DEPLOYMENT_VERSION_TVOS;DEPLOYMENT_VERSION_WATCHOS;MACCATALYST_BUILD_FLAVOR;BOOTSTRAPPING;INSTALL_BINARY_SWIFTMODULE"
"DEPENDS;COMPILE_FLAGS;MODULE_NAME;MODULE_DIR;ENABLE_LTO"
${ARGN})
@@ -66,6 +66,7 @@ function(handle_swift_sources
translate_flag(${SWIFTSOURCES_NO_LINK_NAME} "NO_LINK_NAME" NO_LINK_NAME_arg)
translate_flag(${SWIFTSOURCES_IS_FRAGILE} "IS_FRAGILE" IS_FRAGILE_arg)
translate_flag(${SWIFTSOURCES_ONLY_SWIFTMODULE} "ONLY_SWIFTMODULE" ONLY_SWIFTMODULE_arg)
translate_flag(${SWIFTSOURCES_NO_SWIFTMODULE} "NO_SWIFTMODULE" NO_SWIFTMODULE_arg)
if(DEFINED SWIFTSOURCES_BOOTSTRAPPING)
set(BOOTSTRAPPING_arg "BOOTSTRAPPING" ${SWIFTSOURCES_BOOTSTRAPPING})
endif()
@@ -161,6 +162,7 @@ function(handle_swift_sources
${BOOTSTRAPPING_arg}
${IS_FRAGILE_arg}
${ONLY_SWIFTMODULE_arg}
${NO_SWIFTMODULE_arg}
INSTALL_BINARY_SWIFTMODULE ${SWIFTSOURCES_INSTALL_BINARY_SWIFTMODULE}
INSTALL_IN_COMPONENT "${SWIFTSOURCES_INSTALL_IN_COMPONENT}"
DEPLOYMENT_VERSION_OSX ${SWIFTSOURCES_DEPLOYMENT_VERSION_OSX}
@@ -405,6 +407,8 @@ endfunction()
# [IS_MAIN] # This is an executable, not a library
# [IS_STDLIB]
# [IS_STDLIB_CORE] # This is the core standard library
# [ONLY_SWIFTMODULE] # Emit swiftmodule only, no binary
# [NO_SWIFTMODULE] # Emit binary only, no swiftmodule
# [OPT_FLAGS] # Optimization flags (overrides SWIFT_OPTIMIZE)
# [MODULE_DIR] # Put .swiftmodule, .swiftdoc., and .o
# # into this directory.
@@ -419,7 +423,7 @@ function(_compile_swift_files
dependency_sib_target_out_var_name dependency_sibopt_target_out_var_name
dependency_sibgen_target_out_var_name)
cmake_parse_arguments(SWIFTFILE
"IS_MAIN;IS_STDLIB;IS_STDLIB_CORE;IS_SDK_OVERLAY;EMBED_BITCODE;STATIC;IS_FRAGILE;ONLY_SWIFTMODULE"
"IS_MAIN;IS_STDLIB;IS_STDLIB_CORE;IS_SDK_OVERLAY;EMBED_BITCODE;STATIC;IS_FRAGILE;ONLY_SWIFTMODULE;NO_SWIFTMODULE"
"OUTPUT;MODULE_NAME;INSTALL_IN_COMPONENT;DEPLOYMENT_VERSION_OSX;DEPLOYMENT_VERSION_IOS;DEPLOYMENT_VERSION_TVOS;DEPLOYMENT_VERSION_WATCHOS;MACCATALYST_BUILD_FLAVOR;BOOTSTRAPPING;INSTALL_BINARY_SWIFTMODULE"
"SOURCES;FLAGS;DEPENDS;SDK;ARCHITECTURE;OPT_FLAGS;MODULE_DIR"
${ARGN})
@@ -678,6 +682,10 @@ function(_compile_swift_files
get_bootstrapping_path(lib_dir ${SWIFTLIB_DIR} "${SWIFTFILE_BOOTSTRAPPING}")
if(NOT SWIFTFILE_IS_MAIN)
list(APPEND swift_flags "-parse-as-library")
endif()
if(NOT SWIFTFILE_IS_MAIN AND NOT SWIFTFILE_NO_SWIFTMODULE)
# Determine the directory where the module file should be placed.
if(SWIFTFILE_MODULE_DIR)
set(module_dir "${SWIFTFILE_MODULE_DIR}")
@@ -687,8 +695,6 @@ function(_compile_swift_files
message(FATAL_ERROR "Don't know where to put the module files")
endif()
list(APPEND swift_flags "-parse-as-library")
set(module_base "${module_dir}/${SWIFTFILE_MODULE_NAME}")
set(module_dir_static "${SWIFTSTATICLIB_DIR}/${library_subdir}")
@@ -1068,7 +1074,7 @@ function(_compile_swift_files
#
# We only build these when we are not producing a main file. We could do this
# with sib/sibgen, but it is useful for looking at the stdlib.
if (NOT SWIFTFILE_IS_MAIN)
if (NOT SWIFTFILE_IS_MAIN AND NOT SWIFTFILE_NO_SWIFTMODULE)
add_custom_command_target(
module_dependency_target
COMMAND

View File

@@ -1,6 +1,6 @@
[
{
"module": "CompatibilitySpan",
"install_name": "/usr/lib/swift/libswiftCompatibilitySpan.dylib"
"install_name": "@rpath/libswiftCompatibilitySpan.dylib"
}
]

View File

@@ -10,11 +10,16 @@
//
//===----------------------------------------------------------------------===//
#if SPAN_COMPATIBILITY_STUB
import Swift
#endif
// A MutableRawSpan represents a span of memory which
// contains initialized `Element` instances.
@safe
@frozen
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
public struct MutableRawSpan: ~Copyable & ~Escapable {
@usableFromInline
internal let _pointer: UnsafeMutableRawPointer?
@@ -40,10 +45,12 @@ public struct MutableRawSpan: ~Copyable & ~Escapable {
}
}
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension MutableRawSpan: @unchecked Sendable {}
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension MutableRawSpan {
@unsafe
@@ -115,7 +122,8 @@ extension MutableRawSpan {
}
}
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension MutableRawSpan {
@_alwaysEmitIntoClient
public var byteCount: Int { _count }
@@ -129,7 +137,8 @@ extension MutableRawSpan {
}
}
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension MutableRawSpan {
@_alwaysEmitIntoClient
@@ -154,7 +163,8 @@ extension MutableRawSpan {
}
}
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension RawSpan {
@_alwaysEmitIntoClient
@@ -166,7 +176,8 @@ extension RawSpan {
}
}
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension MutableRawSpan {
public var bytes: RawSpan {
@@ -202,7 +213,8 @@ extension MutableRawSpan {
}
}
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension MutableRawSpan {
/// Returns a new instance of the given type, constructed from the raw memory
@@ -338,8 +350,13 @@ extension MutableRawSpan {
}
}
// FIXME: The functions in this extension crash the SIL optimizer when built inside
// the stub. But these declarations don't generate a public symbol anyway.
#if !SPAN_COMPATIBILITY_STUB
//MARK: copyMemory
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension MutableRawSpan {
@_alwaysEmitIntoClient
@@ -429,9 +446,11 @@ extension MutableRawSpan {
update(fromContentsOf: source.bytes)
}
}
#endif
// MARK: sub-spans
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension MutableRawSpan {
/// Constructs a new span over the items within the supplied range of
@@ -546,7 +565,8 @@ extension MutableRawSpan {
}
// MARK: prefixes and suffixes
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension MutableRawSpan {
/// Returns a span containing the initial elements of this span,

View File

@@ -10,11 +10,16 @@
//
//===----------------------------------------------------------------------===//
#if SPAN_COMPATIBILITY_STUB
import Swift
#endif
// A MutableSpan<Element> represents a span of memory which
// contains initialized `Element` instances.
@safe
@frozen
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
public struct MutableSpan<Element: ~Copyable>
: ~Copyable, ~Escapable {
@usableFromInline
@@ -41,10 +46,12 @@ public struct MutableSpan<Element: ~Copyable>
}
}
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension MutableSpan: @unchecked Sendable where Element: Sendable {}
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension MutableSpan where Element: ~Copyable {
@unsafe
@@ -87,7 +94,8 @@ extension MutableSpan where Element: ~Copyable {
}
}
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension MutableSpan {
@unsafe
@@ -102,7 +110,8 @@ extension MutableSpan {
}
}
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension MutableSpan where Element: BitwiseCopyable {
@unsafe
@@ -154,7 +163,8 @@ extension MutableSpan where Element: BitwiseCopyable {
}
}
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension Span where Element: ~Copyable {
@_alwaysEmitIntoClient
@@ -170,7 +180,8 @@ extension Span where Element: ~Copyable {
}
}
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension MutableSpan where Element: ~Copyable {
@_alwaysEmitIntoClient
@@ -182,7 +193,8 @@ extension MutableSpan where Element: ~Copyable {
}
}
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension RawSpan {
@_alwaysEmitIntoClient
@@ -198,7 +210,8 @@ extension RawSpan {
}
}
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension MutableSpan where Element: ~Copyable {
@_alwaysEmitIntoClient
@@ -211,7 +224,8 @@ extension MutableSpan where Element: ~Copyable {
}
//MARK: Collection, RandomAccessCollection
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension MutableSpan where Element: ~Copyable {
@_alwaysEmitIntoClient
@@ -228,7 +242,8 @@ extension MutableSpan where Element: ~Copyable {
}
}
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension MutableSpan where Element: BitwiseCopyable {
/// Construct a RawSpan over the memory represented by this span
@@ -243,7 +258,8 @@ extension MutableSpan where Element: BitwiseCopyable {
}
}
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension MutableSpan where Element: ~Copyable {
/// Accesses the element at the specified position in the `Span`.
@@ -296,7 +312,8 @@ extension MutableSpan where Element: ~Copyable {
}
}
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension MutableSpan where Element: ~Copyable {
@_alwaysEmitIntoClient
@@ -319,7 +336,8 @@ extension MutableSpan where Element: ~Copyable {
}
}
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension MutableSpan where Element: BitwiseCopyable {
/// Accesses the element at the specified position in the `Span`.
@@ -368,7 +386,8 @@ extension MutableSpan where Element: BitwiseCopyable {
}
}
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension MutableSpan where Element: ~Copyable {
//FIXME: mark closure parameter as non-escaping
@@ -399,7 +418,8 @@ extension MutableSpan where Element: ~Copyable {
}
}
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension MutableSpan where Element: BitwiseCopyable {
//FIXME: mark closure parameter as non-escaping
@@ -425,7 +445,8 @@ extension MutableSpan where Element: BitwiseCopyable {
}
//MARK: bulk-update functions
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension MutableSpan {
@_alwaysEmitIntoClient
@@ -510,7 +531,8 @@ extension MutableSpan {
}
}
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension MutableSpan where Element: ~Copyable {
// @_alwaysEmitIntoClient
@@ -543,7 +565,8 @@ extension MutableSpan where Element: ~Copyable {
}
}
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension MutableSpan {
@_alwaysEmitIntoClient
@@ -555,7 +578,8 @@ extension MutableSpan {
}
}
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension MutableSpan where Element: BitwiseCopyable {
@_alwaysEmitIntoClient
@@ -649,7 +673,8 @@ extension MutableSpan where Element: BitwiseCopyable {
}
// MARK: sub-spans
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension MutableSpan where Element: ~Copyable {
/// Constructs a new span over the items within the supplied range of
@@ -767,7 +792,8 @@ extension MutableSpan where Element: ~Copyable {
}
// MARK: prefixes and suffixes
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension MutableSpan where Element: ~Copyable {
/// Returns a span containing the initial elements of this span,

View File

@@ -22,7 +22,8 @@ import Swift
/// owning the contiguous memory, ensuring temporal safety and avoiding
/// use-after-free errors. Operations on `RawSpan` are bounds-checked,
/// ensuring spcial safety and avoiding buffer overflow errors.
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
@frozen
@safe
public struct RawSpan: ~Escapable, Copyable, BitwiseCopyable {
@@ -84,10 +85,12 @@ public struct RawSpan: ~Escapable, Copyable, BitwiseCopyable {
}
}
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension RawSpan: @unchecked Sendable {}
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension RawSpan {
/// Unsafely create a `RawSpan` over initialized memory.
@@ -326,7 +329,8 @@ extension RawSpan {
}
}
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension RawSpan {
/// The number of bytes in the span.
@@ -355,7 +359,8 @@ extension RawSpan {
}
// MARK: extracting sub-spans
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension RawSpan {
/// Constructs a new span over the bytes within the supplied range of
@@ -468,7 +473,8 @@ extension RawSpan {
}
}
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension RawSpan {
/// Calls the given closure with a pointer to the underlying bytes of
@@ -498,7 +504,8 @@ extension RawSpan {
}
}
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension RawSpan {
/// View the bytes of this span as type `T`
@@ -530,7 +537,8 @@ extension RawSpan {
}
// MARK: load
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension RawSpan {
/// Returns a new instance of the given type, constructed from the raw memory
@@ -646,7 +654,8 @@ extension RawSpan {
}
}
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension RawSpan {
/// Returns a Boolean value indicating whether two `RawSpan` instances
/// refer to the same region in memory.
@@ -678,7 +687,8 @@ extension RawSpan {
}
// MARK: prefixes and suffixes
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension RawSpan {
/// Returns a span containing the initial bytes of this span,

View File

@@ -24,7 +24,8 @@ import Swift
/// ensuring spcial safety and avoiding buffer overflow errors.
@frozen
@safe
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
public struct Span<Element: ~Copyable>: ~Escapable, Copyable, BitwiseCopyable {
/// The starting address of this `Span`.
@@ -85,10 +86,12 @@ public struct Span<Element: ~Copyable>: ~Escapable, Copyable, BitwiseCopyable {
}
}
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension Span: @unchecked Sendable where Element: Sendable & ~Copyable {}
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension Span where Element: ~Copyable {
/// Unsafely create a `Span` over initialized memory.
@@ -165,7 +168,8 @@ extension Span where Element: ~Copyable {
}
}
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension Span /*where Element: Copyable*/ {
/// Unsafely create a `Span` over initialized memory.
@@ -211,7 +215,8 @@ extension Span /*where Element: Copyable*/ {
}
}
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension Span where Element: BitwiseCopyable {
/// Unsafely create a `Span` over initialized memory.
@@ -374,7 +379,8 @@ extension Span where Element: BitwiseCopyable {
}
}
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension Span where Element: ~Copyable {
/// The number of elements in the span.
@@ -406,7 +412,8 @@ extension Span where Element: ~Copyable {
}
}
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension Span where Element: ~Copyable {
@_semantics("fixed_storage.check_index")
@inline(__always)
@@ -459,7 +466,8 @@ extension Span where Element: ~Copyable {
}
}
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension Span where Element: BitwiseCopyable {
/// Accesses the element at the specified position in the `Span`.
///
@@ -509,7 +517,8 @@ extension Span where Element: BitwiseCopyable {
}
// MARK: sub-spans
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension Span where Element: ~Copyable {
/// Constructs a new span over the items within the supplied range of
@@ -628,7 +637,8 @@ extension Span where Element: ~Copyable {
}
// MARK: UnsafeBufferPointer access hatch
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension Span where Element: ~Copyable {
/// Calls a closure with a pointer to the viewed contiguous storage.
@@ -661,7 +671,8 @@ extension Span where Element: ~Copyable {
}
}
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension Span where Element: BitwiseCopyable {
/// Calls the given closure with a pointer to the underlying bytes of
@@ -693,7 +704,8 @@ extension Span where Element: BitwiseCopyable {
}
}
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension Span where Element: ~Copyable {
/// Returns a Boolean value indicating whether two `Span` instances
/// refer to the same region in memory.
@@ -728,7 +740,8 @@ extension Span where Element: ~Copyable {
}
// MARK: prefixes and suffixes
@available(SwiftStdlib 6.2, *)
@available(SwiftCompatibilitySpan 5.0, *)
@_originallyDefinedIn(module: "Swift;CompatibilitySpan", SwiftCompatibilitySpan 6.2)
extension Span where Element: ~Copyable {
/// Returns a span containing the initial elements of this span,

View File

@@ -4,6 +4,8 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND DEFINED SWIFT_STDLIB_LIBRARY_BUILD_TY
add_swift_target_library("${library_name}" ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_STDLIB
FakeStdlib.swift
../../public/core/Span/MutableRawSpan.swift
../../public/core/Span/MutableSpan.swift
../../public/core/Span/RawSpan.swift
../../public/core/Span/Span.swift
@@ -17,6 +19,8 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND DEFINED SWIFT_STDLIB_LIBRARY_BUILD_TY
-module-abi-name Swift
-DSPAN_COMPATIBILITY_STUB
NO_SWIFTMODULE
DEPLOYMENT_VERSION_OSX ${COMPATIBILITY_MINIMUM_DEPLOYMENT_VERSION_OSX}
DEPLOYMENT_VERSION_IOS ${COMPATIBILITY_MINIMUM_DEPLOYMENT_VERSION_IOS}
DEPLOYMENT_VERSION_TVOS ${COMPATIBILITY_MINIMUM_DEPLOYMENT_VERSION_TVOS}

View File

@@ -59,6 +59,20 @@ internal func _overrideLifetime<
dependent
}
@unsafe
@_unsafeNonescapableResult
@_alwaysEmitIntoClient
@_transparent
@lifetime(&source)
internal func _overrideLifetime<
T: ~Copyable & ~Escapable, U: ~Copyable & ~Escapable
>(
_ dependent: consuming T,
mutating source: inout U
) -> T {
dependent
}
extension Range {
@_alwaysEmitIntoClient
internal init(_uncheckedBounds bounds: (lower: Bound, upper: Bound)) {

View File

@@ -1093,3 +1093,36 @@ Added: _$ss18EnumeratedSequenceVyxGSKsSkRzrlMc
// Indirect tagged string creation
Added: __swift_stdlib_CreateIndirectTaggedPointerString
// Span backward deployment
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss11MutableSpanVMa$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss11MutableSpanVMn$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss11MutableSpanVsRi_zrlE10_uncheckedAByxGSryxG_tcfC$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss11MutableSpanVsRi_zrlE6_countSivg$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss11MutableSpanVsRi_zrlE8_pointerSvSgvg$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss14MutableRawSpanV6_countSivg$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss14MutableRawSpanV8_pointerSvSgvg$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss14MutableRawSpanVMa$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss14MutableRawSpanVMn$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss14MutableRawSpanVN$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss4SpanVMa$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss4SpanVMn$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss4SpanVsRi_zrlE5countSivpMV$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss4SpanVsRi_zrlE6_countSivg$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss4SpanVsRi_zrlE6_countSivpMV$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss4SpanVsRi_zrlE7indicesSnySiGvpMV$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss4SpanVsRi_zrlE7isEmptySbvpMV$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss4SpanVsRi_zrlE8_pointerSVSgvg$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss4SpanVsRi_zrlE8_pointerSVSgvpMV$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss4SpanVss15BitwiseCopyableRzlE9uncheckedxSi_tcipMV$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss4SpanVss15BitwiseCopyableRzlEyxSicipMV$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss7RawSpanV11byteOffsetsSnySiGvpMV$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss7RawSpanV6_countSivg$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss7RawSpanV6_countSivpMV$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss7RawSpanV7isEmptySbvpMV$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss7RawSpanV8_pointerSVSgvg$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss7RawSpanV8_pointerSVSgvpMV$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss7RawSpanV9byteCountSivpMV$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss7RawSpanVMa$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss7RawSpanVMn$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss7RawSpanVN$

View File

@@ -1093,3 +1093,38 @@ Added: _$ss18EnumeratedSequenceVyxGSKsSkRzrlMc
// Indirect tagged string creation
Added: __swift_stdlib_CreateIndirectTaggedPointerString
// Span backward deployment
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss11MutableSpanVMa$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss11MutableSpanVMn$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss11MutableSpanVsRi_zrlE10_uncheckedAByxGSryxG_tcfC$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss11MutableSpanVsRi_zrlE6_countSivg$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss11MutableSpanVsRi_zrlE8_pointerSvSgvg$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss14MutableRawSpanV6_countSivg$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss14MutableRawSpanV8_pointerSvSgvg$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss14MutableRawSpanVMa$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss14MutableRawSpanVMn$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss14MutableRawSpanVN$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss4SpanVMa$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss4SpanVMn$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss4SpanVsRi_zrlE5countSivpMV$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss4SpanVsRi_zrlE6_countSivg$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss4SpanVsRi_zrlE6_countSivpMV$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss4SpanVsRi_zrlE7indicesSnySiGvpMV$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss4SpanVsRi_zrlE7isEmptySbvpMV$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss4SpanVsRi_zrlE8_pointerSVSgvg$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss4SpanVsRi_zrlE8_pointerSVSgvpMV$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss4SpanVss15BitwiseCopyableRzlE9uncheckedxSi_tcipMV$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss4SpanVss15BitwiseCopyableRzlEyxSicipMV$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss7RawSpanV11byteOffsetsSnySiGvpMV$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss7RawSpanV6_countSivg$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss7RawSpanV6_countSivpMV$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss7RawSpanV7isEmptySbvpMV$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss7RawSpanV8_pointerSVSgvg$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss7RawSpanV8_pointerSVSgvpMV$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss7RawSpanV9byteCountSivpMV$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss7RawSpanVMa$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss7RawSpanVMn$
Added: $ld$previous$@rpath/libswiftCompatibilitySpan.dylib$$1$10.14$15.0$_$ss7RawSpanVN$

View File

@@ -502,7 +502,7 @@ def availability_macro_to_swift_abi_target_triple(macro):
# Use a regex and split to pull out the components of an availability macro
# that is formatted like this:
# SwiftStdlib 5.0:macOS 10.14.4, iOS 12.2, watchOS 5.2, tvOS 12.2
matches = re.search(r'^[\s]*SwiftStdlib[\s]+([0-9\.]+)[\s]*:[\s]*(.+)', macro)
matches = re.search(r'^[\s]*Swift(?:Stdlib|CompatibilitySpan)[\s]+([0-9\.]+)[\s]*:[\s]*(.+)', macro)
stdlib_vers = matches.group(1)
vers_by_platform = {}
for platform_vers in matches.group(2).split(', '):

View File

@@ -36,8 +36,16 @@ SwiftStdlib 5.8:macOS 13.3, iOS 16.4, watchOS 9.4, tvOS 16.4
SwiftStdlib 5.9:macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0
SwiftStdlib 5.10:macOS 14.4, iOS 17.4, watchOS 10.4, tvOS 17.4, visionOS 1.1
SwiftStdlib 6.0:macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0
SwiftStdlib 6.1:macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, visionOS 9999
SwiftStdlib 6.1:macOS 15.4, iOS 18.4, watchOS 11.4, tvOS 18.4, visionOS 2.4
SwiftStdlib 6.2:macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, visionOS 9999
# Like SwiftStdlib 5.0, but also the oldest visionOS from SwiftStdlib 5.10.
SwiftCompatibilitySpan 5.0:macOS 10.14.4, iOS 12.2, watchOS 5.2, tvOS 12.2, visionOS 1.1
# Note: This cannot be 9999, so use the last non-placeholder entry instead.
# This will go away once 'SwiftStdlib 6.2' is filled in.
SwiftCompatibilitySpan 6.2:macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0
# TODO: When you add a new version, remember to tell the compiler about it
# by also adding it to include/swift/AST/RuntimeVersions.def.

View File

@@ -48,6 +48,7 @@ for filename in os.listdir(sdk_overlay_dir):
"SwiftLang",
# swiftCxxStdlib uses `-module-interface-preserve-types-as-written`
"CxxStdlib",
"CompatibilitySpan",
]:
continue