[PATCH] D127078: llvm-dwarf-dump: include type name for AT_containing_type

Felipe de Azevedo Piovezan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 8 15:36:25 PDT 2022


fdeazeve updated this revision to Diff 435366.
fdeazeve added a comment.

Rebased


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127078/new/

https://reviews.llvm.org/D127078

Files:
  llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
  llvm/test/DebugInfo/Generic/containing-type-extension.ll
  llvm/test/DebugInfo/Generic/tu-composite.ll
  llvm/test/DebugInfo/X86/containing-type-extension-rust.ll


Index: llvm/test/DebugInfo/X86/containing-type-extension-rust.ll
===================================================================
--- llvm/test/DebugInfo/X86/containing-type-extension-rust.ll
+++ llvm/test/DebugInfo/X86/containing-type-extension-rust.ll
@@ -4,7 +4,7 @@
 ; Check that any type can have a vtable holder.
 ; CHECK: [[SP:.*]]: DW_TAG_structure_type
 ; CHECK-NOT: TAG
-; CHECK: DW_AT_containing_type [DW_FORM_ref4]
+; CHECK: DW_AT_containing_type [DW_FORM_ref4] ({{.*}} "f64")
 ; CHECK: DW_AT_name [DW_FORM_strp] {{.*}}= "vtable")
 
 ; This was compiled using
Index: llvm/test/DebugInfo/Generic/tu-composite.ll
===================================================================
--- llvm/test/DebugInfo/Generic/tu-composite.ll
+++ llvm/test/DebugInfo/Generic/tu-composite.ll
@@ -2,14 +2,14 @@
 ; RUN: llvm-dwarfdump -v -debug-info %t | FileCheck %s
 ; CHECK: [[TYPE:.*]]: DW_TAG_structure_type
 ; Make sure we correctly handle containing type of a struct being a type identifier.
-; CHECK-NEXT: DW_AT_containing_type [DW_FORM_ref4]       (cu + {{.*}} => {[[TYPE]]})
+; CHECK-NEXT: DW_AT_containing_type [DW_FORM_ref4]       (cu + {{.*}} => {[[TYPE]]} "C")
 ; CHECK-NEXT: DW_AT_name {{.*}}"C"
 
 ; Make sure we correctly handle context of a subprogram being a type identifier.
 ; CHECK: [[SP:.*]]: DW_TAG_subprogram
 ; CHECK: DW_AT_name {{.*}}"foo"
 ; Make sure we correctly handle containing type of a subprogram being a type identifier.
-; CHECK: DW_AT_containing_type [DW_FORM_ref4]       (cu + {{.*}} => {[[TYPE]]})
+; CHECK: DW_AT_containing_type [DW_FORM_ref4]       (cu + {{.*}} => {[[TYPE]]} "C")
 ; CHECK: DW_TAG_formal_parameter
 ; CHECK: NULL
 ; CHECK: NULL
Index: llvm/test/DebugInfo/Generic/containing-type-extension.ll
===================================================================
--- llvm/test/DebugInfo/Generic/containing-type-extension.ll
+++ llvm/test/DebugInfo/Generic/containing-type-extension.ll
@@ -4,7 +4,7 @@
 ; Check that any type can have a vtable holder.
 ; CHECK: [[SP:.*]]: DW_TAG_structure_type
 ; CHECK-NOT: TAG
-; CHECK: DW_AT_containing_type [DW_FORM_ref4]
+; CHECK: DW_AT_containing_type [DW_FORM_ref4] ({{.*}} "int")
 ; CHECK: DW_AT_name {{.*}}"vtable"
 
 ; The code doesn't actually matter.
Index: llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
===================================================================
--- llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
+++ llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
@@ -806,7 +806,7 @@
             Die.getAttributeValueAsReferencedDie(FormValue).getName(
                 DINameKind::LinkageName))
       OS << Space << "\"" << Name << '\"';
-  } else if (Attr == DW_AT_type) {
+  } else if (Attr == DW_AT_type || Attr == DW_AT_containing_type) {
     DWARFDie D = resolveReferencedType(Die, FormValue);
     if (D && !D.isNULL()) {
       OS << Space << "\"";


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127078.435366.patch
Type: text/x-patch
Size: 2840 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220608/eedc3b01/attachment.bin>


More information about the llvm-commits mailing list