LLVM  15.0.0git
DIE.cpp
Go to the documentation of this file.
1 //===--- lib/CodeGen/DIE.cpp - DWARF Info Entries -------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // Data structures for DWARF info entries.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #include "llvm/CodeGen/DIE.h"
14 #include "DwarfCompileUnit.h"
15 #include "DwarfDebug.h"
17 #include "llvm/Config/llvm-config.h"
18 #include "llvm/MC/MCAsmInfo.h"
19 #include "llvm/MC/MCStreamer.h"
20 #include "llvm/MC/MCSymbol.h"
21 #include "llvm/Support/Debug.h"
23 #include "llvm/Support/Format.h"
24 #include "llvm/Support/LEB128.h"
26 using namespace llvm;
27 
28 #define DEBUG_TYPE "dwarfdebug"
29 
30 //===----------------------------------------------------------------------===//
31 // DIEAbbrevData Implementation
32 //===----------------------------------------------------------------------===//
33 
34 /// Profile - Used to gather unique data for the abbreviation folding set.
35 ///
37  // Explicitly cast to an integer type for which FoldingSetNodeID has
38  // overloads. Otherwise MSVC 2010 thinks this call is ambiguous.
39  ID.AddInteger(unsigned(Attribute));
40  ID.AddInteger(unsigned(Form));
41  if (Form == dwarf::DW_FORM_implicit_const)
42  ID.AddInteger(Value);
43 }
44 
45 //===----------------------------------------------------------------------===//
46 // DIEAbbrev Implementation
47 //===----------------------------------------------------------------------===//
48 
49 /// Profile - Used to gather unique data for the abbreviation folding set.
50 ///
52  ID.AddInteger(unsigned(Tag));
53  ID.AddInteger(unsigned(Children));
54 
55  // For each attribute description.
56  for (unsigned i = 0, N = Data.size(); i < N; ++i)
57  Data[i].Profile(ID);
58 }
59 
60 /// Emit - Print the abbreviation using the specified asm printer.
61 ///
62 void DIEAbbrev::Emit(const AsmPrinter *AP) const {
63  // Emit its Dwarf tag type.
64  AP->emitULEB128(Tag, dwarf::TagString(Tag).data());
65 
66  // Emit whether it has children DIEs.
67  AP->emitULEB128((unsigned)Children, dwarf::ChildrenString(Children).data());
68 
69  // For each attribute description.
70  for (unsigned i = 0, N = Data.size(); i < N; ++i) {
71  const DIEAbbrevData &AttrData = Data[i];
72 
73  // Emit attribute type.
74  AP->emitULEB128(AttrData.getAttribute(),
76 
77  // Emit form type.
78 #ifndef NDEBUG
79  // Could be an assertion, but this way we can see the failing form code
80  // easily, which helps track down where it came from.
81  if (!dwarf::isValidFormForVersion(AttrData.getForm(),
82  AP->getDwarfVersion())) {
83  LLVM_DEBUG(dbgs() << "Invalid form " << format("0x%x", AttrData.getForm())
84  << " for DWARF version " << AP->getDwarfVersion()
85  << "\n");
86  llvm_unreachable("Invalid form for specified DWARF version");
87  }
88 #endif
89  AP->emitULEB128(AttrData.getForm(),
90  dwarf::FormEncodingString(AttrData.getForm()).data());
91 
92  // Emit value for DW_FORM_implicit_const.
93  if (AttrData.getForm() == dwarf::DW_FORM_implicit_const)
94  AP->emitSLEB128(AttrData.getValue());
95  }
96 
97  // Mark end of abbreviation.
98  AP->emitULEB128(0, "EOM(1)");
99  AP->emitULEB128(0, "EOM(2)");
100 }
101 
104  O << "Abbreviation @"
105  << format("0x%lx", (long)(intptr_t)this)
106  << " "
108  << " "
109  << dwarf::ChildrenString(Children)
110  << '\n';
111 
112  for (unsigned i = 0, N = Data.size(); i < N; ++i) {
113  O << " "
114  << dwarf::AttributeString(Data[i].getAttribute())
115  << " "
116  << dwarf::FormEncodingString(Data[i].getForm());
117 
118  if (Data[i].getForm() == dwarf::DW_FORM_implicit_const)
119  O << " " << Data[i].getValue();
120 
121  O << '\n';
122  }
123 }
124 
125 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
127  print(dbgs());
128 }
129 #endif
130 
131 //===----------------------------------------------------------------------===//
132 // DIEAbbrevSet Implementation
133 //===----------------------------------------------------------------------===//
134 
136  for (DIEAbbrev *Abbrev : Abbreviations)
137  Abbrev->~DIEAbbrev();
138 }
139 
141 
143  DIEAbbrev Abbrev = Die.generateAbbrev();
144  Abbrev.Profile(ID);
145 
146  void *InsertPos;
147  if (DIEAbbrev *Existing =
148  AbbreviationsSet.FindNodeOrInsertPos(ID, InsertPos)) {
149  Die.setAbbrevNumber(Existing->getNumber());
150  return *Existing;
151  }
152 
153  // Move the abbreviation to the heap and assign a number.
154  DIEAbbrev *New = new (Alloc) DIEAbbrev(std::move(Abbrev));
155  Abbreviations.push_back(New);
156  New->setNumber(Abbreviations.size());
157  Die.setAbbrevNumber(Abbreviations.size());
158 
159  // Store it for lookup.
160  AbbreviationsSet.InsertNode(New, InsertPos);
161  return *New;
162 }
163 
164 void DIEAbbrevSet::Emit(const AsmPrinter *AP, MCSection *Section) const {
165  if (!Abbreviations.empty()) {
166  // Start the debug abbrev section.
167  AP->OutStreamer->switchSection(Section);
168  AP->emitDwarfAbbrevs(Abbreviations);
169  }
170 }
171 
172 //===----------------------------------------------------------------------===//
173 // DIE Implementation
174 //===----------------------------------------------------------------------===//
175 
176 DIE *DIE::getParent() const {
177  return Owner.dyn_cast<DIE*>();
178 }
179 
181  DIEAbbrev Abbrev(Tag, hasChildren());
182  for (const DIEValue &V : values())
183  if (V.getForm() == dwarf::DW_FORM_implicit_const)
184  Abbrev.AddImplicitConstAttribute(V.getAttribute(),
185  V.getDIEInteger().getValue());
186  else
187  Abbrev.AddAttribute(V.getAttribute(), V.getForm());
188  return Abbrev;
189 }
190 
192  const DIEUnit *Unit = getUnit();
193  assert(Unit && "DIE must be owned by a DIEUnit to get its absolute offset");
194  return Unit->getDebugSectionOffset() + getOffset();
195 }
196 
197 const DIE *DIE::getUnitDie() const {
198  const DIE *p = this;
199  while (p) {
200  if (p->getTag() == dwarf::DW_TAG_compile_unit ||
201  p->getTag() == dwarf::DW_TAG_skeleton_unit ||
202  p->getTag() == dwarf::DW_TAG_type_unit)
203  return p;
204  p = p->getParent();
205  }
206  return nullptr;
207 }
208 
210  const DIE *UnitDie = getUnitDie();
211  if (UnitDie)
212  return UnitDie->Owner.dyn_cast<DIEUnit*>();
213  return nullptr;
214 }
215 
217  // Iterate through all the attributes until we find the one we're
218  // looking for, if we can't find it return NULL.
219  for (const auto &V : values())
220  if (V.getAttribute() == Attribute)
221  return V;
222  return DIEValue();
223 }
224 
226 static void printValues(raw_ostream &O, const DIEValueList &Values,
227  StringRef Type, unsigned Size, unsigned IndentCount) {
228  O << Type << ": Size: " << Size << "\n";
229 
230  unsigned I = 0;
231  const std::string Indent(IndentCount, ' ');
232  for (const auto &V : Values.values()) {
233  O << Indent;
234  O << "Blk[" << I++ << "]";
235  O << " " << dwarf::FormEncodingString(V.getForm()) << " ";
236  V.print(O);
237  O << "\n";
238  }
239 }
240 
242 void DIE::print(raw_ostream &O, unsigned IndentCount) const {
243  const std::string Indent(IndentCount, ' ');
244  O << Indent << "Die: " << format("0x%lx", (long)(intptr_t) this)
245  << ", Offset: " << Offset << ", Size: " << Size << "\n";
246 
247  O << Indent << dwarf::TagString(getTag()) << " "
248  << dwarf::ChildrenString(hasChildren()) << "\n";
249 
250  IndentCount += 2;
251  for (const auto &V : values()) {
252  O << Indent;
253  O << dwarf::AttributeString(V.getAttribute());
254  O << " " << dwarf::FormEncodingString(V.getForm()) << " ";
255  V.print(O);
256  O << "\n";
257  }
258  IndentCount -= 2;
259 
260  for (const auto &Child : children())
261  Child.print(O, IndentCount + 4);
262 
263  O << "\n";
264 }
265 
266 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
268  print(dbgs());
269 }
270 #endif
271 
273  DIEAbbrevSet &AbbrevSet,
274  unsigned CUOffset) {
275  // Unique the abbreviation and fill in the abbreviation number so this DIE
276  // can be emitted.
277  const DIEAbbrev &Abbrev = AbbrevSet.uniqueAbbreviation(*this);
278 
279  // Set compile/type unit relative offset of this DIE.
280  setOffset(CUOffset);
281 
282  // Add the byte size of the abbreviation code.
283  CUOffset += getULEB128Size(getAbbrevNumber());
284 
285  // Add the byte size of all the DIE attribute values.
286  for (const auto &V : values())
287  CUOffset += V.sizeOf(FormParams);
288 
289  // Let the children compute their offsets and abbreviation numbers.
290  if (hasChildren()) {
291  (void)Abbrev;
292  assert(Abbrev.hasChildren() && "Children flag not set");
293 
294  for (auto &Child : children())
295  CUOffset =
296  Child.computeOffsetsAndAbbrevs(FormParams, AbbrevSet, CUOffset);
297 
298  // Each child chain is terminated with a zero byte, adjust the offset.
299  CUOffset += sizeof(int8_t);
300  }
301 
302  // Compute the byte size of this DIE and all of its children correctly. This
303  // is needed so that top level DIE can help the compile unit set its length
304  // correctly.
305  setSize(CUOffset - getOffset());
306  return CUOffset;
307 }
308 
309 //===----------------------------------------------------------------------===//
310 // DIEUnit Implementation
311 //===----------------------------------------------------------------------===//
312 DIEUnit::DIEUnit(dwarf::Tag UnitTag) : Die(UnitTag) {
313  Die.Owner = this;
314  assert((UnitTag == dwarf::DW_TAG_compile_unit ||
315  UnitTag == dwarf::DW_TAG_skeleton_unit ||
316  UnitTag == dwarf::DW_TAG_type_unit ||
317  UnitTag == dwarf::DW_TAG_partial_unit) &&
318  "expected a unit TAG");
319 }
320 
321 void DIEValue::emitValue(const AsmPrinter *AP) const {
322  switch (Ty) {
323  case isNone:
324  llvm_unreachable("Expected valid DIEValue");
325 #define HANDLE_DIEVALUE(T) \
326  case is##T: \
327  getDIE##T().emitValue(AP, Form); \
328  break;
329 #include "llvm/CodeGen/DIEValue.def"
330  }
331 }
332 
334  switch (Ty) {
335  case isNone:
336  llvm_unreachable("Expected valid DIEValue");
337 #define HANDLE_DIEVALUE(T) \
338  case is##T: \
339  return getDIE##T().sizeOf(FormParams, Form);
340 #include "llvm/CodeGen/DIEValue.def"
341  }
342  llvm_unreachable("Unknown DIE kind");
343 }
344 
347  switch (Ty) {
348  case isNone:
349  llvm_unreachable("Expected valid DIEValue");
350 #define HANDLE_DIEVALUE(T) \
351  case is##T: \
352  getDIE##T().print(O); \
353  break;
354 #include "llvm/CodeGen/DIEValue.def"
355  }
356 }
357 
358 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
360  print(dbgs());
361 }
362 #endif
363 
364 //===----------------------------------------------------------------------===//
365 // DIEInteger Implementation
366 //===----------------------------------------------------------------------===//
367 
368 /// EmitValue - Emit integer of appropriate size.
369 ///
371  switch (Form) {
372  case dwarf::DW_FORM_implicit_const:
373  case dwarf::DW_FORM_flag_present:
374  // Emit something to keep the lines and comments in sync.
375  // FIXME: Is there a better way to do this?
376  Asm->OutStreamer->addBlankLine();
377  return;
378  case dwarf::DW_FORM_flag:
379  case dwarf::DW_FORM_ref1:
380  case dwarf::DW_FORM_data1:
381  case dwarf::DW_FORM_strx1:
382  case dwarf::DW_FORM_addrx1:
383  case dwarf::DW_FORM_ref2:
384  case dwarf::DW_FORM_data2:
385  case dwarf::DW_FORM_strx2:
386  case dwarf::DW_FORM_addrx2:
387  case dwarf::DW_FORM_strx3:
388  case dwarf::DW_FORM_strp:
389  case dwarf::DW_FORM_ref4:
390  case dwarf::DW_FORM_data4:
391  case dwarf::DW_FORM_ref_sup4:
392  case dwarf::DW_FORM_strx4:
393  case dwarf::DW_FORM_addrx4:
394  case dwarf::DW_FORM_ref8:
395  case dwarf::DW_FORM_ref_sig8:
396  case dwarf::DW_FORM_data8:
397  case dwarf::DW_FORM_ref_sup8:
398  case dwarf::DW_FORM_GNU_ref_alt:
399  case dwarf::DW_FORM_GNU_strp_alt:
400  case dwarf::DW_FORM_line_strp:
401  case dwarf::DW_FORM_sec_offset:
402  case dwarf::DW_FORM_strp_sup:
403  case dwarf::DW_FORM_addr:
404  case dwarf::DW_FORM_ref_addr:
405  Asm->OutStreamer->emitIntValue(Integer,
406  sizeOf(Asm->getDwarfFormParams(), Form));
407  return;
408  case dwarf::DW_FORM_GNU_str_index:
409  case dwarf::DW_FORM_GNU_addr_index:
410  case dwarf::DW_FORM_ref_udata:
411  case dwarf::DW_FORM_strx:
412  case dwarf::DW_FORM_addrx:
413  case dwarf::DW_FORM_rnglistx:
414  case dwarf::DW_FORM_udata:
415  Asm->emitULEB128(Integer);
416  return;
417  case dwarf::DW_FORM_sdata:
418  Asm->emitSLEB128(Integer);
419  return;
420  default: llvm_unreachable("DIE Value form not supported yet");
421  }
422 }
423 
424 /// sizeOf - Determine size of integer value in bytes.
425 ///
427  dwarf::Form Form) const {
428  if (Optional<uint8_t> FixedSize =
430  return *FixedSize;
431 
432  switch (Form) {
433  case dwarf::DW_FORM_GNU_str_index:
434  case dwarf::DW_FORM_GNU_addr_index:
435  case dwarf::DW_FORM_ref_udata:
436  case dwarf::DW_FORM_strx:
437  case dwarf::DW_FORM_addrx:
438  case dwarf::DW_FORM_rnglistx:
439  case dwarf::DW_FORM_udata:
440  return getULEB128Size(Integer);
441  case dwarf::DW_FORM_sdata:
442  return getSLEB128Size(Integer);
443  default: llvm_unreachable("DIE Value form not supported yet");
444  }
445 }
446 
449  O << "Int: " << (int64_t)Integer << " 0x";
450  O.write_hex(Integer);
451 }
452 
453 //===----------------------------------------------------------------------===//
454 // DIEExpr Implementation
455 //===----------------------------------------------------------------------===//
456 
457 /// EmitValue - Emit expression value.
458 ///
460  AP->emitDebugValue(Expr, sizeOf(AP->getDwarfFormParams(), Form));
461 }
462 
463 /// SizeOf - Determine size of expression value in bytes.
464 ///
466  dwarf::Form Form) const {
467  switch (Form) {
468  case dwarf::DW_FORM_data4:
469  return 4;
470  case dwarf::DW_FORM_data8:
471  return 8;
472  case dwarf::DW_FORM_sec_offset:
474  default:
475  llvm_unreachable("DIE Value form not supported yet");
476  }
477 }
478 
480 void DIEExpr::print(raw_ostream &O) const { O << "Expr: " << *Expr; }
481 
482 //===----------------------------------------------------------------------===//
483 // DIELabel Implementation
484 //===----------------------------------------------------------------------===//
485 
486 /// EmitValue - Emit label value.
487 ///
489  bool IsSectionRelative = Form != dwarf::DW_FORM_addr;
491  IsSectionRelative);
492 }
493 
494 /// sizeOf - Determine size of label value in bytes.
495 ///
497  dwarf::Form Form) const {
498  switch (Form) {
499  case dwarf::DW_FORM_data4:
500  return 4;
501  case dwarf::DW_FORM_data8:
502  return 8;
503  case dwarf::DW_FORM_sec_offset:
504  case dwarf::DW_FORM_strp:
506  case dwarf::DW_FORM_addr:
507  return FormParams.AddrSize;
508  default:
509  llvm_unreachable("DIE Value form not supported yet");
510  }
511 }
512 
514 void DIELabel::print(raw_ostream &O) const { O << "Lbl: " << Label->getName(); }
515 
516 //===----------------------------------------------------------------------===//
517 // DIEBaseTypeRef Implementation
518 //===----------------------------------------------------------------------===//
519 
521  uint64_t Offset = CU->ExprRefedBaseTypes[Index].Die->getOffset();
522  assert(Offset < (1ULL << (ULEB128PadSize * 7)) && "Offset wont fit");
523  AP->emitULEB128(Offset, nullptr, ULEB128PadSize);
524 }
525 
527  return ULEB128PadSize;
528 }
529 
531 void DIEBaseTypeRef::print(raw_ostream &O) const { O << "BaseTypeRef: " << Index; }
532 
533 //===----------------------------------------------------------------------===//
534 // DIEDelta Implementation
535 //===----------------------------------------------------------------------===//
536 
537 /// EmitValue - Emit delta value.
538 ///
540  AP->emitLabelDifference(LabelHi, LabelLo,
541  sizeOf(AP->getDwarfFormParams(), Form));
542 }
543 
544 /// SizeOf - Determine size of delta value in bytes.
545 ///
547  dwarf::Form Form) const {
548  switch (Form) {
549  case dwarf::DW_FORM_data4:
550  return 4;
551  case dwarf::DW_FORM_data8:
552  return 8;
553  case dwarf::DW_FORM_sec_offset:
555  default:
556  llvm_unreachable("DIE Value form not supported yet");
557  }
558 }
559 
562  O << "Del: " << LabelHi->getName() << "-" << LabelLo->getName();
563 }
564 
565 //===----------------------------------------------------------------------===//
566 // DIEString Implementation
567 //===----------------------------------------------------------------------===//
568 
569 /// EmitValue - Emit string value.
570 ///
572  // Index of string in symbol table.
573  switch (Form) {
574  case dwarf::DW_FORM_GNU_str_index:
575  case dwarf::DW_FORM_strx:
576  case dwarf::DW_FORM_strx1:
577  case dwarf::DW_FORM_strx2:
578  case dwarf::DW_FORM_strx3:
579  case dwarf::DW_FORM_strx4:
580  DIEInteger(S.getIndex()).emitValue(AP, Form);
581  return;
582  case dwarf::DW_FORM_strp:
584  DIELabel(S.getSymbol()).emitValue(AP, Form);
585  else
587  return;
588  default:
589  llvm_unreachable("Expected valid string form");
590  }
591 }
592 
593 /// sizeOf - Determine size of delta value in bytes.
594 ///
596  dwarf::Form Form) const {
597  // Index of string in symbol table.
598  switch (Form) {
599  case dwarf::DW_FORM_GNU_str_index:
600  case dwarf::DW_FORM_strx:
601  case dwarf::DW_FORM_strx1:
602  case dwarf::DW_FORM_strx2:
603  case dwarf::DW_FORM_strx3:
604  case dwarf::DW_FORM_strx4:
605  return DIEInteger(S.getIndex()).sizeOf(FormParams, Form);
606  case dwarf::DW_FORM_strp:
608  return DIELabel(S.getSymbol()).sizeOf(FormParams, Form);
609  return DIEInteger(S.getOffset()).sizeOf(FormParams, Form);
610  default:
611  llvm_unreachable("Expected valid string form");
612  }
613 }
614 
617  O << "String: " << S.getString();
618 }
619 
620 //===----------------------------------------------------------------------===//
621 // DIEInlineString Implementation
622 //===----------------------------------------------------------------------===//
624  if (Form == dwarf::DW_FORM_string) {
625  AP->OutStreamer->emitBytes(S);
626  AP->emitInt8(0);
627  return;
628  }
629  llvm_unreachable("Expected valid string form");
630 }
631 
633  // Emit string bytes + NULL byte.
634  return S.size() + 1;
635 }
636 
639  O << "InlineString: " << S;
640 }
641 
642 //===----------------------------------------------------------------------===//
643 // DIEEntry Implementation
644 //===----------------------------------------------------------------------===//
645 
646 /// EmitValue - Emit debug information entry offset.
647 ///
649 
650  switch (Form) {
651  case dwarf::DW_FORM_ref1:
652  case dwarf::DW_FORM_ref2:
653  case dwarf::DW_FORM_ref4:
654  case dwarf::DW_FORM_ref8:
655  AP->OutStreamer->emitIntValue(Entry->getOffset(),
656  sizeOf(AP->getDwarfFormParams(), Form));
657  return;
658 
659  case dwarf::DW_FORM_ref_udata:
660  AP->emitULEB128(Entry->getOffset());
661  return;
662 
663  case dwarf::DW_FORM_ref_addr: {
664  // Get the absolute offset for this DIE within the debug info/types section.
666  if (const MCSymbol *SectionSym =
668  AP->emitLabelPlusOffset(SectionSym, Addr,
669  sizeOf(AP->getDwarfFormParams(), Form), true);
670  return;
671  }
672 
673  AP->OutStreamer->emitIntValue(Addr, sizeOf(AP->getDwarfFormParams(), Form));
674  return;
675  }
676  default:
677  llvm_unreachable("Improper form for DIE reference");
678  }
679 }
680 
682  dwarf::Form Form) const {
683  switch (Form) {
684  case dwarf::DW_FORM_ref1:
685  return 1;
686  case dwarf::DW_FORM_ref2:
687  return 2;
688  case dwarf::DW_FORM_ref4:
689  return 4;
690  case dwarf::DW_FORM_ref8:
691  return 8;
692  case dwarf::DW_FORM_ref_udata:
693  return getULEB128Size(Entry->getOffset());
694  case dwarf::DW_FORM_ref_addr:
696 
697  default:
698  llvm_unreachable("Improper form for DIE reference");
699  }
700 }
701 
704  O << format("Die: 0x%lx", (long)(intptr_t)&Entry);
705 }
706 
707 //===----------------------------------------------------------------------===//
708 // DIELoc Implementation
709 //===----------------------------------------------------------------------===//
710 
712  if (!Size) {
713  for (const auto &V : values())
714  Size += V.sizeOf(FormParams);
715  }
716 
717  return Size;
718 }
719 
720 /// EmitValue - Emit location data.
721 ///
723  switch (Form) {
724  default: llvm_unreachable("Improper form for block");
725  case dwarf::DW_FORM_block1: Asm->emitInt8(Size); break;
726  case dwarf::DW_FORM_block2: Asm->emitInt16(Size); break;
727  case dwarf::DW_FORM_block4: Asm->emitInt32(Size); break;
728  case dwarf::DW_FORM_block:
729  case dwarf::DW_FORM_exprloc:
730  Asm->emitULEB128(Size);
731  break;
732  }
733 
734  for (const auto &V : values())
735  V.emitValue(Asm);
736 }
737 
738 /// sizeOf - Determine size of location data in bytes.
739 ///
741  switch (Form) {
742  case dwarf::DW_FORM_block1: return Size + sizeof(int8_t);
743  case dwarf::DW_FORM_block2: return Size + sizeof(int16_t);
744  case dwarf::DW_FORM_block4: return Size + sizeof(int32_t);
745  case dwarf::DW_FORM_block:
746  case dwarf::DW_FORM_exprloc:
747  return Size + getULEB128Size(Size);
748  default: llvm_unreachable("Improper form for block");
749  }
750 }
751 
754  printValues(O, *this, "ExprLoc", Size, 5);
755 }
756 
757 //===----------------------------------------------------------------------===//
758 // DIEBlock Implementation
759 //===----------------------------------------------------------------------===//
760 
762  if (!Size) {
763  for (const auto &V : values())
764  Size += V.sizeOf(FormParams);
765  }
766 
767  return Size;
768 }
769 
770 /// EmitValue - Emit block data.
771 ///
773  switch (Form) {
774  default: llvm_unreachable("Improper form for block");
775  case dwarf::DW_FORM_block1: Asm->emitInt8(Size); break;
776  case dwarf::DW_FORM_block2: Asm->emitInt16(Size); break;
777  case dwarf::DW_FORM_block4: Asm->emitInt32(Size); break;
778  case dwarf::DW_FORM_exprloc:
779  case dwarf::DW_FORM_block:
780  Asm->emitULEB128(Size);
781  break;
782  case dwarf::DW_FORM_string: break;
783  case dwarf::DW_FORM_data16: break;
784  }
785 
786  for (const auto &V : values())
787  V.emitValue(Asm);
788 }
789 
790 /// sizeOf - Determine size of block data in bytes.
791 ///
793  switch (Form) {
794  case dwarf::DW_FORM_block1: return Size + sizeof(int8_t);
795  case dwarf::DW_FORM_block2: return Size + sizeof(int16_t);
796  case dwarf::DW_FORM_block4: return Size + sizeof(int32_t);
797  case dwarf::DW_FORM_exprloc:
798  case dwarf::DW_FORM_block: return Size + getULEB128Size(Size);
799  case dwarf::DW_FORM_data16: return 16;
800  default: llvm_unreachable("Improper form for block");
801  }
802 }
803 
806  printValues(O, *this, "Blk", Size, 5);
807 }
808 
809 //===----------------------------------------------------------------------===//
810 // DIELocList Implementation
811 //===----------------------------------------------------------------------===//
812 
814  dwarf::Form Form) const {
815  switch (Form) {
816  case dwarf::DW_FORM_loclistx:
817  return getULEB128Size(Index);
818  case dwarf::DW_FORM_data4:
820  "DW_FORM_data4 is not suitable to emit a pointer to a location list "
821  "in the 64-bit DWARF format");
822  return 4;
823  case dwarf::DW_FORM_data8:
825  "DW_FORM_data8 is not suitable to emit a pointer to a location list "
826  "in the 32-bit DWARF format");
827  return 8;
828  case dwarf::DW_FORM_sec_offset:
830  default:
831  llvm_unreachable("DIE Value form not supported yet");
832  }
833 }
834 
835 /// EmitValue - Emit label value.
836 ///
838  if (Form == dwarf::DW_FORM_loclistx) {
839  AP->emitULEB128(Index);
840  return;
841  }
842  DwarfDebug *DD = AP->getDwarfDebug();
843  MCSymbol *Label = DD->getDebugLocs().getList(Index).Label;
844  AP->emitDwarfSymbolReference(Label, /*ForceOffset*/ DD->useSplitDwarf());
845 }
846 
848 void DIELocList::print(raw_ostream &O) const { O << "LocList: " << Index; }
849 
850 //===----------------------------------------------------------------------===//
851 // DIEAddrOffset Implementation
852 //===----------------------------------------------------------------------===//
853 
855  dwarf::Form) const {
856  return Addr.sizeOf(FormParams, dwarf::DW_FORM_addrx) +
857  Offset.sizeOf(FormParams, dwarf::DW_FORM_data4);
858 }
859 
860 /// EmitValue - Emit label value.
861 ///
863  Addr.emitValue(AP, dwarf::DW_FORM_addrx);
864  Offset.emitValue(AP, dwarf::DW_FORM_data4);
865 }
866 
869  O << "AddrOffset: ";
870  Addr.print(O);
871  O << " + ";
872  Offset.print(O);
873 }
i
i
Definition: README.txt:29
llvm::DIEAbbrevData::getForm
dwarf::Form getForm() const
Definition: DIE.h:68
AsmPrinter.h
llvm::DIEAbbrev::print
void print(raw_ostream &O) const
Definition: DIE.cpp:103
llvm::DIE::setOffset
void setOffset(unsigned O)
Definition: DIE.h:850
llvm::DIEExpr::sizeOf
unsigned sizeOf(const dwarf::FormParams &FormParams, dwarf::Form Form) const
SizeOf - Determine size of expression value in bytes.
Definition: DIE.cpp:465
llvm::DIEValue::print
void print(raw_ostream &O) const
Definition: DIE.cpp:346
llvm::AsmPrinter::emitLabelDifference
void emitLabelDifference(const MCSymbol *Hi, const MCSymbol *Lo, unsigned Size) const
Emit something like ".long Hi-Lo" where the size in bytes of the directive is specified by Size and H...
Definition: AsmPrinter.cpp:2635
llvm::DIELabel::emitValue
void emitValue(const AsmPrinter *AP, dwarf::Form Form) const
EmitValue - Emit label value.
Definition: DIE.cpp:488
LLVM_DUMP_METHOD
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
Definition: Compiler.h:494
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:17
llvm::DebugLocStream::List::Label
MCSymbol * Label
Definition: DebugLocStream.h:35
llvm::MCSymbol
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:41
intptr_t
llvm::DebugLocStream::getList
const List & getList(size_t LI) const
Definition: DebugLocStream.h:61
llvm::AsmPrinter::emitULEB128
void emitULEB128(uint64_t Value, const char *Desc=nullptr, unsigned PadTo=0) const
Emit the specified unsigned leb128 value.
Definition: AsmPrinterDwarf.cpp:43
llvm::AsmPrinter::getDwarfDebug
DwarfDebug * getDwarfDebug()
Definition: AsmPrinter.h:234
llvm::Attribute
Definition: Attributes.h:65
llvm::DIEAbbrev::Profile
void Profile(FoldingSetNodeID &ID) const
Used to gather unique data for the abbreviation folding set.
Definition: DIE.cpp:51
llvm::AsmPrinter::MAI
const MCAsmInfo * MAI
Target Asm Printer information.
Definition: AsmPrinter.h:87
llvm::DIEValue
Definition: DIE.h:369
llvm::DIEUnit
Represents a compile or type unit.
Definition: DIE.h:880
llvm::DIE::print
void print(raw_ostream &O, unsigned IndentCount=0) const
Definition: DIE.cpp:242
llvm::DIEAbbrevSet::uniqueAbbreviation
DIEAbbrev & uniqueAbbreviation(DIE &Die)
Generate the abbreviation declaration for a DIE and return a pointer to the generated abbreviation.
Definition: DIE.cpp:140
llvm::dwarf::Form
Form
Definition: Dwarf.h:132
llvm::DIEAddrOffset::emitValue
void emitValue(const AsmPrinter *AP, dwarf::Form Form) const
EmitValue - Emit label value.
Definition: DIE.cpp:862
ErrorHandling.h
llvm::AsmPrinter::emitSLEB128
void emitSLEB128(int64_t Value, const char *Desc=nullptr) const
Emit the specified signed leb128 value.
Definition: AsmPrinterDwarf.cpp:36
llvm::DIEUnit::getCrossSectionRelativeBaseAddress
virtual const MCSymbol * getCrossSectionRelativeBaseAddress() const
Definition: DIE.h:909
llvm::DIEDelta::sizeOf
unsigned sizeOf(const dwarf::FormParams &FormParams, dwarf::Form Form) const
SizeOf - Determine size of delta value in bytes.
Definition: DIE.cpp:546
llvm::DIELoc::sizeOf
unsigned sizeOf(const dwarf::FormParams &, dwarf::Form Form) const
sizeOf - Determine size of location data in bytes.
Definition: DIE.cpp:740
llvm::DIE::getUnitDie
const DIE * getUnitDie() const
Climb up the parent chain to get the compile unit or type unit DIE that this DIE belongs to.
Definition: DIE.cpp:197
llvm::getULEB128Size
unsigned getULEB128Size(uint64_t Value)
Utility function to get the size of the ULEB128-encoded value.
Definition: LEB128.cpp:19
llvm::Type
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:45
llvm::dwarf::FormParams::AddrSize
uint8_t AddrSize
Definition: Dwarf.h:655
llvm::DIEAbbrevData::getAttribute
dwarf::Attribute getAttribute() const
Accessors.
Definition: DIE.h:67
llvm::Optional< uint8_t >
llvm::DIEBlock::computeSize
unsigned computeSize(const dwarf::FormParams &FormParams) const
Calculate the size of the location expression.
Definition: DIE.cpp:761
llvm::DIEAbbrev::AddAttribute
void AddAttribute(dwarf::Attribute Attribute, dwarf::Form Form)
Adds another set of attribute information to the abbreviation.
Definition: DIE.h:109
llvm::DIE
A structured debug information entry.
Definition: DIE.h:739
llvm::DIEBlock::sizeOf
unsigned sizeOf(const dwarf::FormParams &, dwarf::Form Form) const
sizeOf - Determine size of block data in bytes.
Definition: DIE.cpp:792
llvm::AsmPrinter::emitLabelReference
void emitLabelReference(const MCSymbol *Label, unsigned Size, bool IsSectionRelative=false) const
Emit something like ".long Label" where the size in bytes of the directive is specified by Size and L...
Definition: AsmPrinter.h:632
llvm::DIE::getTag
dwarf::Tag getTag() const
Definition: DIE.h:775
llvm::dwarf::Tag
Tag
Definition: Dwarf.h:105
llvm::DIEEntry::emitValue
void emitValue(const AsmPrinter *AP, dwarf::Form Form) const
EmitValue - Emit debug information entry offset.
Definition: DIE.cpp:648
Format.h
llvm::DIEDelta::print
void print(raw_ostream &O) const
Definition: DIE.cpp:561
llvm::dwarf::FormParams::Format
DwarfFormat Format
Definition: Dwarf.h:656
llvm::DIE::computeOffsetsAndAbbrevs
unsigned computeOffsetsAndAbbrevs(const dwarf::FormParams &FormParams, DIEAbbrevSet &AbbrevSet, unsigned CUOffset)
Compute the offset of this DIE and all its children.
Definition: DIE.cpp:272
p
the resulting code requires compare and branches when and if * p
Definition: README.txt:396
LLVM_DEBUG
#define LLVM_DEBUG(X)
Definition: Debug.h:101
llvm::dwarf::Attribute
Attribute
Attributes.
Definition: Dwarf.h:125
llvm::DIEAbbrev::AddImplicitConstAttribute
void AddImplicitConstAttribute(dwarf::Attribute Attribute, int64_t Value)
Adds attribute with DW_FORM_implicit_const value.
Definition: DIE.h:114
llvm::DIEInlineString::sizeOf
unsigned sizeOf(const dwarf::FormParams &, dwarf::Form) const
Definition: DIE.cpp:632
llvm::DIELocList::emitValue
void emitValue(const AsmPrinter *AP, dwarf::Form Form) const
EmitValue - Emit label value.
Definition: DIE.cpp:837
llvm::DIEValueList::values
value_range values()
Definition: DIE.h:727
llvm::dbgs
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
Definition: Debug.cpp:163
llvm::DIEValue::dump
void dump() const
Definition: DIE.cpp:359
llvm::DIEAbbrev
Dwarf abbreviation, describes the organization of a debug information object.
Definition: DIE.h:79
llvm::DIEExpr::print
void print(raw_ostream &O) const
Definition: DIE.cpp:480
llvm::AsmPrinter::OutStreamer
std::unique_ptr< MCStreamer > OutStreamer
This is the MCStreamer object for the file we are generating.
Definition: AsmPrinter.h:96
llvm::DIEAbbrev::Emit
void Emit(const AsmPrinter *AP) const
Print the abbreviation using the specified asm printer.
Definition: DIE.cpp:62
MCSymbol.h
llvm::DIEBaseTypeRef::emitValue
void emitValue(const AsmPrinter *AP, dwarf::Form Form) const
EmitValue - Emit base type reference.
Definition: DIE.cpp:520
llvm::DIEInlineString::emitValue
void emitValue(const AsmPrinter *AP, dwarf::Form Form) const
Definition: DIE.cpp:623
llvm::dwarf::Index
Index
Definition: Dwarf.h:472
llvm::DIE::dump
void dump() const
Definition: DIE.cpp:267
llvm::DIEAbbrevData
Dwarf abbreviation data, describes one attribute of a Dwarf abbreviation.
Definition: DIE.h:49
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:54
llvm::DIELabel::sizeOf
unsigned sizeOf(const dwarf::FormParams &FormParams, dwarf::Form Form) const
sizeOf - Determine size of label value in bytes.
Definition: DIE.cpp:496
llvm::DIEAbbrevSet::~DIEAbbrevSet
~DIEAbbrevSet()
Definition: DIE.cpp:135
llvm::DIEInteger
An integer value DIE.
Definition: DIE.h:163
llvm::MCSymbol::getName
StringRef getName() const
getName - Get the symbol name.
Definition: MCSymbol.h:198
llvm::DIEAbbrevSet::Emit
void Emit(const AsmPrinter *AP, MCSection *Section) const
Print all abbreviations using the specified asm printer.
Definition: DIE.cpp:164
DwarfDebug.h
llvm::AsmPrinter::emitDwarfAbbrevs
void emitDwarfAbbrevs(const T &Abbrevs) const
Emit Dwarf abbreviation table.
Definition: AsmPrinter.h:719
llvm::DIELocList::sizeOf
unsigned sizeOf(const dwarf::FormParams &FormParams, dwarf::Form Form) const
Definition: DIE.cpp:813
llvm::AsmPrinter::emitDwarfSymbolReference
void emitDwarfSymbolReference(const MCSymbol *Label, bool ForceOffset=false) const
Emit a reference to a symbol for use in dwarf.
Definition: AsmPrinterDwarf.cpp:154
llvm::DIEEntry::sizeOf
unsigned sizeOf(const dwarf::FormParams &FormParams, dwarf::Form Form) const
Definition: DIE.cpp:681
llvm::AsmPrinter::emitInt8
void emitInt8(int Value) const
Emit a byte directive and value.
Definition: AsmPrinter.cpp:2619
llvm::DIEAbbrevData::Profile
void Profile(FoldingSetNodeID &ID) const
Used to gather unique data for the abbreviation folding set.
Definition: DIE.cpp:36
llvm::DIEBaseTypeRef::print
void print(raw_ostream &O) const
Definition: DIE.cpp:531
llvm::DIE::getDebugSectionOffset
uint64_t getDebugSectionOffset() const
Get the absolute offset within the .debug_info or .debug_types section for this DIE.
Definition: DIE.cpp:191
llvm::DwarfStringPoolEntryRef::getString
StringRef getString() const
Definition: DwarfStringPoolEntry.h:53
llvm::DIE::setSize
void setSize(unsigned S)
Definition: DIE.h:851
llvm::CallingConv::ID
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
Definition: CallingConv.h:24
llvm::dwarf::FormEncodingString
StringRef FormEncodingString(unsigned Encoding)
Definition: Dwarf.cpp:105
DIE.h
llvm::DIELocList::print
void print(raw_ostream &O) const
Definition: DIE.cpp:848
llvm::DIEExpr::emitValue
void emitValue(const AsmPrinter *AP, dwarf::Form Form) const
EmitValue - Emit expression value.
Definition: DIE.cpp:459
llvm::DIELoc::emitValue
void emitValue(const AsmPrinter *Asm, dwarf::Form Form) const
EmitValue - Emit location data.
Definition: DIE.cpp:722
llvm::DIE::generateAbbrev
DIEAbbrev generateAbbrev() const
Generate the abbreviation for this DIE.
Definition: DIE.cpp:180
llvm::DIEUnit::DIEUnit
DIEUnit(dwarf::Tag UnitTag)
Definition: DIE.cpp:312
llvm::DIEString::emitValue
void emitValue(const AsmPrinter *AP, dwarf::Form Form) const
EmitValue - Emit string value.
Definition: DIE.cpp:571
llvm::DIEDelta::emitValue
void emitValue(const AsmPrinter *AP, dwarf::Form Form) const
EmitValue - Emit delta value.
Definition: DIE.cpp:539
llvm::DIEString::sizeOf
unsigned sizeOf(const dwarf::FormParams &FormParams, dwarf::Form Form) const
sizeOf - Determine size of delta value in bytes.
Definition: DIE.cpp:595
llvm::RISCVFenceField::O
@ O
Definition: RISCVBaseInfo.h:239
llvm::DIEBlock::emitValue
void emitValue(const AsmPrinter *Asm, dwarf::Form Form) const
EmitValue - Emit block data.
Definition: DIE.cpp:772
llvm::DwarfDebug
Collects and handles dwarf debug information.
Definition: DwarfDebug.h:294
llvm::AsmPrinter::emitLabelPlusOffset
void emitLabelPlusOffset(const MCSymbol *Label, uint64_t Offset, unsigned Size, bool IsSectionRelative=false) const
Emit something like ".long Label+Offset" where the size in bytes of the directive is specified by Siz...
Definition: AsmPrinter.cpp:2643
uint64_t
Addr
uint64_t Addr
Definition: ELFObjHandler.cpp:78
llvm::dwarf::FormParams::DwarfUsesRelocationsAcrossSections
bool DwarfUsesRelocationsAcrossSections
True if DWARF v2 output generally uses relocations for references to other .debug_* sections.
Definition: Dwarf.h:659
LEB128.h
move
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
Definition: README.txt:546
llvm::DwarfDebug::useSplitDwarf
bool useSplitDwarf() const
Returns whether or not to change the current debug info for the split dwarf proposal support.
Definition: DwarfDebug.h:735
I
#define I(x, y, z)
Definition: MD5.cpp:58
llvm::DIE::getParent
DIE * getParent() const
Definition: DIE.cpp:176
llvm::DwarfStringPoolEntryRef::getOffset
uint64_t getOffset() const
Definition: DwarfStringPoolEntry.h:48
llvm::dwarf::FormParams
A helper struct providing information about the byte size of DW_FORM values that vary in size dependi...
Definition: Dwarf.h:653
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::dwarf::FormParams::getDwarfOffsetByteSize
uint8_t getDwarfOffsetByteSize() const
The size of a reference is determined by the DWARF 32/64-bit format.
Definition: Dwarf.h:671
llvm::DIEInteger::emitValue
void emitValue(const AsmPrinter *Asm, dwarf::Form Form) const
EmitValue - Emit integer of appropriate size.
Definition: DIE.cpp:370
llvm::DIEValue::emitValue
void emitValue(const AsmPrinter *AP) const
Emit value via the Dwarf writer.
Definition: DIE.cpp:321
llvm::DIEEntry::print
void print(raw_ostream &O) const
Definition: DIE.cpp:703
llvm::AsmPrinter::emitDebugValue
virtual void emitDebugValue(const MCExpr *Value, unsigned Size) const
Emit the directive and value for debug thread local expression.
Definition: AsmPrinter.cpp:874
llvm::DIEAbbrev::hasChildren
bool hasChildren() const
Definition: DIE.h:102
printValues
static LLVM_DUMP_METHOD void printValues(raw_ostream &O, const DIEValueList &Values, StringRef Type, unsigned Size, unsigned IndentCount)
Definition: DIE.cpp:226
llvm::DwarfDebug::getDebugLocs
const DebugLocStream & getDebugLocs() const
Returns the entries for the .debug_loc section.
Definition: DwarfDebug.h:774
llvm::DIEBaseTypeRef::sizeOf
unsigned sizeOf(const dwarf::FormParams &, dwarf::Form) const
sizeOf - Determine size of the base type reference in bytes.
Definition: DIE.cpp:526
MCAsmInfo.h
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:143
llvm::DIE::children
child_range children()
Definition: DIE.h:795
llvm::MCSection
Instances of this class represent a uniqued identifier for a section in the current translation unit.
Definition: MCSection.h:39
llvm::FoldingSetNodeID
FoldingSetNodeID - This class is used to gather all the unique data bits of a node.
Definition: FoldingSet.h:318
llvm::MCAsmInfo::doesDwarfUseRelocationsAcrossSections
bool doesDwarfUseRelocationsAcrossSections() const
Definition: MCAsmInfo.h:799
DwarfCompileUnit.h
llvm::format
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.
Definition: Format.h:124
llvm::dwarf::ChildrenString
StringRef ChildrenString(unsigned Children)
Definition: Dwarf.cpp:62
llvm::DIEValue::sizeOf
unsigned sizeOf(const dwarf::FormParams &FormParams) const
Return the size of a value in bytes.
Definition: DIE.cpp:333
llvm::DIEInteger::print
void print(raw_ostream &O) const
Definition: DIE.cpp:448
llvm::getSLEB128Size
unsigned getSLEB128Size(int64_t Value)
Utility function to get the size of the SLEB128-encoded value.
Definition: LEB128.cpp:29
llvm::dwarf::getFixedFormByteSize
Optional< uint8_t > getFixedFormByteSize(dwarf::Form Form, FormParams Params)
Get the fixed byte size for a given form.
Definition: Dwarf.cpp:694
llvm::StringRef::size
constexpr LLVM_NODISCARD size_t size() const
size - Get the string size.
Definition: StringRef.h:157
llvm::DIELabel::print
void print(raw_ostream &O) const
Definition: DIE.cpp:514
llvm::DIE::getUnit
DIEUnit * getUnit() const
Climb up the parent chain to get the compile unit or type unit that this DIE belongs to.
Definition: DIE.cpp:209
llvm::DwarfStringPoolEntryRef::getSymbol
MCSymbol * getSymbol() const
Definition: DwarfStringPoolEntry.h:44
llvm::DIEBlock::print
void print(raw_ostream &O) const
Definition: DIE.cpp:805
llvm::DwarfStringPoolEntryRef::getIndex
unsigned getIndex() const
Definition: DwarfStringPoolEntry.h:49
llvm::DIEAbbrev::dump
void dump() const
Definition: DIE.cpp:126
llvm::AsmPrinter::getDwarfVersion
uint16_t getDwarfVersion() const
Definition: AsmPrinter.cpp:3824
llvm::DIEAbbrevSet
Helps unique DIEAbbrev objects and assigns abbreviation numbers.
Definition: DIE.h:135
llvm::AsmPrinter
This class is intended to be used as a driving class for all asm writers.
Definition: AsmPrinter.h:81
llvm::DIELoc::computeSize
unsigned computeSize(const dwarf::FormParams &FormParams) const
Calculate the size of the location expression.
Definition: DIE.cpp:711
llvm::DIEValue::isNone
@ isNone
Definition: DIE.h:372
llvm::dwarf::isValidFormForVersion
bool isValidFormForVersion(Form F, unsigned Version, bool ExtensionsOk=true)
Tells whether the specified form is defined in the specified version, or is an extension if extension...
Definition: Dwarf.cpp:781
llvm::DIE::getAbbrevNumber
unsigned getAbbrevNumber() const
Definition: DIE.h:774
llvm::DIE::findAttribute
DIEValue findAttribute(dwarf::Attribute Attribute) const
Find a value in the DIE with the attribute given.
Definition: DIE.cpp:216
N
#define N
MCStreamer.h
llvm::DIELoc::print
void print(raw_ostream &O) const
Definition: DIE.cpp:753
llvm::DIE::hasChildren
bool hasChildren() const
Definition: DIE.h:787
llvm::StringRef::data
const LLVM_NODISCARD char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
Definition: StringRef.h:149
llvm::DIEAddrOffset::sizeOf
unsigned sizeOf(const dwarf::FormParams &FormParams, dwarf::Form Form) const
Definition: DIE.cpp:854
llvm::HexStyle::Asm
@ Asm
0ffh
Definition: MCInstPrinter.h:34
llvm::dwarf::DWARF64
@ DWARF64
Definition: Dwarf.h:93
llvm::DIEInteger::sizeOf
unsigned sizeOf(const dwarf::FormParams &FormParams, dwarf::Form Form) const
sizeOf - Determine size of integer value in bytes.
Definition: DIE.cpp:426
llvm::dwarf::TagString
StringRef TagString(unsigned Tag)
Definition: Dwarf.cpp:21
raw_ostream.h
llvm::DIE::getOffset
unsigned getOffset() const
Get the compile/type unit relative offset of this DIE.
Definition: DIE.h:777
llvm::DIEAbbrevData::getValue
int64_t getValue() const
Definition: DIE.h:69
llvm::DIEValueList
A list of DIE values.
Definition: DIE.h:662
llvm::DIEAddrOffset::print
void print(raw_ostream &O) const
Definition: DIE.cpp:868
llvm::DIE::setAbbrevNumber
void setAbbrevNumber(unsigned I)
Set the abbreviation number for this DIE.
Definition: DIE.h:811
CU
Definition: AArch64AsmBackend.cpp:504
llvm::DIELabel
A label DIE.
Definition: DIE.h:218
llvm::Value
LLVM Value Representation.
Definition: Value.h:74
Debug.h
llvm::DIEString::print
void print(raw_ostream &O) const
Definition: DIE.cpp:616
llvm::dwarf::AttributeString
StringRef AttributeString(unsigned Attribute)
Definition: Dwarf.cpp:72
llvm::DIEInlineString::print
void print(raw_ostream &O) const
Definition: DIE.cpp:638
llvm::AsmPrinter::getDwarfFormParams
dwarf::FormParams getDwarfFormParams() const
Returns information about the byte size of DW_FORM values.
Definition: AsmPrinter.cpp:3841
llvm::Intrinsic::ID
unsigned ID
Definition: TargetTransformInfo.h:38
llvm::dwarf::FormParams::getRefAddrByteSize
uint8_t getRefAddrByteSize() const
The definition of the size of form DW_FORM_ref_addr depends on the version.
Definition: Dwarf.h:664