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
diff --git a/lldb/source/Symbol/CompactUnwindInfo.cpp b/lldb/source/Symbol/CompactUnwindInfo.cpp
index 1baf444..6f0f35f 100644
--- a/lldb/source/Symbol/CompactUnwindInfo.cpp
+++ b/lldb/source/Symbol/CompactUnwindInfo.cpp
@@ -183,8 +183,7 @@
if (function_info.encoding == 0)
return false;
- ArchSpec arch;
- if (m_objfile.GetArchitecture(arch)) {
+ if (ArchSpec arch = m_objfile.GetArchitecture()) {
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_UNWIND));
if (log && log->GetVerbose()) {
@@ -338,8 +337,7 @@
// };
bool clear_address_zeroth_bit = false;
- ArchSpec arch;
- if (m_objfile.GetArchitecture(arch)) {
+ if (ArchSpec arch = m_objfile.GetArchitecture()) {
if (arch.GetTriple().getArch() == llvm::Triple::arm ||
arch.GetTriple().getArch() == llvm::Triple::thumb)
clear_address_zeroth_bit = true;