Skip to content

[master] Apple Silicon support #32705

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 37 commits into from
Jul 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
c894511
[Apple Silicon] Add arm64 macOS support to benchmark suite
shahmishal Jul 2, 2020
ff547e7
[Apple Silicon][Test] Enable testing for arm64 macOS
shahmishal Jul 2, 2020
84489d8
[Apple Silicon] Mark several tests that require the Swift interpreter…
shahmishal Jul 2, 2020
92ca9fc
[Apple Silicon] Generalize tests for other macOS architectures
shahmishal Jul 2, 2020
1899d2c
[Apple Silicon] Mark macOS tests that require x86_64
shahmishal Jul 2, 2020
919da26
[Apple Silicon] [Build] Generalize macOS architecture check
shahmishal Jul 2, 2020
4c97d0c
[Apple Silicon] [ObjectiveC Overlay] ObjCBool is C _Bool on arm64 macOS.
shahmishal Jul 2, 2020
134f202
[Apple Silicon] Baseline arm64 macOS at Swift 5.3 / macOS 10.16
shahmishal Jul 2, 2020
efe5907
[Apple Silicon] [Test] Fix various IRGen tests for arm64 macOS
shahmishal Jul 3, 2020
02b7403
[Apple Silicon] [Test] Generalize api-digester tests for Apple Silico…
shahmishal Jul 3, 2020
ee1ea6e
[Apple Silicon] Support building for macOS arm64/arm64e
shahmishal Jul 3, 2020
960f6ce
[Apple Silicon] [build-script] Support stdlib macOS arm64/arm64e
shahmishal Jul 3, 2020
37f7848
[Apple Silicon] Use SWIFT_CROSS_COMPILING to use build-time tools (tb…
shahmishal Jul 3, 2020
587ce88
[Apple Silicon] Don't set native llvm tools path when cross compiling…
shahmishal Jul 3, 2020
91a1dc4
[Apple Silicon] [build-script] Build compiler-rt even when cross-comp…
shahmishal Jul 3, 2020
24a48ef
[Apple Silicon] [build-script] Fix cross-compile check.
shahmishal Jul 3, 2020
5218470
[Apple Silicon] Build system configuration to support arm64 macOS
shahmishal Jul 3, 2020
7009e2e
[Apple Silicon] [build-script] Fix lipo step invocation with --no-leg…
shahmishal Jul 3, 2020
2aef2c5
[Apple Silicon] Fix cross-compilation in Xcode trains where we're not…
shahmishal Jul 3, 2020
24e8e32
[Apple Silicon] [Platform] Default arm64 macOS and arm64 simulators t…
shahmishal Jul 3, 2020
0c2617f
[Apple Silicon] [IRGen] Fix test for arm64 macOS
shahmishal Jul 3, 2020
3c9e72f
[Apple Silicon] [macCatalyst] Baseline arm64(e) macCatalyst at Swift …
shahmishal Jul 3, 2020
a8aec14
[Apple Silicon] Adjust linking deployment target from 11.0 down to 10…
shahmishal Jul 3, 2020
6336b14
[Apple Silicon] [In-process memory reader] Adjust low-bits computatio…
shahmishal Jul 3, 2020
83c57f3
[Apple Silicon] [Build] Filter out any architectures that are unsuppo…
shahmishal Jul 3, 2020
76fe814
[Apple Silicon] [Test] Fix a few tests for SDK differences
shahmishal Jul 3, 2020
40d0024
[Apple Silicon] [Test] Remove explicitly-specified target.
shahmishal Jul 3, 2020
a930b51
[Apple Silicon] Simulator support for arm64
shahmishal Jul 3, 2020
710ba14
[Apple Silicon] [Platform] Baseline arm64 simulators at iOS/tvOS 14.0…
shahmishal Jul 3, 2020
194d5d0
[Apple Silicon] Use a correct isa mask on Apple Silicon without signe…
shahmishal Jul 3, 2020
0c07365
[Apple Silicon] Fix the availability for Swift 5.3 version
shahmishal Jul 3, 2020
60d996f
[Apple Silicon] Add support for triple and availability canonicalization
shahmishal Jul 3, 2020
10dda58
[Apple Silicon] Update tests for no macOS target triple canonicalization
shahmishal Jul 3, 2020
899925a
[Apple Silicon] Remove tvOS/watchOS simulator from Driver/linker test
shahmishal Jul 3, 2020
3072429
[Apple Silicon] Update the comment in AvailabilitySpec.h
shahmishal Jul 5, 2020
6ef029d
[Apple Silicon] Update the comment in lib/AST/PlatformKind.cpp
shahmishal Jul 5, 2020
bee7ba2
[Apple Silicon] Update the comment in lib/Parse/ParseExpr.cpp
shahmishal Jul 5, 2020
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
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,12 @@ if(SWIFT_PATH_TO_CMARK_BUILD)
endif()
message(STATUS "")

if("${SWIFT_NATIVE_LLVM_TOOLS_PATH}" STREQUAL "")
set(SWIFT_CROSS_COMPILING FALSE)
else()
set(SWIFT_CROSS_COMPILING TRUE)
endif()

include(SwiftSharedCMakeConfig)

# NOTE: We include this before SwiftComponents as it relies on some LLVM CMake
Expand Down
8 changes: 2 additions & 6 deletions benchmark/cmake/modules/AddSwiftBenchmarkSuite.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ macro(configure_build)
endmacro()

macro(configure_sdks_darwin)
set(macosx_arch "x86_64")
set(macosx_arch "x86_64" "arm64")
set(iphoneos_arch "arm64" "arm64e" "armv7")
set(appletvos_arch "arm64")
set(watchos_arch "armv7k")
Expand Down Expand Up @@ -609,11 +609,7 @@ function (swift_benchmark_compile_archopts)

if(is_darwin)
# If host == target.
if("${BENCH_COMPILE_ARCHOPTS_PLATFORM}" STREQUAL "macosx")
set(OUTPUT_EXEC "${benchmark-bin-dir}/Benchmark_${BENCH_COMPILE_ARCHOPTS_OPT}")
else()
set(OUTPUT_EXEC "${benchmark-bin-dir}/Benchmark_${BENCH_COMPILE_ARCHOPTS_OPT}-${target}")
endif()
set(OUTPUT_EXEC "${benchmark-bin-dir}/Benchmark_${BENCH_COMPILE_ARCHOPTS_OPT}-${target}")
else()
# If we are on Linux, we do not support cross compiling.
set(OUTPUT_EXEC "${benchmark-bin-dir}/Benchmark_${BENCH_COMPILE_ARCHOPTS_OPT}")
Expand Down
27 changes: 22 additions & 5 deletions cmake/modules/DarwinSDKs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,34 @@ option(SWIFT_ENABLE_IOS32

if(SWIFT_ENABLE_IOS32)
set(SUPPORTED_IOS_ARCHS "armv7;armv7s;arm64;arm64e")
set(SUPPORTED_IOS_SIMULATOR_ARCHS "i386;x86_64")
set(SUPPORTED_IOS_SIMULATOR_ARCHS "i386;x86_64;arm64")
else()
set(SUPPORTED_IOS_ARCHS "arm64;arm64e")
set(SUPPORTED_IOS_SIMULATOR_ARCHS "x86_64")
set(SUPPORTED_IOS_SIMULATOR_ARCHS "x86_64;arm64")
endif()

set(SUPPORTED_TVOS_ARCHS "arm64")
set(SUPPORTED_TVOS_SIMULATOR_ARCHS "x86_64")
set(SUPPORTED_TVOS_SIMULATOR_ARCHS "x86_64;arm64")
set(SUPPORTED_WATCHOS_ARCHS "armv7k")
set(SUPPORTED_WATCHOS_SIMULATOR_ARCHS "i386")
set(SUPPORTED_OSX_ARCHS "x86_64")
set(SUPPORTED_WATCHOS_SIMULATOR_ARCHS "i386;arm64")
set(SUPPORTED_OSX_ARCHS "x86_64;arm64;arm64e")

# Get the SDK version from SDKSettings.
execute_process(
COMMAND "defaults" "read" "${CMAKE_OSX_SYSROOT}/SDKSettings.plist" "Version"
OUTPUT_VARIABLE SWIFT_OSX_SDK_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)

# Remove the last component, if any. e.g. 10.15.26 -> 10.15
string(REGEX REPLACE "\([0-9]*[.][0-9]*\)[.][0-9]*" "\\1"
SWIFT_OSX_SDK_VERSION "${SWIFT_OSX_SDK_VERSION}")

if (${SWIFT_OSX_SDK_VERSION} STREQUAL "10.14" OR
${SWIFT_OSX_SDK_VERSION} STREQUAL "10.15")
set(SUPPORTED_OSX_ARCHS "x86_64")
else()
set(SUPPORTED_OSX_ARCHS "x86_64;arm64e")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this include arm64 like line 17?

Copy link
Member Author

@shahmishal shahmishal Jul 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going to file a bugs.swift.org and follow up in the future PR. SR-13144

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This bit of code should be dead now

endif()

is_sdk_requested(OSX swift_build_osx)
if(swift_build_osx)
Expand Down
35 changes: 35 additions & 0 deletions cmake/modules/SwiftConfigureSDK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,38 @@ function(_report_sdk prefix)
message(STATUS "")
endfunction()

# Remove architectures not supported by the SDK from the given list.
function(remove_sdk_unsupported_archs name os sdk_path architectures_var)
execute_process(COMMAND
/usr/libexec/PlistBuddy -c "Print :SupportedTargets:${os}:Archs" ${sdk_path}/SDKSettings.plist
OUTPUT_VARIABLE sdk_supported_archs
RESULT_VARIABLE plist_error)

if (NOT plist_error EQUAL 0)
message(STATUS "${os} SDK at ${sdk_path} does not publish its supported architectures")
return()
endif()

set(architectures)
foreach(arch ${${architectures_var}})
if(sdk_supported_archs MATCHES "${arch}\n")
list(APPEND architectures ${arch})
elseif(arch MATCHES "^armv7(s)?$" AND os STREQUAL "iphoneos")
# 32-bit iOS is not listed explicitly in SDK settings.
message(STATUS "Assuming ${name} SDK at ${sdk_path} supports architecture ${arch}")
list(APPEND architectures ${arch})
elseif(arch STREQUAL "i386" AND os STREQUAL "iphonesimulator")
# 32-bit iOS simulatoris not listed explicitly in SDK settings.
message(STATUS "Assuming ${name} SDK at ${sdk_path} supports architecture ${arch}")
list(APPEND architectures ${arch})
else()
message(STATUS "${name} SDK at ${sdk_path} does not support architecture ${arch}")
endif()
endforeach()

set("${architectures_var}" ${architectures} PARENT_SCOPE)
endfunction()

# Configure an SDK
#
# Usage:
Expand Down Expand Up @@ -164,6 +196,9 @@ macro(configure_sdk_darwin
SWIFT_SDK_${prefix}_ARCHITECTURES) # result
endif()

# Remove any architectures not supported by the SDK.
remove_sdk_unsupported_archs(${name} ${xcrun_name} ${SWIFT_SDK_${prefix}_PATH} SWIFT_SDK_${prefix}_ARCHITECTURES)

list_intersect(
"${SWIFT_DARWIN_MODULE_ARCHS}" # lhs
"${architectures}" # rhs
Expand Down
2 changes: 1 addition & 1 deletion cmake/modules/SwiftSharedCMakeConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ macro(swift_common_standalone_build_config_llvm product)
fix_imported_targets_for_xcode("${LLVM_EXPORTED_TARGETS}")
endif()

if(NOT CMAKE_CROSSCOMPILING)
if(NOT CMAKE_CROSSCOMPILING AND NOT SWIFT_CROSS_COMPILING)
set(${product}_NATIVE_LLVM_TOOLS_PATH "${LLVM_TOOLS_BINARY_DIR}")
endif()

Expand Down
22 changes: 22 additions & 0 deletions include/swift/AST/AvailabilitySpec.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,33 @@ class PlatformVersionConstraintAvailabilitySpec : public AvailabilitySpec {
SourceLoc PlatformLoc;

llvm::VersionTuple Version;

// For macOS Big Sur, we canonicalize 10.16 to 11.0 for compile-time
// checking since clang canonicalizes availability markup. However, to
// support Beta versions of macOS Big Sur where the OS
// reports 10.16 at run time, we need to compare against 10.16,
//
// This means for:
//
// if #available(macOS 10.16, *) { ... }
//
// we need to keep around both a canonical version for use in compile-time
// checks and an uncanonicalized version for the version to actually codegen
// with.
llvm::VersionTuple RuntimeVersion;

SourceRange VersionSrcRange;

public:
PlatformVersionConstraintAvailabilitySpec(PlatformKind Platform,
SourceLoc PlatformLoc,
llvm::VersionTuple Version,
llvm::VersionTuple RuntimeVersion,
SourceRange VersionSrcRange)
: AvailabilitySpec(AvailabilitySpecKind::PlatformVersionConstraint),
Platform(Platform),
PlatformLoc(PlatformLoc), Version(Version),
RuntimeVersion(RuntimeVersion),
VersionSrcRange(VersionSrcRange) {}

/// The required platform.
Expand All @@ -93,6 +110,11 @@ class PlatformVersionConstraintAvailabilitySpec : public AvailabilitySpec {
llvm::VersionTuple getVersion() const { return Version; }
SourceRange getVersionSrcRange() const { return VersionSrcRange; }

// The version to be used in codegen for version comparisons at run time.
// This is required to support beta versions of macOS Big Sur that
// report 10.16 at run time.
llvm::VersionTuple getRuntimeVersion() const { return RuntimeVersion; }

SourceRange getSourceRange() const;

void print(raw_ostream &OS, unsigned Indent) const;
Expand Down
4 changes: 4 additions & 0 deletions include/swift/AST/PlatformKind.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "swift/Basic/LLVM.h"
#include "swift/Config.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/VersionTuple.h"

namespace swift {

Expand Down Expand Up @@ -65,6 +66,9 @@ PlatformKind targetPlatform(const LangOptions &LangOpts);
/// an explicit attribute for the child.
bool inheritsAvailabilityFromPlatform(PlatformKind Child, PlatformKind Parent);

llvm::VersionTuple canonicalizePlatformVersion(
PlatformKind platform, const llvm::VersionTuple &version);

} // end namespace swift

#endif
4 changes: 2 additions & 2 deletions include/swift/Remote/InProcessMemoryReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class InProcessMemoryReader final : public MemoryReader {
#else
auto applePlatform = false;
#endif
#if defined(__APPLE__) && __APPLE__ && ((defined(TARGET_OS_IOS) && TARGET_OS_IOS) || (defined(TARGET_OS_IOS) && TARGET_OS_WATCH) || (defined(TARGET_OS_TV) && TARGET_OS_TV))
#if defined(__APPLE__) && __APPLE__ && ((defined(TARGET_OS_IOS) && TARGET_OS_IOS) || (defined(TARGET_OS_IOS) && TARGET_OS_WATCH) || (defined(TARGET_OS_TV) && TARGET_OS_TV) || defined(__arm64__))
auto iosDerivedPlatform = true;
#else
auto iosDerivedPlatform = false;
Expand Down Expand Up @@ -67,7 +67,7 @@ class InProcessMemoryReader final : public MemoryReader {
case DLQ_GetObjCReservedLowBits: {
auto result = static_cast<uint8_t *>(outBuffer);
if (applePlatform && !iosDerivedPlatform && (sizeof(void *) == 8)) {
// Obj-C reserves low bit on 64-bit macOS only.
// Obj-C reserves low bit on 64-bit Intel macOS only.
// Other Apple platforms don't reserve this bit (even when
// running on x86_64-based simulators).
*result = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ swift_reflection_interop_minimalDataLayoutQueryFunction8(
#else
int applePlatform = 0;
#endif
#if defined(__APPLE__) && __APPLE__ && ((defined(TARGET_OS_IOS) && TARGET_OS_IOS) || (defined(TARGET_OS_IOS) && TARGET_OS_WATCH) || (defined(TARGET_OS_TV) && TARGET_OS_TV))
#if defined(__APPLE__) && __APPLE__ && ((defined(TARGET_OS_IOS) && TARGET_OS_IOS) || (defined(TARGET_OS_IOS) && TARGET_OS_WATCH) || (defined(TARGET_OS_TV) && TARGET_OS_TV) || defined(__arm64__))
int iosDerivedPlatform = 1;
#else
int iosDerivedPlatform = 0;
Expand Down
55 changes: 45 additions & 10 deletions lib/AST/Availability.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,16 @@ AvailabilityContext ASTContext::getSwift50Availability() {
return AvailabilityContext::alwaysAvailable();

if (target.isMacOSX()) {
if (target.isAArch64())
return AvailabilityContext::alwaysAvailable();

return AvailabilityContext(
VersionRange::allGTE(llvm::VersionTuple(10,14,4)));
} else if (target.isiOS()) {
if (target.isAArch64() &&
(target.isSimulatorEnvironment() || target.isMacCatalystEnvironment()))
return AvailabilityContext::alwaysAvailable();

return AvailabilityContext(
VersionRange::allGTE(llvm::VersionTuple(12,2)));
} else if (target.isWatchOS()) {
Expand All @@ -274,9 +281,16 @@ AvailabilityContext ASTContext::getSwift51Availability() {
return AvailabilityContext::alwaysAvailable();

if (target.isMacOSX()) {
if (target.isAArch64())
return AvailabilityContext::alwaysAvailable();

return AvailabilityContext(
VersionRange::allGTE(llvm::VersionTuple(10,15,0)));
} else if (target.isiOS()) {
if (target.isAArch64() &&
(target.isSimulatorEnvironment() || target.isMacCatalystEnvironment()))
return AvailabilityContext::alwaysAvailable();

return AvailabilityContext(
VersionRange::allGTE(llvm::VersionTuple(13,0,0)));
} else if (target.isWatchOS()) {
Expand Down Expand Up @@ -310,18 +324,27 @@ AvailabilityContext ASTContext::getSwift52Availability() {
if (target.getArchName() == "arm64e")
return AvailabilityContext::alwaysAvailable();

if (target.isMacOSX() ) {
if (target.isMacOSX()) {
if (target.isAArch64())
return AvailabilityContext::alwaysAvailable();

return AvailabilityContext(
VersionRange::allGTE(llvm::VersionTuple(10, 99, 0)));
VersionRange::allGTE(llvm::VersionTuple(10, 15, 4)));
} else if (target.isiOS()) {
if (target.isAArch64() &&
(target.isSimulatorEnvironment() || target.isMacCatalystEnvironment()))
return AvailabilityContext::alwaysAvailable();

return AvailabilityContext(
VersionRange::allGTE(llvm::VersionTuple(99, 0, 0)));
VersionRange::allGTE(llvm::VersionTuple(13, 4, 0)));
} else if (target.isWatchOS()) {
if (target.isArch64Bit())
return AvailabilityContext::alwaysAvailable();

return AvailabilityContext(
VersionRange::allGTE(llvm::VersionTuple(9, 99, 0)));
} else {
return AvailabilityContext::alwaysAvailable();
VersionRange::allGTE(llvm::VersionTuple(6, 2, 0)));
}
return AvailabilityContext::alwaysAvailable();
}

AvailabilityContext ASTContext::getSwift53Availability() {
Expand All @@ -331,14 +354,26 @@ AvailabilityContext ASTContext::getSwift53Availability() {
return AvailabilityContext::alwaysAvailable();

if (target.isMacOSX() ) {
if (target.isAArch64())
return AvailabilityContext::alwaysAvailable();

llvm::VersionTuple macOVersion53(10, 16, 0);
macOVersion53 = canonicalizePlatformVersion(PlatformKind::OSX, macOVersion53);
return AvailabilityContext(
VersionRange::allGTE(llvm::VersionTuple(10, 99, 0)));
VersionRange::allGTE(macOVersion53));
} else if (target.isiOS()) {
if (target.isAArch64() &&
(target.isSimulatorEnvironment() || target.isMacCatalystEnvironment()))
return AvailabilityContext::alwaysAvailable();

return AvailabilityContext(
VersionRange::allGTE(llvm::VersionTuple(99, 0, 0)));
VersionRange::allGTE(llvm::VersionTuple(14, 0, 0)));
} else if (target.isWatchOS()) {
if (target.isArch64Bit())
return AvailabilityContext::alwaysAvailable();

return AvailabilityContext(
VersionRange::allGTE(llvm::VersionTuple(9, 99, 0)));
VersionRange::allGTE(llvm::VersionTuple(7, 0, 0)));
} else {
return AvailabilityContext::alwaysAvailable();
}
Expand All @@ -349,7 +384,7 @@ AvailabilityContext ASTContext::getSwiftFutureAvailability() {

if (target.isMacOSX() ) {
return AvailabilityContext(
VersionRange::allGTE(llvm::VersionTuple(10, 99, 0)));
VersionRange::allGTE(llvm::VersionTuple(99, 99, 0)));
} else if (target.isiOS()) {
return AvailabilityContext(
VersionRange::allGTE(llvm::VersionTuple(99, 0, 0)));
Expand Down
15 changes: 15 additions & 0 deletions lib/AST/PlatformKind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "llvm/ADT/StringSwitch.h"
#include "llvm/Support/ErrorHandling.h"


using namespace swift;

StringRef swift::platformString(PlatformKind platform) {
Expand Down Expand Up @@ -155,3 +156,17 @@ bool swift::inheritsAvailabilityFromPlatform(PlatformKind Child,

return false;
}

llvm::VersionTuple swift::canonicalizePlatformVersion(
PlatformKind platform, const llvm::VersionTuple &version) {

// Canonicalize macOS version for macOS Big Sur to treat
// 10.16 as 11.0.
if (platform == PlatformKind::OSX ||
platform == PlatformKind::OSXApplicationExtension) {
return llvm::Triple::getCanonicalVersionForOS(llvm::Triple::MacOSX,
version);
}

return version;
}
12 changes: 12 additions & 0 deletions lib/Basic/Platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,9 @@ swift::getSwiftRuntimeCompatibilityVersionForTarget(
if (Triple.isMacOSX()) {
Triple.getMacOSXVersion(Major, Minor, Micro);
if (Major == 10) {
if (Triple.isAArch64() && Minor <= 16)
return llvm::VersionTuple(5, 3);

if (Minor <= 14) {
return llvm::VersionTuple(5, 0);
} else if (Minor <= 15) {
Expand All @@ -396,9 +399,18 @@ swift::getSwiftRuntimeCompatibilityVersionForTarget(
return llvm::VersionTuple(5, 2);
}
}
} else if (Major == 11) {
return llvm::VersionTuple(5, 3);
}
} else if (Triple.isiOS()) { // includes tvOS
Triple.getiOSVersion(Major, Minor, Micro);

// arm64 simulators and macCatalyst are introduced in iOS 14.0/tvOS 14.0
// with Swift 5.3
if (Triple.isAArch64() && Major <= 14 &&
(Triple.isSimulatorEnvironment() || Triple.isMacCatalystEnvironment()))
return llvm::VersionTuple(5, 3);

if (Major <= 12) {
return llvm::VersionTuple(5, 0);
} else if (Major <= 13) {
Expand Down
Loading