[Lldb-commits] [PATCH 1/4] ArchSpec: Do not set default to host settings when setting a triple.

Stephen Wilson wilsons at start.ca
Wed Feb 23 13:16:19 PST 2011


The major issue this patch solves is that ArchSpec::SetTriple no longer depends
on the implementation of Host::GetArchitecture.  On linux, HostGetArchitecture
calls ArchSpec::SetTriple, thus blowing the stack.

A second smaller point is that SetTriple now does what its name suggests.
Clients that need "default to the Host triple" semantics can implement such
logic if needed.
---
 source/Core/ArchSpec.cpp |    9 ---------
 1 files changed, 0 insertions(+), 9 deletions(-)

diff --git a/source/Core/ArchSpec.cpp b/source/Core/ArchSpec.cpp
index a5493b3..9592aa9 100644
--- a/source/Core/ArchSpec.cpp
+++ b/source/Core/ArchSpec.cpp
@@ -406,15 +406,6 @@ ArchSpec::SetTriple (const llvm::Triple &triple)
     {
         m_core = core_def->core;
         m_byte_order = core_def->default_byte_order;
-
-        // If the vendor, OS or environment aren't specified, default to the system?
-        const ArchSpec &host_arch_ref = Host::GetArchitecture (Host::eSystemDefaultArchitecture);
-        if (m_triple.getVendor() == llvm::Triple::UnknownVendor)
-            m_triple.setVendor(host_arch_ref.GetTriple().getVendor());
-        if (m_triple.getOS() == llvm::Triple::UnknownOS)
-            m_triple.setOS(host_arch_ref.GetTriple().getOS());
-        if (m_triple.getEnvironment() == llvm::Triple::UnknownEnvironment)
-            m_triple.setEnvironment(host_arch_ref.GetTriple().getEnvironment());
     }
     else
     {
-- 
1.7.3.5




More information about the lldb-commits mailing list