Index: include/llvm/ADT/Triple.h |
=================================================================== |
--- include/llvm/ADT/Triple.h (revision 138335) |
+++ include/llvm/ADT/Triple.h (working copy) |
@@ -254,20 +254,190 @@ |
/// isMacOSX - Is this a Mac OS X triple. For legacy reasons, we support both |
/// "darwin" and "osx" as OS X triples. |
bool isMacOSX() const { |
+#if defined(LLVM_ENABLED_TARGET_OS_MACOSX) || \ |
+ defined(LLVM_ENABLED_TARGET_OS_DARWIN) |
return getOS() == Triple::Darwin || getOS() == Triple::MacOSX; |
+#else |
+ return false; |
+#endif |
} |
/// isOSDarwin - Is this a "Darwin" OS (OS X or iOS). |
bool isOSDarwin() const { |
+#if defined(LLVM_ENABLED_TARGET_OS_MACOSX) || \ |
+ defined(LLVM_ENABLED_TARGET_OS_DARWIN) || \ |
+ defined(LLVM_ENABLED_TARGET_OS_IOS) |
return isMacOSX() || getOS() == Triple::IOS; |
+#else |
+ return false; |
+#endif |
} |
/// isOSWindows - Is this a "Windows" OS. |
bool isOSWindows() const { |
+#if defined(LLVM_ENABLED_TARGET_OS_WIN32) || \ |
+ defined(LLVM_ENABLED_TARGET_OS_CYGWIN) || \ |
+ defined(LLVM_ENABLED_TARGET_OS_MINGW32) |
return getOS() == Triple::Win32 || getOS() == Triple::Cygwin || |
getOS() == Triple::MinGW32; |
+#else |
+ return false; |
+#endif |
} |
+ /// isOSAuroraUX - Is getOS() == AuroraUX. |
+ bool isOSAuroraUX() const { |
+#if defined(LLVM_ENABLED_TARGET_OS_AURORAUX) |
+ return getOS() == Triple::AuroraUX; |
+#else |
+ return false; |
+#endif |
+ } |
+ |
+ /// isOSCygwin - Is getOS() == Cygwin. |
+ bool isOSCygwin() const { |
+#if defined(LLVM_ENABLED_TARGET_OS_CYGWIN) |
+ return getOS() == Triple::Cygwin; |
+#else |
+ return false; |
+#endif |
+ } |
+ |
+ /// isOSDragonFly - Is getOS() == DragonFly. |
+ bool isOSDragonFly() const { |
+#if defined(LLVM_ENABLED_TARGET_OS_DRAGONFLY) |
+ return getOS() == Triple::DragonFly; |
+#else |
+ return false; |
+#endif |
+ } |
+ |
+ /// isOSFreeBSD - Is getOS() == FreeBSD. |
+ bool isOSFreeBSD() const { |
+#if defined(LLVM_ENABLED_TARGET_OS_FREEBSD) |
+ return getOS() == Triple::FreeBSD; |
+#else |
+ return false; |
+#endif |
+ } |
+ |
+ /// isOSIOS - Is getOS() == IOS |
+ bool isOSIOS() const { |
+#if defined(LLVM_ENABLED_TARGET_OS_IOS) |
+ return getOS() == Triple::IOS; |
+#else |
+ return false; |
+#endif |
+ } |
+ |
+ /// isOSLinux - Is getOS() == Linux. |
+ bool isOSLinux() const { |
+#if defined(LLVM_ENABLED_TARGET_OS_LINUX) |
+ return getOS() == Triple::Linux; |
+#else |
+ return false; |
+#endif |
+ } |
+ |
+ /// isOSLv2 - Is getOS() == Lv2. |
+ bool isOSLv2() const { |
+#if defined(LLVM_ENABLED_TARGET_OS_LV2) |
+ return getOS() == Triple::Lv2; |
+#else |
+ return false; |
+#endif |
+ } |
+ |
+ /// isOSMinGW32 - Is getOS() == MinGW32. |
+ bool isOSMinGW32() const { |
+#if defined(LLVM_ENABLED_TARGET_OS_MINGW32) |
+ return getOS() == Triple::MinGW32; |
+#else |
+ return false; |
+#endif |
+ } |
+ |
+ /// isOSNetBSD - Is getOS() == NetBSD. |
+ bool isOSNetBSD() const { |
+#if defined(LLVM_ENABLED_TARGET_OS_NETBSD) |
+ return getOS() == Triple::NetBSD; |
+#else |
+ return false; |
+#endif |
+ } |
+ |
+ /// isOSOpenBSD - Is getOS() == OpenBSD. |
+ bool isOSOpenBSD() const { |
+#if defined(LLVM_ENABLED_TARGET_OS_OPENBSD) |
+ return getOS() == Triple::OpenBSD; |
+#else |
+ return false; |
+#endif |
+ } |
+ |
+ /// isOSPsp - Is getOS() == Psp. |
+ bool isOSPsp() const { |
+#if defined(LLVM_ENABLED_TARGET_OS_PSP) |
+ return getOS() == Triple::Psp; |
+#else |
+ return false; |
+#endif |
+ } |
+ |
+ /// isOSSolaris - Is getOS() == Solaris. |
+ bool isOSSolaris() const { |
+#if defined(LLVM_ENABLED_TARGET_OS_SOLARIS) |
+ return getOS() == Triple::Solaris; |
+#else |
+ return false; |
+#endif |
+ } |
+ |
+ /// isOSWin32 - Is getOS() == Win32. |
+ bool isOSWin32() const { |
+#if defined(LLVM_ENABLED_TARGET_OS_WIN32) |
+ return getOS() == Triple::Win32; |
+#else |
+ return false; |
+#endif |
+ } |
+ |
+ /// isOSHaiku - Is getOS() == Haiku. |
+ bool isOSHaiku() const { |
+#if defined(LLVM_ENABLED_TARGET_OS_HAIKU) |
+ return getOS() == Triple::Haiku; |
+#else |
+ return false; |
+#endif |
+ } |
+ |
+ /// isOSMinix - Is getOS() == Minix. |
+ bool isOSMinix() const { |
+#if defined(LLVM_ENABLED_TARGET_OS_MINIX) |
+ return getOS() == Triple::Minix; |
+#else |
+ return false; |
+#endif |
+ } |
+ |
+ /// isOSRTEMS - Is getOS() == RTEMS. |
+ bool isOSRTEMS() const { |
+#if defined(LLVM_ENABLED_TARGET_OS_RTEMS) |
+ return getOS() == Triple::RTEMS; |
+#else |
+ return false; |
+#endif |
+ } |
+ |
+ /// isOSNativeClient - Is getOS() == NativeClient. |
+ bool isOSNativeClient() const { |
+#if defined(LLVM_ENABLED_TARGET_OS_NATIVECLIENT) |
+ return getOS() == Triple::NativeClient; |
+#else |
+ return false; |
+#endif |
+ } |
+ |
/// isMacOSXVersionLT - Comparison function for checking OS X version |
/// compatibility, which handles supporting skewed version numbering schemes |
/// used by the "darwin" triples. |
@@ -284,6 +454,42 @@ |
return isOSVersionLT(Minor + 4, Micro, 0); |
} |
+ /// isEnvironmentEABI - Is getEnvironment() == EABI. |
+ bool isEnvironmentEABI() const { |
+#if defined(LLVM_ENABLED_TARGET_ENV_EABI) |
+ return getEnvironment() == Triple::EABI; |
+#else |
+ return false; |
+#endif |
+ } |
+ |
+ /// isEnvironmentGNUEABI - Is getEnvironment() == GNUEABI. |
+ bool isEnvironmentGNUEABI() const { |
+#if defined(LLVM_ENABLED_TARGET_ENV_GNUEABI) |
+ return getEnvironment() == Triple::GNUEABI; |
+#else |
+ return false; |
+#endif |
+ } |
+ |
+ /// isEnvironmentGNU - Is getEnvironment() == GNU. |
+ bool isEnvironmentGNU() const { |
+#if defined(LLVM_ENABLED_TARGET_ENV_GNU) |
+ return getEnvironment() == Triple::GNU; |
+#else |
+ return false; |
+#endif |
+ } |
+ |
+ /// isEnvironmentMachO - Is getEnvironment() == MachO. |
+ bool isEnvironmentMachO() const { |
+#if defined(LLVM_ENABLED_TARGET_ENV_MACHO) |
+ return getEnvironment() == Triple::MachO; |
+#else |
+ return false; |
+#endif |
+ } |
+ |
/// @} |
/// @name Mutators |
/// @{ |