diff options
| author | Pavel Labath <pavel@labath.sk> | 2019-09-24 12:36:54 +0000 |
|---|---|---|
| committer | Pavel Labath <pavel@labath.sk> | 2019-09-24 12:36:54 +0000 |
| commit | 13a4e8f3ef24dd69e143bb3d3591dccb2c04df9d (patch) | |
| tree | 2d34679b9811f3d3311e7c8d2def58a72e5e41b8 /lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp | |
| parent | 182d4874fd4d3aa4399c14d497a41909e12fb5ed (diff) | |
| download | llvm-13a4e8f3ef24dd69e143bb3d3591dccb2c04df9d.tar.gz llvm-13a4e8f3ef24dd69e143bb3d3591dccb2c04df9d.tar.bz2 llvm-13a4e8f3ef24dd69e143bb3d3591dccb2c04df9d.zip | |
Enhance SymbolFileDWARF::ParseDeclsForContext performance
This implements
DWARFASTParserClang::EnsureAllDIEsInDeclContextHaveBeenParsed so as to
provide a faster way to ensure all DIEs linked to a certain declaration
context have been parsed.
Currently, we rely on SymbolFileDWARF::ParseDeclsForContext calling
DWARFASTParserClang::GetDIEForDeclContext, and only then
DWARFASTParserClang::GetDeclForUIDFromDWARF. This change shortcuts that
logic and removes redundant calls to DWARFASTParserClang::
GetClangDeclForDIE by deleting DIEs from the m_decl_ctx_to_die map once
they have been parsed.
Differential Revision: https://reviews.llvm.org/D67760
Patch by Guilherme Andrade <guiandrade@google.com>.
llvm-svn: 372744
Diffstat (limited to 'lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp')
| -rw-r--r-- | lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index 2177cbc89574..504fc2f7410c 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -1217,16 +1217,9 @@ bool SymbolFileDWARF::ClassOrStructIsVirtual(const DWARFDIE &parent_die) { void SymbolFileDWARF::ParseDeclsForContext(CompilerDeclContext decl_ctx) { auto *type_system = decl_ctx.GetTypeSystem(); - if (!type_system) - return; - DWARFASTParser *ast_parser = type_system->GetDWARFParser(); - std::vector<DWARFDIE> decl_ctx_die_list = - ast_parser->GetDIEForDeclContext(decl_ctx); - - for (DWARFDIE decl_ctx_die : decl_ctx_die_list) - for (DWARFDIE decl = decl_ctx_die.GetFirstChild(); decl; - decl = decl.GetSibling()) - ast_parser->GetDeclForUIDFromDWARF(decl); + if (type_system != nullptr) + type_system->GetDWARFParser()->EnsureAllDIEsInDeclContextHaveBeenParsed( + decl_ctx); } user_id_t SymbolFileDWARF::GetUID(DIERef ref) { |
