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

Greg Clayton gclayton at apple.com
Wed Feb 23 15:59:37 PST 2011


Or use the llvm::sys::getHostTriple() like you did in path 2/4...

On Feb 23, 2011, at 3:55 PM, Greg Clayton wrote:

> I still think we need to make the m_triple have the host's vendor and host's OS.
> 
> Can we modify this patch to use the string versions from host? Something like:
> 
>        if (m_triple.getVendor() == llvm::Triple::UnknownVendor)
>            m_triple.setVendor(llvm::StringRef (Host::GetVendorString().GetCString()));
>        if (m_triple.getOS() == llvm::Triple::UnknownOS)
>            m_triple.setOS(llvm::StringRef (Host::GetOSString().GetCString()));
> 
> 
> On Feb 23, 2011, at 1:16 PM, Stephen Wilson wrote:
> 
>> 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
>> 
>> _______________________________________________
>> lldb-commits mailing list
>> lldb-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
> 
> 
> _______________________________________________
> lldb-commits mailing list
> lldb-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits





More information about the lldb-commits mailing list