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

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Fri May 17 02:23:13 PDT 2024


================
@@ -2306,6 +2345,11 @@ bool DWARFASTParserClang::CompleteTypeFromDWARF(const DWARFDIE &die,
 
   if (!die)
     return false;
+  ParsedDWARFTypeAttributes attrs(die);
----------------
labath wrote:

> Probably not, the `DWARFAttributes` object is large, 336 bytes.

I think that would be very wasteful, since we're just accessing these attributes once (well, maybe twice). After we've constructed the type, we should never need to look at them again, as all the information has been translated to the clang ast.

> This extra check was added in https://github.com/llvm/llvm-project/pull/91799 to ensure we don't accidentally parse declaration DIE

How exactly do we get here in that case? Presumably we still go through ParseTypesFromDWARF (where this property is checked already), is that right? Could we make a note somewhere (perhaps by putting a fake/invalid DIE into the type-to-die map) that the die is not a definition?

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


More information about the lldb-commits mailing list