diff --git a/llvm/lib/Support/Triple.cpp b/llvm/lib/Support/Triple.cpp --- a/llvm/lib/Support/Triple.cpp +++ b/llvm/lib/Support/Triple.cpp @@ -1140,9 +1140,9 @@ case TvOS: case WatchOS: // Ignore the version from the triple. This is only handled because the - // the clang driver combines OS X and IOS support into a common Darwin + // the clang driver combines OS X and iOS support into a common Darwin // toolchain that wants to know the OS X version number even when targeting - // IOS. + // iOS. Major = 10; Minor = 4; Micro = 0; @@ -1158,7 +1158,7 @@ case Darwin: case MacOSX: // Ignore the version from the triple. This is only handled because the - // the clang driver combines OS X and IOS support into a common Darwin + // the clang driver combines OS X and iOS support into a common Darwin // toolchain that wants to know the iOS version number even when targeting // OS X. Major = 5; @@ -1634,7 +1634,7 @@ getObjectFormat() == Other.getObjectFormat(); } - // If vendor is apple, ignore the version number. + // If vendor is Apple, ignore the version number. if (getVendor() == Triple::Apple) return getArch() == Other.getArch() && getSubArch() == Other.getSubArch() && getVendor() == Other.getVendor() && getOS() == Other.getOS(); @@ -1643,7 +1643,7 @@ } std::string Triple::merge(const Triple &Other) const { - // If vendor is apple, pick the triple with the larger version number. + // If vendor is Apple, pick the triple with the larger version number. if (getVendor() == Triple::Apple) if (Other.isOSVersionLT(*this)) return str(); @@ -1680,7 +1680,7 @@ // ARM64 simulators are supported for iOS 14+. if (isMacCatalystEnvironment() || isSimulatorEnvironment()) return VersionTuple(14, 0, 0); - // ARM64e slice is supported starting from iOS 14. + // ARM64e slice is supported starting from iOS 14+. if (isArm64e()) return VersionTuple(14, 0, 0); break; @@ -1763,8 +1763,6 @@ return "arm7tdmi"; } } - - llvm_unreachable("invalid arch name"); } VersionTuple Triple::getCanonicalVersionForOS(OSType OSKind, @@ -1774,6 +1772,11 @@ // macOS 10.16 is canonicalized to macOS 11. if (Version == VersionTuple(10, 16)) return VersionTuple(11, 0); + // macOS 10.17 is canonicalized to macOS 12. + // TODO: Find a better way to do this going forward rather than hardcoding a + // new if statement every year + if (Version == VersionTuple(10, 17)) + return VersionTuple(12, 0); LLVM_FALLTHROUGH; default: return Version;