mirror of
https://github.com/intel/llvm.git
synced 2026-01-15 04:17:17 +08:00
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
This commit is contained in:
@@ -153,8 +153,7 @@ void ObjectFileJIT::Dump(Stream *s) {
|
||||
s->Indent();
|
||||
s->PutCString("ObjectFileJIT");
|
||||
|
||||
ArchSpec arch;
|
||||
if (GetArchitecture(arch))
|
||||
if (ArchSpec arch = GetArchitecture())
|
||||
*s << ", arch = " << arch.GetArchitectureName();
|
||||
|
||||
s->EOL();
|
||||
@@ -190,11 +189,10 @@ ObjectFile::Type ObjectFileJIT::CalculateType() { return eTypeJIT; }
|
||||
|
||||
ObjectFile::Strata ObjectFileJIT::CalculateStrata() { return eStrataJIT; }
|
||||
|
||||
bool ObjectFileJIT::GetArchitecture(ArchSpec &arch) {
|
||||
ObjectFileJITDelegateSP delegate_sp(m_delegate_wp.lock());
|
||||
if (delegate_sp)
|
||||
return delegate_sp->GetArchitecture(arch);
|
||||
return false;
|
||||
ArchSpec ObjectFileJIT::GetArchitecture() {
|
||||
if (ObjectFileJITDelegateSP delegate_sp = m_delegate_wp.lock())
|
||||
return delegate_sp->GetArchitecture();
|
||||
return ArchSpec();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user