[Lldb-commits] [lldb] r332201 - Use const_iterator in DWARFUnit

Jan Kratochvil via lldb-commits lldb-commits at lists.llvm.org
Sun May 13 12:04:17 PDT 2018


Author: jankratochvil
Date: Sun May 13 12:04:17 2018
New Revision: 332201

URL: http://llvm.org/viewvc/llvm-project?rev=332201&view=rev
Log:
Use const_iterator in DWARFUnit

Function DWARFUnit::GetDIE is using m_die_array only for reading so it can use
DWARFDebugInfoEntry::const_iterator.

Modified:
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp?rev=332201&r1=332200&r2=332201&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp Sun May 13 12:04:17 2018
@@ -450,9 +450,9 @@ DWARFUnit::GetDIE(dw_offset_t die_offset
 
     if (ContainsDIEOffset(die_offset)) {
       ExtractDIEsIfNeeded(false);
-      DWARFDebugInfoEntry::iterator end = m_die_array.end();
-      DWARFDebugInfoEntry::iterator pos =
-          lower_bound(m_die_array.begin(), end, die_offset, CompareDIEOffset);
+      DWARFDebugInfoEntry::const_iterator end = m_die_array.cend();
+      DWARFDebugInfoEntry::const_iterator pos =
+          lower_bound(m_die_array.cbegin(), end, die_offset, CompareDIEOffset);
       if (pos != end) {
         if (die_offset == (*pos).GetOffset())
           return DWARFDIE(this, &(*pos));




More information about the lldb-commits mailing list