Canonicalise Windows target triple spellings
[oota-llvm.git] / lib / Target / X86 / X86Subtarget.h
index 51b2e51d20227b5ac1ff8a76d46bd3873cd16f1f..d66d859505912c315a430b4dd72d59a9d229bf52 100644 (file)
@@ -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(); }