diff options
5 files changed, 14 insertions, 25 deletions
diff --git a/lldb/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp b/lldb/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp index 1648cd3bc2f..aa7907550f2 100644 --- a/lldb/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp +++ b/lldb/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp @@ -69,10 +69,8 @@ lldb::ByteOrder ABISysV_ppc64::GetByteOrder() const { ABISP ABISysV_ppc64::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) { - if (arch.GetTriple().getArch() == llvm::Triple::ppc64 || - arch.GetTriple().getArch() == llvm::Triple::ppc64le) { + if (arch.GetTriple().isPPC64()) return ABISP(new ABISysV_ppc64(process_sp)); - } return ABISP(); } 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(); } diff --git a/lldb/source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.cpp b/lldb/source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.cpp index 86507619413..c77fa04fc7d 100644 --- a/lldb/source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.cpp +++ b/lldb/source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.cpp @@ -55,23 +55,15 @@ EmulateInstruction * EmulateInstructionPPC64::CreateInstance(const ArchSpec &arch, InstructionType inst_type) { if (EmulateInstructionPPC64::SupportsEmulatingInstructionsOfTypeStatic( - inst_type)) { - if (arch.GetTriple().getArch() == llvm::Triple::ppc64 || - arch.GetTriple().getArch() == llvm::Triple::ppc64le) { + inst_type)) + if (arch.GetTriple().isPPC64()) return new EmulateInstructionPPC64(arch); - } - } return nullptr; } bool EmulateInstructionPPC64::SetTargetTriple(const ArchSpec &arch) { - if (arch.GetTriple().getArch() == llvm::Triple::ppc64) - return true; - else if (arch.GetTriple().getArch() == llvm::Triple::ppc64le) - return true; - - return false; + return arch.GetTriple().isPPC64(); } static bool LLDBTableGetRegisterInfo(uint32_t reg_num, RegisterInfo ®_info) { diff --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp index 1768b4ba1a9..a55dc41bed0 100644 --- a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp @@ -1007,7 +1007,7 @@ NativeProcessLinux::SetupSoftwareSingleStepping(NativeThreadLinux &thread) { // Arm mode error = SetSoftwareBreakpoint(next_pc, 4); } - } else if (m_arch.IsMIPS() || m_arch.GetMachine() == llvm::Triple::ppc64le) + } else if (m_arch.IsMIPS() || m_arch.GetTriple().isPPC64()) error = SetSoftwareBreakpoint(next_pc, 4); else { // No size hint is given for the next breakpoint diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp index 1916c50c773..c6b792e70fc 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -1711,21 +1711,21 @@ lldb_private::Status GDBRemoteCommunicationClient::GetWatchpointsTriggerAfterInstruction( bool &after, const ArchSpec &arch) { Status error; - llvm::Triple::ArchType atype = arch.GetMachine(); + llvm::Triple triple = arch.GetTriple(); // we assume watchpoints will happen after running the relevant opcode and we // only want to override this behavior if we have explicitly received a // qHostInfo telling us otherwise if (m_qHostInfo_is_valid != eLazyBoolYes) { - // On targets like MIPS and ppc64le, watchpoint exceptions are always + // On targets like MIPS and ppc64, watchpoint exceptions are always // generated before the instruction is executed. The connected target may // not support qHostInfo or qWatchpointSupportInfo packets. - after = !(arch.IsMIPS() || atype == llvm::Triple::ppc64le); + after = !(triple.isMIPS() || triple.isPPC64()); } else { - // For MIPS and ppc64le, set m_watchpoints_trigger_after_instruction to + // For MIPS and ppc64, set m_watchpoints_trigger_after_instruction to // eLazyBoolNo if it is not calculated before. if (m_watchpoints_trigger_after_instruction == eLazyBoolCalculate && - (arch.IsMIPS() || atype == llvm::Triple::ppc64le)) + (triple.isMIPS() || triple.isPPC64())) m_watchpoints_trigger_after_instruction = eLazyBoolNo; after = (m_watchpoints_trigger_after_instruction != eLazyBoolNo); |

