jankratochvil created this revision. jankratochvil added reviewers: labath, clayborg. jankratochvil added a project: LLDB. Herald added a subscriber: JDevlieghere. Herald added a reviewer: shafik. jankratochvil requested review of this revision.
After D96236 <https://reviews.llvm.org/D96236> using just `DWARFDebugInfoEntry *` is ambiguous as it does not contain MainCU. `DIERef` (after D96239 <https://reviews.llvm.org/D96239>) does contain it and it has the same sizeof as `DWARFDebugInfoEntry *`. This replacement should have no real performance disadvantage. My question about upstreaming of this patchset. <https://reviews.llvm.org/D96236#3020116> Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D110400 Files: lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h +++ lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h @@ -77,9 +77,8 @@ typedef std::multimap<const clang::DeclContext *, std::pair<SymbolFileDWARF *, DIERef>> DeclContextToFileDIERefMap; - typedef llvm::DenseMap<const DWARFDebugInfoEntry *, - lldb_private::OptionalClangModuleID> - DIEToModuleMap; + typedef llvm::DenseMap<DIERef, lldb_private::OptionalClangModuleID> + DIERefToModuleMap; typedef llvm::DenseMap<const DWARFDebugInfoEntry *, clang::Decl *> DIEToDeclMap; @@ -87,7 +86,7 @@ DIEToDeclMap m_die_to_decl; DIERefToDeclContextMap m_dieref_to_decl_ctx; DeclContextToFileDIERefMap m_decl_ctx_to_filedieref; - DIEToModuleMap m_die_to_module; + DIERefToModuleMap m_dieref_to_module; std::unique_ptr<lldb_private::ClangASTImporter> m_clang_ast_importer_up; /// @} Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp +++ lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp @@ -3271,8 +3271,9 @@ const dw_tag_t tag = parent.Tag(); if (tag == DW_TAG_module) { DWARFDIE module_die = parent; - auto it = m_die_to_module.find(module_die.GetDIE()); - if (it != m_die_to_module.end()) + DIERef module_dieref = *module_die.GetDIERef(); + auto it = m_dieref_to_module.find(module_dieref); + if (it != m_dieref_to_module.end()) return it->second; const char *name = module_die.GetAttributeValueAsString(DW_AT_name, 0); if (!name) @@ -3280,7 +3281,7 @@ OptionalClangModuleID id = m_ast.GetOrCreateClangModule(name, GetOwningClangModule(module_die)); - m_die_to_module.insert({module_die.GetDIE(), id}); + m_dieref_to_module.insert({module_dieref, id}); return id; } }
Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h +++ lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h @@ -77,9 +77,8 @@ typedef std::multimap<const clang::DeclContext *, std::pair<SymbolFileDWARF *, DIERef>> DeclContextToFileDIERefMap; - typedef llvm::DenseMap<const DWARFDebugInfoEntry *, - lldb_private::OptionalClangModuleID> - DIEToModuleMap; + typedef llvm::DenseMap<DIERef, lldb_private::OptionalClangModuleID> + DIERefToModuleMap; typedef llvm::DenseMap<const DWARFDebugInfoEntry *, clang::Decl *> DIEToDeclMap; @@ -87,7 +86,7 @@ DIEToDeclMap m_die_to_decl; DIERefToDeclContextMap m_dieref_to_decl_ctx; DeclContextToFileDIERefMap m_decl_ctx_to_filedieref; - DIEToModuleMap m_die_to_module; + DIERefToModuleMap m_dieref_to_module; std::unique_ptr<lldb_private::ClangASTImporter> m_clang_ast_importer_up; /// @} Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp =================================================================== --- lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp +++ lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp @@ -3271,8 +3271,9 @@ const dw_tag_t tag = parent.Tag(); if (tag == DW_TAG_module) { DWARFDIE module_die = parent; - auto it = m_die_to_module.find(module_die.GetDIE()); - if (it != m_die_to_module.end()) + DIERef module_dieref = *module_die.GetDIERef(); + auto it = m_dieref_to_module.find(module_dieref); + if (it != m_dieref_to_module.end()) return it->second; const char *name = module_die.GetAttributeValueAsString(DW_AT_name, 0); if (!name) @@ -3280,7 +3281,7 @@ OptionalClangModuleID id = m_ast.GetOrCreateClangModule(name, GetOwningClangModule(module_die)); - m_die_to_module.insert({module_die.GetDIE(), id}); + m_dieref_to_module.insert({module_dieref, id}); return id; } }
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits