[Lldb-commits] [lldb] r217862 - Clean-up warnings on Linux/GCC

David Majnemer david.majnemer at gmail.com
Mon Sep 15 23:34:30 PDT 2014


Author: majnemer
Date: Tue Sep 16 01:34:29 2014
New Revision: 217862

URL: http://llvm.org/viewvc/llvm-project?rev=217862&view=rev
Log:
Clean-up warnings on Linux/GCC

Modified:
    lldb/trunk/include/lldb/Breakpoint/BreakpointLocation.h
    lldb/trunk/source/Expression/IRExecutionUnit.cpp
    lldb/trunk/source/Host/common/ThisThread.cpp
    lldb/trunk/source/Plugins/Process/Linux/NativeThreadLinux.cpp
    lldb/trunk/source/Symbol/ClangASTType.cpp
    lldb/trunk/source/Target/Memory.cpp
    lldb/trunk/source/Target/Platform.cpp

Modified: lldb/trunk/include/lldb/Breakpoint/BreakpointLocation.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Breakpoint/BreakpointLocation.h?rev=217862&r1=217861&r2=217862&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Breakpoint/BreakpointLocation.h (original)
+++ lldb/trunk/include/lldb/Breakpoint/BreakpointLocation.h Tue Sep 16 01:34:29 2014
@@ -52,8 +52,6 @@ class BreakpointLocation :
     public StoppointLocation
 {
 public:
-    friend class BreakpointLocationList;
-
     ~BreakpointLocation ();
 
     //------------------------------------------------------------------

Modified: lldb/trunk/source/Expression/IRExecutionUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRExecutionUnit.cpp?rev=217862&r1=217861&r2=217862&view=diff
==============================================================================
--- lldb/trunk/source/Expression/IRExecutionUnit.cpp (original)
+++ lldb/trunk/source/Expression/IRExecutionUnit.cpp Tue Sep 16 01:34:29 2014
@@ -301,6 +301,7 @@ IRExecutionUnit::GetRunnableInfo(Error &
     .setErrorStr(&error_string)
     .setRelocationModel(relocModel)
     .setJITMemoryManager(new MemoryManager(*this))
+    .setCodeModel(codeModel)
     .setOptLevel(llvm::CodeGenOpt::Less);
 
     llvm::StringRef mArch;

Modified: lldb/trunk/source/Host/common/ThisThread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/ThisThread.cpp?rev=217862&r1=217861&r2=217862&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/ThisThread.cpp (original)
+++ lldb/trunk/source/Host/common/ThisThread.cpp Tue Sep 16 01:34:29 2014
@@ -28,12 +28,12 @@ ThisThread::SetName(llvm::StringRef name
     // off leads to a lot of similar named threads.  Go through the thread name
     // and search for the last dot and use that.
 
-    if (max_length > 0 && truncated_name.length() > max_length)
+    if (max_length > 0 && truncated_name.length() > static_cast<size_t>(max_length))
     {
         // First see if we can get lucky by removing any initial or final braces.
         std::string::size_type begin = truncated_name.find_first_not_of("(<");
         std::string::size_type end = truncated_name.find_last_not_of(")>.");
-        if (end - begin > max_length)
+        if (end - begin > static_cast<size_t>(max_length))
         {
             // We're still too long.  Since this is a dotted component, use everything after the last
             // dot, up to a maximum of |length| characters.

Modified: lldb/trunk/source/Plugins/Process/Linux/NativeThreadLinux.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeThreadLinux.cpp?rev=217862&r1=217861&r2=217862&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/NativeThreadLinux.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Linux/NativeThreadLinux.cpp Tue Sep 16 01:34:29 2014
@@ -113,6 +113,7 @@ NativeThreadLinux::GetStopReason (Thread
         }
         return false;
     }
+    llvm_unreachable("unhandled StateType!");
 }
 
 lldb_private::NativeRegisterContextSP

Modified: lldb/trunk/source/Symbol/ClangASTType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTType.cpp?rev=217862&r1=217861&r2=217862&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTType.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTType.cpp Tue Sep 16 01:34:29 2014
@@ -1789,7 +1789,7 @@ ClangASTType::GetMemberFunctionAtIndex (
                     {
                         auto method_iter = cxx_record_decl->method_begin();
                         auto method_end = cxx_record_decl->method_end();
-                        if (idx < std::distance(method_iter, method_end))
+                        if (idx < static_cast<size_t>(std::distance(method_iter, method_end)))
                         {
                             std::advance(method_iter, idx);
                             auto method_decl = method_iter->getCanonicalDecl();

Modified: lldb/trunk/source/Target/Memory.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Memory.cpp?rev=217862&r1=217861&r2=217862&view=diff
==============================================================================
--- lldb/trunk/source/Target/Memory.cpp (original)
+++ lldb/trunk/source/Target/Memory.cpp Tue Sep 16 01:34:29 2014
@@ -251,7 +251,8 @@ AllocatedBlock::ReserveBlock (uint32_t s
         {
             m_offset_to_chunk_size[0] = needed_chunks;
             if (log)
-                log->Printf ("[1] AllocatedBlock::ReserveBlock(%p) (size = %u (0x%x)) => offset = 0x%x, %u %u bit chunks", this, size, size, 0, needed_chunks, m_chunk_size);
+                log->Printf("[1] AllocatedBlock::ReserveBlock(%p) (size = %u (0x%x)) => offset = 0x%x, %u %u bit chunks", (void *)this,
+                            size, size, 0, needed_chunks, m_chunk_size);
             addr = m_addr;
         }
         else
@@ -269,7 +270,9 @@ AllocatedBlock::ReserveBlock (uint32_t s
                     {
                         m_offset_to_chunk_size[last_offset] = needed_chunks;
                         if (log)
-                            log->Printf ("[2] AllocatedBlock::ReserveBlock(%p) (size = %u (0x%x)) => offset = 0x%x, %u %u bit chunks - num_chunks %lu", this, size, size, last_offset, needed_chunks, m_chunk_size, m_offset_to_chunk_size.size());
+                            log->Printf("[2] AllocatedBlock::ReserveBlock(%p) (size = %u (0x%x)) => offset = 0x%x, %u %u bit chunks - "
+                                        "num_chunks %lu",
+                                        (void *)this, size, size, last_offset, needed_chunks, m_chunk_size, m_offset_to_chunk_size.size());
                         addr = m_addr + last_offset;
                         break;
                     }
@@ -285,7 +288,9 @@ AllocatedBlock::ReserveBlock (uint32_t s
                     {
                         m_offset_to_chunk_size[last_offset] = needed_chunks;
                         if (log)
-                            log->Printf ("[3] AllocatedBlock::ReserveBlock(%p) (size = %u (0x%x)) => offset = 0x%x, %u %u bit chunks - num_chunks %lu", this, size, size, last_offset, needed_chunks, m_chunk_size, m_offset_to_chunk_size.size());
+                            log->Printf("[3] AllocatedBlock::ReserveBlock(%p) (size = %u (0x%x)) => offset = 0x%x, %u %u bit chunks - "
+                                        "num_chunks %lu",
+                                        (void *)this, size, size, last_offset, needed_chunks, m_chunk_size, m_offset_to_chunk_size.size());
                         addr = m_addr + last_offset;
                         break;
                     }
@@ -346,7 +351,7 @@ AllocatedBlock::ReserveBlock (uint32_t s
     }
 
     if (log)
-        log->Printf ("AllocatedBlock::ReserveBlock(%p) (size = %u (0x%x)) => 0x%16.16" PRIx64, this, size, size, (uint64_t)addr);
+        log->Printf("AllocatedBlock::ReserveBlock(%p) (size = %u (0x%x)) => 0x%16.16" PRIx64, (void *)this, size, size, (uint64_t)addr);
     return addr;
 }
 
@@ -363,7 +368,8 @@ AllocatedBlock::FreeBlock (addr_t addr)
     }
     Log *log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS | LIBLLDB_LOG_VERBOSE));
     if (log)
-        log->Printf ("AllocatedBlock::FreeBlock(%p) (addr = 0x%16.16" PRIx64 ") => %i, num_chunks: %lu", this, (uint64_t)addr, success, m_offset_to_chunk_size.size());
+        log->Printf("AllocatedBlock::FreeBlock(%p) (addr = 0x%16.16" PRIx64 ") => %i, num_chunks: %lu", (void *)this, (uint64_t)addr,
+                    success, m_offset_to_chunk_size.size());
     return success;
 }
 

Modified: lldb/trunk/source/Target/Platform.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Platform.cpp?rev=217862&r1=217861&r2=217862&view=diff
==============================================================================
--- lldb/trunk/source/Target/Platform.cpp (original)
+++ lldb/trunk/source/Target/Platform.cpp Tue Sep 16 01:34:29 2014
@@ -541,6 +541,7 @@ RecurseCopy_Callback (void *baton,
             return FileSpec::eEnumerateDirectoryResultQuit; // got an error, bail out
             break;
     }
+    llvm_unreachable("Unhandled FileSpec::FileType!");
 }
 
 Error





More information about the lldb-commits mailing list