summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2011-04-19 21:12:05 +0000
committerDaniel Dunbar <daniel@zuster.org>2011-04-19 21:12:05 +0000
commit163a0966a92bb989b1d91c59be5943a4f2988cf7 (patch)
treed399adcdc5ca6b6a14df0e1418d6797c47377762 /llvm/include
parent3c0fbce10b20609422c2ee50081cc1dcf39a9c69 (diff)
downloadbcm5719-llvm-163a0966a92bb989b1d91c59be5943a4f2988cf7.tar.gz
bcm5719-llvm-163a0966a92bb989b1d91c59be5943a4f2988cf7.zip
ADT/Triple: Add isOSDarwin() and isOSWindows() helper functions.
llvm-svn: 129815
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/ADT/Triple.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/include/llvm/ADT/Triple.h b/llvm/include/llvm/ADT/Triple.h
index 480c9316bd0..f8e0ec88786 100644
--- a/llvm/include/llvm/ADT/Triple.h
+++ b/llvm/include/llvm/ADT/Triple.h
@@ -249,6 +249,8 @@ public:
return getOSMajorVersion();
}
+ /// isOSVersionLT - Helper function for doing comparisons against version
+ /// numbers included in the target triple.
bool isOSVersionLT(unsigned Major, unsigned Minor = 0,
unsigned Micro = 0) const {
unsigned LHS[3];
@@ -270,6 +272,17 @@ public:
return getOS() == Triple::Darwin || getOS() == Triple::OSX;
}
+ /// isOSDarwin - Is this a "Darwin" OS (OS X or iOS).
+ bool isOSDarwin() const {
+ return isOSX() ||getOS() == Triple::IOS;
+ }
+
+ /// isOSWindows - Is this a "Windows" OS.
+ bool isOSWindows() const {
+ return getOS() == Triple::Win32 || getOS() == Triple::Cygwin ||
+ getOS() == Triple::MinGW32;
+ }
+
/// isOSXVersionLT - Comparison function for checking OS X version
/// compatibility, which handles supporting skewed version numbering schemes
/// used by the "darwin" triples.
OpenPOWER on IntegriCloud