This revision was automatically updated to reflect the committed changes.
Closed by commit rL316745: Express Registers_*::lastDwarfReg using 
_LIBUNWIND_HIGHEST_DWARF_REGISTER (authored by mstorsjo).

Changed prior to commit:
  https://reviews.llvm.org/D39281?vs=120467&id=120548#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D39281

Files:
  libunwind/trunk/include/__libunwind_config.h
  libunwind/trunk/src/DwarfInstructions.hpp
  libunwind/trunk/src/DwarfParser.hpp
  libunwind/trunk/src/Registers.hpp

Index: libunwind/trunk/src/DwarfInstructions.hpp
===================================================================
--- libunwind/trunk/src/DwarfInstructions.hpp
+++ libunwind/trunk/src/DwarfInstructions.hpp
@@ -167,7 +167,7 @@
       R newRegisters = registers;
       pint_t returnAddress = 0;
       const int lastReg = R::lastDwarfRegNum();
-      assert((int)CFI_Parser<A>::kMaxRegisterNumber > lastReg &&
+      assert(static_cast<int>(CFI_Parser<A>::kMaxRegisterNumber) >= lastReg &&
              "register range too large");
       assert(lastReg >= (int)cieInfo.returnAddressRegister &&
              "register range does not contain return address register");
Index: libunwind/trunk/src/DwarfParser.hpp
===================================================================
--- libunwind/trunk/src/DwarfParser.hpp
+++ libunwind/trunk/src/DwarfParser.hpp
@@ -87,7 +87,7 @@
     uint32_t          codeOffsetAtStackDecrement;
     bool              registersInOtherRegisters;
     bool              sameValueUsed;
-    RegisterLocation  savedRegisters[kMaxRegisterNumber];
+    RegisterLocation  savedRegisters[kMaxRegisterNumber + 1];
   };
 
   struct PrologInfoStackEntry {
Index: libunwind/trunk/src/Registers.hpp
===================================================================
--- libunwind/trunk/src/Registers.hpp
+++ libunwind/trunk/src/Registers.hpp
@@ -44,7 +44,7 @@
   void        setVectorRegister(int num, v128 value);
   const char *getRegisterName(int num);
   void        jumpto();
-  static int  lastDwarfRegNum() { return 8; }
+  static int  lastDwarfRegNum() { return _LIBUNWIND_HIGHEST_DWARF_REGISTER; }
 
   uint32_t  getSP() const          { return _registers.__esp; }
   void      setSP(uint32_t value)  { _registers.__esp = value; }
@@ -250,7 +250,7 @@
   void        setVectorRegister(int num, v128 value);
   const char *getRegisterName(int num);
   void        jumpto();
-  static int  lastDwarfRegNum() { return 16; }
+  static int  lastDwarfRegNum() { return _LIBUNWIND_HIGHEST_DWARF_REGISTER; }
 
   uint64_t  getSP() const          { return _registers.__rsp; }
   void      setSP(uint64_t value)  { _registers.__rsp = value; }
@@ -500,7 +500,7 @@
   void        setVectorRegister(int num, v128 value);
   const char *getRegisterName(int num);
   void        jumpto();
-  static int  lastDwarfRegNum() { return 112; }
+  static int  lastDwarfRegNum() { return _LIBUNWIND_HIGHEST_DWARF_REGISTER; }
 
   uint64_t  getSP() const         { return _registers.__r1; }
   void      setSP(uint32_t value) { _registers.__r1 = value; }
@@ -1066,7 +1066,7 @@
   void        setVectorRegister(int num, v128 value);
   const char *getRegisterName(int num);
   void        jumpto();
-  static int  lastDwarfRegNum() { return 95; }
+  static int  lastDwarfRegNum() { return _LIBUNWIND_HIGHEST_DWARF_REGISTER; }
 
   uint64_t  getSP() const         { return _registers.__sp; }
   void      setSP(uint64_t value) { _registers.__sp = value; }
@@ -1815,7 +1815,7 @@
   void        setVectorRegister(int num, v128 value);
   const char *getRegisterName(int num);
   void        jumpto();
-  static int  lastDwarfRegNum() { return 31; }
+  static int  lastDwarfRegNum() { return _LIBUNWIND_HIGHEST_DWARF_REGISTER; }
 
   uint64_t  getSP() const         { return _registers.__r[1]; }
   void      setSP(uint32_t value) { _registers.__r[1] = value; }
Index: libunwind/trunk/include/__libunwind_config.h
===================================================================
--- libunwind/trunk/include/__libunwind_config.h
+++ libunwind/trunk/include/__libunwind_config.h
@@ -20,22 +20,22 @@
 #  define _LIBUNWIND_TARGET_I386
 #  define _LIBUNWIND_CONTEXT_SIZE 8
 #  define _LIBUNWIND_CURSOR_SIZE 19
-#  define _LIBUNWIND_HIGHEST_DWARF_REGISTER 9
+#  define _LIBUNWIND_HIGHEST_DWARF_REGISTER 8
 # elif defined(__x86_64__)
 #  define _LIBUNWIND_TARGET_X86_64 1
 #  define _LIBUNWIND_CONTEXT_SIZE 21
 #  define _LIBUNWIND_CURSOR_SIZE 33
-#  define _LIBUNWIND_HIGHEST_DWARF_REGISTER 17
+#  define _LIBUNWIND_HIGHEST_DWARF_REGISTER 16
 # elif defined(__ppc__)
 #  define _LIBUNWIND_TARGET_PPC 1
 #  define _LIBUNWIND_CONTEXT_SIZE 117
 #  define _LIBUNWIND_CURSOR_SIZE 128
-#  define _LIBUNWIND_HIGHEST_DWARF_REGISTER 113
+#  define _LIBUNWIND_HIGHEST_DWARF_REGISTER 112
 # elif defined(__aarch64__)
 #  define _LIBUNWIND_TARGET_AARCH64 1
 #  define _LIBUNWIND_CONTEXT_SIZE 66
 #  define _LIBUNWIND_CURSOR_SIZE 78
-#  define _LIBUNWIND_HIGHEST_DWARF_REGISTER 96
+#  define _LIBUNWIND_HIGHEST_DWARF_REGISTER 95
 # elif defined(__arm__)
 #  define _LIBUNWIND_TARGET_ARM 1
 #  if defined(__ARM_WMMX)
@@ -45,12 +45,12 @@
 #    define _LIBUNWIND_CONTEXT_SIZE 42
 #    define _LIBUNWIND_CURSOR_SIZE 49
 #  endif
-#  define _LIBUNWIND_HIGHEST_DWARF_REGISTER 96
+#  define _LIBUNWIND_HIGHEST_DWARF_REGISTER 95
 # elif defined(__or1k__)
 #  define _LIBUNWIND_TARGET_OR1K 1
 #  define _LIBUNWIND_CONTEXT_SIZE 16
 #  define _LIBUNWIND_CURSOR_SIZE 28
-#  define _LIBUNWIND_HIGHEST_DWARF_REGISTER 32
+#  define _LIBUNWIND_HIGHEST_DWARF_REGISTER 31
 # else
 #  error "Unsupported architecture."
 # endif
@@ -63,7 +63,7 @@
 # define _LIBUNWIND_TARGET_OR1K 1
 # define _LIBUNWIND_CONTEXT_SIZE 128
 # define _LIBUNWIND_CURSOR_SIZE 140
-# define _LIBUNWIND_HIGHEST_DWARF_REGISTER 120
+# define _LIBUNWIND_HIGHEST_DWARF_REGISTER 119
 #endif // _LIBUNWIND_IS_NATIVE_ONLY
 
 #endif // ____LIBUNWIND_CONFIG_H__
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to