llvm.org GIT mirror llvm / cbbd5b1
Remove the DW_AT_MIPS_linkage name attribute when we don't need it output (we're emitting a specification already and the information isn't changing) and we're not in old gdb compat mode. Saves 1% on the debug information for a build of llvm. Fixes rdar://11043421 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162493 91177308-0d34-0410-b5e6-96231b3b80d8 Eric Christopher 7 years ago
3 changed file(s) with 67 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
10271027 // AT_specification code in order to work around a bug in older
10281028 // gdbs that requires the linkage name to resolve multiple template
10291029 // functions.
1030 // TODO: Remove this set of code when we get rid of the old gdb
1031 // compatibility.
10301032 StringRef LinkageName = SP.getLinkageName();
1031 if (!LinkageName.empty())
1033 if (!LinkageName.empty() && DD->useDarwinGDBCompat())
10321034 addString(SPDie, dwarf::DW_AT_MIPS_linkage_name,
10331035 getRealLinkageName(LinkageName));
10341036
10411043
10421044 return SPDie;
10431045 }
1046
1047 // Add the linkage name if we have one.
1048 if (!LinkageName.empty() && !DD->useDarwinGDBCompat())
1049 addString(SPDie, dwarf::DW_AT_MIPS_linkage_name,
1050 getRealLinkageName(LinkageName));
10441051
10451052 // Constructors and operators for anonymous aggregates do not have names.
10461053 if (!SP.getName().empty())
66 ; first check that we have a TAG_subprogram at a given offset and it has
77 ; AT_inline.
88
9 ; CHECK: 0x00000134: DW_TAG_subprogram [18]
10 ; CHECK-NEXT: DW_AT_MIPS_linkage_name
9 ; CHECK: 0x00000130: DW_TAG_subprogram [18]
1110 ; CHECK-NEXT: DW_AT_specification
1211 ; CHECK-NEXT: DW_AT_inline
1312
1413
1514 ; and then that a TAG_subprogram refers to it with AT_abstract_origin.
1615
17 ; CHECK: 0x00000184: DW_TAG_subprogram [20]
18 ; CHECK-NEXT: DW_AT_abstract_origin [DW_FORM_ref4] (cu + 0x0134 => {0x00000134})
16 ; CHECK: 0x00000174: DW_TAG_subprogram [20]
17 ; CHECK-NEXT: DW_AT_abstract_origin [DW_FORM_ref4] (cu + 0x0130 => {0x00000130})
1918
2019 define i32 @_ZN17nsAutoRefCnt7ReleaseEv() {
2120 entry:
0 ; RUN: llc -mtriple=x86_64-macosx -darwin-gdb-compat=Disable %s -o %t -filetype=obj
1 ; RUN: llvm-dwarfdump %t | FileCheck %s
2
3 ; CHECK: DW_TAG_subprogram [9] *
4 ; CHECK-NOT: DW_AT_MIPS_linkage_name
5 ; CHECK: DW_AT_specification
6
7 %class.A = type { i8 }
8
9 @a = global %class.A zeroinitializer, align 1
10
11 define i32 @_ZN1A1aEi(%class.A* %this, i32 %b) nounwind uwtable ssp align 2 {
12 entry:
13 %this.addr = alloca %class.A*, align 8
14 %b.addr = alloca i32, align 4
15 store %class.A* %this, %class.A** %this.addr, align 8
16 call void @llvm.dbg.declare(metadata !{%class.A** %this.addr}, metadata !21), !dbg !23
17 store i32 %b, i32* %b.addr, align 4
18 call void @llvm.dbg.declare(metadata !{i32* %b.addr}, metadata !24), !dbg !25
19 %this1 = load %class.A** %this.addr
20 %0 = load i32* %b.addr, align 4, !dbg !26
21 ret i32 %0, !dbg !26
22 }
23
24 declare void @llvm.dbg.declare(metadata, metadata) nounwind readnone
25
26 !llvm.dbg.cu = !{!0}
27
28 !0 = metadata !{i32 786449, i32 0, i32 4, metadata !"foo.cpp", metadata !"/Users/echristo", metadata !"clang version 3.1 (trunk 152691) (llvm/trunk 152692)", i1 true, i1 false, metadata !"", i32 0, metadata !1, metadata !1, metadata !3, metadata !18} ; [ DW_TAG_compile_unit ]
29 !1 = metadata !{metadata !2}
30 !2 = metadata !{i32 0}
31 !3 = metadata !{metadata !4}
32 !4 = metadata !{metadata !5}
33 !5 = metadata !{i32 786478, i32 0, null, metadata !"a", metadata !"a", metadata !"_ZN1A1aEi", metadata !6, i32 5, metadata !7, i1 false, i1 true, i32 0, i32 0, null, i32 256, i1 false, i32 (%class.A*, i32)* @_ZN1A1aEi, null, metadata !13, metadata !16} ; [ DW_TAG_subprogram ]
34 !6 = metadata !{i32 786473, metadata !"foo.cpp", metadata !"/Users/echristo", null} ; [ DW_TAG_file_type ]
35 !7 = metadata !{i32 786453, i32 0, metadata !"", i32 0, i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !8, i32 0, i32 0} ; [ DW_TAG_subroutine_type ]
36 !8 = metadata !{metadata !9, metadata !10, metadata !9}
37 !9 = metadata !{i32 786468, null, metadata !"int", null, i32 0, i64 32, i64 32, i64 0, i32 0, i32 5} ; [ DW_TAG_base_type ]
38 !10 = metadata !{i32 786447, i32 0, metadata !"", i32 0, i32 0, i64 64, i64 64, i64 0, i32 64, metadata !11} ; [ DW_TAG_pointer_type ]
39 !11 = metadata !{i32 786434, null, metadata !"A", metadata !6, i32 1, i64 8, i64 8, i32 0, i32 0, null, metadata !12, i32 0, null, null} ; [ DW_TAG_class_type ]
40 !12 = metadata !{metadata !13}
41 !13 = metadata !{i32 786478, i32 0, metadata !11, metadata !"a", metadata !"a", metadata !"_ZN1A1aEi", metadata !6, i32 2, metadata !7, i1 false, i1 false, i32 0, i32 0, null, i32 257, i1 false, null, null, i32 0, metadata !14} ; [ DW_TAG_subprogram ]
42 !14 = metadata !{metadata !15}
43 !15 = metadata !{i32 786468} ; [ DW_TAG_base_type ]
44 !16 = metadata !{metadata !17}
45 !17 = metadata !{i32 786468} ; [ DW_TAG_base_type ]
46 !18 = metadata !{metadata !19}
47 !19 = metadata !{metadata !20}
48 !20 = metadata !{i32 786484, i32 0, null, metadata !"a", metadata !"a", metadata !"", metadata !6, i32 9, metadata !11, i32 0, i32 1, %class.A* @a} ; [ DW_TAG_variable ]
49 !21 = metadata !{i32 786689, metadata !5, metadata !"this", metadata !6, i32 16777221, metadata !22, i32 64, i32 0} ; [ DW_TAG_arg_variable ]
50 !22 = metadata !{i32 786447, null, metadata !"", null, i32 0, i64 64, i64 64, i64 0, i32 0, metadata !11} ; [ DW_TAG_pointer_type ]
51 !23 = metadata !{i32 5, i32 8, metadata !5, null}
52 !24 = metadata !{i32 786689, metadata !5, metadata !"b", metadata !6, i32 33554437, metadata !9, i32 0, i32 0} ; [ DW_TAG_arg_variable ]
53 !25 = metadata !{i32 5, i32 14, metadata !5, null}
54 !26 = metadata !{i32 6, i32 4, metadata !27, null}
55 !27 = metadata !{i32 786443, metadata !5, i32 5, i32 17, metadata !6, i32 0} ; [ DW_TAG_lexical_block ]