[Lldb-commits] [lldb] 0c86dfb - Fix -Wunused-result warnings in LLDB

Reid Kleckner via lldb-commits lldb-commits at lists.llvm.org
Tue Feb 4 15:58:44 PST 2020


Author: Reid Kleckner
Date: 2020-02-04T15:58:38-08:00
New Revision: 0c86dfb86de53e74f376c3f2800fc114afaae2ba

URL: https://github.com/llvm/llvm-project/commit/0c86dfb86de53e74f376c3f2800fc114afaae2ba
DIFF: https://github.com/llvm/llvm-project/commit/0c86dfb86de53e74f376c3f2800fc114afaae2ba.diff

LOG: Fix -Wunused-result warnings in LLDB

These try_lock usages intentionally ignore the result, as commented.

Similar to 4d23764dddc23e74ad165086d7f471a3e0e52bf8, which was reviewed
previously.

Added: 
    

Modified: 
    lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp
    lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp
    lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp
    lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp
index fc5c5a65ce44..7dfa759a7fb1 100644
--- a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp
+++ b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp
@@ -106,7 +106,7 @@ void AppleGetItemInfoHandler::Detach() {
       m_get_item_info_return_buffer_addr != LLDB_INVALID_ADDRESS) {
     std::unique_lock<std::mutex> lock(m_get_item_info_retbuffer_mutex,
                                       std::defer_lock);
-    lock.try_lock(); // Even if we don't get the lock, deallocate the buffer
+    (void)lock.try_lock(); // Even if we don't get the lock, deallocate the buffer
     m_process->DeallocateMemory(m_get_item_info_return_buffer_addr);
   }
 }

diff  --git a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp
index 2c220357ce56..ff57aa2afc99 100644
--- a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp
+++ b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp
@@ -109,7 +109,7 @@ void AppleGetPendingItemsHandler::Detach() {
       m_get_pending_items_return_buffer_addr != LLDB_INVALID_ADDRESS) {
     std::unique_lock<std::mutex> lock(m_get_pending_items_retbuffer_mutex,
                                       std::defer_lock);
-    lock.try_lock(); // Even if we don't get the lock, deallocate the buffer
+    (void)lock.try_lock(); // Even if we don't get the lock, deallocate the buffer
     m_process->DeallocateMemory(m_get_pending_items_return_buffer_addr);
   }
 }

diff  --git a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp
index 574e32760027..632f18d6ea85 100644
--- a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp
+++ b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp
@@ -107,7 +107,7 @@ void AppleGetQueuesHandler::Detach() {
       m_get_queues_return_buffer_addr != LLDB_INVALID_ADDRESS) {
     std::unique_lock<std::mutex> lock(m_get_queues_retbuffer_mutex,
                                       std::defer_lock);
-    lock.try_lock(); // Even if we don't get the lock, deallocate the buffer
+    (void)lock.try_lock(); // Even if we don't get the lock, deallocate the buffer
     m_process->DeallocateMemory(m_get_queues_return_buffer_addr);
   }
 }

diff  --git a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp
index c86d40655a05..6bfdbaca27d7 100644
--- a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp
+++ b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp
@@ -115,7 +115,7 @@ void AppleGetThreadItemInfoHandler::Detach() {
       m_get_thread_item_info_return_buffer_addr != LLDB_INVALID_ADDRESS) {
     std::unique_lock<std::mutex> lock(m_get_thread_item_info_retbuffer_mutex,
                                       std::defer_lock);
-    lock.try_lock(); // Even if we don't get the lock, deallocate the buffer
+    (void)lock.try_lock(); // Even if we don't get the lock, deallocate the buffer
     m_process->DeallocateMemory(m_get_thread_item_info_return_buffer_addr);
   }
 }


        


More information about the lldb-commits mailing list