Skip to content

Commit 918efaa

Browse files
committed
fixup! share DIEToType map between debug-map SymbolFiles
1 parent 52ca089 commit 918efaa

File tree

6 files changed

+19
-9
lines changed

6 files changed

+19
-9
lines changed

lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3649,8 +3649,7 @@ bool DWARFASTParserClang::CopyUniqueClassMethodTypes(
36493649
static_cast<DWARFASTParserClang *>(
36503650
SymbolFileDWARF::GetDWARFParser(*dst_class_die.GetCU()));
36513651
auto link = [&](DWARFDIE src, DWARFDIE dst) {
3652-
SymbolFileDWARF::DIEToTypePtr &die_to_type =
3653-
dst_class_die.GetDWARF()->GetDIEToType();
3652+
auto &die_to_type = dst_class_die.GetDWARF()->GetDIEToType();
36543653
clang::DeclContext *dst_decl_ctx =
36553654
dst_dwarf_ast_parser->m_die_to_decl_ctx[dst.GetDIE()];
36563655
if (dst_decl_ctx)

lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,13 @@ static ConstString GetDWARFMachOSegmentName() {
482482
return g_dwarf_section_name;
483483
}
484484

485+
llvm::DenseMap<const DWARFDebugInfoEntry *, Type *> &
486+
SymbolFileDWARF::GetDIEToType() {
487+
if (SymbolFileDWARFDebugMap *debug_map_symfile = GetDebugMapSymfile())
488+
return debug_map_symfile->GetDIEToType();
489+
return m_die_to_type;
490+
}
491+
485492
llvm::DenseMap<lldb::opaque_compiler_type_t, DIERef> &
486493
SymbolFileDWARF::GetForwardDeclCompilerTypeToDIE() {
487494
if (SymbolFileDWARFDebugMap *debug_map_symfile = GetDebugMapSymfile())
@@ -1593,7 +1600,7 @@ bool SymbolFileDWARF::CompleteType(CompilerType &compiler_type) {
15931600
DWARFASTParser *dwarf_ast = GetDWARFParser(*def_die.GetCU());
15941601
if (!dwarf_ast)
15951602
return false;
1596-
Type *type = decl_die.GetDWARF()->GetDIEToType().lookup(decl_die.GetDIE());
1603+
Type *type = GetDIEToType().lookup(decl_die.GetDIE());
15971604
assert(type);
15981605

15991606
if (decl_die != def_die) {

lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -337,9 +337,7 @@ class SymbolFileDWARF : public SymbolFileCommon {
337337
m_file_index = file_index;
338338
}
339339

340-
typedef llvm::DenseMap<const DWARFDebugInfoEntry *, Type *> DIEToTypePtr;
341-
342-
virtual DIEToTypePtr &GetDIEToType() { return m_die_to_type; }
340+
virtual llvm::DenseMap<const DWARFDebugInfoEntry *, Type *> &GetDIEToType();
343341

344342
virtual llvm::DenseMap<lldb::opaque_compiler_type_t, DIERef> &
345343
GetForwardDeclCompilerTypeToDIE();
@@ -532,7 +530,7 @@ class SymbolFileDWARF : public SymbolFileCommon {
532530
UniqueDWARFASTTypeMap m_unique_ast_type_map;
533531
// A map from DIE to lldb_private::Type. For record type, the key might be
534532
// either declaration DIE or definition DIE.
535-
DIEToTypePtr m_die_to_type;
533+
llvm::DenseMap<const DWARFDebugInfoEntry *, Type *> m_die_to_type;
536534
DIEToVariableSP m_die_to_variable_sp;
537535
// A map from CompilerType to the struct/class/union/enum DIE (might be a
538536
// declaration or a definition) that is used to construct it.

lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,10 @@ class SymbolFileDWARFDebugMap : public SymbolFileCommon {
293293
return m_unique_ast_type_map;
294294
}
295295

296+
llvm::DenseMap<const DWARFDebugInfoEntry *, Type *> &GetDIEToType() {
297+
return m_die_to_type;
298+
}
299+
296300
// OSOEntry
297301
class OSOEntry {
298302
public:
@@ -331,6 +335,7 @@ class SymbolFileDWARFDebugMap : public SymbolFileCommon {
331335
llvm::DenseMap<lldb::opaque_compiler_type_t, DIERef>
332336
m_forward_decl_compiler_type_to_die;
333337
UniqueDWARFASTTypeMap m_unique_ast_type_map;
338+
llvm::DenseMap<const DWARFDebugInfoEntry *, Type *> m_die_to_type;
334339
LazyBool m_supports_DW_AT_APPLE_objc_complete_type;
335340
DebugMap m_debug_map;
336341

lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ bool SymbolFileDWARFDwo::ParseVendorDWARFOpcode(
102102
return GetBaseSymbolFile().ParseVendorDWARFOpcode(op, opcodes, offset, stack);
103103
}
104104

105-
SymbolFileDWARF::DIEToTypePtr &SymbolFileDWARFDwo::GetDIEToType() {
105+
llvm::DenseMap<const DWARFDebugInfoEntry *, Type *> &
106+
SymbolFileDWARFDwo::GetDIEToType() {
106107
return GetBaseSymbolFile().GetDIEToType();
107108
}
108109

lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class SymbolFileDWARFDwo : public SymbolFileDWARF {
7070
SymbolFileDWARF *GetDIERefSymbolFile(const DIERef &die_ref) override;
7171

7272
protected:
73-
DIEToTypePtr &GetDIEToType() override;
73+
llvm::DenseMap<const DWARFDebugInfoEntry *, Type *> &GetDIEToType() override;
7474

7575
DIEToVariableSP &GetDIEToVariable() override;
7676

0 commit comments

Comments
 (0)