diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h @@ -77,9 +77,8 @@ typedef std::multimap> DeclContextToFileDIERefMap; - typedef llvm::DenseMap - DIEToModuleMap; + typedef llvm::DenseMap + DIERefToModuleMap; typedef llvm::DenseMap 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 m_clang_ast_importer_up; /// @} diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp +++ b/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; } }