llvm.org GIT mirror llvm / f2eddd6
[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 Frederic Riss 5 years ago
17 changed file(s) with 67 addition(s) and 53 deletion(s). Raw diff Collapse all Expand all
119119 formValue.dump(OS, u);
120120 }
121121
122 // We have dumped the attribute raw value. For some attributes
123 // having both the raw value and the pretty-printed value is
124 // interesting. These attributes are handled below.
125 if ((attr == DW_AT_specification || attr == DW_AT_abstract_origin) &&
126 // The signature references aren't handled.
127 formValue.getForm() != DW_FORM_ref_sig8) {
128 uint32_t Ref = formValue.getAsReference(u).getValue();
129 DWARFDebugInfoEntryMinimal DIE;
130 if (const DWARFUnit *RefU = findUnitAndExtractFast(DIE, u, &Ref))
131 if (const char *Ref = DIE.getSubroutineName(RefU,
132 FunctionNameKind::LinkageName))
133 OS << " \"" << Ref << '\"';
134 }
135
122136 OS << ")\n";
123137 }
124138
4242 ; skeleton CU to address the relocation problem, then remove abstract
4343 ; definitions from -gmlt here.
4444
45 ; CHECK: [[F3_ABS_DEF:.*]]: DW_TAG_subprogram
45 ; CHECK: DW_TAG_subprogram
4646 ; CHECK-NEXT: DW_AT_name {{.*}} "f3"
4747
4848 ; FIXME: We don't really need DW_AT_inline, consumers can ignore this due to
6262 ; As mentioned above - replace DW_AT_abstract_origin with DW_AT_name to save
6363 ; space once we have support for string indexing in non-dwo sections
6464
65 ; CHECK-NEXT: DW_AT_abstract_origin {{.*}} {[[F3_ABS_DEF]]}
65 ; CHECK-NEXT: DW_AT_abstract_origin {{.*}} "f3"
6666 ; CHECK-NEXT: DW_AT_low_pc
6767 ; CHECK-NEXT: DW_AT_high_pc
6868 ; CHECK-NEXT: DW_AT_call_file
1717 ; CHECK-NOT: DW_TAG
1818 ; CHECK: DW_AT_name {{.*}} "~C"
1919
20 ; CHECK: [[D1_ABS:.*]]: DW_TAG_subprogram
20 ; CHECK: DW_TAG_subprogram
2121 ; CHECK-NOT: DW_TAG
2222 ; CHECK: DW_AT_MIPS_linkage_name {{.*}} "_ZN1CD1Ev"
2323 ; CHECK-NOT: {{DW_TAG|NULL}}
3131 ; CHECK-NOT: {{DW_TAG|NULL}}
3232 ; CHECK: DW_TAG_inlined_subroutine
3333 ; CHECK-NOT: DW_TAG
34 ; CHECK: DW_AT_abstract_origin {{.*}} {[[D1_ABS]]}
34 ; CHECK: DW_AT_abstract_origin {{.*}} "_ZN1CD1Ev"
3535 ; CHECK-NOT: {{DW_TAG|NULL}}
3636 ; CHECK: DW_TAG_formal_parameter
3737 ; CHECK-NOT: DW_TAG
1717 ; Test that we do emit a linkage name for a specific instance of it.
1818
1919 ; CHECK: DW_TAG_subprogram
20 ; CHECK: [[A_DTOR:.*]]: DW_TAG_subprogram
20 ; CHECK: DW_TAG_subprogram
2121 ; CHECK: DW_AT_name {{.*}} "~A"
2222 ; CHECK-NOT: DW_AT_MIPS_linkage_name
2323 ; CHECK: DW_TAG_subprogram
2424 ; CHECK-NOT: DW_TAG
2525 ; CHECK: DW_AT_MIPS_linkage_name {{.*}} "_ZN1AD2Ev"
2626 ; CHECK-NOT: DW_TAG
27 ; CHECK: DW_AT_specification {{.*}}[[A_DTOR]]
27 ; CHECK: DW_AT_specification {{.*}} "~A"
2828
2929
3030 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
22
33 ; test that the DW_AT_specification is a back edge in the file.
44
5 ; CHECK: [[BAR_DECL:0x[0-9a-f]*]]: DW_TAG_subprogram
5 ; CHECK: DW_TAG_subprogram
66 ; CHECK-NEXT: DW_AT_MIPS_linkage_name {{.*}} "_ZN3foo3barEv"
77 ; CHECK: DW_TAG_subprogram
88 ; CHECK-NOT: DW_TAG
9 ; CHECK: DW_AT_specification {{.*}} {[[BAR_DECL]]}
9 ; CHECK: DW_AT_specification {{.*}} "_ZN3foo3barEv"
1010
1111
1212 @_ZZN3foo3barEvE1x = constant i32 0, align 4
77
88 ; CHECK: DW_TAG_class_type
99 ; CHECK: DW_TAG_subprogram
10 ; CHECK: [[ASSIGN_DECL:0x........]]: DW_TAG_subprogram
10 ; CHECK: DW_TAG_subprogram
11 ; CHECK: DW_AT_MIPS_linkage_name {{.*}} "_ZN12nsAutoRefCntaSEi"
1112
1213 ; CHECK: DW_TAG_class_type
13 ; CHECK: [[RELEASE_DECL:0x........]]: DW_TAG_subprogram
14 ; CHECK: [[DTOR_DECL:0x........]]: DW_TAG_subprogram
14 ; CHECK: DW_TAG_subprogram
15 ; CHECK: DW_AT_MIPS_linkage_name {{.*}} "_ZN17nsAutoRefCnt7ReleaseEv"
16 ; CHECK: DW_TAG_subprogram
17 ; CHECK: DW_AT_name {{.*}} "~nsAutoRefCnt"
1518
16 ; CHECK: [[D2_ABS:.*]]: DW_TAG_subprogram
19 ; CHECK: DW_TAG_subprogram
1720 ; CHECK-NEXT: DW_AT_{{.*}}linkage_name {{.*}}D2
18 ; CHECK-NEXT: DW_AT_specification {{.*}} {[[DTOR_DECL]]}
21 ; CHECK-NEXT: DW_AT_specification {{.*}} "~nsAutoRefCnt"
1922 ; CHECK-NEXT: DW_AT_inline
2023 ; CHECK-NOT: DW_AT
2124 ; CHECK: DW_TAG
22 ; CHECK: [[D1_ABS:.*]]: DW_TAG_subprogram
25 ; CHECK: DW_TAG_subprogram
2326 ; CHECK-NEXT: DW_AT_{{.*}}linkage_name {{.*}}D1
24 ; CHECK-NEXT: DW_AT_specification {{.*}} {[[DTOR_DECL]]}
27 ; CHECK-NEXT: DW_AT_specification {{.*}} "~nsAutoRefCnt"
2528 ; CHECK-NEXT: DW_AT_inline
2629 ; CHECK-NOT: DW_AT
2730 ; CHECK: [[D1_THIS_ABS:.*]]: DW_TAG_formal_parameter
2831
29 ; CHECK: [[RELEASE:0x........]]: DW_TAG_subprogram
30 ; CHECK: DW_AT_specification {{.*}} {[[RELEASE_DECL]]}
32 ; CHECK: DW_TAG_subprogram
33 ; CHECK: DW_AT_specification {{.*}} "_ZN17nsAutoRefCnt7ReleaseEv"
3134 ; CHECK: DW_TAG_formal_parameter
3235 ; CHECK-NOT: NULL
3336 ; CHECK-NOT: DW_TAG
3437 ; CHECK: DW_TAG_inlined_subroutine
35 ; CHECK-NEXT: DW_AT_abstract_origin {{.*}} {[[ASSIGN:0x........]]}
38 ; CHECK-NEXT: DW_AT_abstract_origin {{.*}} "_ZN12nsAutoRefCntaSEi"
3639 ; CHECK-NOT: NULL
3740 ; CHECK-NOT: DW_TAG
3841 ; CHECK: DW_TAG_inlined_subroutine
39 ; CHECK-NEXT: DW_AT_abstract_origin {{.*}} {[[D1_ABS]]}
42 ; CHECK-NEXT: DW_AT_abstract_origin {{.*}} "_ZN17nsAutoRefCntD1Ev"
4043 ; CHECK-NOT: NULL
4144 ; CHECK-NOT: DW_TAG
4245 ; CHECK: DW_TAG_inlined_subroutine
43 ; CHECK-NEXT: DW_AT_abstract_origin {{.*}} {[[D2_ABS]]}
46 ; CHECK-NEXT: DW_AT_abstract_origin {{.*}} "_ZN17nsAutoRefCntD2Ev"
4447
4548 ; and then that a TAG_subprogram refers to it with AT_abstract_origin.
4649
4750 ; CHECK: DW_TAG_subprogram
4851 ; CHECK-NOT: DW_TAG
49 ; CHECK: DW_AT_abstract_origin {{.*}} {[[D1_ABS]]}
52 ; CHECK: DW_AT_abstract_origin {{.*}} "_ZN17nsAutoRefCntD1Ev"
5053 ; CHECK: DW_TAG_formal_parameter
5154 ; CHECK-NOT: DW_TAG
5255 ; CHECK: DW_AT_abstract_origin {{.*}} {[[D1_THIS_ABS]]}
5356 ; CHECK: DW_TAG_inlined_subroutine
54 ; CHECK-NEXT: DW_AT_abstract_origin {{.*}} {[[D2_ABS]]}
57 ; CHECK-NEXT: DW_AT_abstract_origin {{.*}} "_ZN17nsAutoRefCntD2Ev"
5558
5659
5760 define i32 @_ZN17nsAutoRefCnt7ReleaseEv() {
55 ; RUN: | llvm-dwarfdump -debug-dump=info - | FileCheck --check-prefix=CHECK --check-prefix=DARWIN %s
66
77 ; CHECK: DW_TAG_subprogram
8 ; CHECK: DW_AT_abstract_origin {{.*}}{[[ABS:.*]]}
8 ; CHECK: DW_AT_abstract_origin {{.*}} "foo"
99 ; CHECK: DW_TAG_formal_parameter
1010 ; CHECK-NOT: DW_TAG
1111 ; CHECK: DW_AT_abstract_origin {{.*}}{[[ABS_SP:.*]]}
1313 ; CHECK-NOT: DW_TAG
1414 ; CHECK: DW_AT_abstract_origin {{.*}}{[[ABS_NUMS:.*]]}
1515
16 ; CHECK: [[ABS]]: DW_TAG_subprogram
16 ; CHECK: DW_TAG_subprogram
1717 ; CHECK-NOT: DW_TAG
1818 ; CHECK: DW_AT_name {{.*}} "foo"
1919 ; CHECK: [[ABS_SP]]: DW_TAG_formal_parameter
2424 ; CHECK: DW_AT_name {{.*}} "nums"
2525
2626 ;CHECK: DW_TAG_inlined_subroutine
27 ;CHECK-NEXT: DW_AT_abstract_origin {{.*}}{[[ABS]]}
27 ;CHECK-NEXT: DW_AT_abstract_origin {{.*}} "foo"
2828 ;CHECK-NEXT: DW_AT_low_pc [DW_FORM_addr]
2929 ;CHECK-NEXT: DW_AT_high_pc [DW_FORM_data4]
3030 ;CHECK-NEXT: DW_AT_call_file
5454 ; CHECK: [[STATIC_MEM_DECL:0x[0-9a-f]+]]: DW_TAG_member
5555 ; CHECK-NEXT: DW_AT_name {{.*}} "static_member_variable"
5656
57 ; CHECK: [[MEM_FUNC_DECL:0x[0-9a-f]+]]: DW_TAG_subprogram
57 ; CHECK: DW_TAG_subprogram
5858 ; CHECK-NEXT: DW_AT_MIPS_linkage_name
5959 ; CHECK-NEXT: DW_AT_name {{.*}} "member_function"
6060
61 ; CHECK: [[STATIC_MEM_FUNC_DECL:0x[0-9a-f]+]]: DW_TAG_subprogram
61 ; CHECK: DW_TAG_subprogram
6262 ; CHECK-NEXT: DW_AT_MIPS_linkage_name
6363 ; CHECK-NEXT: DW_AT_name {{.*}} "static_member_function"
6464
159159
160160 ; CHECK: [[MEM_FUNC:0x[0-9a-f]+]]: DW_TAG_subprogram
161161 ; CHECK-NOT: DW_TAG
162 ; CHECK: DW_AT_specification {{.*}} {[[MEM_FUNC_DECL]]}
162 ; CHECK: DW_AT_specification {{.*}} "_ZN1C15member_functionEv"
163163
164164 ; CHECK: [[STATIC_MEM_FUNC:0x[0-9a-f]+]]: DW_TAG_subprogram
165165 ; CHECK-NOT: DW_TAG
166 ; CHECK: DW_AT_specification {{.*}} {[[STATIC_MEM_FUNC_DECL]]}
166 ; CHECK: DW_AT_specification {{.*}} "_ZN1C22static_member_functionEv"
167167
168168 ; CHECK: [[GLOBAL_FUNC:0x[0-9a-f]+]]: DW_TAG_subprogram
169169 ; CHECK-NOT: DW_TAG
1717
1818 ; But make sure we emit DW_AT_object_pointer on the abstract definition.
1919 ; CHECK: [[ABSTRACT_ORIGIN:.*]]: DW_TAG_subprogram
20 ; CHECK-NOT: NULL
21 ; CHECK-NOT: TAG
20 ; CHECK-NOT: {{NULL|TAG}}
21 ; CHECK: DW_AT_specification {{.*}} "_ZN3foo4funcEi"
22 ; CHECK-NOT: {{NULL|TAG}}
2223 ; CHECK: DW_AT_object_pointer
2324
2425 ; Ensure we omit DW_AT_object_pointer on inlined subroutines.
2526 ; CHECK: DW_TAG_inlined_subroutine
26 ; CHECK-NEXT: DW_AT_abstract_origin {{.*}}{[[ABSTRACT_ORIGIN]]}
27 ; CHECK-NEXT: DW_AT_abstract_origin {{.*}} {[[ABSTRACT_ORIGIN]]} "_ZN3foo4funcEi"
2728 ; CHECK-NOT: NULL
2829 ; CHECK-NOT: DW_AT_object_pointer
2930 ; CHECK: DW_TAG_formal_parameter
1010 ; x = f(x);
1111 ; }
1212
13 ; CHECK: [[F:.*]]: DW_TAG_subprogram
14 ; CHECK-NOT: DW_TAG
15 ; CHECK: DW_AT_name {{.*}} "f"
16
1713 ; CHECK: DW_TAG_inlined_subroutine
18 ; CHECK-NEXT: DW_AT_abstract_origin {{.*}} {[[F]]}
14 ; CHECK-NEXT: DW_AT_abstract_origin {{.*}} "f"
1915
2016
2117 ; Make sure the condition test is attributed to the inline function, not the
55 ; Skip the definition of zed(foo*)
66 ; CHECK: DW_TAG_subprogram
77 ; CHECK: DW_TAG_class_type
8 ; CHECK: [[BAR_DECL:0x[0-9a-f]*]]: DW_TAG_subprogram
8 ; CHECK: DW_TAG_subprogram
99 ; CHECK: DW_AT_MIPS_linkage_name {{.*}} "_ZN3foo3barEv"
1010 ; CHECK: DW_TAG_subprogram
1111 ; CHECK-NOT: DW_TAG
12 ; CHECK: DW_AT_specification {{.*}} {[[BAR_DECL]]}
12 ; CHECK: DW_AT_specification {{.*}} "_ZN3foo3barEv"
1313
1414 %struct.foo = type { i8 }
1515
3737 ; CHECK-NOT: {{DW_TAG|NULL}}
3838 ; CHECK: DW_TAG_member
3939 ; CHECK-NOT: {{DW_TAG|NULL}}
40 ; CHECK: [[M_FN2_DECL:.*]]: DW_TAG_subprogram
40 ; CHECK: DW_TAG_subprogram
4141 ; CHECK-NOT: DW_TAG
4242 ; CHECK: DW_AT_name {{.*}} "m_fn2"
4343 ; CHECK-NOT: {{DW_TAG|NULL}}
4646 ; The abstract definition of C::m_fn2
4747 ; CHECK: [[M_FN2_ABS_DEF:.*]]: DW_TAG_subprogram
4848 ; CHECK-NOT: DW_TAG
49 ; CHECK: DW_AT_specification {{.*}} {[[M_FN2_DECL]]}
49 ; CHECK: DW_AT_specification {{.*}} "_ZN1C5m_fn2Ev"
5050 ; CHECK-NOT: DW_TAG
5151 ; CHECK: DW_AT_inline
5252 ; CHECK-NOT: {{DW_TAG|NULL}}
6262 ; The concrete definition of C::m_fn2
6363 ; CHECK: DW_TAG_subprogram
6464 ; CHECK-NOT: DW_TAG
65 ; CHECK: DW_AT_abstract_origin {{.*}} {[[M_FN2_ABS_DEF]]}
65 ; CHECK: DW_AT_abstract_origin {{.*}} {[[M_FN2_ABS_DEF]]} "_ZN1C5m_fn2Ev"
6666 ; CHECK-NOT: {{DW_TAG|NULL}}
6767 ; CHECK: DW_TAG_formal_parameter
6868 ; CHECK-NOT: DW_TAG
7777 ; Inlined C::m_fn2:
7878 ; CHECK: DW_TAG_inlined_subroutine
7979 ; CHECK-NOT: DW_TAG
80 ; CHECK: DW_AT_abstract_origin {{.*}} {[[M_FN2_ABS_DEF]]}
80 ; CHECK: DW_AT_abstract_origin {{.*}} {[[M_FN2_ABS_DEF]]} "_ZN1C5m_fn2Ev"
8181 ; CHECK-NOT: {{DW_TAG|NULL}}
8282 ; CHECK: DW_TAG_formal_parameter
8383 ; CHECK-NOT: DW_TAG
2424 ; CHECK: DW_TAG_subprogram
2525 ; CHECK: DW_AT_type [DW_FORM_ref_addr] (0x00000000[[INT:.*]])
2626 ; CHECK: DW_TAG_inlined_subroutine
27 ; CHECK: DW_AT_abstract_origin {{.*}}[[ABS_FUNC:........]])
27 ; CHECK: DW_AT_abstract_origin {{.*}}[[ABS_FUNC:........]] "_Z4funci"
2828 ; CHECK: DW_TAG_formal_parameter
2929 ; CHECK: DW_AT_abstract_origin {{.*}}[[ABS_VAR:........]])
3030
4646 ; provides the address range and variable location
4747 ; CHECK: DW_TAG_subprogram
4848 ; CHECK: DW_AT_low_pc
49 ; CHECK: DW_AT_abstract_origin {{.*}} {0x[[ABS_FUNC]]}
49 ; CHECK: DW_AT_abstract_origin {{.*}} {0x[[ABS_FUNC]]} "_Z4funci"
5050 ; CHECK: DW_TAG_formal_parameter
5151 ; CHECK: DW_AT_location
5252 ; CHECK: DW_AT_abstract_origin {{.*}} {0x[[ABS_VAR]]}
3737
3838 ; CHECK: DW_TAG_structure_type
3939 ; CHECK-NEXT: DW_AT_name {{.*}} "C"
40 ; CHECK: [[FN3_DECL:.*]]: DW_TAG_subprogram
40 ; CHECK: DW_TAG_subprogram
4141 ; CHECK-NOT: DW_TAG
4242 ; CHECK: DW_AT_name {{.*}} "m_fn3"
4343
44 ; CHECK: DW_AT_specification {{.*}} {[[FN3_DECL]]}
44 ; CHECK: DW_AT_specification {{.*}} "_ZN1C5m_fn3Ev"
4545 ; CHECK-NOT: DW_TAG
4646 ; CHECK: DW_TAG_formal_parameter
4747 ; CHECK-NOT: DW_TAG
3636 ; x(u);
3737 ; }
3838
39 ; CHECK: [[ABS_X:.*]]: DW_TAG_subprogram
39 ; CHECK: DW_TAG_subprogram
4040 ; CHECK-NOT: DW_TAG
4141 ; CHECK: DW_AT_name {{.*}} "x"
4242 ; CHECK-NOT: {{DW_TAG|NULL}}
5656 ; CHECK-NOT: {{DW_TAG|NULL}}
5757 ; CHECK: DW_TAG_inlined_subroutine
5858 ; CHECK-NOT: DW_TAG
59 ; CHECK: DW_AT_abstract_origin {{.*}} {[[ABS_X]]}
59 ; CHECK: DW_AT_abstract_origin {{.*}} "_Z1xb"
6060 ; CHECK-NOT: {{DW_TAG|NULL}}
6161 ; CHECK: DW_TAG_formal_parameter
6262 ; CHECK-NOT: DW_TAG
7777 ; CHECK-NOT: {{DW_TAG|NULL}}
7878 ; CHECK: DW_TAG_inlined_subroutine
7979 ; CHECK-NOT: DW_TAG
80 ; CHECK: DW_AT_abstract_origin {{.*}} {[[ABS_X]]}
80 ; CHECK: DW_AT_abstract_origin {{.*}} "_Z1xb"
8181 ; CHECK-NOT: {{DW_TAG|NULL}}
8282 ; FIXME: This formal parameter goes missing at least at -O2 (& on
8383 ; mips/powerpc), maybe before that. Perhaps SelectionDAG is to blame (and
1414 ; CHECK: DW_TAG_namespace
1515 ; CHECK-NEXT: DW_AT_name {{.*}} "ns"
1616 ; CHECK-NOT: DW_TAG
17 ; CHECK: [[ABS_DEF:0x.*]]: DW_TAG_subprogram
17 ; CHECK: DW_TAG_subprogram
1818 ; CHECK-NOT: DW_TAG
1919 ; CHECK: DW_AT_MIPS_linkage_name {{.*}} "_ZN2ns4funcEi"
2020 ; CHECK-NOT: DW_TAG
2323 ; CHECK-NOT: NULL
2424 ; CHECK: DW_TAG_subprogram
2525 ; CHECK-NOT: DW_TAG
26 ; CHECK: DW_AT_abstract_origin {{.*}} {[[ABS_DEF]]}
26 ; CHECK: DW_AT_abstract_origin {{.*}} "_ZN2ns4funcEi"
2727 ; CHECK-NOT: DW_TAG
2828 ; CHECK: DW_TAG_formal_parameter
2929 ; CHECK: DW_AT_abstract_origin {{.*}} {[[ABS_PRM]]}
4040 ; CHECK: DW_AT_MIPS_linkage_name {{.*}} "_ZL3barv"
4141
4242 ; getFoo and A may only appear once.
43 ; CHECK-NOT: {{(getFoo)|("A")}}
43 ; CHECK-NOT: AT_name{{.*(getFoo)|("A")}}
4444
4545
4646 ; ModuleID = 'type-unique-odr-a.cpp'