diff options
| author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2018-05-31 08:55:40 +0000 |
|---|---|---|
| committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2018-05-31 08:55:40 +0000 |
| commit | a375349c53d914ab24de2af5a95d6e0455007ff2 (patch) | |
| tree | eb079126211cb8db712d8aa9a95a36b858d2d43a /lldb/source/Plugins/SymbolFile | |
| parent | 59870af66f015c13105bbb865fb30a5b22e5548b (diff) | |
| download | bcm5719-llvm-a375349c53d914ab24de2af5a95d6e0455007ff2.tar.gz bcm5719-llvm-a375349c53d914ab24de2af5a95d6e0455007ff2.zip | |
Simplify DWARFUnit::m_die_array swap() to use shrink_to_fit()
rL145086 introduced m_die_array.shrink_to_fit() implemented by
exact_size_die_array.swap, it was before LLVM became written in C++11.
Differential revision: https://reviews.llvm.org/D47492
llvm-svn: 333636
Diffstat (limited to 'lldb/source/Plugins/SymbolFile')
| -rw-r--r-- | lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp index 84a581ad484..1bb11728c82 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp @@ -180,15 +180,7 @@ bool DWARFUnit::ExtractDIEsIfNeeded() { m_first_die = m_die_array.front(); } - // Since std::vector objects will double their size, we really need to make a - // new array with the perfect size so we don't end up wasting space. So here - // we copy and swap to make sure we don't have any extra memory taken up. - - if (m_die_array.size() < m_die_array.capacity()) { - DWARFDebugInfoEntry::collection exact_size_die_array(m_die_array.begin(), - m_die_array.end()); - exact_size_die_array.swap(m_die_array); - } + m_die_array.shrink_to_fit(); ExtractDIEsEndCheck(offset); |

