[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:34 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();
+  }
----------------
labath wrote:

Could we move create a helper function to unify this bit with the equivalent code in ParseTypeFromDWARF?

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


More information about the lldb-commits mailing list