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
This commit is contained in:
Adrian Prantl 2014-03-14 23:08:29 +00:00
parent 7e1a3830ca
commit 1d8c02bef3
2 changed files with 7 additions and 0 deletions

View File

@ -958,6 +958,9 @@ DIE *DwarfUnit::getOrCreateTypeDIE(const MDNode *TyNode) {
DIE *ContextDIE = getOrCreateContextDIE(Context);
assert(ContextDIE);
// Unique the type. This is a noop if the type has no unique identifier.
Ty = DIType(resolve(Ty.getRef()));
DIE *TyDIE = getDIE(Ty);
if (TyDIE)
return TyDIE;

View File

@ -28,6 +28,10 @@
; CHECK-NEXT: DW_AT_MIPS_linkage_name {{.*}} "_ZL3barv"
; CHECK: DW_TAG_class_type
; CHECK-NEXT: DW_AT_name {{.*}} "A"
; CHECK-NOT: DW_TAG
; CHECK: DW_TAG_member
; CHECK-NEXT: DW_AT_name {{.*}} "data"
; CHECK-NOT: DW_TAG
; CHECK: DW_TAG_subprogram
; CHECK-NEXT: DW_AT_MIPS_linkage_name {{.*}} "_ZN1A6getFooEv"
; CHECK-NEXT: DW_AT_name {{.*}} "getFoo"