llvm.org GIT mirror llvm / ecc582a
DebugInfo: Add a CU metadata attribute for use of DWARF ranges base address specifiers Summary: Ranges base address specifiers can save a lot of object size in relocation records especially in optimized builds. For an optimized self-host build of Clang with split DWARF and debug info compression in object files, but uncompressed debug info in the executable, this change produces about 18% smaller object files and 6% larger executable. While it would've been nice to turn this on by default, gold's 32 bit gdb-index support crashes on this input & I don't think there's any perfect heuristic to implement solely in LLVM that would suffice - so we'll need a flag one way or another (also possible people might want to aggressively optimized for executable size that contains debug info (even with compression this would still come at some cost to executable size)) - so let's plumb it through. Differential Revision: https://reviews.llvm.org/D54242 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346788 91177308-0d34-0410-b5e6-96231b3b80d8 David Blaikie 2 years ago
11 changed file(s) with 161 addition(s) and 109 deletion(s). Raw diff Collapse all Expand all
144144 uint64_t DWOId = 0, bool SplitDebugInlining = true,
145145 bool DebugInfoForProfiling = false,
146146 DICompileUnit::DebugNameTableKind NameTableKind =
147 DICompileUnit::DebugNameTableKind::Default);
147 DICompileUnit::DebugNameTableKind::Default,
148 bool RangesBaseAddress = false);
148149
149150 /// Create a file descriptor to hold debugging information for a file.
150151 /// \param Filename File name.
11911191 bool SplitDebugInlining;
11921192 bool DebugInfoForProfiling;
11931193 unsigned NameTableKind;
1194 bool RangesBaseAddress;
11941195
11951196 DICompileUnit(LLVMContext &C, StorageType Storage, unsigned SourceLanguage,
11961197 bool IsOptimized, unsigned RuntimeVersion,
11971198 unsigned EmissionKind, uint64_t DWOId, bool SplitDebugInlining,
11981199 bool DebugInfoForProfiling, unsigned NameTableKind,
1199 ArrayRef Ops)
1200 bool RangesBaseAddress, ArrayRef Ops)
12001201 : DIScope(C, DICompileUnitKind, Storage, dwarf::DW_TAG_compile_unit, Ops),
12011202 SourceLanguage(SourceLanguage), IsOptimized(IsOptimized),
12021203 RuntimeVersion(RuntimeVersion), EmissionKind(EmissionKind),
12031204 DWOId(DWOId), SplitDebugInlining(SplitDebugInlining),
12041205 DebugInfoForProfiling(DebugInfoForProfiling),
1205 NameTableKind(NameTableKind) {
1206 NameTableKind(NameTableKind), RangesBaseAddress(RangesBaseAddress) {
12061207 assert(Storage != Uniqued);
12071208 }
12081209 ~DICompileUnit() = default;
12161217 DIGlobalVariableExpressionArray GlobalVariables,
12171218 DIImportedEntityArray ImportedEntities, DIMacroNodeArray Macros,
12181219 uint64_t DWOId, bool SplitDebugInlining, bool DebugInfoForProfiling,
1219 unsigned NameTableKind, StorageType Storage,
1220 unsigned NameTableKind, bool RangesBaseAddress, StorageType Storage,
12201221 bool ShouldCreate = true) {
1221 return getImpl(
1222 Context, SourceLanguage, File, getCanonicalMDString(Context, Producer),
1223 IsOptimized, getCanonicalMDString(Context, Flags), RuntimeVersion,
1224 getCanonicalMDString(Context, SplitDebugFilename), EmissionKind,
1225 EnumTypes.get(), RetainedTypes.get(), GlobalVariables.get(),
1226 ImportedEntities.get(), Macros.get(), DWOId, SplitDebugInlining,
1227 DebugInfoForProfiling, NameTableKind, Storage, ShouldCreate);
1222 return getImpl(Context, SourceLanguage, File,
1223 getCanonicalMDString(Context, Producer), IsOptimized,
1224 getCanonicalMDString(Context, Flags), RuntimeVersion,
1225 getCanonicalMDString(Context, SplitDebugFilename),
1226 EmissionKind, EnumTypes.get(), RetainedTypes.get(),
1227 GlobalVariables.get(), ImportedEntities.get(), Macros.get(),
1228 DWOId, SplitDebugInlining, DebugInfoForProfiling,
1229 NameTableKind, RangesBaseAddress, Storage, ShouldCreate);
12281230 }
12291231 static DICompileUnit *
12301232 getImpl(LLVMContext &Context, unsigned SourceLanguage, Metadata *File,
12341236 Metadata *GlobalVariables, Metadata *ImportedEntities,
12351237 Metadata *Macros, uint64_t DWOId, bool SplitDebugInlining,
12361238 bool DebugInfoForProfiling, unsigned NameTableKind,
1237 StorageType Storage, bool ShouldCreate = true);
1239 bool RangesBaseAddress, StorageType Storage, bool ShouldCreate = true);
12381240
12391241 TempDICompileUnit cloneImpl() const {
1240 return getTemporary(getContext(), getSourceLanguage(), getFile(),
1241 getProducer(), isOptimized(), getFlags(),
1242 getRuntimeVersion(), getSplitDebugFilename(),
1243 getEmissionKind(), getEnumTypes(), getRetainedTypes(),
1244 getGlobalVariables(), getImportedEntities(),
1245 getMacros(), DWOId, getSplitDebugInlining(),
1246 getDebugInfoForProfiling(), getNameTableKind());
1242 return getTemporary(
1243 getContext(), getSourceLanguage(), getFile(), getProducer(),
1244 isOptimized(), getFlags(), getRuntimeVersion(), getSplitDebugFilename(),
1245 getEmissionKind(), getEnumTypes(), getRetainedTypes(),
1246 getGlobalVariables(), getImportedEntities(), getMacros(), DWOId,
1247 getSplitDebugInlining(), getDebugInfoForProfiling(), getNameTableKind(),
1248 getRangesBaseAddress());
12471249 }
12481250
12491251 public:
12591261 DIGlobalVariableExpressionArray GlobalVariables,
12601262 DIImportedEntityArray ImportedEntities, DIMacroNodeArray Macros,
12611263 uint64_t DWOId, bool SplitDebugInlining, bool DebugInfoForProfiling,
1262 DebugNameTableKind NameTableKind),
1264 DebugNameTableKind NameTableKind, bool RangesBaseAddress),
12631265 (SourceLanguage, File, Producer, IsOptimized, Flags, RuntimeVersion,
12641266 SplitDebugFilename, EmissionKind, EnumTypes, RetainedTypes,
12651267 GlobalVariables, ImportedEntities, Macros, DWOId, SplitDebugInlining,
1266 DebugInfoForProfiling, (unsigned)NameTableKind))
1268 DebugInfoForProfiling, (unsigned)NameTableKind, RangesBaseAddress))
12671269 DEFINE_MDNODE_GET_DISTINCT_TEMPORARY(
12681270 DICompileUnit,
12691271 (unsigned SourceLanguage, Metadata *File, MDString *Producer,
12721274 Metadata *RetainedTypes, Metadata *GlobalVariables,
12731275 Metadata *ImportedEntities, Metadata *Macros, uint64_t DWOId,
12741276 bool SplitDebugInlining, bool DebugInfoForProfiling,
1275 unsigned NameTableKind),
1277 unsigned NameTableKind, bool RangesBaseAddress),
12761278 (SourceLanguage, File, Producer, IsOptimized, Flags, RuntimeVersion,
12771279 SplitDebugFilename, EmissionKind, EnumTypes, RetainedTypes,
12781280 GlobalVariables, ImportedEntities, Macros, DWOId, SplitDebugInlining,
1279 DebugInfoForProfiling, NameTableKind))
1281 DebugInfoForProfiling, NameTableKind, RangesBaseAddress))
12801282
12811283 TempDICompileUnit clone() const { return cloneImpl(); }
12821284
12931295 DebugNameTableKind getNameTableKind() const {
12941296 return (DebugNameTableKind)NameTableKind;
12951297 }
1296 StringRef getProducer() const { return getStringOperand(1); }
1297 StringRef getFlags() const { return getStringOperand(2); }
1298 StringRef getSplitDebugFilename() const { return getStringOperand(3); }
1298 bool getRangesBaseAddress() const {
1299 return RangesBaseAddress; }
1300 StringRef getProducer() const {
1301 return getStringOperand(1); }
1302 StringRef getFlags() const {
1303 return getStringOperand(2); }
1304 StringRef getSplitDebugFilename() const {
1305 return getStringOperand(3); }
12991306 DICompositeTypeArray getEnumTypes() const {
13001307 return cast_or_null(getRawEnumTypes());
13011308 }
44964496 OPTIONAL(dwoId, MDUnsignedField, ); \
44974497 OPTIONAL(splitDebugInlining, MDBoolField, = true); \
44984498 OPTIONAL(debugInfoForProfiling, MDBoolField, = false); \
4499 OPTIONAL(nameTableKind, NameTableKindField, );
4499 OPTIONAL(nameTableKind, NameTableKindField, ); \
4500 OPTIONAL(debugBaseAddress, MDBoolField, = false);
45004501 PARSE_MD_FIELDS();
45014502 #undef VISIT_MD_FIELDS
45024503
45044505 Context, language.Val, file.Val, producer.Val, isOptimized.Val, flags.Val,
45054506 runtimeVersion.Val, splitDebugFilename.Val, emissionKind.Val, enums.Val,
45064507 retainedTypes.Val, globals.Val, imports.Val, macros.Val, dwoId.Val,
4507 splitDebugInlining.Val, debugInfoForProfiling.Val, nameTableKind.Val);
4508 splitDebugInlining.Val, debugInfoForProfiling.Val, nameTableKind.Val,
4509 debugBaseAddress.Val);
45084510 return false;
45094511 }
45104512
13941394 Record.size() <= 14 ? 0 : Record[14],
13951395 Record.size() <= 16 ? true : Record[16],
13961396 Record.size() <= 17 ? false : Record[17],
1397 Record.size() <= 18 ? 0 : Record[18]);
1397 Record.size() <= 18 ? 0 : Record[18],
1398 Record.size() <= 19 ? 0 : Record[19]);
13981399
13991400 MetadataList.assignValue(CU, NextMetadataNo);
14001401 NextMetadataNo++;
22862286 // contributions.
22872287 auto *Base = CUBase;
22882288 if (!Base && (P.second.size() > 1 || DwarfVersion < 5) &&
2289 (UseDwarfRangesBaseAddressSpecifier || DwarfVersion >= 5)) {
2289 (CU.getCUNode()->getRangesBaseAddress() || DwarfVersion >= 5)) {
22902290 BaseIsSet = true;
22912291 // FIXME/use care: This may not be a useful base address if it's not
22922292 // the lowest address/range in this object.
19091909 Printer.printBool("debugInfoForProfiling", N->getDebugInfoForProfiling(),
19101910 false);
19111911 Printer.printNameTableKind("nameTableKind", N->getNameTableKind());
1912 Printer.printBool("rangesBaseAddress", N->getRangesBaseAddress(), false);
19121913 Out << ")";
19131914 }
19141915
139139 StringRef Flags, unsigned RunTimeVer, StringRef SplitName,
140140 DICompileUnit::DebugEmissionKind Kind, uint64_t DWOId,
141141 bool SplitDebugInlining, bool DebugInfoForProfiling,
142 DICompileUnit::DebugNameTableKind NameTableKind) {
142 DICompileUnit::DebugNameTableKind NameTableKind, bool RangesBaseAddress) {
143143
144144 assert(((Lang <= dwarf::DW_LANG_Fortran08 && Lang >= dwarf::DW_LANG_C89) ||
145145 (Lang <= dwarf::DW_LANG_hi_user && Lang >= dwarf::DW_LANG_lo_user)) &&
149149 CUNode = DICompileUnit::getDistinct(
150150 VMContext, Lang, File, Producer, isOptimized, Flags, RunTimeVer,
151151 SplitName, Kind, nullptr, nullptr, nullptr, nullptr, nullptr, DWOId,
152 SplitDebugInlining, DebugInfoForProfiling, NameTableKind);
152 SplitDebugInlining, DebugInfoForProfiling, NameTableKind,
153 RangesBaseAddress);
153154
154155 // Create a named metadata so that it is easier to find cu in a module.
155156 NamedMDNode *NMD = M.getOrInsertNamedMetadata("llvm.dbg.cu");
490490 CU->getSplitDebugFilename(), DICompileUnit::LineTablesOnly, EnumTypes,
491491 RetainedTypes, GlobalVariables, ImportedEntities, CU->getMacros(),
492492 CU->getDWOId(), CU->getSplitDebugInlining(),
493 CU->getDebugInfoForProfiling(), CU->getNameTableKind());
493 CU->getDebugInfoForProfiling(), CU->getNameTableKind(),
494 CU->getRangesBaseAddress());
494495 }
495496
496497 DILocation *getReplacementMDLocation(DILocation *MLD) {
469469 unsigned EmissionKind, Metadata *EnumTypes, Metadata *RetainedTypes,
470470 Metadata *GlobalVariables, Metadata *ImportedEntities, Metadata *Macros,
471471 uint64_t DWOId, bool SplitDebugInlining, bool DebugInfoForProfiling,
472 unsigned NameTableKind, StorageType Storage, bool ShouldCreate) {
472 unsigned NameTableKind, bool RangesBaseAddress, StorageType Storage,
473 bool ShouldCreate) {
473474 assert(Storage != Uniqued && "Cannot unique DICompileUnit");
474475 assert(isCanonical(Producer) && "Expected canonical MDString");
475476 assert(isCanonical(Flags) && "Expected canonical MDString");
482483 return storeImpl(new (array_lengthof(Ops)) DICompileUnit(
483484 Context, Storage, SourceLanguage, IsOptimized,
484485 RuntimeVersion, EmissionKind, DWOId, SplitDebugInlining,
485 DebugInfoForProfiling, NameTableKind, Ops),
486 DebugInfoForProfiling, NameTableKind, RangesBaseAddress,
487 Ops),
486488 Storage);
487489 }
488490
None ; RUN: llc -filetype=asm -mtriple=x86_64-pc-linux-gnu %s -o - -use-dwarf-ranges-base-address-specifier | FileCheck --check-prefix=COMMON --check-prefix=BASE %s
1 ; RUN: llc -filetype=asm -mtriple=x86_64-pc-linux-gnu %s -o - | FileCheck --check-prefix=COMMON --check-prefix=NOBASE %s
0 ; RUN: llc -filetype=asm -mtriple=x86_64-pc-linux-gnu %s -o - | FileCheck %s
21 ; RUN: llc -filetype=asm -mtriple=x86_64-pc-linux-gnu %s -o - -dwarf-version 5 | FileCheck --check-prefix=DWARF5 %s
32
43 ; Group ranges in a range list that apply to the same section and use a base
1413 ; in the linked executable. Without compression in the objects, the win would be
1514 ; smaller (the growth of debug_ranges itself would be more significant).
1615
17 ; COMMON: {{^.Ldebug_ranges0}}
18 ; NOBASE-NEXT: .quad .Lfunc_begin0
19 ; NOBASE-NEXT: .quad .Lfunc_end0
20 ; NOBASE-NEXT: .quad .Lfunc_begin1
21 ; NOBASE-NEXT: .quad .Lfunc_end1
22 ; NOBASE-NEXT: .quad .Lfunc_begin3
23 ; NOBASE-NEXT: .quad .Lfunc_end3
24 ; NOBASE-NEXT: .quad .Lfunc_begin4
25 ; NOBASE-NEXT: .quad .Lfunc_end4
26 ; NOBASE-NEXT: .quad .Lfunc_begin5
27 ; NOBASE-NEXT: .quad .Lfunc_end5
16 ; This is a merged module containing two CUs, one that uses range base address
17 ; specifiers and exercises different cases there, and another that does not
2818
29 ; BASE-NEXT: .quad -1
30 ; BASE-NEXT: .quad .Lfunc_begin0
31 ; BASE-NEXT: .quad .Lfunc_begin0-.Lfunc_begin0
32 ; BASE-NEXT: .quad .Lfunc_end0-.Lfunc_begin0
33 ; BASE-NEXT: .quad -1
34 ; BASE-NEXT: .quad .Lfunc_begin1
35 ; BASE-NEXT: .quad .Lfunc_begin1-.Lfunc_begin1
36 ; BASE-NEXT: .quad .Lfunc_end1-.Lfunc_begin1
37 ; BASE-NEXT: .quad .Lfunc_begin3-.Lfunc_begin1
38 ; BASE-NEXT: .quad .Lfunc_end3-.Lfunc_begin1
39 ; BASE-NEXT: .quad -1
40 ; BASE-NEXT: .quad .Lfunc_begin4
41 ; BASE-NEXT: .quad .Lfunc_begin4-.Lfunc_begin4
42 ; BASE-NEXT: .quad .Lfunc_end4-.Lfunc_begin4
43 ; BASE-NEXT: .quad -1
44 ; BASE-NEXT: .quad .Lfunc_begin5
45 ; BASE-NEXT: .quad .Lfunc_begin5-.Lfunc_begin5
46 ; BASE-NEXT: .quad .Lfunc_end5-.Lfunc_begin5
47 ; COMMON-NEXT: .quad 0
48 ; COMMON-NEXT: .quad 0
19 ; ranges.cpp
20 ; Single range entry
21 ; __attribute__((section("a"))) void f1() {}
22 ; Single address with two ranges due to the whole caused by f3
23 ; __attribute__((section("b"))) void f2() {}
24 ; __attribute__((section("b"))) __attribute__((nodebug)) void f3() {}
25 ; __attribute__((section("b"))) void f4() {}
26 ; Reset the base address & emit a couple more single range entries
27 ; __attribute__((section("c"))) void f5() {}
28 ; __attribute__((section("d"))) void f6() {}
29 ; ranges_no_base.cpp:
30 ; Include enough complexity to cause ranges to be emitted, so it can be checked
31 ; that those ranges don't use base address specifiers
32 ; __attribute__((section("e"))) void f7() {}
33 ; __attribute__((section("f"))) void f8() {}
34
35 ; CHECK: {{^.Ldebug_ranges0}}
36 ; CHECK-NEXT: .quad -1
37 ; CHECK-NEXT: .quad .Lfunc_begin0
38 ; CHECK-NEXT: .quad .Lfunc_begin0-.Lfunc_begin0
39 ; CHECK-NEXT: .quad .Lfunc_end0-.Lfunc_begin0
40 ; CHECK-NEXT: .quad -1
41 ; CHECK-NEXT: .quad .Lfunc_begin1
42 ; CHECK-NEXT: .quad .Lfunc_begin1-.Lfunc_begin1
43 ; CHECK-NEXT: .quad .Lfunc_end1-.Lfunc_begin1
44 ; CHECK-NEXT: .quad .Lfunc_begin3-.Lfunc_begin1
45 ; CHECK-NEXT: .quad .Lfunc_end3-.Lfunc_begin1
46 ; CHECK-NEXT: .quad -1
47 ; CHECK-NEXT: .quad .Lfunc_begin4
48 ; CHECK-NEXT: .quad .Lfunc_begin4-.Lfunc_begin4
49 ; CHECK-NEXT: .quad .Lfunc_end4-.Lfunc_begin4
50 ; CHECK-NEXT: .quad -1
51 ; CHECK-NEXT: .quad .Lfunc_begin5
52 ; CHECK-NEXT: .quad .Lfunc_begin5-.Lfunc_begin5
53 ; CHECK-NEXT: .quad .Lfunc_end5-.Lfunc_begin5
54 ; CHECK-NEXT: .quad 0
55 ; CHECK-NEXT: .quad 0
56 ; CHECK-NEXT: {{^.Ldebug_ranges1}}
57 ; CHECK-NEXT: .quad .Lfunc_begin6
58 ; CHECK-NEXT: .quad .Lfunc_end6
59 ; CHECK-NEXT: .quad .Lfunc_begin7
60 ; CHECK-NEXT: .quad .Lfunc_end7
4961
5062 ; DWARF5: {{^.Ldebug_ranges0}}
5163 ; DWARF5-NEXT: # DW_RLE_startx_length
6678 ; DWARF5-NEXT: .byte 4 # start index
6779 ; DWARF5-NEXT: .uleb128 .Lfunc_end5-.Lfunc_begin5 # length
6880 ; DWARF5-NEXT: # DW_RLE_end_of_list
81 ; DWARF5-NEXT: {{^.Ldebug_ranges1}}
82 ; DWARF5-NEXT: # DW_RLE_startx_length
83 ; DWARF5-NEXT: .byte 5 # start index
84 ; DWARF5-NEXT: .uleb128 .Lfunc_end6-.Lfunc_begin6 # length
85 ; DWARF5-NEXT: # DW_RLE_startx_length
86 ; DWARF5-NEXT: .byte 6 # start index
87 ; DWARF5-NEXT: .uleb128 .Lfunc_end7-.Lfunc_begin7 # length
88 ; DWARF5-NEXT: # DW_RLE_end_of_list
6989
7090 ; Function Attrs: noinline nounwind optnone uwtable
71 define void @_Z2f1v() #0 section "a" !dbg !7 {
72 entry:
73 ret void, !dbg !10
74 }
75
76 ; Function Attrs: noinline nounwind optnone uwtable
77 define void @_Z2f2v() #0 section "b" !dbg !11 {
91 define dso_local void @_Z2f1v() section "a" !dbg !9 {
7892 entry:
7993 ret void, !dbg !12
8094 }
8195
8296 ; Function Attrs: noinline nounwind optnone uwtable
83 define void @_Z2f3v() #0 section "b" {
97 define dso_local void @_Z2f2v() section "b" !dbg !13 {
98 entry:
99 ret void, !dbg !14
100 }
101
102 ; Function Attrs: noinline nounwind optnone uwtable
103 define dso_local void @_Z2f3v() section "b" {
84104 entry:
85105 ret void
86106 }
87107
88108 ; Function Attrs: noinline nounwind optnone uwtable
89 define void @_Z2f4v() #0 section "b" !dbg !13 {
90 entry:
91 ret void, !dbg !14
92 }
93
94 ; Function Attrs: noinline nounwind optnone uwtable
95 define void @_Z2f5v() #0 section "e" !dbg !15 {
109 define dso_local void @_Z2f4v() section "b" !dbg !15 {
96110 entry:
97111 ret void, !dbg !16
98112 }
99113
100114 ; Function Attrs: noinline nounwind optnone uwtable
101 define void @_Z2f6v() #0 section "f" !dbg !17 {
115 define dso_local void @_Z2f5v() section "c" !dbg !17 {
102116 entry:
103117 ret void, !dbg !18
104118 }
105119
106 attributes #0 = { noinline nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
120 ; Function Attrs: noinline nounwind optnone uwtable
121 define dso_local void @_Z2f6v() section "d" !dbg !19 {
122 entry:
123 ret void, !dbg !20
124 }
107125
108 !llvm.dbg.cu = !{!0}
109 !llvm.module.flags = !{!3, !4, !5}
110 !llvm.ident = !{!6}
126 ; Function Attrs: noinline nounwind optnone uwtable
127 define dso_local void @_Z2f7v() section "e" !dbg !21 {
128 entry:
129 ret void, !dbg !22
130 }
111131
112 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 6.0.0 (trunk 309523) (llvm/trunk 309526)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
113 !1 = !DIFile(filename: "funcs.cpp", directory: "/usr/local/google/home/blaikie/dev/scratch")
132 ; Function Attrs: noinline nounwind optnone uwtable
133 define dso_local void @_Z2f8v() section "f" !dbg !23 {
134 entry:
135 ret void, !dbg !24
136 }
137
138 !llvm.dbg.cu = !{!0, !3}
139 !llvm.ident = !{!5, !5}
140 !llvm.module.flags = !{!6, !7, !8}
141
142 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 8.0.0 (trunk 346343) (llvm/trunk 346350)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None, debugBaseAddress: true)
143 !1 = !DIFile(filename: "ranges.cpp", directory: "/usr/local/google/home/blaikie/dev/scratch")
114144 !2 = !{}
115 !3 = !{i32 2, !"Dwarf Version", i32 4}
116 !4 = !{i32 2, !"Debug Info Version", i32 3}
117 !5 = !{i32 1, !"wchar_size", i32 4}
118 !6 = !{!"clang version 6.0.0 (trunk 309523) (llvm/trunk 309526)"}
119 !7 = distinct !DISubprogram(name: "f1", linkageName: "_Z2f1v", scope: !1, file: !1, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
120 !8 = !DISubroutineType(types: !9)
121 !9 = !{null}
122 !10 = !DILocation(line: 1, column: 42, scope: !7)
123 !11 = distinct !DISubprogram(name: "f2", linkageName: "_Z2f2v", scope: !1, file: !1, line: 2, type: !8, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
124 !12 = !DILocation(line: 2, column: 42, scope: !11)
125 !13 = distinct !DISubprogram(name: "f4", linkageName: "_Z2f4v", scope: !1, file: !1, line: 4, type: !8, isLocal: false, isDefinition: true, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
126 !14 = !DILocation(line: 4, column: 42, scope: !13)
127 !15 = distinct !DISubprogram(name: "f5", linkageName: "_Z2f5v", scope: !1, file: !1, line: 5, type: !8, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
128 !16 = !DILocation(line: 5, column: 42, scope: !15)
129 !17 = distinct !DISubprogram(name: "f6", linkageName: "_Z2f6v", scope: !1, file: !1, line: 6, type: !8, isLocal: false, isDefinition: true, scopeLine: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
130 !18 = !DILocation(line: 6, column: 42, scope: !17)
145 !3 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !4, producer: "clang version 8.0.0 (trunk 346343) (llvm/trunk 346350)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None)
146 !4 = !DIFile(filename: "ranges_no_base.cpp", directory: "/usr/local/google/home/blaikie/dev/scratch")
147 !5 = !{!"clang version 8.0.0 (trunk 346343) (llvm/trunk 346350)"}
148 !6 = !{i32 2, !"Dwarf Version", i32 4}
149 !7 = !{i32 2, !"Debug Info Version", i32 3}
150 !8 = !{i32 1, !"wchar_size", i32 4}
151 !9 = distinct !DISubprogram(name: "f1", linkageName: "_Z2f1v", scope: !1, file: !1, line: 1, type: !10, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
152 !10 = !DISubroutineType(types: !11)
153 !11 = !{null}
154 !12 = !DILocation(line: 1, column: 42, scope: !9)
155 !13 = distinct !DISubprogram(name: "f2", linkageName: "_Z2f2v", scope: !1, file: !1, line: 2, type: !10, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
156 !14 = !DILocation(line: 2, column: 42, scope: !13)
157 !15 = distinct !DISubprogram(name: "f4", linkageName: "_Z2f4v", scope: !1, file: !1, line: 4, type: !10, isLocal: false, isDefinition: true, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
158 !16 = !DILocation(line: 4, column: 42, scope: !15)
159 !17 = distinct !DISubprogram(name: "f5", linkageName: "_Z2f5v", scope: !1, file: !1, line: 5, type: !10, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
160 !18 = !DILocation(line: 5, column: 42, scope: !17)
161 !19 = distinct !DISubprogram(name: "f6", linkageName: "_Z2f6v", scope: !1, file: !1, line: 6, type: !10, isLocal: false, isDefinition: true, scopeLine: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
162 !20 = !DILocation(line: 6, column: 42, scope: !19)
163 !21 = distinct !DISubprogram(name: "f7", linkageName: "_Z2f7v", scope: !4, file: !4, line: 1, type: !10, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !3, retainedNodes: !2)
164 !22 = !DILocation(line: 1, column: 42, scope: !21)
165 !23 = distinct !DISubprogram(name: "f8", linkageName: "_Z2f8v", scope: !4, file: !4, line: 2, type: !10, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: false, unit: !3, retainedNodes: !2)
166 !24 = !DILocation(line: 2, column: 42, scope: !23)
9595 Context, 1, getFile(), "clang", false, "-g", 2, "",
9696 DICompileUnit::FullDebug, getTuple(), getTuple(), getTuple(),
9797 getTuple(), getTuple(), 0, true, false,
98 DICompileUnit::DebugNameTableKind::Default);
98 DICompileUnit::DebugNameTableKind::Default, false);
9999 }
100100 DIType *getBasicType(StringRef Name) {
101101 return DIBasicType::get(Context, dwarf::DW_TAG_unspecified_type, Name);
16061606 Context, SourceLanguage, File, Producer, IsOptimized, Flags,
16071607 RuntimeVersion, SplitDebugFilename, EmissionKind, EnumTypes,
16081608 RetainedTypes, GlobalVariables, ImportedEntities, Macros, DWOId, true,
1609 false, DICompileUnit::DebugNameTableKind::Default);
1609 false, DICompileUnit::DebugNameTableKind::Default, false);
16101610
16111611 EXPECT_EQ(dwarf::DW_TAG_compile_unit, N->getTag());
16121612 EXPECT_EQ(SourceLanguage, N->getSourceLanguage());
16641664 Context, SourceLanguage, File, Producer, IsOptimized, Flags,
16651665 RuntimeVersion, SplitDebugFilename, EmissionKind, EnumTypes,
16661666 RetainedTypes, nullptr, ImportedEntities, nullptr, DWOId, true, false,
1667 DICompileUnit::DebugNameTableKind::Default);
1667 DICompileUnit::DebugNameTableKind::Default, false);
16681668
16691669 auto *GlobalVariables = MDTuple::getDistinct(Context, None);
16701670 EXPECT_EQ(nullptr, N->getGlobalVariables().get());