Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit 1d8c02b

Browse files
committed
Debug info: Unique types before emitting them to DWARF, where applicable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203983 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 7e1a383 commit 1d8c02b

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

lib/CodeGen/AsmPrinter/DwarfUnit.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -958,6 +958,9 @@ DIE *DwarfUnit::getOrCreateTypeDIE(const MDNode *TyNode) {
958958
DIE *ContextDIE = getOrCreateContextDIE(Context);
959959
assert(ContextDIE);
960960

961+
// Unique the type. This is a noop if the type has no unique identifier.
962+
Ty = DIType(resolve(Ty.getRef()));
963+
961964
DIE *TyDIE = getDIE(Ty);
962965
if (TyDIE)
963966
return TyDIE;

test/Linker/type-unique-odr-a.ll

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
; CHECK-NEXT: DW_AT_MIPS_linkage_name {{.*}} "_ZL3barv"
2929
; CHECK: DW_TAG_class_type
3030
; CHECK-NEXT: DW_AT_name {{.*}} "A"
31+
; CHECK-NOT: DW_TAG
32+
; CHECK: DW_TAG_member
33+
; CHECK-NEXT: DW_AT_name {{.*}} "data"
34+
; CHECK-NOT: DW_TAG
3135
; CHECK: DW_TAG_subprogram
3236
; CHECK-NEXT: DW_AT_MIPS_linkage_name {{.*}} "_ZN1A6getFooEv"
3337
; CHECK-NEXT: DW_AT_name {{.*}} "getFoo"

0 commit comments

Comments
 (0)