Use const_iterator in DWARFUnit

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

llvm-svn: 332201
This commit is contained in:
Jan Kratochvil 2018-05-13 19:04:17 +00:00
parent 03aff468c9
commit 2e5be0cb6f

View 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));