From 9cac9f65e1ac4d7ac574775610c952986e7b1e81 Mon Sep 17 00:00:00 2001 From: Davide Italiano Date: Fri, 14 Apr 2017 22:27:28 +0000 Subject: [ARM/Emulation] Remove an unneeded comparison and simplify. NFCI. reg0 is always zero and comparison to an unsigned always yields true. git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@300375 91177308-0d34-0410-b5e6-96231b3b80d8 --- source/Plugins/Instruction/ARM/EmulationStateARM.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/Plugins/Instruction') diff --git a/source/Plugins/Instruction/ARM/EmulationStateARM.cpp b/source/Plugins/Instruction/ARM/EmulationStateARM.cpp index 7b10f8ffa..5e90965c1 100644 --- a/source/Plugins/Instruction/ARM/EmulationStateARM.cpp +++ b/source/Plugins/Instruction/ARM/EmulationStateARM.cpp @@ -66,7 +66,7 @@ bool EmulationStateARM::LoadPseudoRegistersFromFrame(StackFrame &frame) { bool EmulationStateARM::StorePseudoRegisterValue(uint32_t reg_num, uint64_t value) { - if ((dwarf_r0 <= reg_num) && (reg_num <= dwarf_cpsr)) + if (reg_num <= dwarf_cpsr) m_gpr[reg_num - dwarf_r0] = (uint32_t)value; else if ((dwarf_s0 <= reg_num) && (reg_num <= dwarf_s31)) { uint32_t idx = reg_num - dwarf_s0; @@ -89,7 +89,7 @@ uint64_t EmulationStateARM::ReadPseudoRegisterValue(uint32_t reg_num, uint64_t value = 0; success = true; - if ((dwarf_r0 <= reg_num) && (reg_num <= dwarf_cpsr)) + if (reg_num <= dwarf_cpsr) value = m_gpr[reg_num - dwarf_r0]; else if ((dwarf_s0 <= reg_num) && (reg_num <= dwarf_s31)) { uint32_t idx = reg_num - dwarf_s0; -- cgit v1.2.3