[PATCH] Canonicalise Windows target triple spellings

Reid Kleckner rnk at google.com
Tue Mar 4 13:56:26 PST 2014


  This seems like the right direction, but we need to stage this so that we don't break Clang.


================
Comment at: include/llvm/ADT/Triple.h:334
@@ -329,2 +333,3 @@
   bool isOSCygMing() const {
-    return getOS() == Triple::Cygwin || getOS() == Triple::MinGW32;
+    return getOS() == Triple::Cygwin || getOS() == Triple::MinGW32 ||
+           (getOS() == Triple::Win32 && (getEnvironment() == Triple::Cygnus ||
----------------
Are you planning to remove the MinGW32 OS enum?

================
Comment at: lib/Support/Triple.cpp:531-539
@@ +530,11 @@
+      Components[3] = "msvc";
+  } else if (OS == Triple::MinGW32) {
+    Components.resize(4);
+    Components[2] = "windows";
+    Components[3] = (Format == Triple::ELF) ? "gnuelf" : "gnu";
+  } else if (OS == Triple::Cygwin) {
+    Components.resize(4);
+    Components[2] = "windows";
+    Components[3] = "cygnus";
+  }
+
----------------
These canonicalizations will change the behavior of Clang, because it often looks for getOS() == llvm::Triple::MinGW32 / Cygwin in many places.  Can we defer this canonicalization until we've updated clang to do the right thing with the new triple?


http://llvm-reviews.chandlerc.com/D2947



More information about the llvm-commits mailing list