[Lldb-commits] [PATCH] EmulationStateARM: Don't have >= comparisons against dwarf_r0

David Majnemer david.majnemer at gmail.com
Tue Jul 22 13:44:41 PDT 2014


Hi zturner, tfiala,

dwarf_r0 is defined to be zero in ARM_DWARF_Registers.h, this makes
unsigned comparisons against it pointless and provokes warnings on GCC.

http://reviews.llvm.org/D4629

Files:
  source/Plugins/Instruction/ARM/EmulationStateARM.cpp

Index: source/Plugins/Instruction/ARM/EmulationStateARM.cpp
===================================================================
--- source/Plugins/Instruction/ARM/EmulationStateARM.cpp
+++ source/Plugins/Instruction/ARM/EmulationStateARM.cpp
@@ -77,7 +77,7 @@
 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))
     {
@@ -105,7 +105,7 @@
     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))
     {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4629.11781.patch
Type: text/x-patch
Size: 844 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20140722/5e1c9e31/attachment.bin>


More information about the lldb-commits mailing list