LLVM: lib/CodeGen/AsmPrinter/DIE.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
17#include "llvm/Config/llvm-config.h"
26using namespace llvm;
27
28#define DEBUG_TYPE "dwarfdebug"
29
30
31
32
33
34
35
37
38
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
47
48
49
50
52 ID.AddInteger(unsigned(Tag));
53 ID.AddInteger(unsigned(Children));
54
55
58}
59
60
61
63
65
66
68
69
71
74
75
76#ifndef NDEBUG
77
78
83 << "\n");
85 }
86#endif
89
90
91 if (AttrData.getForm() == dwarf::DW_FORM_implicit_const)
93 }
94
95
98}
99
102 O << "Abbreviation @"
103 << format("0x%lx", (long)(intptr_t)this)
104 << " "
106 << " "
108 << '\n';
109
113
114 if (D.getForm() == dwarf::DW_FORM_implicit_const)
115 O << " " << D.getValue();
116
117 O << '\n';
118 }
119}
120
121#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
125#endif
126
127
128
129
130
132 for (DIEAbbrev *Abbrev : Abbreviations)
133 Abbrev->~DIEAbbrev();
134}
135
137
141
142 void *InsertPos;
144 AbbreviationsSet.FindNodeOrInsertPos(ID, InsertPos)) {
146 return *Existing;
147 }
148
149
151 Abbreviations.push_back(New);
152 New->setNumber(Abbreviations.size());
154
155
156 AbbreviationsSet.InsertNode(New, InsertPos);
157 return *New;
158}
159
161 if (!Abbreviations.empty()) {
162
165 }
166}
167
168
169
170
171
173
177 if (V.getForm() == dwarf::DW_FORM_implicit_const)
179 V.getDIEInteger().getValue());
180 else
181 Abbrev.AddAttribute(V.getAttribute(), V.getForm());
182 return Abbrev;
183}
184
187 assert(Unit && "DIE must be owned by a DIEUnit to get its absolute offset");
188 return Unit->getDebugSectionOffset() + getOffset();
189}
190
192 const DIE *p = this;
193 while (p) {
194 if (p->getTag() == dwarf::DW_TAG_compile_unit ||
195 p->getTag() == dwarf::DW_TAG_skeleton_unit ||
196 p->getTag() == dwarf::DW_TAG_type_unit)
197 return p;
198 p = p->getParent();
199 }
200 return nullptr;
201}
202
205 if (UnitDie)
207 return nullptr;
208}
209
211
212
213 for (const auto &V : values())
214 if (V.getAttribute() == Attribute)
215 return V;
217}
218
222 O << Type << ": Size: " << Size << "\n";
223
224 unsigned I = 0;
225 const std::string Indent(IndentCount, ' ');
226 for (const auto &V : Values.values()) {
227 O << Indent;
228 O << "Blk[" << I++ << "]";
230 V.print(O);
231 O << "\n";
232 }
233}
234
237 const std::string Indent(IndentCount, ' ');
238 O << Indent << "Die: " << format("0x%lx", (long)(intptr_t) this)
239 << ", Offset: " << Offset << ", Size: " << Size << "\n";
240
243
244 IndentCount += 2;
245 for (const auto &V : values()) {
246 O << Indent;
249 V.print(O);
250 O << "\n";
251 }
252 IndentCount -= 2;
253
254 for (const auto &Child : children())
255 Child.print(O, IndentCount + 4);
256
257 O << "\n";
258}
259
260#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
264#endif
265
268 unsigned CUOffset) {
269
270
272
273
275
276
278
279
280 for (const auto &V : values())
281 CUOffset += V.sizeOf(FormParams);
282
283
285 (void)Abbrev;
287
288 for (auto &Child : children())
289 CUOffset =
290 Child.computeOffsetsAndAbbrevs(FormParams, AbbrevSet, CUOffset);
291
292
293 CUOffset += sizeof(int8_t);
294 }
295
296
297
298
300 return CUOffset;
301}
302
303
304
305
307 Die.Owner = this;
308 assert((UnitTag == dwarf::DW_TAG_compile_unit ||
309 UnitTag == dwarf::DW_TAG_skeleton_unit ||
310 UnitTag == dwarf::DW_TAG_type_unit ||
311 UnitTag == dwarf::DW_TAG_partial_unit) &&
312 "expected a unit TAG");
313}
314
316 switch (Ty) {
319#define HANDLE_DIEVALUE(T) \
320 case is##T: \
321 getDIE##T().emitValue(AP, Form); \
322 break;
323#include "llvm/CodeGen/DIEValue.def"
324 }
325}
326
328 switch (Ty) {
331#define HANDLE_DIEVALUE(T) \
332 case is##T: \
333 return getDIE##T().sizeOf(FormParams, Form);
334#include "llvm/CodeGen/DIEValue.def"
335 }
337}
338
341 switch (Ty) {
344#define HANDLE_DIEVALUE(T) \
345 case is##T: \
346 getDIE##T().print(O); \
347 break;
348#include "llvm/CodeGen/DIEValue.def"
349 }
350}
351
352#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
356#endif
357
358
359
360
361
362
363
365 switch (Form) {
366 case dwarf::DW_FORM_implicit_const:
367 case dwarf::DW_FORM_flag_present:
368
369
370 Asm->OutStreamer->addBlankLine();
371 return;
372 case dwarf::DW_FORM_flag:
373 case dwarf::DW_FORM_ref1:
374 case dwarf::DW_FORM_data1:
375 case dwarf::DW_FORM_strx1:
376 case dwarf::DW_FORM_addrx1:
377 case dwarf::DW_FORM_ref2:
378 case dwarf::DW_FORM_data2:
379 case dwarf::DW_FORM_strx2:
380 case dwarf::DW_FORM_addrx2:
381 case dwarf::DW_FORM_strx3:
382 case dwarf::DW_FORM_addrx3:
383 case dwarf::DW_FORM_strp:
384 case dwarf::DW_FORM_ref4:
385 case dwarf::DW_FORM_data4:
386 case dwarf::DW_FORM_ref_sup4:
387 case dwarf::DW_FORM_strx4:
388 case dwarf::DW_FORM_addrx4:
389 case dwarf::DW_FORM_ref8:
390 case dwarf::DW_FORM_ref_sig8:
391 case dwarf::DW_FORM_data8:
392 case dwarf::DW_FORM_ref_sup8:
393 case dwarf::DW_FORM_GNU_ref_alt:
394 case dwarf::DW_FORM_GNU_strp_alt:
395 case dwarf::DW_FORM_line_strp:
396 case dwarf::DW_FORM_sec_offset:
397 case dwarf::DW_FORM_strp_sup:
398 case dwarf::DW_FORM_addr:
399 case dwarf::DW_FORM_ref_addr:
400 Asm->OutStreamer->emitIntValue(Integer,
401 sizeOf(Asm->getDwarfFormParams(), Form));
402 return;
403 case dwarf::DW_FORM_GNU_str_index:
404 case dwarf::DW_FORM_GNU_addr_index:
405 case dwarf::DW_FORM_ref_udata:
406 case dwarf::DW_FORM_strx:
407 case dwarf::DW_FORM_addrx:
408 case dwarf::DW_FORM_rnglistx:
409 case dwarf::DW_FORM_udata:
410 Asm->emitULEB128(Integer);
411 return;
412 case dwarf::DW_FORM_sdata:
413 Asm->emitSLEB128(Integer);
414 return;
415 default: llvm_unreachable("DIE Value form not supported yet");
416 }
417}
418
419
420
423 if (std::optional<uint8_t> FixedSize =
425 return *FixedSize;
426
427 switch (Form) {
428 case dwarf::DW_FORM_GNU_str_index:
429 case dwarf::DW_FORM_GNU_addr_index:
430 case dwarf::DW_FORM_ref_udata:
431 case dwarf::DW_FORM_strx:
432 case dwarf::DW_FORM_addrx:
433 case dwarf::DW_FORM_rnglistx:
434 case dwarf::DW_FORM_udata:
436 case dwarf::DW_FORM_sdata:
438 default: llvm_unreachable("DIE Value form not supported yet");
439 }
440}
441
444 O << "Int: " << (int64_t)Integer << " 0x";
445 O.write_hex(Integer);
446}
447
448
449
450
451
452
453
457
458
459
462 switch (Form) {
463 case dwarf::DW_FORM_data4:
464 return 4;
465 case dwarf::DW_FORM_data8:
466 return 8;
467 case dwarf::DW_FORM_sec_offset:
469 default:
471 }
472}
473
479
480
481
482
483
484
485
487 bool IsSectionRelative = Form != dwarf::DW_FORM_addr;
489 IsSectionRelative);
490}
491
492
493
496 switch (Form) {
497 case dwarf::DW_FORM_data4:
498 return 4;
499 case dwarf::DW_FORM_data8:
500 return 8;
501 case dwarf::DW_FORM_sec_offset:
502 case dwarf::DW_FORM_strp:
504 case dwarf::DW_FORM_addr:
506 default:
508 }
509}
510
513
514
515
516
517
519 uint64_t Offset = CU->ExprRefedBaseTypes[Index].Die->getOffset();
520 assert(Offset < (1ULL << (ULEB128PadSize * 7)) && "Offset wont fit");
522}
523
525 return ULEB128PadSize;
526}
527
530
531
532
533
534
535
536
541
542
543
546 switch (Form) {
547 case dwarf::DW_FORM_data4:
548 return 4;
549 case dwarf::DW_FORM_data8:
550 return 8;
551 case dwarf::DW_FORM_sec_offset:
553 default:
555 }
556}
557
560 O << "Del: " << LabelHi->getName() << "-" << LabelLo->getName();
561}
562
563
564
565
566
567
568
570
571 switch (Form) {
572 case dwarf::DW_FORM_GNU_str_index:
573 case dwarf::DW_FORM_strx:
574 case dwarf::DW_FORM_strx1:
575 case dwarf::DW_FORM_strx2:
576 case dwarf::DW_FORM_strx3:
577 case dwarf::DW_FORM_strx4:
579 return;
580 case dwarf::DW_FORM_strp:
583 else
585 return;
586 default:
588 }
589}
590
591
592
595
596 switch (Form) {
597 case dwarf::DW_FORM_GNU_str_index:
598 case dwarf::DW_FORM_strx:
599 case dwarf::DW_FORM_strx1:
600 case dwarf::DW_FORM_strx2:
601 case dwarf::DW_FORM_strx3:
602 case dwarf::DW_FORM_strx4:
604 case dwarf::DW_FORM_strp:
606 return DIELabel(S.getSymbol()).sizeOf(FormParams, Form);
608 default:
610 }
611}
612
615 O << "String: " << S.getString();
616}
617
618
619
620
622 if (Form == dwarf::DW_FORM_string) {
625 return;
626 }
628}
629
631
632 return S.size() + 1;
633}
634
637 O << "InlineString: " << S;
638}
639
640
641
642
643
644
645
647
648 switch (Form) {
649 case dwarf::DW_FORM_ref1:
650 case dwarf::DW_FORM_ref2:
651 case dwarf::DW_FORM_ref4:
652 case dwarf::DW_FORM_ref8:
653 AP->OutStreamer->emitIntValue(Entry->getOffset(),
655 return;
656
657 case dwarf::DW_FORM_ref_udata:
659 return;
660
661 case dwarf::DW_FORM_ref_addr: {
662
663 uint64_t Addr = Entry->getDebugSectionOffset();
664 if (const MCSymbol *SectionSym =
665 Entry->getUnit()->getCrossSectionRelativeBaseAddress()) {
668 return;
669 }
670
672 return;
673 }
674 default:
676 }
677}
678
681 switch (Form) {
682 case dwarf::DW_FORM_ref1:
683 return 1;
684 case dwarf::DW_FORM_ref2:
685 return 2;
686 case dwarf::DW_FORM_ref4:
687 return 4;
688 case dwarf::DW_FORM_ref8:
689 return 8;
690 case dwarf::DW_FORM_ref_udata:
692 case dwarf::DW_FORM_ref_addr:
694
695 default:
697 }
698}
699
702 O << format("Die: 0x%lx", (long)(intptr_t)&Entry);
703}
704
705
706
707
708
710 if (!Size) {
711 for (const auto &V : values())
712 Size += V.sizeOf(FormParams);
713 }
714
715 return Size;
716}
717
718
719
721 switch (Form) {
723 case dwarf::DW_FORM_block1: Asm->emitInt8(Size); break;
724 case dwarf::DW_FORM_block2: Asm->emitInt16(Size); break;
725 case dwarf::DW_FORM_block4: Asm->emitInt32(Size); break;
726 case dwarf::DW_FORM_block:
727 case dwarf::DW_FORM_exprloc:
728 Asm->emitULEB128(Size);
729 break;
730 }
731
732 for (const auto &V : values())
733 V.emitValue(Asm);
734}
735
736
737
739 switch (Form) {
740 case dwarf::DW_FORM_block1: return Size + sizeof(int8_t);
741 case dwarf::DW_FORM_block2: return Size + sizeof(int16_t);
742 case dwarf::DW_FORM_block4: return Size + sizeof(int32_t);
743 case dwarf::DW_FORM_block:
744 case dwarf::DW_FORM_exprloc:
747 }
748}
749
754
755
756
757
758
760 if (!Size) {
761 for (const auto &V : values())
762 Size += V.sizeOf(FormParams);
763 }
764
765 return Size;
766}
767
768
769
771 switch (Form) {
773 case dwarf::DW_FORM_block1: Asm->emitInt8(Size); break;
774 case dwarf::DW_FORM_block2: Asm->emitInt16(Size); break;
775 case dwarf::DW_FORM_block4: Asm->emitInt32(Size); break;
776 case dwarf::DW_FORM_exprloc:
777 case dwarf::DW_FORM_block:
778 Asm->emitULEB128(Size);
779 break;
780 case dwarf::DW_FORM_string: break;
781 case dwarf::DW_FORM_data16: break;
782 }
783
784 for (const auto &V : values())
785 V.emitValue(Asm);
786}
787
788
789
791 switch (Form) {
792 case dwarf::DW_FORM_block1: return Size + sizeof(int8_t);
793 case dwarf::DW_FORM_block2: return Size + sizeof(int16_t);
794 case dwarf::DW_FORM_block4: return Size + sizeof(int32_t);
795 case dwarf::DW_FORM_exprloc:
796 case dwarf::DW_FORM_block: return Size + getULEB128Size(Size);
797 case dwarf::DW_FORM_data16: return 16;
799 }
800}
801
806
807
808
809
810
813 switch (Form) {
814 case dwarf::DW_FORM_loclistx:
816 case dwarf::DW_FORM_data4:
818 "DW_FORM_data4 is not suitable to emit a pointer to a location list "
819 "in the 64-bit DWARF format");
820 return 4;
821 case dwarf::DW_FORM_data8:
823 "DW_FORM_data8 is not suitable to emit a pointer to a location list "
824 "in the 32-bit DWARF format");
825 return 8;
826 case dwarf::DW_FORM_sec_offset:
828 default:
830 }
831}
832
833
834
836 if (Form == dwarf::DW_FORM_loclistx) {
838 return;
839 }
843}
844
847
848
849
850
851
854 return Addr.sizeOf(FormParams, dwarf::DW_FORM_addrx) +
855 Offset.sizeOf(FormParams, dwarf::DW_FORM_data4);
856}
857
858
859
861 Addr.emitValue(AP, dwarf::DW_FORM_addrx);
862 Offset.emitValue(AP, dwarf::DW_FORM_data4);
863}
864
867 O << "AddrOffset: ";
868 Addr.print(O);
869 O << " + ";
870 Offset.print(O);
871}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
static LLVM_DUMP_METHOD void printValues(raw_ostream &O, const DIEValueList &Values, StringRef Type, unsigned Size, unsigned IndentCount)
Definition DIE.cpp:220
This class is intended to be used as a driving class for all asm writers.
void emitULEB128(uint64_t Value, const char *Desc=nullptr, unsigned PadTo=0) const
Emit the specified unsigned leb128 value.
void emitDwarfSymbolReference(const MCSymbol *Label, bool ForceOffset=false) const
Emit a reference to a symbol for use in dwarf.
virtual void emitDebugValue(const MCExpr *Value, unsigned Size) const
Emit the directive and value for debug thread local expression.
DwarfDebug * getDwarfDebug()
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...
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...
void emitInt8(int Value) const
Emit a byte directive and value.
void emitDwarfAbbrevs(const T &Abbrevs) const
Emit Dwarf abbreviation table.
void emitSLEB128(int64_t Value, const char *Desc=nullptr) const
Emit the specified signed leb128 value.
std::unique_ptr< MCStreamer > OutStreamer
This is the MCStreamer object for the file we are generating.
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...
uint16_t getDwarfVersion() const
dwarf::FormParams getDwarfFormParams() const
Returns information about the byte size of DW_FORM values.
bool doesDwarfUseRelocationsAcrossSections() const
Functions, function parameters, and return types can have attributes to indicate how they should be t...
Dwarf abbreviation data, describes one attribute of a Dwarf abbreviation.
LLVM_ABI void Profile(FoldingSetNodeID &ID) const
Used to gather unique data for the abbreviation folding set.
Definition DIE.cpp:36
Helps unique DIEAbbrev objects and assigns abbreviation numbers.
LLVM_ABI ~DIEAbbrevSet()
Definition DIE.cpp:131
LLVM_ABI void Emit(const AsmPrinter *AP, MCSection *Section) const
Print all abbreviations using the specified asm printer.
Definition DIE.cpp:160
LLVM_ABI DIEAbbrev & uniqueAbbreviation(DIE &Die)
Generate the abbreviation declaration for a DIE and return a pointer to the generated abbreviation.
Definition DIE.cpp:136
Dwarf abbreviation, describes the organization of a debug information object.
LLVM_ABI void print(raw_ostream &O) const
Definition DIE.cpp:101
void AddImplicitConstAttribute(dwarf::Attribute Attribute, int64_t Value)
Adds attribute with DW_FORM_implicit_const value.
LLVM_ABI void Emit(const AsmPrinter *AP) const
Print the abbreviation using the specified asm printer.
Definition DIE.cpp:62
void AddAttribute(dwarf::Attribute Attribute, dwarf::Form Form)
Adds another set of attribute information to the abbreviation.
LLVM_ABI void dump() const
Definition DIE.cpp:122
LLVM_ABI void Profile(FoldingSetNodeID &ID) const
Used to gather unique data for the abbreviation folding set.
Definition DIE.cpp:51
LLVM_ABI void print(raw_ostream &O) const
Definition DIE.cpp:866
LLVM_ABI unsigned sizeOf(const dwarf::FormParams &FormParams, dwarf::Form Form) const
Definition DIE.cpp:852
LLVM_ABI void emitValue(const AsmPrinter *AP, dwarf::Form Form) const
EmitValue - Emit label value.
Definition DIE.cpp:860
LLVM_ABI void emitValue(const AsmPrinter *AP, dwarf::Form Form) const
EmitValue - Emit base type reference.
Definition DIE.cpp:518
LLVM_ABI void print(raw_ostream &O) const
Definition DIE.cpp:529
LLVM_ABI unsigned sizeOf(const dwarf::FormParams &, dwarf::Form) const
sizeOf - Determine size of the base type reference in bytes.
Definition DIE.cpp:524
LLVM_ABI unsigned sizeOf(const dwarf::FormParams &, dwarf::Form Form) const
sizeOf - Determine size of block data in bytes.
Definition DIE.cpp:790
LLVM_ABI void print(raw_ostream &O) const
Definition DIE.cpp:803
LLVM_ABI void emitValue(const AsmPrinter *Asm, dwarf::Form Form) const
EmitValue - Emit block data.
Definition DIE.cpp:770
LLVM_ABI unsigned computeSize(const dwarf::FormParams &FormParams) const
Calculate the size of the location expression.
Definition DIE.cpp:759
LLVM_ABI void print(raw_ostream &O) const
Definition DIE.cpp:559
LLVM_ABI unsigned sizeOf(const dwarf::FormParams &FormParams, dwarf::Form Form) const
SizeOf - Determine size of delta value in bytes.
Definition DIE.cpp:544
LLVM_ABI void emitValue(const AsmPrinter *AP, dwarf::Form Form) const
EmitValue - Emit delta value.
Definition DIE.cpp:537
LLVM_ABI void emitValue(const AsmPrinter *AP, dwarf::Form Form) const
EmitValue - Emit debug information entry offset.
Definition DIE.cpp:646
LLVM_ABI void print(raw_ostream &O) const
Definition DIE.cpp:701
LLVM_ABI unsigned sizeOf(const dwarf::FormParams &FormParams, dwarf::Form Form) const
Definition DIE.cpp:679
LLVM_ABI void print(raw_ostream &O) const
Definition DIE.cpp:475
LLVM_ABI void emitValue(const AsmPrinter *AP, dwarf::Form Form) const
EmitValue - Emit expression value.
Definition DIE.cpp:454
LLVM_ABI unsigned sizeOf(const dwarf::FormParams &FormParams, dwarf::Form Form) const
SizeOf - Determine size of expression value in bytes.
Definition DIE.cpp:460
LLVM_ABI void emitValue(const AsmPrinter *AP, dwarf::Form Form) const
Definition DIE.cpp:621
LLVM_ABI void print(raw_ostream &O) const
Definition DIE.cpp:636
LLVM_ABI unsigned sizeOf(const dwarf::FormParams &, dwarf::Form) const
Definition DIE.cpp:630
LLVM_ABI unsigned sizeOf(const dwarf::FormParams &FormParams, dwarf::Form Form) const
sizeOf - Determine size of integer value in bytes.
Definition DIE.cpp:421
LLVM_ABI void print(raw_ostream &O) const
Definition DIE.cpp:443
LLVM_ABI void emitValue(const AsmPrinter *Asm, dwarf::Form Form) const
EmitValue - Emit integer of appropriate size.
Definition DIE.cpp:364
LLVM_ABI void emitValue(const AsmPrinter *AP, dwarf::Form Form) const
EmitValue - Emit label value.
Definition DIE.cpp:486
LLVM_ABI void print(raw_ostream &O) const
Definition DIE.cpp:512
LLVM_ABI unsigned sizeOf(const dwarf::FormParams &FormParams, dwarf::Form Form) const
sizeOf - Determine size of label value in bytes.
Definition DIE.cpp:494
LLVM_ABI void print(raw_ostream &O) const
Definition DIE.cpp:846
LLVM_ABI unsigned sizeOf(const dwarf::FormParams &FormParams, dwarf::Form Form) const
Definition DIE.cpp:811
LLVM_ABI void emitValue(const AsmPrinter *AP, dwarf::Form Form) const
EmitValue - Emit label value.
Definition DIE.cpp:835
LLVM_ABI void print(raw_ostream &O) const
Definition DIE.cpp:751
LLVM_ABI unsigned sizeOf(const dwarf::FormParams &, dwarf::Form Form) const
sizeOf - Determine size of location data in bytes.
Definition DIE.cpp:738
LLVM_ABI void emitValue(const AsmPrinter *Asm, dwarf::Form Form) const
EmitValue - Emit location data.
Definition DIE.cpp:720
LLVM_ABI unsigned computeSize(const dwarf::FormParams &FormParams) const
Calculate the size of the location expression.
Definition DIE.cpp:709
LLVM_ABI void emitValue(const AsmPrinter *AP, dwarf::Form Form) const
EmitValue - Emit string value.
Definition DIE.cpp:569
LLVM_ABI void print(raw_ostream &O) const
Definition DIE.cpp:614
LLVM_ABI unsigned sizeOf(const dwarf::FormParams &FormParams, dwarf::Form Form) const
sizeOf - Determine size of delta value in bytes.
Definition DIE.cpp:593
LLVM_ABI DIEUnit(dwarf::Tag UnitTag)
Definition DIE.cpp:306
LLVM_ABI void print(raw_ostream &O) const
Definition DIE.cpp:340
LLVM_ABI void emitValue(const AsmPrinter *AP) const
Emit value via the Dwarf writer.
Definition DIE.cpp:315
LLVM_ABI unsigned sizeOf(const dwarf::FormParams &FormParams) const
Return the size of a value in bytes.
Definition DIE.cpp:327
LLVM_ABI void dump() const
Definition DIE.cpp:353
A structured debug information entry.
LLVM_ABI DIEValue findAttribute(dwarf::Attribute Attribute) const
Find a value in the DIE with the attribute given.
Definition DIE.cpp:210
LLVM_ABI void print(raw_ostream &O, unsigned IndentCount=0) const
Definition DIE.cpp:236
unsigned getAbbrevNumber() const
LLVM_ABI DIEAbbrev generateAbbrev() const
Generate the abbreviation for this DIE.
Definition DIE.cpp:174
LLVM_ABI unsigned computeOffsetsAndAbbrevs(const dwarf::FormParams &FormParams, DIEAbbrevSet &AbbrevSet, unsigned CUOffset)
Compute the offset of this DIE and all its children.
Definition DIE.cpp:266
LLVM_ABI DIEUnit * getUnit() const
Climb up the parent chain to get the compile unit or type unit that this DIE belongs to.
Definition DIE.cpp:203
LLVM_ABI 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:191
void setAbbrevNumber(unsigned I)
Set the abbreviation number for this DIE.
unsigned getOffset() const
Get the compile/type unit relative offset of this DIE.
void setOffset(unsigned O)
LLVM_ABI uint64_t getDebugSectionOffset() const
Get the absolute offset within the .debug_info or .debug_types section for this DIE.
Definition DIE.cpp:185
dwarf::Tag getTag() const
LLVM_ABI void dump() const
Definition DIE.cpp:261
LLVM_ABI DIE * getParent() const
Definition DIE.cpp:172
const List & getList(size_t LI) const
Collects and handles dwarf debug information.
const DebugLocStream & getDebugLocs() const
Returns the entries for the .debug_loc section.
bool useSplitDwarf() const
Returns whether or not to change the current debug info for the split dwarf proposal support.
FoldingSetNodeID - This class is used to gather all the unique data bits of a node.
This class is intended to be used as a base class for asm properties and features specific to the tar...
void printExpr(raw_ostream &, const MCExpr &) const
Instances of this class represent a uniqued identifier for a section in the current translation unit.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
StringRef - Represent a constant reference to a string, i.e.
The instances of the Type class are immutable: once they are created, they are never changed.
This class implements an extremely fast bulk output stream that can only output to a stream.
LLVM_ABI StringRef AttributeString(unsigned Attribute)
LLVM_ABI StringRef FormEncodingString(unsigned Encoding)
LLVM_ABI StringRef ChildrenString(unsigned Children)
LLVM_ABI StringRef TagString(unsigned Tag)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
LLVM_ABI 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...
LLVM_ABI std::optional< uint8_t > getFixedFormByteSize(dwarf::Form Form, FormParams Params)
Get the fixed byte size for a given form.
This is an optimization pass for GlobalISel generic memory operations.
auto dyn_cast_if_present(const Y &Val)
dyn_cast_if_present - Functionally identical to dyn_cast, except that a null (or none in the case ...
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.
LLVM_ABI unsigned getULEB128Size(uint64_t Value)
Utility function to get the size of the ULEB128-encoded value.
LLVM_ABI unsigned getSLEB128Size(int64_t Value)
Utility function to get the size of the SLEB128-encoded value.
A helper struct providing information about the byte size of DW_FORM values that vary in size dependi...
bool DwarfUsesRelocationsAcrossSections
True if DWARF v2 output generally uses relocations for references to other .debug_* sections.
uint8_t getDwarfOffsetByteSize() const
The size of a reference is determined by the DWARF 32/64-bit format.
uint8_t getRefAddrByteSize() const
The definition of the size of form DW_FORM_ref_addr depends on the version.