blob: 6b557b9e265763352a4012b4ce6968ae47c9f52e [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) {
60 StringMap<unsigned> SectionAmountMap;
61 std::vector<StringRef> SectionNames;
62 if (Obj.getFile() && !DumpOpts.Brief) {
63 for (const SectionRef &Section : Obj.getFile()->sections()) {
64 StringRef Name;
65 if (Section.getName(Name))
66 Name = "<error>";
67
68 ++SectionAmountMap[Name];
69 SectionNames.push_back(Name);
70 }
71 }
72
73 for (size_t I = 0; I < Ranges.size(); ++I) {
74 const DWARFAddressRange &R = Ranges[I];
75
Greg Claytonc8c10322016-12-13 18:25:19 +000076 OS << '\n';
77 OS.indent(Indent);
George Rimar6957ab52017-08-15 12:32:54 +000078 OS << format("[0x%0*" PRIx64 " - 0x%0*" PRIx64 ")", AddressSize * 2,
79 R.LowPC, AddressSize * 2, R.HighPC);
80
81 if (SectionNames.empty() || R.SectionIndex == -1ULL)
82 continue;
83
84 StringRef Name = R.SectionIndex < SectionNames.size()
85 ? SectionNames[R.SectionIndex]
86 : "<error>";
87 OS << format(" \"%s\"", Name.str().c_str());
88
89 // Print section index if there is more than one section with this name.
90 if (SectionAmountMap[Name] > 1)
91 OS << format(" [%u]", R.SectionIndex);
Greg Claytonc8c10322016-12-13 18:25:19 +000092 }
93}
94
95static void dumpAttribute(raw_ostream &OS, const DWARFDie &Die,
96 uint32_t *OffsetPtr, dwarf::Attribute Attr,
Adrian Prantl318d1192017-06-06 23:28:45 +000097 dwarf::Form Form, unsigned Indent,
98 DIDumpOptions DumpOpts) {
Greg Claytonc8c10322016-12-13 18:25:19 +000099 if (!Die.isValid())
100 return;
101 const char BaseIndent[] = " ";
102 OS << BaseIndent;
103 OS.indent(Indent+2);
104 auto attrString = AttributeString(Attr);
105 if (!attrString.empty())
106 WithColor(OS, syntax::Attribute) << attrString;
107 else
108 WithColor(OS, syntax::Attribute).get() << format("DW_AT_Unknown_%x", Attr);
Adrian Prantl318d1192017-06-06 23:28:45 +0000109
110 if (!DumpOpts.Brief) {
111 auto formString = FormEncodingString(Form);
112 if (!formString.empty())
113 OS << " [" << formString << ']';
114 else
115 OS << format(" [DW_FORM_Unknown_%x]", Form);
116 }
117
Greg Claytonc8c10322016-12-13 18:25:19 +0000118 DWARFUnit *U = Die.getDwarfUnit();
119 DWARFFormValue formValue(Form);
120
121 if (!formValue.extractValue(U->getDebugInfoExtractor(), OffsetPtr, U))
122 return;
123
124 OS << "\t(";
125
126 StringRef Name;
127 std::string File;
128 auto Color = syntax::Enumerator;
129 if (Attr == DW_AT_decl_file || Attr == DW_AT_call_file) {
130 Color = syntax::String;
131 if (const auto *LT = U->getContext().getLineTableForUnit(U))
132 if (LT->getFileNameByIndex(formValue.getAsUnsignedConstant().getValue(), U->getCompilationDir(), DILineInfoSpecifier::FileLineInfoKind::AbsoluteFilePath, File)) {
133 File = '"' + File + '"';
134 Name = File;
135 }
136 } else if (Optional<uint64_t> Val = formValue.getAsUnsignedConstant())
137 Name = AttributeValueString(Attr, *Val);
138
139 if (!Name.empty())
140 WithColor(OS, Color) << Name;
141 else if (Attr == DW_AT_decl_line || Attr == DW_AT_call_line)
142 OS << *formValue.getAsUnsignedConstant();
143 else
144 formValue.dump(OS);
145
146 // We have dumped the attribute raw value. For some attributes
147 // having both the raw value and the pretty-printed value is
148 // interesting. These attributes are handled below.
149 if (Attr == DW_AT_specification || Attr == DW_AT_abstract_origin) {
150 if (const char *Name = Die.getAttributeValueAsReferencedDie(Attr).getName(DINameKind::LinkageName))
151 OS << " \"" << Name << '\"';
152 } else if (Attr == DW_AT_APPLE_property_attribute) {
153 if (Optional<uint64_t> OptVal = formValue.getAsUnsignedConstant())
154 dumpApplePropertyAttribute(OS, *OptVal);
155 } else if (Attr == DW_AT_ranges) {
George Rimar6957ab52017-08-15 12:32:54 +0000156 const DWARFObject &Obj = Die.getDwarfUnit()->getContext().getDWARFObj();
157 dumpRanges(Obj, OS, Die.getAddressRanges(), U->getAddressByteSize(),
158 sizeof(BaseIndent) + Indent + 4, DumpOpts);
Greg Claytonc8c10322016-12-13 18:25:19 +0000159 }
George Rimar6957ab52017-08-15 12:32:54 +0000160
Greg Claytonc8c10322016-12-13 18:25:19 +0000161 OS << ")\n";
162}
163
Greg Claytonc8c10322016-12-13 18:25:19 +0000164bool DWARFDie::isSubprogramDIE() const {
165 return getTag() == DW_TAG_subprogram;
166}
167
168bool DWARFDie::isSubroutineDIE() const {
169 auto Tag = getTag();
170 return Tag == DW_TAG_subprogram || Tag == DW_TAG_inlined_subroutine;
171}
172
Greg Clayton1cbf3fa2016-12-13 23:20:56 +0000173Optional<DWARFFormValue>
Greg Clayton97d22182017-01-13 21:08:18 +0000174DWARFDie::find(dwarf::Attribute Attr) const {
Greg Clayton1cbf3fa2016-12-13 23:20:56 +0000175 if (!isValid())
176 return None;
Greg Claytonc8c10322016-12-13 18:25:19 +0000177 auto AbbrevDecl = getAbbreviationDeclarationPtr();
178 if (AbbrevDecl)
Greg Clayton1cbf3fa2016-12-13 23:20:56 +0000179 return AbbrevDecl->getAttributeValue(getOffset(), Attr, *U);
180 return None;
Greg Claytonc8c10322016-12-13 18:25:19 +0000181}
182
Greg Clayton97d22182017-01-13 21:08:18 +0000183Optional<DWARFFormValue>
Greg Claytonc109bbe2017-01-13 22:32:12 +0000184DWARFDie::find(ArrayRef<dwarf::Attribute> Attrs) const {
185 if (!isValid())
186 return None;
187 auto AbbrevDecl = getAbbreviationDeclarationPtr();
188 if (AbbrevDecl) {
189 for (auto Attr : Attrs) {
190 if (auto Value = AbbrevDecl->getAttributeValue(getOffset(), Attr, *U))
191 return Value;
192 }
193 }
194 return None;
195}
196
197Optional<DWARFFormValue>
198DWARFDie::findRecursively(ArrayRef<dwarf::Attribute> Attrs) const {
199 if (!isValid())
200 return None;
David Blaikie1914c822017-03-13 21:46:37 +0000201 auto Die = *this;
202 if (auto Value = Die.find(Attrs))
Greg Claytonc109bbe2017-01-13 22:32:12 +0000203 return Value;
David Blaikie1914c822017-03-13 21:46:37 +0000204 if (auto D = Die.getAttributeValueAsReferencedDie(DW_AT_abstract_origin))
205 Die = D;
206 if (auto Value = Die.find(Attrs))
207 return Value;
208 if (auto D = Die.getAttributeValueAsReferencedDie(DW_AT_specification))
209 Die = D;
210 if (auto Value = Die.find(Attrs))
211 return Value;
Greg Claytonc109bbe2017-01-13 22:32:12 +0000212 return None;
213}
214
Greg Claytonc8c10322016-12-13 18:25:19 +0000215DWARFDie
216DWARFDie::getAttributeValueAsReferencedDie(dwarf::Attribute Attr) const {
Greg Clayton97d22182017-01-13 21:08:18 +0000217 auto SpecRef = toReference(find(Attr));
Greg Clayton52fe1f62016-12-14 22:38:08 +0000218 if (SpecRef) {
219 auto SpecUnit = U->getUnitSection().getUnitForOffset(*SpecRef);
Greg Claytonc8c10322016-12-13 18:25:19 +0000220 if (SpecUnit)
Greg Clayton52fe1f62016-12-14 22:38:08 +0000221 return SpecUnit->getDIEForOffset(*SpecRef);
Greg Claytonc8c10322016-12-13 18:25:19 +0000222 }
223 return DWARFDie();
224}
225
Greg Clayton52fe1f62016-12-14 22:38:08 +0000226Optional<uint64_t>
227DWARFDie::getRangesBaseAttribute() const {
Greg Claytonc109bbe2017-01-13 22:32:12 +0000228 return toSectionOffset(find({DW_AT_rnglists_base, DW_AT_GNU_ranges_base}));
Greg Claytonc8c10322016-12-13 18:25:19 +0000229}
230
Greg Clayton2520c9e2016-12-19 20:36:41 +0000231Optional<uint64_t> DWARFDie::getHighPC(uint64_t LowPC) const {
Greg Clayton97d22182017-01-13 21:08:18 +0000232 if (auto FormValue = find(DW_AT_high_pc)) {
Greg Clayton2520c9e2016-12-19 20:36:41 +0000233 if (auto Address = FormValue->getAsAddress()) {
234 // High PC is an address.
235 return Address;
236 }
237 if (auto Offset = FormValue->getAsUnsignedConstant()) {
238 // High PC is an offset from LowPC.
239 return LowPC + *Offset;
240 }
241 }
242 return None;
243}
Greg Clayton52fe1f62016-12-14 22:38:08 +0000244
George Rimara25d3292017-05-27 18:10:23 +0000245bool DWARFDie::getLowAndHighPC(uint64_t &LowPC, uint64_t &HighPC,
246 uint64_t &SectionIndex) const {
247 auto F = find(DW_AT_low_pc);
248 auto LowPcAddr = toAddress(F);
Greg Clayton2520c9e2016-12-19 20:36:41 +0000249 if (!LowPcAddr)
Greg Clayton52fe1f62016-12-14 22:38:08 +0000250 return false;
Greg Clayton2520c9e2016-12-19 20:36:41 +0000251 if (auto HighPcAddr = getHighPC(*LowPcAddr)) {
252 LowPC = *LowPcAddr;
253 HighPC = *HighPcAddr;
George Rimara25d3292017-05-27 18:10:23 +0000254 SectionIndex = F->getSectionIndex();
Greg Clayton2520c9e2016-12-19 20:36:41 +0000255 return true;
256 }
257 return false;
Greg Claytonc8c10322016-12-13 18:25:19 +0000258}
259
260DWARFAddressRangesVector
261DWARFDie::getAddressRanges() const {
262 if (isNULL())
263 return DWARFAddressRangesVector();
264 // Single range specified by low/high PC.
George Rimara25d3292017-05-27 18:10:23 +0000265 uint64_t LowPC, HighPC, Index;
266 if (getLowAndHighPC(LowPC, HighPC, Index))
267 return {{LowPC, HighPC, Index}};
George Rimar4671f2e2017-05-16 12:30:59 +0000268
Greg Claytonc8c10322016-12-13 18:25:19 +0000269 // Multiple ranges from .debug_ranges section.
Greg Clayton97d22182017-01-13 21:08:18 +0000270 auto RangesOffset = toSectionOffset(find(DW_AT_ranges));
Greg Clayton52fe1f62016-12-14 22:38:08 +0000271 if (RangesOffset) {
Greg Claytonc8c10322016-12-13 18:25:19 +0000272 DWARFDebugRangeList RangeList;
Greg Clayton52fe1f62016-12-14 22:38:08 +0000273 if (U->extractRangeList(*RangesOffset, RangeList))
Greg Claytonc8c10322016-12-13 18:25:19 +0000274 return RangeList.getAbsoluteRanges(U->getBaseAddress());
275 }
276 return DWARFAddressRangesVector();
277}
278
279void
280DWARFDie::collectChildrenAddressRanges(DWARFAddressRangesVector& Ranges) const {
281 if (isNULL())
282 return;
283 if (isSubprogramDIE()) {
284 const auto &DIERanges = getAddressRanges();
285 Ranges.insert(Ranges.end(), DIERanges.begin(), DIERanges.end());
286 }
287
Greg Clayton93e4fe82017-01-05 23:47:37 +0000288 for (auto Child: children())
Greg Claytonc8c10322016-12-13 18:25:19 +0000289 Child.collectChildrenAddressRanges(Ranges);
Greg Claytonc8c10322016-12-13 18:25:19 +0000290}
291
292bool DWARFDie::addressRangeContainsAddress(const uint64_t Address) const {
293 for (const auto& R : getAddressRanges()) {
George Rimar4671f2e2017-05-16 12:30:59 +0000294 if (R.LowPC <= Address && Address < R.HighPC)
Greg Claytonc8c10322016-12-13 18:25:19 +0000295 return true;
296 }
297 return false;
298}
299
300const char *
301DWARFDie::getSubroutineName(DINameKind Kind) const {
302 if (!isSubroutineDIE())
303 return nullptr;
304 return getName(Kind);
305}
306
307const char *
308DWARFDie::getName(DINameKind Kind) const {
309 if (!isValid() || Kind == DINameKind::None)
310 return nullptr;
Greg Claytonc8c10322016-12-13 18:25:19 +0000311 // Try to get mangled name only if it was asked for.
312 if (Kind == DINameKind::LinkageName) {
Greg Claytonc109bbe2017-01-13 22:32:12 +0000313 if (auto Name = dwarf::toString(findRecursively({DW_AT_MIPS_linkage_name,
314 DW_AT_linkage_name}), nullptr))
Greg Clayton97d22182017-01-13 21:08:18 +0000315 return Name;
Greg Claytonc8c10322016-12-13 18:25:19 +0000316 }
Greg Clayton97d22182017-01-13 21:08:18 +0000317 if (auto Name = dwarf::toString(findRecursively(DW_AT_name), nullptr))
318 return Name;
Greg Claytonc8c10322016-12-13 18:25:19 +0000319 return nullptr;
320}
321
David Blaikieefc4eba2017-02-06 20:19:02 +0000322uint64_t DWARFDie::getDeclLine() const {
323 return toUnsigned(findRecursively(DW_AT_decl_line), 0);
324}
325
Greg Claytonc8c10322016-12-13 18:25:19 +0000326void DWARFDie::getCallerFrame(uint32_t &CallFile, uint32_t &CallLine,
Dehao Chenef700d52017-04-17 20:10:39 +0000327 uint32_t &CallColumn,
328 uint32_t &CallDiscriminator) const {
Greg Clayton97d22182017-01-13 21:08:18 +0000329 CallFile = toUnsigned(find(DW_AT_call_file), 0);
330 CallLine = toUnsigned(find(DW_AT_call_line), 0);
331 CallColumn = toUnsigned(find(DW_AT_call_column), 0);
Dehao Chenef700d52017-04-17 20:10:39 +0000332 CallDiscriminator = toUnsigned(find(DW_AT_GNU_discriminator), 0);
Greg Claytonc8c10322016-12-13 18:25:19 +0000333}
334
Adrian Prantl318d1192017-06-06 23:28:45 +0000335void DWARFDie::dump(raw_ostream &OS, unsigned RecurseDepth, unsigned Indent,
336 DIDumpOptions DumpOpts) const {
Greg Claytonc8c10322016-12-13 18:25:19 +0000337 if (!isValid())
338 return;
Paul Robinson17536b92017-06-29 16:52:08 +0000339 DWARFDataExtractor debug_info_data = U->getDebugInfoExtractor();
Greg Claytonc8c10322016-12-13 18:25:19 +0000340 const uint32_t Offset = getOffset();
341 uint32_t offset = Offset;
342
343 if (debug_info_data.isValidOffset(offset)) {
344 uint32_t abbrCode = debug_info_data.getULEB128(&offset);
345 WithColor(OS, syntax::Address).get() << format("\n0x%8.8x: ", Offset);
346
347 if (abbrCode) {
348 auto AbbrevDecl = getAbbreviationDeclarationPtr();
349 if (AbbrevDecl) {
350 auto tagString = TagString(getTag());
351 if (!tagString.empty())
352 WithColor(OS, syntax::Tag).get().indent(Indent) << tagString;
353 else
354 WithColor(OS, syntax::Tag).get().indent(Indent)
355 << format("DW_TAG_Unknown_%x", getTag());
Adrian Prantl318d1192017-06-06 23:28:45 +0000356
357 if (!DumpOpts.Brief)
358 OS << format(" [%u] %c", abbrCode,
359 AbbrevDecl->hasChildren() ? '*' : ' ');
360 OS << '\n';
361
Greg Claytonc8c10322016-12-13 18:25:19 +0000362 // Dump all data in the DIE for the attributes.
363 for (const auto &AttrSpec : AbbrevDecl->attributes()) {
Victor Leschuk96d99812017-02-25 13:15:57 +0000364 if (AttrSpec.Form == DW_FORM_implicit_const) {
365 // We are dumping .debug_info section ,
366 // implicit_const attribute values are not really stored here,
367 // but in .debug_abbrev section. So we just skip such attrs.
368 continue;
369 }
Greg Claytonc8c10322016-12-13 18:25:19 +0000370 dumpAttribute(OS, *this, &offset, AttrSpec.Attr, AttrSpec.Form,
Adrian Prantl318d1192017-06-06 23:28:45 +0000371 Indent, DumpOpts);
Greg Claytonc8c10322016-12-13 18:25:19 +0000372 }
373
374 DWARFDie child = getFirstChild();
375 if (RecurseDepth > 0 && child) {
376 while (child) {
Adrian Prantl318d1192017-06-06 23:28:45 +0000377 child.dump(OS, RecurseDepth-1, Indent+2, DumpOpts);
Greg Claytonc8c10322016-12-13 18:25:19 +0000378 child = child.getSibling();
379 }
380 }
381 } else {
382 OS << "Abbreviation code not found in 'debug_abbrev' class for code: "
383 << abbrCode << '\n';
384 }
385 } else {
386 OS.indent(Indent) << "NULL\n";
387 }
388 }
389}
390
Greg Clayton78a07bf2016-12-21 21:37:06 +0000391DWARFDie DWARFDie::getParent() const {
392 if (isValid())
393 return U->getParent(Die);
394 return DWARFDie();
395}
396
397DWARFDie DWARFDie::getSibling() const {
398 if (isValid())
399 return U->getSibling(Die);
400 return DWARFDie();
401}
Greg Clayton0e62ee72017-01-13 00:13:42 +0000402
403iterator_range<DWARFDie::attribute_iterator>
404DWARFDie::attributes() const {
405 return make_range(attribute_iterator(*this, false),
406 attribute_iterator(*this, true));
407}
408
409DWARFDie::attribute_iterator::attribute_iterator(DWARFDie D, bool End) :
410 Die(D), AttrValue(0), Index(0) {
411 auto AbbrDecl = Die.getAbbreviationDeclarationPtr();
412 assert(AbbrDecl && "Must have abbreviation declaration");
413 if (End) {
414 // This is the end iterator so we set the index to the attribute count.
415 Index = AbbrDecl->getNumAttributes();
416 } else {
417 // This is the begin iterator so we extract the value for this->Index.
418 AttrValue.Offset = D.getOffset() + AbbrDecl->getCodeByteSize();
419 updateForIndex(*AbbrDecl, 0);
420 }
421}
422
423void DWARFDie::attribute_iterator::updateForIndex(
424 const DWARFAbbreviationDeclaration &AbbrDecl, uint32_t I) {
425 Index = I;
Hiroshi Inoueddb34d82017-07-03 06:32:59 +0000426 // AbbrDecl must be valid before calling this function.
Greg Clayton0e62ee72017-01-13 00:13:42 +0000427 auto NumAttrs = AbbrDecl.getNumAttributes();
428 if (Index < NumAttrs) {
429 AttrValue.Attr = AbbrDecl.getAttrByIndex(Index);
430 // Add the previous byte size of any previous attribute value.
431 AttrValue.Offset += AttrValue.ByteSize;
432 AttrValue.Value.setForm(AbbrDecl.getFormByIndex(Index));
433 uint32_t ParseOffset = AttrValue.Offset;
434 auto U = Die.getDwarfUnit();
435 assert(U && "Die must have valid DWARF unit");
436 bool b = AttrValue.Value.extractValue(U->getDebugInfoExtractor(),
437 &ParseOffset, U);
438 (void)b;
439 assert(b && "extractValue cannot fail on fully parsed DWARF");
440 AttrValue.ByteSize = ParseOffset - AttrValue.Offset;
441 } else {
442 assert(Index == NumAttrs && "Indexes should be [0, NumAttrs) only");
443 AttrValue.clear();
444 }
445}
446
447DWARFDie::attribute_iterator &DWARFDie::attribute_iterator::operator++() {
448 if (auto AbbrDecl = Die.getAbbreviationDeclarationPtr())
449 updateForIndex(*AbbrDecl, Index + 1);
450 return *this;
451}