[Lldb-commits] [lldb] r292598 - Fix more unused variable warnings when asserts are disabled.

Hafiz Abid Qadeer via lldb-commits lldb-commits at lists.llvm.org
Fri Jan 20 02:24:04 PST 2017


Author: abidh
Date: Fri Jan 20 04:24:03 2017
New Revision: 292598

URL: http://llvm.org/viewvc/llvm-project?rev=292598&view=rev
Log:
Fix more unused variable warnings when asserts are disabled.


Modified:
    lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
    lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
    lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
    lldb/trunk/source/Symbol/LineTable.cpp

Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp?rev=292598&r1=292597&r2=292598&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp (original)
+++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp Fri Jan 20 04:24:03 2017
@@ -895,6 +895,7 @@ UtilityFunction *AppleObjCRuntimeV2::Cre
   }
 
   assert(len < (int)sizeof(check_function_code));
+  UNUSED_IF_ASSERT_DISABLED(len);
 
   Error error;
   return GetTargetRef().GetUtilityFunctionForLanguage(

Modified: lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp?rev=292598&r1=292597&r2=292598&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp Fri Jan 20 04:24:03 2017
@@ -632,6 +632,7 @@ size_t ObjectFileELF::GetModuleSpecifica
           // SetArchitecture should have set the vendor to unknown
           vendor = spec.GetArchitecture().GetTriple().getVendor();
           assert(vendor == llvm::Triple::UnknownVendor);
+          UNUSED_IF_ASSERT_DISABLED(vendor);
 
           //
           // Validate it is ok to remove GetOsFromOSABI
@@ -1524,6 +1525,7 @@ size_t ObjectFileELF::GetSectionHeaderIn
     GetOsFromOSABI(header.e_ident[EI_OSABI], ostype);
     spec_ostype = arch_spec.GetTriple().getOS();
     assert(spec_ostype == ostype);
+    UNUSED_IF_ASSERT_DISABLED(spec_ostype);
   }
 
   if (arch_spec.GetMachine() == llvm::Triple::mips ||

Modified: lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp?rev=292598&r1=292597&r2=292598&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp Fri Jan 20 04:24:03 2017
@@ -1532,6 +1532,7 @@ Error NativeProcessLinux::GetMemoryRegio
     assert((proc_entry_info.GetRange().GetRangeBase() >= prev_base_address) &&
            "descending /proc/pid/maps entries detected, unexpected");
     prev_base_address = proc_entry_info.GetRange().GetRangeBase();
+    UNUSED_IF_ASSERT_DISABLED(prev_base_address);
 
     // If the target address comes before this entry, indicate distance to next
     // region.

Modified: lldb/trunk/source/Symbol/LineTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/LineTable.cpp?rev=292598&r1=292597&r2=292598&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/LineTable.cpp (original)
+++ lldb/trunk/source/Symbol/LineTable.cpp Fri Jan 20 04:24:03 2017
@@ -501,6 +501,7 @@ LineTable *LineTable::LinkLineTable(cons
 
     if (terminate_previous_entry && !sequence.m_entries.empty()) {
       assert(prev_file_addr != LLDB_INVALID_ADDRESS);
+      UNUSED_IF_ASSERT_DISABLED(prev_file_addr);
       sequence.m_entries.push_back(sequence.m_entries.back());
       if (prev_end_entry_linked_file_addr == LLDB_INVALID_ADDRESS)
         prev_end_entry_linked_file_addr =




More information about the lldb-commits mailing list