diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2014-03-27 22:50:05 +0000 |
---|---|---|
committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2014-03-27 22:50:05 +0000 |
commit | edbdd2e5df8b59dac8ae5f45059407f8a79850d6 (patch) | |
tree | e4ce058f3ca8e75c06523477c16f38c53b74c090 /llvm/lib/Target | |
parent | 9dcb3583d5743278f53865dc922beca20369e7db (diff) | |
download | bcm5719-llvm-edbdd2e5df8b59dac8ae5f45059407f8a79850d6.tar.gz bcm5719-llvm-edbdd2e5df8b59dac8ae5f45059407f8a79850d6.zip |
Canonicalise Windows target triple spellings
Construct a uniform Windows target triple nomenclature which is congruent to the
Linux counterpart. The old triples are normalised to the new canonical form.
This cleans up the long-standing issue of odd naming for various Windows
environments.
There are four different environments on Windows:
MSVC: The MS ABI, MSVCRT environment as defined by Microsoft
GNU: The MinGW32/MinGW32-W64 environment which uses MSVCRT and auxiliary libraries
Itanium: The MSVCRT environment + libc++ built with Itanium ABI
Cygnus: The Cygwin environment which uses custom libraries for everything
The following spellings are now written as:
i686-pc-win32 => i686-pc-windows-msvc
i686-pc-mingw32 => i686-pc-windows-gnu
i686-pc-cygwin => i686-pc-windows-cygnus
This should be sufficiently flexible to allow us to target other windows
environments in the future as necessary.
llvm-svn: 204977
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r-- | llvm/lib/Target/TargetLibraryInfo.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/Target/X86/X86Subtarget.h | 11 |
2 files changed, 9 insertions, 4 deletions
diff --git a/llvm/lib/Target/TargetLibraryInfo.cpp b/llvm/lib/Target/TargetLibraryInfo.cpp index 063151601b8..7f8919772f7 100644 --- a/llvm/lib/Target/TargetLibraryInfo.cpp +++ b/llvm/lib/Target/TargetLibraryInfo.cpp @@ -417,7 +417,7 @@ static void initialize(TargetLibraryInfo &TLI, const Triple &T, TLI.setUnavailable(LibFunc::fiprintf); } - if (T.getOS() == Triple::Win32) { + if (T.isKnownWindowsMSVCEnvironment()) { // Win32 does not support long double TLI.setUnavailable(LibFunc::acosl); TLI.setUnavailable(LibFunc::asinl); diff --git a/llvm/lib/Target/X86/X86Subtarget.h b/llvm/lib/Target/X86/X86Subtarget.h index 51b2e51d202..d66d8595059 100644 --- a/llvm/lib/Target/X86/X86Subtarget.h +++ b/llvm/lib/Target/X86/X86Subtarget.h @@ -343,9 +343,14 @@ public: bool isTargetNaCl() const { return TargetTriple.isOSNaCl(); } bool isTargetNaCl32() const { return isTargetNaCl() && !is64Bit(); } bool isTargetNaCl64() const { return isTargetNaCl() && is64Bit(); } - bool isTargetWindows() const { return TargetTriple.getOS() == Triple::Win32; } - bool isTargetMingw() const { return TargetTriple.getOS() == Triple::MinGW32; } - bool isTargetCygwin() const { return TargetTriple.getOS() == Triple::Cygwin; } + bool isTargetWindows() const { + return TargetTriple.isOSWindows() && + !TargetTriple.isWindowsGNUEnvironment(); + } + bool isTargetMingw() const { return TargetTriple.isWindowsGNUEnvironment(); } + bool isTargetCygwin() const { + return TargetTriple.isWindowsCygwinEnvironment(); + } bool isTargetCygMing() const { return TargetTriple.isOSCygMing(); } bool isOSWindows() const { return TargetTriple.isOSWindows(); } |