summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Architecture
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2019-05-16 09:07:33 +0000
committerFangrui Song <maskray@google.com>2019-05-16 09:07:33 +0000
commit2f677ab07bcf0613b03b9ece8928693ba4cfacaf (patch)
treef09fd5c2ba2fe9df53edb713c56d4bce409037ef /lldb/source/Plugins/Architecture
parent064f6ab556499c8b513d1dc423fc0740ad9a1408 (diff)
downloadbcm5719-llvm-2f677ab07bcf0613b03b9ece8928693ba4cfacaf.tar.gz
bcm5719-llvm-2f677ab07bcf0613b03b9ece8928693ba4cfacaf.zip
Simplify Triple::ppc64{,le} checks with Triple::isPPC64()
While here, update some ppc64le specific check to isPPC64(), if it applies to big-endian as well, in the hope that it will ease the support of big-endian if people are interested in this area. The big-endian variant is used by at least FreeBSD, Gentoo Linux, Adélie Linux, and Void Linux. llvm-svn: 360868
Diffstat (limited to 'lldb/source/Plugins/Architecture')
-rw-r--r--lldb/source/Plugins/Architecture/PPC64/ArchitecturePPC64.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/lldb/source/Plugins/Architecture/PPC64/ArchitecturePPC64.cpp b/lldb/source/Plugins/Architecture/PPC64/ArchitecturePPC64.cpp
index d8538f8488b..76eaa44546e 100644
--- a/lldb/source/Plugins/Architecture/PPC64/ArchitecturePPC64.cpp
+++ b/lldb/source/Plugins/Architecture/PPC64/ArchitecturePPC64.cpp
@@ -35,11 +35,10 @@ void ArchitecturePPC64::Terminate() {
}
std::unique_ptr<Architecture> ArchitecturePPC64::Create(const ArchSpec &arch) {
- if ((arch.GetMachine() != llvm::Triple::ppc64 &&
- arch.GetMachine() != llvm::Triple::ppc64le) ||
- arch.GetTriple().getObjectFormat() != llvm::Triple::ObjectFormatType::ELF)
- return nullptr;
- return std::unique_ptr<Architecture>(new ArchitecturePPC64());
+ if (arch.GetTriple().isPPC64() &&
+ arch.GetTriple().getObjectFormat() == llvm::Triple::ObjectFormatType::ELF)
+ return std::unique_ptr<Architecture>(new ArchitecturePPC64());
+ return nullptr;
}
ConstString ArchitecturePPC64::GetPluginName() { return GetPluginNameStatic(); }
OpenPOWER on IntegriCloud