[lldb][AArch64] Use macro for unused var without asserts enabled
authorDavid Spickett <david.spickett@linaro.org>
Mon, 25 Jul 2022 15:14:03 +0000 (15:14 +0000)
committerDavid Spickett <david.spickett@linaro.org>
Mon, 25 Jul 2022 15:14:49 +0000 (15:14 +0000)
82d4f39f342165a92eaa1fe74488158942cf27b4 marked an unused
var of mine (thanks Dmitri Gribenko!). Which reminded me lldb has
a macro just for that purpose.

lldb/source/Plugins/Process/Utility/MemoryTagManagerAArch64MTE.cpp

index dbd36fb..7e25bc4 100644 (file)
@@ -290,7 +290,7 @@ MemoryTagManagerAArch64MTE::UnpackTagsFromCoreFileSegment(
   const size_t bytes_copied =
       reader(tag_segment_data_address + file_offset_in_bytes, tag_bytes_to_read,
              tag_data.data());
-  (void)bytes_copied;
+  UNUSED_IF_ASSERT_DISABLED(bytes_copied);
   assert(bytes_copied == tag_bytes_to_read);
 
   std::vector<lldb::addr_t> tags;