[Lldb-commits] [PATCH] Remove Triple Vendor check when creating Linux Platform

Ted Woodward ted.woodward at codeaurora.org
Tue Mar 31 11:59:58 PDT 2015


Hi clayborg, vharron,

The Linux Platform shouldn't care about the Vendor field in the Triple. Currently it allows a value of "PC", or "unknown" if LLDB was built on Linux. This patch removes that check, so the Vendor field isn't touched. This will allow the Linux Platform to be created when using a Triple of *-*-Linux.

http://reviews.llvm.org/D8742

Files:
  source/Plugins/Platform/Linux/PlatformLinux.cpp

Index: source/Plugins/Platform/Linux/PlatformLinux.cpp
===================================================================
--- source/Plugins/Platform/Linux/PlatformLinux.cpp
+++ source/Plugins/Platform/Linux/PlatformLinux.cpp
@@ -166,44 +166,23 @@
     if (create == false && arch && arch->IsValid())
     {
         const llvm::Triple &triple = arch->GetTriple();
-        switch (triple.getVendor())
+        switch (triple.getOS())
         {
-            case llvm::Triple::PC:
+            case llvm::Triple::Linux:
                 create = true;
                 break;
 
 #if defined(__linux__)
-            // Only accept "unknown" for the vendor if the host is linux and
+            // Only accept "unknown" for the OS if the host is linux and
             // it "unknown" wasn't specified (it was just returned because it
-            // was NOT specified_
-            case llvm::Triple::VendorType::UnknownVendor:
-                create = !arch->TripleVendorWasSpecified();
+            // was NOT specified)
+            case llvm::Triple::OSType::UnknownOS:
+                create = !arch->TripleOSWasSpecified();
                 break;
 #endif
             default:
                 break;
         }
-
-        if (create)
-        {
-            switch (triple.getOS())
-            {
-                case llvm::Triple::Linux:
-                    break;
-
-#if defined(__linux__)
-                // Only accept "unknown" for the OS if the host is linux and
-                // it "unknown" wasn't specified (it was just returned because it
-                // was NOT specified)
-                case llvm::Triple::OSType::UnknownOS:
-                    create = !arch->TripleOSWasSpecified();
-                    break;
-#endif
-                default:
-                    create = false;
-                    break;
-            }
-        }
     }
 
     if (create)

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8742.22992.patch
Type: text/x-patch
Size: 1900 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150331/6796d4ee/attachment.bin>


More information about the lldb-commits mailing list