Author: davide Date: Fri Apr 14 17:27:28 2017 New Revision: 300375 URL: http://llvm.org/viewvc/llvm-project?rev=300375&view=rev Log: [ARM/Emulation] Remove an unneeded comparison and simplify. NFCI.
reg0 is always zero and comparison to an unsigned always yields true. Modified: lldb/trunk/source/Plugins/Instruction/ARM/EmulationStateARM.cpp Modified: lldb/trunk/source/Plugins/Instruction/ARM/EmulationStateARM.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/ARM/EmulationStateARM.cpp?rev=300375&r1=300374&r2=300375&view=diff ============================================================================== --- lldb/trunk/source/Plugins/Instruction/ARM/EmulationStateARM.cpp (original) +++ lldb/trunk/source/Plugins/Instruction/ARM/EmulationStateARM.cpp Fri Apr 14 17:27:28 2017 @@ -66,7 +66,7 @@ bool EmulationStateARM::LoadPseudoRegist 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::ReadPseudoRe 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; _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits