aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2011-04-19 23:34:12 +0000
committerDaniel Dunbar <daniel@zuster.org>2011-04-19 23:34:12 +0000
commit1af394766fe4e725d5af2fe82c2ad9cfcbc7dd34 (patch)
treeba6af72cc51519c26389f23afd914bbb451dfc4b
parent912225e18559a73228099330a4c253fdccf9fa3d (diff)
downloadexternal_llvm-1af394766fe4e725d5af2fe82c2ad9cfcbc7dd34.tar.gz
external_llvm-1af394766fe4e725d5af2fe82c2ad9cfcbc7dd34.tar.bz2
external_llvm-1af394766fe4e725d5af2fe82c2ad9cfcbc7dd34.zip
ADT/Triple: Add support for Triple::MacOSX per feedback from Chris, will remove
Triple::OSX once Clang has moved. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129833 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/ADT/Triple.h6
-rw-r--r--lib/Support/Triple.cpp3
2 files changed, 7 insertions, 2 deletions
diff --git a/include/llvm/ADT/Triple.h b/include/llvm/ADT/Triple.h
index f8e0ec8878..90a4db120e 100644
--- a/include/llvm/ADT/Triple.h
+++ b/include/llvm/ADT/Triple.h
@@ -86,6 +86,7 @@ public:
IOS,
Linux,
Lv2, // PS3
+ MacOSX,
MinGW32, // i*86-pc-mingw32, *-w64-mingw32
NetBSD,
OSX,
@@ -269,7 +270,8 @@ public:
/// isOSX - Is this an OS X triple. For legacy reasons, we support both
/// "darwin" and "osx" as OS X triples.
bool isOSX() const {
- return getOS() == Triple::Darwin || getOS() == Triple::OSX;
+ return getOS() == Triple::Darwin || getOS() == Triple::OSX ||
+ getOS() == Triple::MacOSX;
}
/// isOSDarwin - Is this a "Darwin" OS (OS X or iOS).
@@ -291,7 +293,7 @@ public:
assert(isOSX() && "Not an OS X triple!");
// If this is OS X, expect a sane version number.
- if (getOS() == Triple::OSX)
+ if (getOS() == Triple::OSX || getOS() == Triple::MacOSX)
return isOSVersionLT(Major, Minor, Micro);
// Otherwise, compare to the "Darwin" number.
diff --git a/lib/Support/Triple.cpp b/lib/Support/Triple.cpp
index 8281b483c9..38cb15a50e 100644
--- a/lib/Support/Triple.cpp
+++ b/lib/Support/Triple.cpp
@@ -102,6 +102,7 @@ const char *Triple::getOSTypeName(OSType Kind) {
case IOS: return "ios";
case Linux: return "linux";
case Lv2: return "lv2";
+ case MacOSX: return "macosx";
case MinGW32: return "mingw32";
case NetBSD: return "netbsd";
case OSX: return "osx";
@@ -322,6 +323,8 @@ Triple::OSType Triple::ParseOS(StringRef OSName) {
return Linux;
else if (OSName.startswith("lv2"))
return Lv2;
+ else if (OSName.startswith("macosx"))
+ return MacOSX;
else if (OSName.startswith("mingw32"))
return MinGW32;
else if (OSName.startswith("netbsd"))