[llvm-commits] [llvm] r112470 - in /llvm/trunk: docs/ReleaseNotes.html lib/Support/Triple.cpp

Duncan Sands baldrick at free.fr
Mon Aug 30 03:57:54 PDT 2010


Author: baldrick
Date: Mon Aug 30 05:57:54 2010
New Revision: 112470

URL: http://llvm.org/viewvc/llvm-project?rev=112470&view=rev
Log:
Remove a hack that tries to understand incorrect triples from the
Triple class constructor.  Only valid triples should now be used
inside LLVM - front-ends are now responsable for rejecting or
correcting invalid target triples.  The Triple::normalize method
can be used to straighten out funky triples provided by users.
Give this a whirl through the buildbots to see if I caught all
places where triples enter LLVM.

Modified:
    llvm/trunk/docs/ReleaseNotes.html
    llvm/trunk/lib/Support/Triple.cpp

Modified: llvm/trunk/docs/ReleaseNotes.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ReleaseNotes.html?rev=112470&r1=112469&r2=112470&view=diff
==============================================================================
--- llvm/trunk/docs/ReleaseNotes.html (original)
+++ llvm/trunk/docs/ReleaseNotes.html Mon Aug 30 05:57:54 2010
@@ -348,6 +348,11 @@
   SMDiagnostic takes different parameters now. //FIXME: how to upgrade?
 </li>
 <li>
+  The constructor for the Triple class no longer tries to understand odd triple
+  specifications.  Frontends should ensure that they only pass valid triples to
+  LLVM.  The Triple::normalize utility method has been added to help front-ends
+  deal with funky triples.
+<li>
   Some APIs got renamed:
   <ul>
       <li>llvm_report_error -> report_fatal_error</li>

Modified: llvm/trunk/lib/Support/Triple.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Triple.cpp?rev=112470&r1=112469&r2=112470&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Triple.cpp (original)
+++ llvm/trunk/lib/Support/Triple.cpp Mon Aug 30 05:57:54 2010
@@ -323,22 +323,6 @@
   Vendor = ParseVendor(getVendorName());
   OS = ParseOS(getOSName());
 
-  // Handle some exceptional cases where the OS / environment components are
-  // stuck into the vendor field.
-  // TODO: Remove this logic and have places that need it use 'normalize'.
-  if (StringRef(getTriple()).count('-') == 1) {
-    StringRef VendorName = getVendorName();
-
-    if (VendorName.startswith("mingw32")) { // 'i386-mingw32', etc.
-      Vendor = PC;
-      OS = MinGW32;
-      return;
-    }
-
-    // arm-elf is another example, but we don't currently parse anything about
-    // the environment.
-  }
-
   assert(isInitialized() && "Failed to initialize!");
 }
 





More information about the llvm-commits mailing list