summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/SymbolFile/DWARF/NameToDIE.h
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2011-09-12 23:21:58 +0000
committerGreg Clayton <gclayton@apple.com>2011-09-12 23:21:58 +0000
commitd4a2b37091486619386db4ccd0b1698fba8db92c (patch)
tree2a029b5c4fb238f092cf8eff7ee9f253336128a9 /lldb/source/Plugins/SymbolFile/DWARF/NameToDIE.h
parent54a109845d6612997f02535be139289baf5d089b (diff)
downloadbcm5719-llvm-d4a2b37091486619386db4ccd0b1698fba8db92c.tar.gz
bcm5719-llvm-d4a2b37091486619386db4ccd0b1698fba8db92c.zip
Huge memory and performance improvements in the DWARF parser.
Address ranges are now split up into two different tables: - one in DWARFDebugInfo that is compile unit specific - one in each DWARFCompileUnit that has exact function DIE offsets This helps keep the size of the aranges down since the main table will get uniqued and sorted and have consecutive ranges merged. We then only parse the compile unit one on demand once we have determined that a compile unit contains the address in question. We also now use the .debug_aranges section if there is one instead of always indexing the DWARF manually. NameToDIE now uses a UniqueCStringMap<dw_offset> map instead of a std::map. std::map is very bulky as each node has 3 pointers and the key and value types. This gets our NameToDIE entry down to 12 bytes each instead of 48 which saves us a lot of memory when we have very large DWARF. DWARFDebugAranges now has a smaller footprint for each range it contains to save on memory. llvm-svn: 139557
Diffstat (limited to 'lldb/source/Plugins/SymbolFile/DWARF/NameToDIE.h')
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/NameToDIE.h38
1 files changed, 16 insertions, 22 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/NameToDIE.h b/lldb/source/Plugins/SymbolFile/DWARF/NameToDIE.h
index 2fcd34a1b5c..43fb8a54ce9 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/NameToDIE.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/NameToDIE.h
@@ -10,24 +10,18 @@
#ifndef SymbolFileDWARF_NameToDIE_h_
#define SymbolFileDWARF_NameToDIE_h_
-#include <map>
-#include <vector>
+#include "lldb/Core/UniqueCStringMap.h"
#include "lldb/lldb-defines.h"
class SymbolFileDWARF;
+typedef std::vector<uint32_t> DIEArray;
+
class NameToDIE
{
public:
- typedef struct Info
- {
- uint32_t cu_idx;
- uint32_t die_idx;
- } Info;
-
-
- NameToDIE () :
- m_collection ()
+ NameToDIE () :
+ m_map()
{
}
@@ -39,27 +33,27 @@ public:
Dump (lldb_private::Stream *s);
void
- Insert (const lldb_private::ConstString& name, const Info &info);
-
+ Insert (const lldb_private::ConstString& name, uint32_t die_offset);
+
+ void
+ Finalize();
+
size_t
Find (const lldb_private::ConstString &name,
- std::vector<Info> &info_array) const;
+ DIEArray &info_array) const;
size_t
Find (const lldb_private::RegularExpression& regex,
- std::vector<Info> &info_array) const;
+ DIEArray &info_array) const;
size_t
- FindAllEntriesForCompileUnitWithIndex (const uint32_t cu_idx,
- std::vector<Info> &info_array) const;
-
- void
- Hash (lldb_private::Stream *s, SymbolFileDWARF *dwarf);
+ FindAllEntriesForCompileUnit (uint32_t cu_offset,
+ uint32_t cu_end_offset,
+ DIEArray &info_array) const;
protected:
- typedef std::multimap<const char *, Info> collection;
+ lldb_private::UniqueCStringMap<uint32_t> m_map;
- collection m_collection;
};
#endif // SymbolFileDWARF_NameToDIE_h_
OpenPOWER on IntegriCloud