Simplify NativeProcessProtocol::GetArchitecture/GetByteOrder

Summary:
These functions used to return bool to signify whether they were able to
retrieve the data. This is redundant because the ArchSpec and ByteOrder
already have their own "invalid" states, *and* because both of the
current implementations (linux, netbsd) can always provide a valid
result.

This allows us to simplify bits of the code handling these values.

Reviewers: eugene, krytarowski

Subscribers: javed.absar, lldb-commits

Differential Revision: https://reviews.llvm.org/D39733

llvm-svn: 317779
This commit is contained in:
Pavel Labath
2017-11-09 10:43:16 +00:00
parent 3a7044ef78
commit 578a425890
13 changed files with 26 additions and 87 deletions

View File

@@ -144,14 +144,10 @@ NativeRegisterContextSP NativeThreadNetBSD::GetRegisterContext() {
if (m_reg_context_sp)
return m_reg_context_sp;
ArchSpec target_arch;
if (!m_process.GetArchitecture(target_arch))
return NativeRegisterContextSP();
const uint32_t concrete_frame_idx = 0;
m_reg_context_sp.reset(
NativeRegisterContextNetBSD::CreateHostNativeRegisterContextNetBSD(
target_arch, *this, concrete_frame_idx));
m_process.GetArchitecture(), *this, concrete_frame_idx));
return m_reg_context_sp;
}