[cfe-commits] [libcxxabi] r152328 - in /libcxxabi/trunk: lib/buildit src/cxa_demangle.cpp src/cxa_personality.cpp src/fallback_malloc.ipp

Howard Hinnant hhinnant at apple.com
Thu Mar 8 12:16:45 PST 2012


Author: hhinnant
Date: Thu Mar  8 14:16:45 2012
New Revision: 152328

URL: http://llvm.org/viewvc/llvm-project?rev=152328&view=rev
Log:
Enable/silence -Wconversion.

Modified:
    libcxxabi/trunk/lib/buildit
    libcxxabi/trunk/src/cxa_demangle.cpp
    libcxxabi/trunk/src/cxa_personality.cpp
    libcxxabi/trunk/src/fallback_malloc.ipp

Modified: libcxxabi/trunk/lib/buildit
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/lib/buildit?rev=152328&r1=152327&r2=152328&view=diff
==============================================================================
--- libcxxabi/trunk/lib/buildit (original)
+++ libcxxabi/trunk/lib/buildit Thu Mar  8 14:16:45 2012
@@ -28,7 +28,7 @@
 fi
 
 EXTRA_FLAGS="-std=c++0x -stdlib=libc++ -fstrict-aliasing -Wstrict-aliasing=2 \
-             -Wsign-conversion -Wshadow -Wnewline-eof"
+             -Wsign-conversion -Wshadow -Wconversion -Wnewline-eof"
 
 case $TRIPLE in
   *-apple-*)

Modified: libcxxabi/trunk/src/cxa_demangle.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/cxa_demangle.cpp?rev=152328&r1=152327&r2=152328&view=diff
==============================================================================
--- libcxxabi/trunk/src/cxa_demangle.cpp (original)
+++ libcxxabi/trunk/src/cxa_demangle.cpp Thu Mar  8 14:16:45 2012
@@ -460,7 +460,7 @@
     : public __node
 {
 public:
-    __source_name(const char* __name, unsigned __size)
+    __source_name(const char* __name, size_t __size)
     {
         __name_ = __name;
         __size_ = __size;
@@ -5962,7 +5962,7 @@
     : public __node
 {
 public:
-    __dot_suffix(__node* name, const char* suffix, unsigned sz)
+    __dot_suffix(__node* name, const char* suffix, size_t sz)
     {
         __left_ = name;
         __name_ = suffix;
@@ -10259,7 +10259,7 @@
                 }
                 break;
             case 'U':
-                assert(!"__parse_nested_name U");
+                // assert(!"__parse_nested_name U");
                 // could have following <template-args>
                 break;
             case 'T':

Modified: libcxxabi/trunk/src/cxa_personality.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/cxa_personality.cpp?rev=152328&r1=152327&r2=152328&view=diff
==============================================================================
--- libcxxabi/trunk/src/cxa_personality.cpp (original)
+++ libcxxabi/trunk/src/cxa_personality.cpp Thu Mar  8 14:16:45 2012
@@ -247,7 +247,7 @@
         p += sizeof(uint32_t);
         break;
     case DW_EH_PE_udata8:
-        result = *((uint64_t*)p);
+        result = static_cast<uintptr_t>(*((uint64_t*)p));
         p += sizeof(uint64_t);
         break;
     case DW_EH_PE_sdata2:
@@ -527,7 +527,7 @@
     // Walk call-site table looking for range that 
     // includes current PC. 
     uint8_t callSiteEncoding = *lsda++;
-    uint32_t callSiteTableLength = readULEB128(&lsda);
+    uint32_t callSiteTableLength = static_cast<uint32_t>(readULEB128(&lsda));
     const uint8_t* callSiteTableStart = lsda;
     const uint8_t* callSiteTableEnd = callSiteTableStart + callSiteTableLength;
     const uint8_t* actionTableStart = callSiteTableEnd;

Modified: libcxxabi/trunk/src/fallback_malloc.ipp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/fallback_malloc.ipp?rev=152328&r1=152327&r2=152328&view=diff
==============================================================================
--- libcxxabi/trunk/src/fallback_malloc.ipp (original)
+++ libcxxabi/trunk/src/fallback_malloc.ipp Thu Mar  8 14:16:45 2012
@@ -54,7 +54,7 @@
     { return (heap_node *) ( heap + ( offset * sizeof (heap_node))); }
 
 heap_offset offset_from_node ( const heap_node *ptr )
-    { return static_cast<size_t>(((char *) ptr ) - heap)  / sizeof (heap_node); }
+    { return static_cast<heap_offset>(static_cast<size_t>(((char *) ptr ) - heap)  / sizeof (heap_node)); }
  
 void init_heap () {
     freelist = (heap_node *) heap;
@@ -87,7 +87,7 @@
             p->len -= nelems;
             q = p + p->len;
             q->next_node = 0;
-            q->len = nelems;
+            q->len = static_cast<heap_size>(nelems);
             return (void *) (q + 1);
         }
         





More information about the cfe-commits mailing list