diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DIERef.h b/lldb/source/Plugins/SymbolFile/DWARF/DIERef.h --- a/lldb/source/Plugins/SymbolFile/DWARF/DIERef.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DIERef.h @@ -34,6 +34,8 @@ assert(this->dwo_num() == dwo_num && "Dwo number out of range?"); } + DIERef() {} + llvm::Optional dwo_num() const { if (m_dwo_num_valid) return m_dwo_num; @@ -58,7 +60,7 @@ uint32_t m_dwo_num : 30; uint32_t m_dwo_num_valid : 1; uint32_t m_section : 1; - dw_offset_t m_die_offset; + dw_offset_t m_die_offset = DW_INVALID_OFFSET; }; static_assert(sizeof(DIERef) == 8, ""); 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 @@ -1723,7 +1723,7 @@ clang_type.GetOpaqueQualType(); dwarf->GetForwardDeclClangTypeToDie() [ClangUtil::RemoveFastQualifiers(clang_type).GetOpaqueQualType()] = - die.GetID(); + *die.GetDIERef(); m_ast.SetHasExternalStorage(clang_type.GetOpaqueQualType(), true); } } diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h @@ -322,7 +322,7 @@ typedef llvm::DenseMap DIEToClangType; - typedef llvm::DenseMap + typedef llvm::DenseMap ClangTypeToDIE; DISALLOW_COPY_AND_ASSIGN(SymbolFileDWARF);