Remove a hack that tries to understand incorrect triples from the
authorDuncan Sands <baldrick@free.fr>
Mon, 30 Aug 2010 10:57:54 +0000 (10:57 +0000)
committerDuncan Sands <baldrick@free.fr>
Mon, 30 Aug 2010 10:57:54 +0000 (10:57 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112470 91177308-0d34-0410-b5e6-96231b3b80d8

docs/ReleaseNotes.html
lib/Support/Triple.cpp

index f9f492c2639f258b4ef1fd6b7d55d02584587594..b937f7d871351fdd10daae7fe76d2e2c5daa2bfb 100644 (file)
@@ -347,6 +347,11 @@ expose new optimization opportunities:</p>
 <li>
   SMDiagnostic takes different parameters now. //FIXME: how to upgrade?
 </li>
 <li>
   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>
   Some APIs got renamed:
   <ul>
index 7806aec16c6d9a4f590eaeb038e4b916e2eedc56..3a95b65e69000853cab2685b85110df6b3343223 100644 (file)
@@ -323,22 +323,6 @@ void Triple::Parse() const {
   Vendor = ParseVendor(getVendorName());
   OS = ParseOS(getOSName());
 
   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!");
 }
 
   assert(isInitialized() && "Failed to initialize!");
 }