blob: 42e014f87ff08110ab40277d7c4bae2713107492 [file] [log] [blame]
Eugene Zelenkoe94042c2017-02-27 23:43:14 +00001//===- DWARFDie.cpp -------------------------------------------------------===//
Greg Claytonc8c10322016-12-13 18:25:19 +00002//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
Chandler Carruth6bda14b2017-06-06 11:49:48 +000010#include "llvm/DebugInfo/DWARF/DWARFDie.h"
Greg Claytonc8c10322016-12-13 18:25:19 +000011#include "SyntaxHighlighting.h"
Eugene Zelenkoe94042c2017-02-27 23:43:14 +000012#include "llvm/ADT/None.h"
13#include "llvm/ADT/Optional.h"
14#include "llvm/ADT/StringRef.h"
Zachary Turner264b5d92017-06-07 03:48:56 +000015#include "llvm/BinaryFormat/Dwarf.h"
Eugene Zelenkoe94042c2017-02-27 23:43:14 +000016#include "llvm/DebugInfo/DWARF/DWARFAbbreviationDeclaration.h"
Greg Claytonc8c10322016-12-13 18:25:19 +000017#include "llvm/DebugInfo/DWARF/DWARFContext.h"
Eugene Zelenkoe94042c2017-02-27 23:43:14 +000018#include "llvm/DebugInfo/DWARF/DWARFDebugRangeList.h"
Greg Claytonc8c10322016-12-13 18:25:19 +000019#include "llvm/DebugInfo/DWARF/DWARFFormValue.h"
Eugene Zelenkoe94042c2017-02-27 23:43:14 +000020#include "llvm/DebugInfo/DWARF/DWARFUnit.h"
George Rimar6957ab52017-08-15 12:32:54 +000021#include "llvm/Object/ObjectFile.h"
Eugene Zelenkoe94042c2017-02-27 23:43:14 +000022#include "llvm/Support/DataExtractor.h"
Greg Claytonc8c10322016-12-13 18:25:19 +000023#include "llvm/Support/Format.h"
Eugene Zelenkoe94042c2017-02-27 23:43:14 +000024#include "llvm/Support/MathExtras.h"
Greg Claytonc8c10322016-12-13 18:25:19 +000025#include "llvm/Support/raw_ostream.h"
Eugene Zelenkoe94042c2017-02-27 23:43:14 +000026#include <algorithm>
27#include <cassert>
28#include <cinttypes>
29#include <cstdint>
30#include <string>
31#include <utility>
Greg Claytonc8c10322016-12-13 18:25:19 +000032
33using namespace llvm;
34using namespace dwarf;
George Rimar6957ab52017-08-15 12:32:54 +000035using namespace object;
Greg Claytonc8c10322016-12-13 18:25:19 +000036using namespace syntax;
37
Eugene Zelenkoe94042c2017-02-27 23:43:14 +000038static void dumpApplePropertyAttribute(raw_ostream &OS, uint64_t Val) {
Greg Claytonc8c10322016-12-13 18:25:19 +000039 OS << " (";
40 do {
41 uint64_t Shift = countTrailingZeros(Val);
42 assert(Shift < 64 && "undefined behavior");
43 uint64_t Bit = 1ULL << Shift;
44 auto PropName = ApplePropertyString(Bit);
45 if (!PropName.empty())
46 OS << PropName;
47 else
48 OS << format("DW_APPLE_PROPERTY_0x%" PRIx64, Bit);
49 if (!(Val ^= Bit))
50 break;
51 OS << ", ";
52 } while (true);
53 OS << ")";
54}
55
George Rimar6957ab52017-08-15 12:32:54 +000056static void dumpRanges(const DWARFObject &Obj, raw_ostream &OS,
57 const DWARFAddressRangesVector &Ranges,
58 unsigned AddressSize, unsigned Indent,
59 const DIDumpOptions &DumpOpts) {
George Rimare1c30f72017-08-15 15:54:43 +000060 ArrayRef<SectionName> SectionNames;
61 if (!DumpOpts.Brief)
62 SectionNames = Obj.getSectionNames();
George Rimar6957ab52017-08-15 12:32:54 +000063
64 for (size_t I = 0; I < Ranges.size(); ++I) {
65 const DWARFAddressRange &R = Ranges[I];
66
Greg Claytonc8c10322016-12-13 18:25:19 +000067 OS << '\n';
68 OS.indent(Indent);
George Rimar6957ab52017-08-15 12:32:54 +000069 OS << format("[0x%0*" PRIx64 " - 0x%0*" PRIx64 ")", AddressSize * 2,
70 R.LowPC, AddressSize * 2, R.HighPC);
71
72 if (SectionNames.empty() || R.SectionIndex == -1ULL)
73 continue;
74
George Rimare1c30f72017-08-15 15:54:43 +000075 StringRef Name = SectionNames[R.SectionIndex].Name;
76 OS << " \"" << Name << '\"';
George Rimar6957ab52017-08-15 12:32:54 +000077
George Rimare1c30f72017-08-15 15:54:43 +000078 // Print section index if name is not unique.
79 if (!SectionNames[R.SectionIndex].IsNameUnique)
George Rimare5269432017-08-15 16:42:21 +000080 OS << format(" [%" PRIu64 "]", R.SectionIndex);
Greg Claytonc8c10322016-12-13 18:25:19 +000081 }
82}
83
84static void dumpAttribute(raw_ostream &OS, const DWARFDie &Die,
85 uint32_t *OffsetPtr, dwarf::Attribute Attr,
Adrian Prantl318d1192017-06-06 23:28:45 +000086 dwarf::Form Form, unsigned Indent,
87 DIDumpOptions DumpOpts) {
Greg Claytonc8c10322016-12-13 18:25:19 +000088 if (!Die.isValid())
89 return;
90 const char BaseIndent[] = " ";
91 OS << BaseIndent;
92 OS.indent(Indent+2);
93 auto attrString = AttributeString(Attr);
94 if (!attrString.empty())
95 WithColor(OS, syntax::Attribute) << attrString;
96 else
97 WithColor(OS, syntax::Attribute).get() << format("DW_AT_Unknown_%x", Attr);
Adrian Prantl318d1192017-06-06 23:28:45 +000098
99 if (!DumpOpts.Brief) {
100 auto formString = FormEncodingString(Form);
101 if (!formString.empty())
102 OS << " [" << formString << ']';
103 else
104 OS << format(" [DW_FORM_Unknown_%x]", Form);
105 }
106
Greg Claytonc8c10322016-12-13 18:25:19 +0000107 DWARFUnit *U = Die.getDwarfUnit();
108 DWARFFormValue formValue(Form);
109
110 if (!formValue.extractValue(U->getDebugInfoExtractor(), OffsetPtr, U))
111 return;
112
113 OS << "\t(";
114
115 StringRef Name;
116 std::string File;
117 auto Color = syntax::Enumerator;
118 if (Attr == DW_AT_decl_file || Attr == DW_AT_call_file) {
119 Color = syntax::String;
120 if (const auto *LT = U->getContext().getLineTableForUnit(U))
121 if (LT->getFileNameByIndex(formValue.getAsUnsignedConstant().getValue(), U->getCompilationDir(), DILineInfoSpecifier::FileLineInfoKind::AbsoluteFilePath, File)) {
122 File = '"' + File + '"';
123 Name = File;
124 }
125 } else if (Optional<uint64_t> Val = formValue.getAsUnsignedConstant())
126 Name = AttributeValueString(Attr, *Val);
127
128 if (!Name.empty())
129 WithColor(OS, Color) << Name;
130 else if (Attr == DW_AT_decl_line || Attr == DW_AT_call_line)
131 OS << *formValue.getAsUnsignedConstant();
132 else
133 formValue.dump(OS);
134
135 // We have dumped the attribute raw value. For some attributes
136 // having both the raw value and the pretty-printed value is
137 // interesting. These attributes are handled below.
138 if (Attr == DW_AT_specification || Attr == DW_AT_abstract_origin) {
139 if (const char *Name = Die.getAttributeValueAsReferencedDie(Attr).getName(DINameKind::LinkageName))
140 OS << " \"" << Name << '\"';
141 } else if (Attr == DW_AT_APPLE_property_attribute) {
142 if (Optional<uint64_t> OptVal = formValue.getAsUnsignedConstant())
143 dumpApplePropertyAttribute(OS, *OptVal);
144 } else if (Attr == DW_AT_ranges) {
George Rimar6957ab52017-08-15 12:32:54 +0000145 const DWARFObject &Obj = Die.getDwarfUnit()->getContext().getDWARFObj();
146 dumpRanges(Obj, OS, Die.getAddressRanges(), U->getAddressByteSize(),
147 sizeof(BaseIndent) + Indent + 4, DumpOpts);
Greg Claytonc8c10322016-12-13 18:25:19 +0000148 }
George Rimar6957ab52017-08-15 12:32:54 +0000149
Greg Claytonc8c10322016-12-13 18:25:19 +0000150 OS << ")\n";
151}
152
Greg Claytonc8c10322016-12-13 18:25:19 +0000153bool DWARFDie::isSubprogramDIE() const {
154 return getTag() == DW_TAG_subprogram;
155}
156
157bool DWARFDie::isSubroutineDIE() const {
158 auto Tag = getTag();
159 return Tag == DW_TAG_subprogram || Tag == DW_TAG_inlined_subroutine;
160}
161
Greg Clayton1cbf3fa2016-12-13 23:20:56 +0000162Optional<DWARFFormValue>
Greg Clayton97d22182017-01-13 21:08:18 +0000163DWARFDie::find(dwarf::Attribute Attr) const {
Greg Clayton1cbf3fa2016-12-13 23:20:56 +0000164 if (!isValid())
165 return None;
Greg Claytonc8c10322016-12-13 18:25:19 +0000166 auto AbbrevDecl = getAbbreviationDeclarationPtr();
167 if (AbbrevDecl)
Greg Clayton1cbf3fa2016-12-13 23:20:56 +0000168 return AbbrevDecl->getAttributeValue(getOffset(), Attr, *U);
169 return None;
Greg Claytonc8c10322016-12-13 18:25:19 +0000170}
171
Greg Clayton97d22182017-01-13 21:08:18 +0000172Optional<DWARFFormValue>
Greg Claytonc109bbe2017-01-13 22:32:12 +0000173DWARFDie::find(ArrayRef<dwarf::Attribute> Attrs) const {
174 if (!isValid())
175 return None;
176 auto AbbrevDecl = getAbbreviationDeclarationPtr();
177 if (AbbrevDecl) {
178 for (auto Attr : Attrs) {
179 if (auto Value = AbbrevDecl->getAttributeValue(getOffset(), Attr, *U))
180 return Value;
181 }
182 }
183 return None;
184}
185
186Optional<DWARFFormValue>
187DWARFDie::findRecursively(ArrayRef<dwarf::Attribute> Attrs) const {
188 if (!isValid())
189 return None;
David Blaikie1914c822017-03-13 21:46:37 +0000190 auto Die = *this;
191 if (auto Value = Die.find(Attrs))
Greg Claytonc109bbe2017-01-13 22:32:12 +0000192 return Value;
David Blaikie1914c822017-03-13 21:46:37 +0000193 if (auto D = Die.getAttributeValueAsReferencedDie(DW_AT_abstract_origin))
194 Die = D;
195 if (auto Value = Die.find(Attrs))
196 return Value;
197 if (auto D = Die.getAttributeValueAsReferencedDie(DW_AT_specification))
198 Die = D;
199 if (auto Value = Die.find(Attrs))
200 return Value;
Greg Claytonc109bbe2017-01-13 22:32:12 +0000201 return None;
202}
203
Greg Claytonc8c10322016-12-13 18:25:19 +0000204DWARFDie
205DWARFDie::getAttributeValueAsReferencedDie(dwarf::Attribute Attr) const {
Greg Clayton97d22182017-01-13 21:08:18 +0000206 auto SpecRef = toReference(find(Attr));
Greg Clayton52fe1f62016-12-14 22:38:08 +0000207 if (SpecRef) {
208 auto SpecUnit = U->getUnitSection().getUnitForOffset(*SpecRef);
Greg Claytonc8c10322016-12-13 18:25:19 +0000209 if (SpecUnit)
Greg Clayton52fe1f62016-12-14 22:38:08 +0000210 return SpecUnit->getDIEForOffset(*SpecRef);
Greg Claytonc8c10322016-12-13 18:25:19 +0000211 }
212 return DWARFDie();
213}
214
Greg Clayton52fe1f62016-12-14 22:38:08 +0000215Optional<uint64_t>
216DWARFDie::getRangesBaseAttribute() const {
Greg Claytonc109bbe2017-01-13 22:32:12 +0000217 return toSectionOffset(find({DW_AT_rnglists_base, DW_AT_GNU_ranges_base}));
Greg Claytonc8c10322016-12-13 18:25:19 +0000218}
219
Greg Clayton2520c9e2016-12-19 20:36:41 +0000220Optional<uint64_t> DWARFDie::getHighPC(uint64_t LowPC) const {
Greg Clayton97d22182017-01-13 21:08:18 +0000221 if (auto FormValue = find(DW_AT_high_pc)) {
Greg Clayton2520c9e2016-12-19 20:36:41 +0000222 if (auto Address = FormValue->getAsAddress()) {
223 // High PC is an address.
224 return Address;
225 }
226 if (auto Offset = FormValue->getAsUnsignedConstant()) {
227 // High PC is an offset from LowPC.
228 return LowPC + *Offset;
229 }
230 }
231 return None;
232}
Greg Clayton52fe1f62016-12-14 22:38:08 +0000233
George Rimara25d3292017-05-27 18:10:23 +0000234bool DWARFDie::getLowAndHighPC(uint64_t &LowPC, uint64_t &HighPC,
235 uint64_t &SectionIndex) const {
236 auto F = find(DW_AT_low_pc);
237 auto LowPcAddr = toAddress(F);
Greg Clayton2520c9e2016-12-19 20:36:41 +0000238 if (!LowPcAddr)
Greg Clayton52fe1f62016-12-14 22:38:08 +0000239 return false;
Greg Clayton2520c9e2016-12-19 20:36:41 +0000240 if (auto HighPcAddr = getHighPC(*LowPcAddr)) {
241 LowPC = *LowPcAddr;
242 HighPC = *HighPcAddr;
George Rimara25d3292017-05-27 18:10:23 +0000243 SectionIndex = F->getSectionIndex();
Greg Clayton2520c9e2016-12-19 20:36:41 +0000244 return true;
245 }
246 return false;
Greg Claytonc8c10322016-12-13 18:25:19 +0000247}
248
249DWARFAddressRangesVector
250DWARFDie::getAddressRanges() const {
251 if (isNULL())
252 return DWARFAddressRangesVector();
253 // Single range specified by low/high PC.
George Rimara25d3292017-05-27 18:10:23 +0000254 uint64_t LowPC, HighPC, Index;
255 if (getLowAndHighPC(LowPC, HighPC, Index))
256 return {{LowPC, HighPC, Index}};
George Rimar4671f2e2017-05-16 12:30:59 +0000257
Greg Claytonc8c10322016-12-13 18:25:19 +0000258 // Multiple ranges from .debug_ranges section.
Greg Clayton97d22182017-01-13 21:08:18 +0000259 auto RangesOffset = toSectionOffset(find(DW_AT_ranges));
Greg Clayton52fe1f62016-12-14 22:38:08 +0000260 if (RangesOffset) {
Greg Claytonc8c10322016-12-13 18:25:19 +0000261 DWARFDebugRangeList RangeList;
Greg Clayton52fe1f62016-12-14 22:38:08 +0000262 if (U->extractRangeList(*RangesOffset, RangeList))
Greg Claytonc8c10322016-12-13 18:25:19 +0000263 return RangeList.getAbsoluteRanges(U->getBaseAddress());
264 }
265 return DWARFAddressRangesVector();
266}
267
268void
269DWARFDie::collectChildrenAddressRanges(DWARFAddressRangesVector& Ranges) const {
270 if (isNULL())
271 return;
272 if (isSubprogramDIE()) {
273 const auto &DIERanges = getAddressRanges();
274 Ranges.insert(Ranges.end(), DIERanges.begin(), DIERanges.end());
275 }
276
Greg Clayton93e4fe82017-01-05 23:47:37 +0000277 for (auto Child: children())
Greg Claytonc8c10322016-12-13 18:25:19 +0000278 Child.collectChildrenAddressRanges(Ranges);
Greg Claytonc8c10322016-12-13 18:25:19 +0000279}
280
281bool DWARFDie::addressRangeContainsAddress(const uint64_t Address) const {
282 for (const auto& R : getAddressRanges()) {
George Rimar4671f2e2017-05-16 12:30:59 +0000283 if (R.LowPC <= Address && Address < R.HighPC)
Greg Claytonc8c10322016-12-13 18:25:19 +0000284 return true;
285 }
286 return false;
287}
288
289const char *
290DWARFDie::getSubroutineName(DINameKind Kind) const {
291 if (!isSubroutineDIE())
292 return nullptr;
293 return getName(Kind);
294}
295
296const char *
297DWARFDie::getName(DINameKind Kind) const {
298 if (!isValid() || Kind == DINameKind::None)
299 return nullptr;
Greg Claytonc8c10322016-12-13 18:25:19 +0000300 // Try to get mangled name only if it was asked for.
301 if (Kind == DINameKind::LinkageName) {
Greg Claytonc109bbe2017-01-13 22:32:12 +0000302 if (auto Name = dwarf::toString(findRecursively({DW_AT_MIPS_linkage_name,
303 DW_AT_linkage_name}), nullptr))
Greg Clayton97d22182017-01-13 21:08:18 +0000304 return Name;
Greg Claytonc8c10322016-12-13 18:25:19 +0000305 }
Greg Clayton97d22182017-01-13 21:08:18 +0000306 if (auto Name = dwarf::toString(findRecursively(DW_AT_name), nullptr))
307 return Name;
Greg Claytonc8c10322016-12-13 18:25:19 +0000308 return nullptr;
309}
310
David Blaikieefc4eba2017-02-06 20:19:02 +0000311uint64_t DWARFDie::getDeclLine() const {
312 return toUnsigned(findRecursively(DW_AT_decl_line), 0);
313}
314
Greg Claytonc8c10322016-12-13 18:25:19 +0000315void DWARFDie::getCallerFrame(uint32_t &CallFile, uint32_t &CallLine,
Dehao Chenef700d52017-04-17 20:10:39 +0000316 uint32_t &CallColumn,
317 uint32_t &CallDiscriminator) const {
Greg Clayton97d22182017-01-13 21:08:18 +0000318 CallFile = toUnsigned(find(DW_AT_call_file), 0);
319 CallLine = toUnsigned(find(DW_AT_call_line), 0);
320 CallColumn = toUnsigned(find(DW_AT_call_column), 0);
Dehao Chenef700d52017-04-17 20:10:39 +0000321 CallDiscriminator = toUnsigned(find(DW_AT_GNU_discriminator), 0);
Greg Claytonc8c10322016-12-13 18:25:19 +0000322}
323
Adrian Prantl318d1192017-06-06 23:28:45 +0000324void DWARFDie::dump(raw_ostream &OS, unsigned RecurseDepth, unsigned Indent,
325 DIDumpOptions DumpOpts) const {
Greg Claytonc8c10322016-12-13 18:25:19 +0000326 if (!isValid())
327 return;
Paul Robinson17536b92017-06-29 16:52:08 +0000328 DWARFDataExtractor debug_info_data = U->getDebugInfoExtractor();
Greg Claytonc8c10322016-12-13 18:25:19 +0000329 const uint32_t Offset = getOffset();
330 uint32_t offset = Offset;
331
332 if (debug_info_data.isValidOffset(offset)) {
333 uint32_t abbrCode = debug_info_data.getULEB128(&offset);
334 WithColor(OS, syntax::Address).get() << format("\n0x%8.8x: ", Offset);
335
336 if (abbrCode) {
337 auto AbbrevDecl = getAbbreviationDeclarationPtr();
338 if (AbbrevDecl) {
339 auto tagString = TagString(getTag());
340 if (!tagString.empty())
341 WithColor(OS, syntax::Tag).get().indent(Indent) << tagString;
342 else
343 WithColor(OS, syntax::Tag).get().indent(Indent)
344 << format("DW_TAG_Unknown_%x", getTag());
Adrian Prantl318d1192017-06-06 23:28:45 +0000345
346 if (!DumpOpts.Brief)
347 OS << format(" [%u] %c", abbrCode,
348 AbbrevDecl->hasChildren() ? '*' : ' ');
349 OS << '\n';
350
Greg Claytonc8c10322016-12-13 18:25:19 +0000351 // Dump all data in the DIE for the attributes.
352 for (const auto &AttrSpec : AbbrevDecl->attributes()) {
Victor Leschuk96d99812017-02-25 13:15:57 +0000353 if (AttrSpec.Form == DW_FORM_implicit_const) {
354 // We are dumping .debug_info section ,
355 // implicit_const attribute values are not really stored here,
356 // but in .debug_abbrev section. So we just skip such attrs.
357 continue;
358 }
Greg Claytonc8c10322016-12-13 18:25:19 +0000359 dumpAttribute(OS, *this, &offset, AttrSpec.Attr, AttrSpec.Form,
Adrian Prantl318d1192017-06-06 23:28:45 +0000360 Indent, DumpOpts);
Greg Claytonc8c10322016-12-13 18:25:19 +0000361 }
362
363 DWARFDie child = getFirstChild();
364 if (RecurseDepth > 0 && child) {
365 while (child) {
Adrian Prantl318d1192017-06-06 23:28:45 +0000366 child.dump(OS, RecurseDepth-1, Indent+2, DumpOpts);
Greg Claytonc8c10322016-12-13 18:25:19 +0000367 child = child.getSibling();
368 }
369 }
370 } else {
371 OS << "Abbreviation code not found in 'debug_abbrev' class for code: "
372 << abbrCode << '\n';
373 }
374 } else {
375 OS.indent(Indent) << "NULL\n";
376 }
377 }
378}
379
Adrian Prantl3d523a62017-08-16 17:43:01 +0000380LLVM_DUMP_METHOD void DWARFDie::dump() const { dump(llvm::errs(), 0); }
381
Greg Clayton78a07bf2016-12-21 21:37:06 +0000382DWARFDie DWARFDie::getParent() const {
383 if (isValid())
384 return U->getParent(Die);
385 return DWARFDie();
386}
387
388DWARFDie DWARFDie::getSibling() const {
389 if (isValid())
390 return U->getSibling(Die);
391 return DWARFDie();
392}
Greg Clayton0e62ee72017-01-13 00:13:42 +0000393
394iterator_range<DWARFDie::attribute_iterator>
395DWARFDie::attributes() const {
396 return make_range(attribute_iterator(*this, false),
397 attribute_iterator(*this, true));
398}
399
400DWARFDie::attribute_iterator::attribute_iterator(DWARFDie D, bool End) :
401 Die(D), AttrValue(0), Index(0) {
402 auto AbbrDecl = Die.getAbbreviationDeclarationPtr();
403 assert(AbbrDecl && "Must have abbreviation declaration");
404 if (End) {
405 // This is the end iterator so we set the index to the attribute count.
406 Index = AbbrDecl->getNumAttributes();
407 } else {
408 // This is the begin iterator so we extract the value for this->Index.
409 AttrValue.Offset = D.getOffset() + AbbrDecl->getCodeByteSize();
410 updateForIndex(*AbbrDecl, 0);
411 }
412}
413
414void DWARFDie::attribute_iterator::updateForIndex(
415 const DWARFAbbreviationDeclaration &AbbrDecl, uint32_t I) {
416 Index = I;
Hiroshi Inoueddb34d82017-07-03 06:32:59 +0000417 // AbbrDecl must be valid before calling this function.
Greg Clayton0e62ee72017-01-13 00:13:42 +0000418 auto NumAttrs = AbbrDecl.getNumAttributes();
419 if (Index < NumAttrs) {
420 AttrValue.Attr = AbbrDecl.getAttrByIndex(Index);
421 // Add the previous byte size of any previous attribute value.
422 AttrValue.Offset += AttrValue.ByteSize;
423 AttrValue.Value.setForm(AbbrDecl.getFormByIndex(Index));
424 uint32_t ParseOffset = AttrValue.Offset;
425 auto U = Die.getDwarfUnit();
426 assert(U && "Die must have valid DWARF unit");
427 bool b = AttrValue.Value.extractValue(U->getDebugInfoExtractor(),
428 &ParseOffset, U);
429 (void)b;
430 assert(b && "extractValue cannot fail on fully parsed DWARF");
431 AttrValue.ByteSize = ParseOffset - AttrValue.Offset;
432 } else {
433 assert(Index == NumAttrs && "Indexes should be [0, NumAttrs) only");
434 AttrValue.clear();
435 }
436}
437
438DWARFDie::attribute_iterator &DWARFDie::attribute_iterator::operator++() {
439 if (auto AbbrDecl = Die.getAbbreviationDeclarationPtr())
440 updateForIndex(*AbbrDecl, Index + 1);
441 return *this;
442}