Use const_iterator in DWARFUnit
authorJan Kratochvil <jan.kratochvil@redhat.com>
Sun, 13 May 2018 19:04:17 +0000 (19:04 +0000)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Sun, 13 May 2018 19:04:17 +0000 (19:04 +0000)
Function DWARFUnit::GetDIE is using m_die_array only for reading so it can use
DWARFDebugInfoEntry::const_iterator.

llvm-svn: 332201

lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp

index 55d40fd..af7291a 100644 (file)
@@ -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));