[dwarfdump] Print the name for referenced specification of abstract_origin DIEs.

Reviewers: dblaikie, samsonov, echristo, aprantl

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D5466

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219099 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Frederic Riss 2014-10-06 03:36:31 +00:00
parent 3736cc5be8
commit f2eddd6694
17 changed files with 67 additions and 53 deletions

View File

@ -120,6 +120,20 @@ void DWARFDebugInfoEntryMinimal::dumpAttribute(raw_ostream &OS,
formValue.dump(OS, u);
}
// We have dumped the attribute raw value. For some attributes
// having both the raw value and the pretty-printed value is
// interesting. These attributes are handled below.
if ((attr == DW_AT_specification || attr == DW_AT_abstract_origin) &&
// The signature references aren't handled.
formValue.getForm() != DW_FORM_ref_sig8) {
uint32_t Ref = formValue.getAsReference(u).getValue();
DWARFDebugInfoEntryMinimal DIE;
if (const DWARFUnit *RefU = findUnitAndExtractFast(DIE, u, &Ref))
if (const char *Ref = DIE.getSubroutineName(RefU,
FunctionNameKind::LinkageName))
OS << " \"" << Ref << '\"';
}
OS << ")\n";
}

View File

@ -43,7 +43,7 @@
; skeleton CU to address the relocation problem, then remove abstract
; definitions from -gmlt here.
; CHECK: [[F3_ABS_DEF:.*]]: DW_TAG_subprogram
; CHECK: DW_TAG_subprogram
; CHECK-NEXT: DW_AT_name {{.*}} "f3"
; FIXME: We don't really need DW_AT_inline, consumers can ignore this due to
@ -63,7 +63,7 @@
; As mentioned above - replace DW_AT_abstract_origin with DW_AT_name to save
; space once we have support for string indexing in non-dwo sections
; CHECK-NEXT: DW_AT_abstract_origin {{.*}} {[[F3_ABS_DEF]]}
; CHECK-NEXT: DW_AT_abstract_origin {{.*}} "f3"
; CHECK-NEXT: DW_AT_low_pc
; CHECK-NEXT: DW_AT_high_pc
; CHECK-NEXT: DW_AT_call_file

View File

@ -18,7 +18,7 @@
; CHECK-NOT: DW_TAG
; CHECK: DW_AT_name {{.*}} "~C"
; CHECK: [[D1_ABS:.*]]: DW_TAG_subprogram
; CHECK: DW_TAG_subprogram
; CHECK-NOT: DW_TAG
; CHECK: DW_AT_MIPS_linkage_name {{.*}} "_ZN1CD1Ev"
; CHECK-NOT: {{DW_TAG|NULL}}
@ -32,7 +32,7 @@
; CHECK-NOT: {{DW_TAG|NULL}}
; CHECK: DW_TAG_inlined_subroutine
; CHECK-NOT: DW_TAG
; CHECK: DW_AT_abstract_origin {{.*}} {[[D1_ABS]]}
; CHECK: DW_AT_abstract_origin {{.*}} "_ZN1CD1Ev"
; CHECK-NOT: {{DW_TAG|NULL}}
; CHECK: DW_TAG_formal_parameter
; CHECK-NOT: DW_TAG

View File

@ -18,14 +18,14 @@
; Test that we do emit a linkage name for a specific instance of it.
; CHECK: DW_TAG_subprogram
; CHECK: [[A_DTOR:.*]]: DW_TAG_subprogram
; CHECK: DW_TAG_subprogram
; CHECK: DW_AT_name {{.*}} "~A"
; CHECK-NOT: DW_AT_MIPS_linkage_name
; CHECK: DW_TAG_subprogram
; CHECK-NOT: DW_TAG
; CHECK: DW_AT_MIPS_linkage_name {{.*}} "_ZN1AD2Ev"
; CHECK-NOT: DW_TAG
; CHECK: DW_AT_specification {{.*}}[[A_DTOR]]
; CHECK: DW_AT_specification {{.*}} "~A"
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"

View File

@ -3,11 +3,11 @@
; test that the DW_AT_specification is a back edge in the file.
; CHECK: [[BAR_DECL:0x[0-9a-f]*]]: DW_TAG_subprogram
; CHECK: DW_TAG_subprogram
; CHECK-NEXT: DW_AT_MIPS_linkage_name {{.*}} "_ZN3foo3barEv"
; CHECK: DW_TAG_subprogram
; CHECK-NOT: DW_TAG
; CHECK: DW_AT_specification {{.*}} {[[BAR_DECL]]}
; CHECK: DW_AT_specification {{.*}} "_ZN3foo3barEv"
@_ZZN3foo3barEvE1x = constant i32 0, align 4

View File

@ -8,51 +8,54 @@
; CHECK: DW_TAG_class_type
; CHECK: DW_TAG_subprogram
; CHECK: [[ASSIGN_DECL:0x........]]: DW_TAG_subprogram
; CHECK: DW_TAG_subprogram
; CHECK: DW_AT_MIPS_linkage_name {{.*}} "_ZN12nsAutoRefCntaSEi"
; CHECK: DW_TAG_class_type
; CHECK: [[RELEASE_DECL:0x........]]: DW_TAG_subprogram
; CHECK: [[DTOR_DECL:0x........]]: DW_TAG_subprogram
; CHECK: DW_TAG_subprogram
; CHECK: DW_AT_MIPS_linkage_name {{.*}} "_ZN17nsAutoRefCnt7ReleaseEv"
; CHECK: DW_TAG_subprogram
; CHECK: DW_AT_name {{.*}} "~nsAutoRefCnt"
; CHECK: [[D2_ABS:.*]]: DW_TAG_subprogram
; CHECK: DW_TAG_subprogram
; CHECK-NEXT: DW_AT_{{.*}}linkage_name {{.*}}D2
; CHECK-NEXT: DW_AT_specification {{.*}} {[[DTOR_DECL]]}
; CHECK-NEXT: DW_AT_specification {{.*}} "~nsAutoRefCnt"
; CHECK-NEXT: DW_AT_inline
; CHECK-NOT: DW_AT
; CHECK: DW_TAG
; CHECK: [[D1_ABS:.*]]: DW_TAG_subprogram
; CHECK: DW_TAG_subprogram
; CHECK-NEXT: DW_AT_{{.*}}linkage_name {{.*}}D1
; CHECK-NEXT: DW_AT_specification {{.*}} {[[DTOR_DECL]]}
; CHECK-NEXT: DW_AT_specification {{.*}} "~nsAutoRefCnt"
; CHECK-NEXT: DW_AT_inline
; CHECK-NOT: DW_AT
; CHECK: [[D1_THIS_ABS:.*]]: DW_TAG_formal_parameter
; CHECK: [[RELEASE:0x........]]: DW_TAG_subprogram
; CHECK: DW_AT_specification {{.*}} {[[RELEASE_DECL]]}
; CHECK: DW_TAG_subprogram
; CHECK: DW_AT_specification {{.*}} "_ZN17nsAutoRefCnt7ReleaseEv"
; CHECK: DW_TAG_formal_parameter
; CHECK-NOT: NULL
; CHECK-NOT: DW_TAG
; CHECK: DW_TAG_inlined_subroutine
; CHECK-NEXT: DW_AT_abstract_origin {{.*}} {[[ASSIGN:0x........]]}
; CHECK-NEXT: DW_AT_abstract_origin {{.*}} "_ZN12nsAutoRefCntaSEi"
; CHECK-NOT: NULL
; CHECK-NOT: DW_TAG
; CHECK: DW_TAG_inlined_subroutine
; CHECK-NEXT: DW_AT_abstract_origin {{.*}} {[[D1_ABS]]}
; CHECK-NEXT: DW_AT_abstract_origin {{.*}} "_ZN17nsAutoRefCntD1Ev"
; CHECK-NOT: NULL
; CHECK-NOT: DW_TAG
; CHECK: DW_TAG_inlined_subroutine
; CHECK-NEXT: DW_AT_abstract_origin {{.*}} {[[D2_ABS]]}
; CHECK-NEXT: DW_AT_abstract_origin {{.*}} "_ZN17nsAutoRefCntD2Ev"
; and then that a TAG_subprogram refers to it with AT_abstract_origin.
; CHECK: DW_TAG_subprogram
; CHECK-NOT: DW_TAG
; CHECK: DW_AT_abstract_origin {{.*}} {[[D1_ABS]]}
; CHECK: DW_AT_abstract_origin {{.*}} "_ZN17nsAutoRefCntD1Ev"
; CHECK: DW_TAG_formal_parameter
; CHECK-NOT: DW_TAG
; CHECK: DW_AT_abstract_origin {{.*}} {[[D1_THIS_ABS]]}
; CHECK: DW_TAG_inlined_subroutine
; CHECK-NEXT: DW_AT_abstract_origin {{.*}} {[[D2_ABS]]}
; CHECK-NEXT: DW_AT_abstract_origin {{.*}} "_ZN17nsAutoRefCntD2Ev"
define i32 @_ZN17nsAutoRefCnt7ReleaseEv() {

View File

@ -6,7 +6,7 @@
; RUN: | llvm-dwarfdump -debug-dump=info - | FileCheck --check-prefix=CHECK --check-prefix=DARWIN %s
; CHECK: DW_TAG_subprogram
; CHECK: DW_AT_abstract_origin {{.*}}{[[ABS:.*]]}
; CHECK: DW_AT_abstract_origin {{.*}} "foo"
; CHECK: DW_TAG_formal_parameter
; CHECK-NOT: DW_TAG
; CHECK: DW_AT_abstract_origin {{.*}}{[[ABS_SP:.*]]}
@ -14,7 +14,7 @@
; CHECK-NOT: DW_TAG
; CHECK: DW_AT_abstract_origin {{.*}}{[[ABS_NUMS:.*]]}
; CHECK: [[ABS]]: DW_TAG_subprogram
; CHECK: DW_TAG_subprogram
; CHECK-NOT: DW_TAG
; CHECK: DW_AT_name {{.*}} "foo"
; CHECK: [[ABS_SP]]: DW_TAG_formal_parameter
@ -25,7 +25,7 @@
; CHECK: DW_AT_name {{.*}} "nums"
;CHECK: DW_TAG_inlined_subroutine
;CHECK-NEXT: DW_AT_abstract_origin {{.*}}{[[ABS]]}
;CHECK-NEXT: DW_AT_abstract_origin {{.*}} "foo"
;CHECK-NEXT: DW_AT_low_pc [DW_FORM_addr]
;CHECK-NEXT: DW_AT_high_pc [DW_FORM_data4]
;CHECK-NEXT: DW_AT_call_file

View File

@ -55,11 +55,11 @@
; CHECK: [[STATIC_MEM_DECL:0x[0-9a-f]+]]: DW_TAG_member
; CHECK-NEXT: DW_AT_name {{.*}} "static_member_variable"
; CHECK: [[MEM_FUNC_DECL:0x[0-9a-f]+]]: DW_TAG_subprogram
; CHECK: DW_TAG_subprogram
; CHECK-NEXT: DW_AT_MIPS_linkage_name
; CHECK-NEXT: DW_AT_name {{.*}} "member_function"
; CHECK: [[STATIC_MEM_FUNC_DECL:0x[0-9a-f]+]]: DW_TAG_subprogram
; CHECK: DW_TAG_subprogram
; CHECK-NEXT: DW_AT_MIPS_linkage_name
; CHECK-NEXT: DW_AT_name {{.*}} "static_member_function"
@ -160,11 +160,11 @@
; CHECK: [[MEM_FUNC:0x[0-9a-f]+]]: DW_TAG_subprogram
; CHECK-NOT: DW_TAG
; CHECK: DW_AT_specification {{.*}} {[[MEM_FUNC_DECL]]}
; CHECK: DW_AT_specification {{.*}} "_ZN1C15member_functionEv"
; CHECK: [[STATIC_MEM_FUNC:0x[0-9a-f]+]]: DW_TAG_subprogram
; CHECK-NOT: DW_TAG
; CHECK: DW_AT_specification {{.*}} {[[STATIC_MEM_FUNC_DECL]]}
; CHECK: DW_AT_specification {{.*}} "_ZN1C22static_member_functionEv"
; CHECK: [[GLOBAL_FUNC:0x[0-9a-f]+]]: DW_TAG_subprogram
; CHECK-NOT: DW_TAG

View File

@ -18,13 +18,14 @@
; But make sure we emit DW_AT_object_pointer on the abstract definition.
; CHECK: [[ABSTRACT_ORIGIN:.*]]: DW_TAG_subprogram
; CHECK-NOT: NULL
; CHECK-NOT: TAG
; CHECK-NOT: {{NULL|TAG}}
; CHECK: DW_AT_specification {{.*}} "_ZN3foo4funcEi"
; CHECK-NOT: {{NULL|TAG}}
; CHECK: DW_AT_object_pointer
; Ensure we omit DW_AT_object_pointer on inlined subroutines.
; CHECK: DW_TAG_inlined_subroutine
; CHECK-NEXT: DW_AT_abstract_origin {{.*}}{[[ABSTRACT_ORIGIN]]}
; CHECK-NEXT: DW_AT_abstract_origin {{.*}} {[[ABSTRACT_ORIGIN]]} "_ZN3foo4funcEi"
; CHECK-NOT: NULL
; CHECK-NOT: DW_AT_object_pointer
; CHECK: DW_TAG_formal_parameter

View File

@ -11,12 +11,8 @@
; x = f(x);
; }
; CHECK: [[F:.*]]: DW_TAG_subprogram
; CHECK-NOT: DW_TAG
; CHECK: DW_AT_name {{.*}} "f"
; CHECK: DW_TAG_inlined_subroutine
; CHECK-NEXT: DW_AT_abstract_origin {{.*}} {[[F]]}
; CHECK-NEXT: DW_AT_abstract_origin {{.*}} "f"
; Make sure the condition test is attributed to the inline function, not the

View File

@ -6,11 +6,11 @@
; Skip the definition of zed(foo*)
; CHECK: DW_TAG_subprogram
; CHECK: DW_TAG_class_type
; CHECK: [[BAR_DECL:0x[0-9a-f]*]]: DW_TAG_subprogram
; CHECK: DW_TAG_subprogram
; CHECK: DW_AT_MIPS_linkage_name {{.*}} "_ZN3foo3barEv"
; CHECK: DW_TAG_subprogram
; CHECK-NOT: DW_TAG
; CHECK: DW_AT_specification {{.*}} {[[BAR_DECL]]}
; CHECK: DW_AT_specification {{.*}} "_ZN3foo3barEv"
%struct.foo = type { i8 }

View File

@ -38,7 +38,7 @@
; CHECK-NOT: {{DW_TAG|NULL}}
; CHECK: DW_TAG_member
; CHECK-NOT: {{DW_TAG|NULL}}
; CHECK: [[M_FN2_DECL:.*]]: DW_TAG_subprogram
; CHECK: DW_TAG_subprogram
; CHECK-NOT: DW_TAG
; CHECK: DW_AT_name {{.*}} "m_fn2"
; CHECK-NOT: {{DW_TAG|NULL}}
@ -47,7 +47,7 @@
; The abstract definition of C::m_fn2
; CHECK: [[M_FN2_ABS_DEF:.*]]: DW_TAG_subprogram
; CHECK-NOT: DW_TAG
; CHECK: DW_AT_specification {{.*}} {[[M_FN2_DECL]]}
; CHECK: DW_AT_specification {{.*}} "_ZN1C5m_fn2Ev"
; CHECK-NOT: DW_TAG
; CHECK: DW_AT_inline
; CHECK-NOT: {{DW_TAG|NULL}}
@ -63,7 +63,7 @@
; The concrete definition of C::m_fn2
; CHECK: DW_TAG_subprogram
; CHECK-NOT: DW_TAG
; CHECK: DW_AT_abstract_origin {{.*}} {[[M_FN2_ABS_DEF]]}
; CHECK: DW_AT_abstract_origin {{.*}} {[[M_FN2_ABS_DEF]]} "_ZN1C5m_fn2Ev"
; CHECK-NOT: {{DW_TAG|NULL}}
; CHECK: DW_TAG_formal_parameter
; CHECK-NOT: DW_TAG
@ -78,7 +78,7 @@
; Inlined C::m_fn2:
; CHECK: DW_TAG_inlined_subroutine
; CHECK-NOT: DW_TAG
; CHECK: DW_AT_abstract_origin {{.*}} {[[M_FN2_ABS_DEF]]}
; CHECK: DW_AT_abstract_origin {{.*}} {[[M_FN2_ABS_DEF]]} "_ZN1C5m_fn2Ev"
; CHECK-NOT: {{DW_TAG|NULL}}
; CHECK: DW_TAG_formal_parameter
; CHECK-NOT: DW_TAG

View File

@ -25,7 +25,7 @@
; CHECK: DW_TAG_subprogram
; CHECK: DW_AT_type [DW_FORM_ref_addr] (0x00000000[[INT:.*]])
; CHECK: DW_TAG_inlined_subroutine
; CHECK: DW_AT_abstract_origin {{.*}}[[ABS_FUNC:........]])
; CHECK: DW_AT_abstract_origin {{.*}}[[ABS_FUNC:........]] "_Z4funci"
; CHECK: DW_TAG_formal_parameter
; CHECK: DW_AT_abstract_origin {{.*}}[[ABS_VAR:........]])
@ -47,7 +47,7 @@
; provides the address range and variable location
; CHECK: DW_TAG_subprogram
; CHECK: DW_AT_low_pc
; CHECK: DW_AT_abstract_origin {{.*}} {0x[[ABS_FUNC]]}
; CHECK: DW_AT_abstract_origin {{.*}} {0x[[ABS_FUNC]]} "_Z4funci"
; CHECK: DW_TAG_formal_parameter
; CHECK: DW_AT_location
; CHECK: DW_AT_abstract_origin {{.*}} {0x[[ABS_VAR]]}

View File

@ -38,11 +38,11 @@
; CHECK: DW_TAG_structure_type
; CHECK-NEXT: DW_AT_name {{.*}} "C"
; CHECK: [[FN3_DECL:.*]]: DW_TAG_subprogram
; CHECK: DW_TAG_subprogram
; CHECK-NOT: DW_TAG
; CHECK: DW_AT_name {{.*}} "m_fn3"
; CHECK: DW_AT_specification {{.*}} {[[FN3_DECL]]}
; CHECK: DW_AT_specification {{.*}} "_ZN1C5m_fn3Ev"
; CHECK-NOT: DW_TAG
; CHECK: DW_TAG_formal_parameter
; CHECK-NOT: DW_TAG

View File

@ -37,7 +37,7 @@
; x(u);
; }
; CHECK: [[ABS_X:.*]]: DW_TAG_subprogram
; CHECK: DW_TAG_subprogram
; CHECK-NOT: DW_TAG
; CHECK: DW_AT_name {{.*}} "x"
; CHECK-NOT: {{DW_TAG|NULL}}
@ -57,7 +57,7 @@
; CHECK-NOT: {{DW_TAG|NULL}}
; CHECK: DW_TAG_inlined_subroutine
; CHECK-NOT: DW_TAG
; CHECK: DW_AT_abstract_origin {{.*}} {[[ABS_X]]}
; CHECK: DW_AT_abstract_origin {{.*}} "_Z1xb"
; CHECK-NOT: {{DW_TAG|NULL}}
; CHECK: DW_TAG_formal_parameter
; CHECK-NOT: DW_TAG
@ -78,7 +78,7 @@
; CHECK-NOT: {{DW_TAG|NULL}}
; CHECK: DW_TAG_inlined_subroutine
; CHECK-NOT: DW_TAG
; CHECK: DW_AT_abstract_origin {{.*}} {[[ABS_X]]}
; CHECK: DW_AT_abstract_origin {{.*}} "_Z1xb"
; CHECK-NOT: {{DW_TAG|NULL}}
; FIXME: This formal parameter goes missing at least at -O2 (& on
; mips/powerpc), maybe before that. Perhaps SelectionDAG is to blame (and

View File

@ -15,7 +15,7 @@
; CHECK: DW_TAG_namespace
; CHECK-NEXT: DW_AT_name {{.*}} "ns"
; CHECK-NOT: DW_TAG
; CHECK: [[ABS_DEF:0x.*]]: DW_TAG_subprogram
; CHECK: DW_TAG_subprogram
; CHECK-NOT: DW_TAG
; CHECK: DW_AT_MIPS_linkage_name {{.*}} "_ZN2ns4funcEi"
; CHECK-NOT: DW_TAG
@ -24,7 +24,7 @@
; CHECK-NOT: NULL
; CHECK: DW_TAG_subprogram
; CHECK-NOT: DW_TAG
; CHECK: DW_AT_abstract_origin {{.*}} {[[ABS_DEF]]}
; CHECK: DW_AT_abstract_origin {{.*}} "_ZN2ns4funcEi"
; CHECK-NOT: DW_TAG
; CHECK: DW_TAG_formal_parameter
; CHECK: DW_AT_abstract_origin {{.*}} {[[ABS_PRM]]}

View File

@ -41,7 +41,7 @@
; CHECK: DW_AT_MIPS_linkage_name {{.*}} "_ZL3barv"
; getFoo and A may only appear once.
; CHECK-NOT: {{(getFoo)|("A")}}
; CHECK-NOT: AT_name{{.*(getFoo)|("A")}}
; ModuleID = 'type-unique-odr-a.cpp'