summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2013-03-22 22:43:14 +0000
committerJason Molenda <jmolenda@apple.com>2013-03-22 22:43:14 +0000
commitee7593fbff7c723b5c738191ea2480aa7b607a35 (patch)
tree02aed608c5434bc8bf68559e3f1199479393021c
parent0827e977007cf7f55e319e04f6547038ba1e3151 (diff)
downloadbcm5719-llvm-ee7593fbff7c723b5c738191ea2480aa7b607a35.tar.gz
bcm5719-llvm-ee7593fbff7c723b5c738191ea2480aa7b607a35.zip
Add a Reserve method to RangeVector and RangeDataVector. Have the
DWARFCallFrameInfo method which returns a RangeVector pre-size the vector based on the number of entries it will be adding insted of growing the vector as items are added. llvm-svn: 177773
-rw-r--r--lldb/include/lldb/Core/RangeMap.h16
-rw-r--r--lldb/source/Symbol/DWARFCallFrameInfo.cpp2
2 files changed, 16 insertions, 2 deletions
diff --git a/lldb/include/lldb/Core/RangeMap.h b/lldb/include/lldb/Core/RangeMap.h
index e917f448df0..c04826164c5 100644
--- a/lldb/include/lldb/Core/RangeMap.h
+++ b/lldb/include/lldb/Core/RangeMap.h
@@ -588,7 +588,13 @@ namespace lldb_private {
{
m_entries.clear();
}
-
+
+ void
+ Reserve (typename Collection::size_type size)
+ {
+ m_entries.resize (size);
+ }
+
bool
IsEmpty () const
{
@@ -1137,7 +1143,13 @@ namespace lldb_private {
{
m_entries.clear();
}
-
+
+ void
+ Reserve (typename Collection::size_type size)
+ {
+ m_entries.resize (size);
+ }
+
bool
IsEmpty () const
{
diff --git a/lldb/source/Symbol/DWARFCallFrameInfo.cpp b/lldb/source/Symbol/DWARFCallFrameInfo.cpp
index c8bc08bbd99..d1e7b22f85e 100644
--- a/lldb/source/Symbol/DWARFCallFrameInfo.cpp
+++ b/lldb/source/Symbol/DWARFCallFrameInfo.cpp
@@ -109,6 +109,8 @@ DWARFCallFrameInfo::GetFunctionAddressAndSizeVector (FunctionAddressAndSizeVecto
{
GetFDEIndex();
const size_t count = m_fde_index.GetSize();
+ function_info.Clear();
+ function_info.Reserve(count);
for (size_t i = 0; i < count; ++i)
{
const FDEEntryMap::Entry *func_offset_data_entry = m_fde_index.GetEntryAtIndex (i);
OpenPOWER on IntegriCloud