diff options
author | Pavel Labath <pavel@labath.sk> | 2019-01-03 10:37:19 +0000 |
---|---|---|
committer | Pavel Labath <pavel@labath.sk> | 2019-01-03 10:37:19 +0000 |
commit | f760f5aef404b0767c06f64da219032e3e7bb3bd (patch) | |
tree | 2b87b4cb47e47a1550ba4631f67deb642fc1f146 /lldb/source/Core/Module.cpp | |
parent | 4d752a88e828120d51187beb51773300118200b2 (diff) | |
download | bcm5719-llvm-f760f5aef404b0767c06f64da219032e3e7bb3bd.tar.gz bcm5719-llvm-f760f5aef404b0767c06f64da219032e3e7bb3bd.zip |
Simplify ObjectFile::GetArchitecture
Summary:
instead of returning the architecture through by-ref argument and a
boolean value indicating success, we can just return the ArchSpec
directly. Since the ArchSpec already has an invalid state, it can be
used to denote the failure without the additional bool.
Reviewers: clayborg, zturner, espindola
Subscribers: emaste, arichardson, JDevlieghere, lldb-commits
Differential Revision: https://reviews.llvm.org/D56129
llvm-svn: 350291
Diffstat (limited to 'lldb/source/Core/Module.cpp')
-rw-r--r-- | lldb/source/Core/Module.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp index a53d54fb103..3b498abf462 100644 --- a/lldb/source/Core/Module.cpp +++ b/lldb/source/Core/Module.cpp @@ -309,7 +309,7 @@ ObjectFile *Module::GetMemoryObjectFile(const lldb::ProcessSP &process_sp, // Once we get the object file, update our module with the object // file's architecture since it might differ in vendor/os if some // parts were unknown. - m_objfile_sp->GetArchitecture(m_arch); + m_arch = m_objfile_sp->GetArchitecture(); } else { error.SetErrorString("unable to find suitable object file plug-in"); } @@ -1265,9 +1265,7 @@ ObjectFile *Module::GetObjectFile() { // parts were unknown. But since the matching arch might already be // more specific than the generic COFF architecture, only merge in // those values that overwrite unspecified unknown values. - ArchSpec new_arch; - m_objfile_sp->GetArchitecture(new_arch); - m_arch.MergeFrom(new_arch); + m_arch.MergeFrom(m_objfile_sp->GetArchitecture()); } else { ReportError("failed to load objfile for %s", GetFileSpec().GetPath().c_str()); |