[libcxxabi] r228805 - unwind: silence -Wconversion warnings

Saleem Abdulrasool compnerd at compnerd.org
Tue Feb 10 21:20:42 PST 2015


Author: compnerd
Date: Tue Feb 10 23:20:42 2015
New Revision: 228805

URL: http://llvm.org/viewvc/llvm-project?rev=228805&view=rev
Log:
unwind: silence -Wconversion warnings

Clean up implicit uint8_t to uint32_t conversion warnings identified by GCC.

Modified:
    libcxxabi/trunk/src/Unwind/Unwind-EHABI.cpp
    libcxxabi/trunk/src/Unwind/UnwindCursor.hpp

Modified: libcxxabi/trunk/src/Unwind/Unwind-EHABI.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/Unwind/Unwind-EHABI.cpp?rev=228805&r1=228804&r2=228805&view=diff
==============================================================================
--- libcxxabi/trunk/src/Unwind/Unwind-EHABI.cpp (original)
+++ libcxxabi/trunk/src/Unwind/Unwind-EHABI.cpp Tue Feb 10 23:20:42 2015
@@ -324,7 +324,8 @@ _Unwind_Reason_Code _Unwind_VRS_Interpre
             case 0xb3: {
               uint8_t v = getByte(data, offset++);
               _Unwind_VRS_Pop(context, _UVRSC_VFP,
-                              RegisterRange(v >> 4, v & 0x0f), _UVRSD_VFPX);
+                              RegisterRange(static_cast<uint8_t>(v >> 4),
+                                            v & 0x0f), _UVRSD_VFPX);
               break;
             }
             case 0xb4:
@@ -352,7 +353,7 @@ _Unwind_Reason_Code _Unwind_VRS_Interpre
               break;
             case 0xc6: {
               uint8_t v = getByte(data, offset++);
-              uint8_t start = v >> 4;
+              uint8_t start = static_cast<uint8_t>(v >> 4);
               uint8_t count_minus_one = v & 0xf;
               if (start + count_minus_one >= 16)
                 return _URC_FAILURE;
@@ -371,7 +372,8 @@ _Unwind_Reason_Code _Unwind_VRS_Interpre
             case 0xc8:
             case 0xc9: {
               uint8_t v = getByte(data, offset++);
-              uint8_t start = ((byte == 0xc8) ? 16 : 0) + (v >> 4);
+              uint8_t start =
+                  static_cast<uint8_t>(((byte == 0xc8) ? 16 : 0) + (v >> 4));
               uint8_t count_minus_one = v & 0xf;
               if (start + count_minus_one >= 32)
                 return _URC_FAILURE;
@@ -904,7 +906,7 @@ _Unwind_VRS_Result _Unwind_VRS_Pop(
         return _UVRSR_FAILED;
       }
       for (uint32_t i = 0; i < 16; ++i) {
-        if (!(discriminator & (1 << i)))
+        if (!(discriminator & static_cast<uint32_t>(1 << i)))
           continue;
         uint32_t value = *sp++;
         if (regclass == _UVRSC_CORE && i == 13)

Modified: libcxxabi/trunk/src/Unwind/UnwindCursor.hpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/Unwind/UnwindCursor.hpp?rev=228805&r1=228804&r2=228805&view=diff
==============================================================================
--- libcxxabi/trunk/src/Unwind/UnwindCursor.hpp (original)
+++ libcxxabi/trunk/src/Unwind/UnwindCursor.hpp Tue Feb 10 23:20:42 2015
@@ -736,8 +736,8 @@ bool UnwindCursor<A, R>::getInfoFromEHAB
   // in compact form (section 6.3 EHABI).
   if (exceptionTableData & 0x80000000) {
     // Grab the index of the personality routine from the compact form.
-    int choice = (exceptionTableData & 0x0f000000) >> 24;
-    int extraWords = 0;
+    uint32_t choice = (exceptionTableData & 0x0f000000) >> 24;
+    uint32_t extraWords = 0;
     switch (choice) {
       case 0:
         personalityRoutine = (unw_word_t) &__aeabi_unwind_cpp_pr0;





More information about the cfe-commits mailing list