[llvm] [llvm/DWARF] Recursively resolve DW_AT_signature references (PR #97423)

Pavel Labath via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 15 08:32:08 PDT 2024


================
@@ -312,27 +307,19 @@ DWARFDie::getAttributeValueAsReferencedDie(dwarf::Attribute Attr) const {
 
 DWARFDie
 DWARFDie::getAttributeValueAsReferencedDie(const DWARFFormValue &V) const {
-  DWARFDie Result;
   if (auto SpecRef = V.getAsRelativeReference()) {
----------------
labath wrote:

> So might be worth changing it to not do that and having an explicit/separate case here?

Yeah, I was wondering about that. It did seem somewhat suboptimal, but I wasn't particularly keen on taking it on. 

Now I am, and here's my attempt to do something about this: https://github.com/llvm/llvm-project/pull/98905


> Incidentally this has probably added support for some DWARF that GCC produces - where it references the type unit directly from DW_AT_type, maybe? Currently llvm-dwarfdump doesn't resolve such references ( https://godbolt.org/z/E5boxcj1r - note the `DW_TAG_variable`'s ` DW_AT_type (0xc949e2ea8b91cfb0)` only has the signature, and I guess with this patch maybe we now get ` DW_AT_type (0xc949e2ea8b91cfb0 "t1")`?)

Interesting. I'll look into this tomorrow.

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


More information about the llvm-commits mailing list