[Lldb-commits] [lldb] Reapply [lldb][DWARF] Delay struct/class/union definition DIE searching when parsing declaration DIEs. (PR #98361)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Thu Jul 11 23:36:35 PDT 2024


================
@@ -824,6 +824,36 @@ DWARFASTParserClang::GetDIEClassTemplateParams(const DWARFDIE &die) {
   return {};
 }
 
+void DWARFASTParserClang::MappingDeclDIEToDefDIE(
+    const lldb_private::plugin::dwarf::DWARFDIE &decl_die,
+    const lldb_private::plugin::dwarf::DWARFDIE &def_die) {
+  LinkDeclContextToDIE(GetCachedClangDeclContextForDIE(decl_die), def_die);
+  SymbolFileDWARF *dwarf = def_die.GetDWARF();
+  ParsedDWARFTypeAttributes decl_attrs(decl_die);
+  ParsedDWARFTypeAttributes def_attrs(def_die);
+  ConstString unique_typename(decl_attrs.name);
+  Declaration decl_declaration(decl_attrs.decl);
+  if (Language::LanguageIsCPlusPlus(
+          SymbolFileDWARF::GetLanguage(*decl_die.GetCU()))) {
+    std::string qualified_name = GetCPlusPlusQualifiedName(decl_die);
+    if (!qualified_name.empty())
+      unique_typename = ConstString(qualified_name);
+    decl_declaration.Clear();
+  }
+  if (UniqueDWARFASTType *unique_ast_entry_type =
----------------
labath wrote:

This should always be true, right (because we've already parsed the type and inserted the proper entry? Failing to find the entry here probably deserves at least a log message..

https://github.com/llvm/llvm-project/pull/98361


More information about the lldb-commits mailing list