Skip to content

Commit d95a90b

Browse files
committed
[HeterogeneousDWARF] Stop emitting DW_AT_address_class on pointer types
This attribute isn't fully supported GDB and it's usage was leading to some errors.
1 parent 02b9959 commit d95a90b

File tree

4 files changed

+4
-11
lines changed

4 files changed

+4
-11
lines changed

llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -895,12 +895,8 @@ void DwarfUnit::constructTypeDIE(DIE &Buffer, const DIDerivedType *DTy) {
895895
// If DWARF address space value is other than None, add it. The IR
896896
// verifier checks that DWARF address space only exists for pointer
897897
// or reference types.
898-
if (auto AS = DTy->getDWARFAddressSpace()) {
899-
// TODO: Drop address_class once the debugger adopts address_space
900-
for (auto ASTag :
901-
{dwarf::DW_AT_address_class, dwarf::DW_AT_LLVM_address_space})
902-
addUInt(Buffer, ASTag, dwarf::DW_FORM_data4, *AS);
903-
}
898+
if (auto AS = DTy->getDWARFAddressSpace())
899+
addUInt(Buffer, dwarf::DW_AT_LLVM_address_space, dwarf::DW_FORM_data4, *AS);
904900

905901
// Add template alias template parameters.
906902
if (Tag == dwarf::DW_TAG_template_alias)

llvm/test/DebugInfo/AMDGPU/heterogeneous-dwarf-diop-diexpression-address-spaces.ll

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ attributes #0 = { "frame-pointer"="all" }
114114

115115
; CHECK: [[PTR_AS_3]]: DW_TAG_pointer_type
116116
; CHECK-NEXT: DW_AT_type
117-
; CHECK-NEXT: DW_AT_address_class (0x00000003)
118117
; CHECK-NEXT: DW_AT_LLVM_address_space (0x00000003 "DW_ASPACE_LLVM_AMDGPU_local")
119118

120119
; CHECK: [[PTR_AS_NONE]]: DW_TAG_pointer_type
@@ -123,7 +122,6 @@ attributes #0 = { "frame-pointer"="all" }
123122

124123
; CHECK: [[PTR_AS_5]]: DW_TAG_pointer_type
125124
; CHECK-NEXT: DW_AT_type
126-
; CHECK-NEXT: DW_AT_address_class (0x00000005)
127125
; CHECK-NEXT: DW_AT_LLVM_address_space (0x00000005 "DW_ASPACE_LLVM_AMDGPU_private_lane")
128126

129127
!llvm.dbg.cu = !{!0}

llvm/test/DebugInfo/AMDGPU/pointer-address-space.ll

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,11 @@
5050

5151
; CHECK: 0x[[LOCAL]]: DW_TAG_pointer_type
5252
; CHECK-NEXT: DW_AT_type
53-
; CHECK-NEXT: DW_AT_address_class [DW_FORM_data4] (0x00000002)
5453
; CHECK-NEXT: DW_AT_LLVM_address_space [DW_FORM_data4] (0x00000002 "DW_ASPACE_LLVM_AMDGPU_region")
5554
; CHECK-NEXT: DW_AT_LLVM_memory_space [DW_FORM_data4] (DW_MSPACE_LLVM_group)
5655

5756
; CHECK: 0x[[PRIVATE]]: DW_TAG_pointer_type
5857
; CHECK-NEXT: DW_AT_type
59-
; CHECK-NEXT: DW_AT_address_class [DW_FORM_data4] (0x00000001)
6058
; CHECK-NEXT: DW_AT_LLVM_address_space [DW_FORM_data4] (0x00000001 "DW_ASPACE_LLVM_AMDGPU_generic")
6159
; CHECK-NEXT: DW_AT_LLVM_memory_space [DW_FORM_data4] (DW_MSPACE_LLVM_private)
6260

llvm/test/DebugInfo/Generic/address_space_rvalue.ll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66

77
; CHECK: DW_TAG_rvalue_reference_type
88
; CHECK-NOT: DW_TAG
9-
; CHECK: DW_AT_address_class (0x00000001)
9+
; CHECK-NOT: DW_AT_address_class
10+
; CHECK: DW_AT_LLVM_address_space (0x00000001)
1011

1112
@y = global ptr null, align 8, !dbg !0
1213

0 commit comments

Comments
 (0)