diff options
author | Alex Lorenz <arphaman@gmail.com> | 2017-05-03 10:42:35 +0000 |
---|---|---|
committer | Alex Lorenz <arphaman@gmail.com> | 2017-05-03 10:42:35 +0000 |
commit | c748d7b57b2e383df1dc4ca088a1d6ea49ab1a55 (patch) | |
tree | f6375f274697e4ad88695a4351273ed7c3f26d29 /llvm/lib/Support/Triple.cpp | |
parent | 05cfa83843943742762618c3a0e96dd33681778c (diff) | |
download | bcm5719-llvm-c748d7b57b2e383df1dc4ca088a1d6ea49ab1a55.tar.gz bcm5719-llvm-c748d7b57b2e383df1dc4ca088a1d6ea49ab1a55.zip |
[Triple] Add a "macos" OS type that acts as a synonym for "macosx"
The "macosx" OS type is still the canonical type. In the future "macos" will
become the canonical OS type (but we will still support "macosx").
rdar://27043820
Differential Revision: https://reviews.llvm.org/D32748
llvm-svn: 302011
Diffstat (limited to 'llvm/lib/Support/Triple.cpp')
-rw-r--r-- | llvm/lib/Support/Triple.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Support/Triple.cpp b/llvm/lib/Support/Triple.cpp index f3a654d7d2b..eb8108908ac 100644 --- a/llvm/lib/Support/Triple.cpp +++ b/llvm/lib/Support/Triple.cpp @@ -459,7 +459,7 @@ static Triple::OSType parseOS(StringRef OSName) { .StartsWith("kfreebsd", Triple::KFreeBSD) .StartsWith("linux", Triple::Linux) .StartsWith("lv2", Triple::Lv2) - .StartsWith("macosx", Triple::MacOSX) + .StartsWith("macos", Triple::MacOSX) .StartsWith("netbsd", Triple::NetBSD) .StartsWith("openbsd", Triple::OpenBSD) .StartsWith("solaris", Triple::Solaris) @@ -984,6 +984,8 @@ void Triple::getOSVersion(unsigned &Major, unsigned &Minor, StringRef OSTypeName = getOSTypeName(getOS()); if (OSName.startswith(OSTypeName)) OSName = OSName.substr(OSTypeName.size()); + else if (getOS() == MacOSX) + OSName.consume_front("macos"); parseVersionFromName(OSName, Major, Minor, Micro); } |