Fix -Wunused-result warnings in LLDB
authorReid Kleckner <rnk@google.com>
Tue, 4 Feb 2020 23:50:44 +0000 (15:50 -0800)
committerReid Kleckner <rnk@google.com>
Tue, 4 Feb 2020 23:58:38 +0000 (15:58 -0800)
These try_lock usages intentionally ignore the result, as commented.

Similar to 4d23764dddc23e74ad165086d7f471a3e0e52bf8, which was reviewed
previously.

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

index fc5c5a6..7dfa759 100644 (file)
@@ -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);
   }
 }
index 2c22035..ff57aa2 100644 (file)
@@ -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);
   }
 }
index 574e327..632f18d 100644 (file)
@@ -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);
   }
 }
index c86d406..6bfdbac 100644 (file)
@@ -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);
   }
 }