LLVM 17.0.0git
DIE.h
Go to the documentation of this file.
1//===- lib/CodeGen/DIE.h - DWARF Info Entries -------------------*- C++ -*-===//
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#ifndef LLVM_CODEGEN_DIE_H
14#define LLVM_CODEGEN_DIE_H
15
16#include "llvm/ADT/FoldingSet.h"
20#include "llvm/ADT/StringRef.h"
21#include "llvm/ADT/iterator.h"
27#include <cassert>
28#include <cstddef>
29#include <cstdint>
30#include <iterator>
31#include <new>
32#include <type_traits>
33#include <utility>
34#include <vector>
35
36namespace llvm {
37
38class AsmPrinter;
39class DIE;
40class DIEUnit;
41class DwarfCompileUnit;
42class MCExpr;
43class MCSection;
44class MCSymbol;
45class raw_ostream;
46
47//===--------------------------------------------------------------------===//
48/// Dwarf abbreviation data, describes one attribute of a Dwarf abbreviation.
50 /// Dwarf attribute code.
52
53 /// Dwarf form code.
55
56 /// Dwarf attribute value for DW_FORM_implicit_const
57 int64_t Value = 0;
58
59public:
61 : Attribute(A), Form(F) {}
63 : Attribute(A), Form(dwarf::DW_FORM_implicit_const), Value(V) {}
64
65 /// Accessors.
66 /// @{
68 dwarf::Form getForm() const { return Form; }
69 int64_t getValue() const { return Value; }
70 /// @}
71
72 /// Used to gather unique data for the abbreviation folding set.
73 void Profile(FoldingSetNodeID &ID) const;
74};
75
76//===--------------------------------------------------------------------===//
77/// Dwarf abbreviation, describes the organization of a debug information
78/// object.
79class DIEAbbrev : public FoldingSetNode {
80 /// Unique number for node.
81 unsigned Number = 0;
82
83 /// Dwarf tag code.
85
86 /// Whether or not this node has children.
87 ///
88 /// This cheats a bit in all of the uses since the values in the standard
89 /// are 0 and 1 for no children and children respectively.
90 bool Children;
91
92 /// Raw data bytes for abbreviation.
94
95public:
96 DIEAbbrev(dwarf::Tag T, bool C) : Tag(T), Children(C) {}
97
98 /// Accessors.
99 /// @{
100 dwarf::Tag getTag() const { return Tag; }
101 unsigned getNumber() const { return Number; }
102 bool hasChildren() const { return Children; }
103 const SmallVectorImpl<DIEAbbrevData> &getData() const { return Data; }
104 void setChildrenFlag(bool hasChild) { Children = hasChild; }
105 void setNumber(unsigned N) { Number = N; }
106 /// @}
107
108 /// Adds another set of attribute information to the abbreviation.
110 Data.push_back(DIEAbbrevData(Attribute, Form));
111 }
112
113 /// Adds attribute with DW_FORM_implicit_const value
115 Data.push_back(DIEAbbrevData(Attribute, Value));
116 }
117
118 /// Adds another set of attribute information to the abbreviation.
119 void AddAttribute(const DIEAbbrevData &AbbrevData) {
120 Data.push_back(AbbrevData);
121 }
122
123 /// Used to gather unique data for the abbreviation folding set.
124 void Profile(FoldingSetNodeID &ID) const;
125
126 /// Print the abbreviation using the specified asm printer.
127 void Emit(const AsmPrinter *AP) const;
128
129 void print(raw_ostream &O) const;
130 void dump() const;
131};
132
133//===--------------------------------------------------------------------===//
134/// Helps unique DIEAbbrev objects and assigns abbreviation numbers.
135///
136/// This class will unique the DIE abbreviations for a llvm::DIE object and
137/// assign a unique abbreviation number to each unique DIEAbbrev object it
138/// finds. The resulting collection of DIEAbbrev objects can then be emitted
139/// into the .debug_abbrev section.
141 /// The bump allocator to use when creating DIEAbbrev objects in the uniqued
142 /// storage container.
143 BumpPtrAllocator &Alloc;
144 /// FoldingSet that uniques the abbreviations.
145 FoldingSet<DIEAbbrev> AbbreviationsSet;
146 /// A list of all the unique abbreviations in use.
147 std::vector<DIEAbbrev *> Abbreviations;
148
149public:
152
153 /// Generate the abbreviation declaration for a DIE and return a pointer to
154 /// the generated abbreviation.
155 ///
156 /// \param Die the debug info entry to generate the abbreviation for.
157 /// \returns A reference to the uniqued abbreviation declaration that is
158 /// owned by this class.
160
161 /// Print all abbreviations using the specified asm printer.
162 void Emit(const AsmPrinter *AP, MCSection *Section) const;
163};
164
165//===--------------------------------------------------------------------===//
166/// An integer value DIE.
167///
169 uint64_t Integer;
170
171public:
172 explicit DIEInteger(uint64_t I) : Integer(I) {}
173
174 /// Choose the best form for integer.
175 static dwarf::Form BestForm(bool IsSigned, uint64_t Int) {
176 if (IsSigned) {
177 const int64_t SignedInt = Int;
178 if ((char)Int == SignedInt)
179 return dwarf::DW_FORM_data1;
180 if ((short)Int == SignedInt)
181 return dwarf::DW_FORM_data2;
182 if ((int)Int == SignedInt)
183 return dwarf::DW_FORM_data4;
184 } else {
185 if ((unsigned char)Int == Int)
186 return dwarf::DW_FORM_data1;
187 if ((unsigned short)Int == Int)
188 return dwarf::DW_FORM_data2;
189 if ((unsigned int)Int == Int)
190 return dwarf::DW_FORM_data4;
191 }
192 return dwarf::DW_FORM_data8;
193 }
194
195 uint64_t getValue() const { return Integer; }
196 void setValue(uint64_t Val) { Integer = Val; }
197
198 void emitValue(const AsmPrinter *Asm, dwarf::Form Form) const;
199 unsigned sizeOf(const dwarf::FormParams &FormParams, dwarf::Form Form) const;
200
201 void print(raw_ostream &O) const;
202};
203
204//===--------------------------------------------------------------------===//
205/// An expression DIE.
206class DIEExpr {
207 const MCExpr *Expr;
208
209public:
210 explicit DIEExpr(const MCExpr *E) : Expr(E) {}
211
212 /// Get MCExpr.
213 const MCExpr *getValue() const { return Expr; }
214
215 void emitValue(const AsmPrinter *AP, dwarf::Form Form) const;
216 unsigned sizeOf(const dwarf::FormParams &FormParams, dwarf::Form Form) const;
217
218 void print(raw_ostream &O) const;
219};
220
221//===--------------------------------------------------------------------===//
222/// A label DIE.
223class DIELabel {
224 const MCSymbol *Label;
225
226public:
227 explicit DIELabel(const MCSymbol *L) : Label(L) {}
228
229 /// Get MCSymbol.
230 const MCSymbol *getValue() const { return Label; }
231
232 void emitValue(const AsmPrinter *AP, dwarf::Form Form) const;
233 unsigned sizeOf(const dwarf::FormParams &FormParams, dwarf::Form Form) const;
234
235 void print(raw_ostream &O) const;
236};
237
238//===--------------------------------------------------------------------===//
239/// A BaseTypeRef DIE.
241 const DwarfCompileUnit *CU;
242 const uint64_t Index;
243 static constexpr unsigned ULEB128PadSize = 4;
244
245public:
247 : CU(TheCU), Index(Idx) {}
248
249 /// EmitValue - Emit base type reference.
250 void emitValue(const AsmPrinter *AP, dwarf::Form Form) const;
251 /// sizeOf - Determine size of the base type reference in bytes.
252 unsigned sizeOf(const dwarf::FormParams &, dwarf::Form) const;
253
254 void print(raw_ostream &O) const;
255 uint64_t getIndex() const { return Index; }
256};
257
258//===--------------------------------------------------------------------===//
259/// A simple label difference DIE.
260///
261class DIEDelta {
262 const MCSymbol *LabelHi;
263 const MCSymbol *LabelLo;
264
265public:
266 DIEDelta(const MCSymbol *Hi, const MCSymbol *Lo) : LabelHi(Hi), LabelLo(Lo) {}
267
268 void emitValue(const AsmPrinter *AP, dwarf::Form Form) const;
269 unsigned sizeOf(const dwarf::FormParams &FormParams, dwarf::Form Form) const;
270
271 void print(raw_ostream &O) const;
272};
273
274//===--------------------------------------------------------------------===//
275/// A container for string pool string values.
276///
277/// This class is used with the DW_FORM_strp and DW_FORM_GNU_str_index forms.
280
281public:
283
284 /// Grab the string out of the object.
285 StringRef getString() const { return S.getString(); }
286
287 void emitValue(const AsmPrinter *AP, dwarf::Form Form) const;
288 unsigned sizeOf(const dwarf::FormParams &FormParams, dwarf::Form Form) const;
289
290 void print(raw_ostream &O) const;
291};
292
293//===--------------------------------------------------------------------===//
294/// A container for inline string values.
295///
296/// This class is used with the DW_FORM_string form.
298 StringRef S;
299
300public:
301 template <typename Allocator>
302 explicit DIEInlineString(StringRef Str, Allocator &A) : S(Str.copy(A)) {}
303
304 ~DIEInlineString() = default;
305
306 /// Grab the string out of the object.
307 StringRef getString() const { return S; }
308
309 void emitValue(const AsmPrinter *AP, dwarf::Form Form) const;
310 unsigned sizeOf(const dwarf::FormParams &, dwarf::Form) const;
311
312 void print(raw_ostream &O) const;
313};
314
315//===--------------------------------------------------------------------===//
316/// A pointer to another debug information entry. An instance of this class can
317/// also be used as a proxy for a debug information entry not yet defined
318/// (ie. types.)
319class DIEEntry {
320 DIE *Entry;
321
322public:
323 DIEEntry() = delete;
324 explicit DIEEntry(DIE &E) : Entry(&E) {}
325
326 DIE &getEntry() const { return *Entry; }
327
328 void emitValue(const AsmPrinter *AP, dwarf::Form Form) const;
329 unsigned sizeOf(const dwarf::FormParams &FormParams, dwarf::Form Form) const;
330
331 void print(raw_ostream &O) const;
332};
333
334//===--------------------------------------------------------------------===//
335/// Represents a pointer to a location list in the debug_loc
336/// section.
338 /// Index into the .debug_loc vector.
339 size_t Index;
340
341public:
342 DIELocList(size_t I) : Index(I) {}
343
344 /// Grab the current index out.
345 size_t getValue() const { return Index; }
346
347 void emitValue(const AsmPrinter *AP, dwarf::Form Form) const;
348 unsigned sizeOf(const dwarf::FormParams &FormParams, dwarf::Form Form) const;
349
350 void print(raw_ostream &O) const;
351};
352
353//===--------------------------------------------------------------------===//
354/// A BaseTypeRef DIE.
356 DIEInteger Addr;
357 DIEDelta Offset;
358
359public:
360 explicit DIEAddrOffset(uint64_t Idx, const MCSymbol *Hi, const MCSymbol *Lo)
361 : Addr(Idx), Offset(Hi, Lo) {}
362
363 void emitValue(const AsmPrinter *AP, dwarf::Form Form) const;
364 unsigned sizeOf(const dwarf::FormParams &FormParams, dwarf::Form Form) const;
365
366 void print(raw_ostream &O) const;
367};
368
369//===--------------------------------------------------------------------===//
370/// A debug information entry value. Some of these roughly correlate
371/// to DWARF attribute classes.
372class DIEBlock;
373class DIELoc;
374class DIEValue {
375public:
376 enum Type {
378#define HANDLE_DIEVALUE(T) is##T,
379#include "llvm/CodeGen/DIEValue.def"
380 };
381
382private:
383 /// Type of data stored in the value.
384 Type Ty = isNone;
385 dwarf::Attribute Attribute = (dwarf::Attribute)0;
386 dwarf::Form Form = (dwarf::Form)0;
387
388 /// Storage for the value.
389 ///
390 /// All values that aren't standard layout (or are larger than 8 bytes)
391 /// should be stored by reference instead of by value.
392 using ValTy =
393 AlignedCharArrayUnion<DIEInteger, DIEString, DIEExpr, DIELabel,
394 DIEDelta *, DIEEntry, DIEBlock *, DIELoc *,
395 DIELocList, DIEBaseTypeRef *, DIEAddrOffset *>;
396
397 static_assert(sizeof(ValTy) <= sizeof(uint64_t) ||
398 sizeof(ValTy) <= sizeof(void *),
399 "Expected all large types to be stored via pointer");
400
401 /// Underlying stored value.
402 ValTy Val;
403
404 template <class T> void construct(T V) {
405 static_assert(std::is_standard_layout<T>::value ||
406 std::is_pointer<T>::value,
407 "Expected standard layout or pointer");
408 new (reinterpret_cast<void *>(&Val)) T(V);
409 }
410
411 template <class T> T *get() { return reinterpret_cast<T *>(&Val); }
412 template <class T> const T *get() const {
413 return reinterpret_cast<const T *>(&Val);
414 }
415 template <class T> void destruct() { get<T>()->~T(); }
416
417 /// Destroy the underlying value.
418 ///
419 /// This should get optimized down to a no-op. We could skip it if we could
420 /// add a static assert on \a std::is_trivially_copyable(), but we currently
421 /// support versions of GCC that don't understand that.
422 void destroyVal() {
423 switch (Ty) {
424 case isNone:
425 return;
426#define HANDLE_DIEVALUE_SMALL(T) \
427 case is##T: \
428 destruct<DIE##T>(); \
429 return;
430#define HANDLE_DIEVALUE_LARGE(T) \
431 case is##T: \
432 destruct<const DIE##T *>(); \
433 return;
434#include "llvm/CodeGen/DIEValue.def"
435 }
436 }
437
438 /// Copy the underlying value.
439 ///
440 /// This should get optimized down to a simple copy. We need to actually
441 /// construct the value, rather than calling memcpy, to satisfy strict
442 /// aliasing rules.
443 void copyVal(const DIEValue &X) {
444 switch (Ty) {
445 case isNone:
446 return;
447#define HANDLE_DIEVALUE_SMALL(T) \
448 case is##T: \
449 construct<DIE##T>(*X.get<DIE##T>()); \
450 return;
451#define HANDLE_DIEVALUE_LARGE(T) \
452 case is##T: \
453 construct<const DIE##T *>(*X.get<const DIE##T *>()); \
454 return;
455#include "llvm/CodeGen/DIEValue.def"
456 }
457 }
458
459public:
460 DIEValue() = default;
461
463 copyVal(X);
464 }
465
467 destroyVal();
468 Ty = X.Ty;
469 Attribute = X.Attribute;
470 Form = X.Form;
471 copyVal(X);
472 return *this;
473 }
474
475 ~DIEValue() { destroyVal(); }
476
477#define HANDLE_DIEVALUE_SMALL(T) \
478 DIEValue(dwarf::Attribute Attribute, dwarf::Form Form, const DIE##T &V) \
479 : Ty(is##T), Attribute(Attribute), Form(Form) { \
480 construct<DIE##T>(V); \
481 }
482#define HANDLE_DIEVALUE_LARGE(T) \
483 DIEValue(dwarf::Attribute Attribute, dwarf::Form Form, const DIE##T *V) \
484 : Ty(is##T), Attribute(Attribute), Form(Form) { \
485 assert(V && "Expected valid value"); \
486 construct<const DIE##T *>(V); \
487 }
488#include "llvm/CodeGen/DIEValue.def"
489
490 /// Accessors.
491 /// @{
492 Type getType() const { return Ty; }
494 dwarf::Form getForm() const { return Form; }
495 explicit operator bool() const { return Ty; }
496 /// @}
497
498#define HANDLE_DIEVALUE_SMALL(T) \
499 const DIE##T &getDIE##T() const { \
500 assert(getType() == is##T && "Expected " #T); \
501 return *get<DIE##T>(); \
502 }
503#define HANDLE_DIEVALUE_LARGE(T) \
504 const DIE##T &getDIE##T() const { \
505 assert(getType() == is##T && "Expected " #T); \
506 return **get<const DIE##T *>(); \
507 }
508#include "llvm/CodeGen/DIEValue.def"
509
510 /// Emit value via the Dwarf writer.
511 void emitValue(const AsmPrinter *AP) const;
512
513 /// Return the size of a value in bytes.
514 unsigned sizeOf(const dwarf::FormParams &FormParams) const;
515
516 void print(raw_ostream &O) const;
517 void dump() const;
518};
519
522
524
526 return Next.getInt() ? nullptr : Next.getPointer();
527 }
528};
529
532
533 Node *Last = nullptr;
534
535 bool empty() const { return !Last; }
536
537 void push_back(Node &N) {
538 assert(N.Next.getPointer() == &N && "Expected unlinked node");
539 assert(N.Next.getInt() == true && "Expected unlinked node");
540
541 if (Last) {
542 N.Next = Last->Next;
543 Last->Next.setPointerAndInt(&N, false);
544 }
545 Last = &N;
546 }
547
549 assert(N.Next.getPointer() == &N && "Expected unlinked node");
550 assert(N.Next.getInt() == true && "Expected unlinked node");
551
552 if (Last) {
553 N.Next.setPointerAndInt(Last->Next.getPointer(), false);
554 Last->Next.setPointerAndInt(&N, true);
555 } else {
556 Last = &N;
557 }
558 }
559};
560
561template <class T> class IntrusiveBackList : IntrusiveBackListBase {
562public:
564
567 T &back() { return *static_cast<T *>(Last); }
568 const T &back() const { return *static_cast<T *>(Last); }
569 T &front() {
570 return *static_cast<T *>(Last ? Last->Next.getPointer() : nullptr);
571 }
572 const T &front() const {
573 return *static_cast<T *>(Last ? Last->Next.getPointer() : nullptr);
574 }
575
577 if (Other.empty())
578 return;
579
580 T *FirstNode = static_cast<T *>(Other.Last->Next.getPointer());
581 T *IterNode = FirstNode;
582 do {
583 // Keep a pointer to the node and increment the iterator.
584 T *TmpNode = IterNode;
585 IterNode = static_cast<T *>(IterNode->Next.getPointer());
586
587 // Unlink the node and push it back to this list.
588 TmpNode->Next.setPointerAndInt(TmpNode, true);
589 push_back(*TmpNode);
590 } while (IterNode != FirstNode);
591
592 Other.Last = nullptr;
593 }
594
595 class const_iterator;
597 : public iterator_facade_base<iterator, std::forward_iterator_tag, T> {
598 friend class const_iterator;
599
600 Node *N = nullptr;
601
602 public:
603 iterator() = default;
604 explicit iterator(T *N) : N(N) {}
605
607 N = N->getNext();
608 return *this;
609 }
610
611 explicit operator bool() const { return N; }
612 T &operator*() const { return *static_cast<T *>(N); }
613
614 bool operator==(const iterator &X) const { return N == X.N; }
615 };
616
618 : public iterator_facade_base<const_iterator, std::forward_iterator_tag,
619 const T> {
620 const Node *N = nullptr;
621
622 public:
623 const_iterator() = default;
624 // Placate MSVC by explicitly scoping 'iterator'.
626 explicit const_iterator(const T *N) : N(N) {}
627
629 N = N->getNext();
630 return *this;
631 }
632
633 explicit operator bool() const { return N; }
634 const T &operator*() const { return *static_cast<const T *>(N); }
635
636 bool operator==(const const_iterator &X) const { return N == X.N; }
637 };
638
640 return Last ? iterator(static_cast<T *>(Last->Next.getPointer())) : end();
641 }
643 return const_cast<IntrusiveBackList *>(this)->begin();
644 }
645 iterator end() { return iterator(); }
646 const_iterator end() const { return const_iterator(); }
647
648 static iterator toIterator(T &N) { return iterator(&N); }
649 static const_iterator toIterator(const T &N) { return const_iterator(&N); }
650};
651
652/// A list of DIE values.
653///
654/// This is a singly-linked list, but instead of reversing the order of
655/// insertion, we keep a pointer to the back of the list so we can push in
656/// order.
657///
658/// There are two main reasons to choose a linked list over a customized
659/// vector-like data structure.
660///
661/// 1. For teardown efficiency, we want DIEs to be BumpPtrAllocated. Using a
662/// linked list here makes this way easier to accomplish.
663/// 2. Carrying an extra pointer per \a DIEValue isn't expensive. 45% of DIEs
664/// have 2 or fewer values, and 90% have 5 or fewer. A vector would be
665/// over-allocated by 50% on average anyway, the same cost as the
666/// linked-list node.
668 struct Node : IntrusiveBackListNode {
669 DIEValue V;
670
671 explicit Node(DIEValue V) : V(V) {}
672 };
673
675
676 ListTy List;
677
678public:
681 : public iterator_adaptor_base<value_iterator, ListTy::iterator,
682 std::forward_iterator_tag, DIEValue> {
684
685 using iterator_adaptor =
686 iterator_adaptor_base<value_iterator, ListTy::iterator,
687 std::forward_iterator_tag, DIEValue>;
688
689 public:
690 value_iterator() = default;
691 explicit value_iterator(ListTy::iterator X) : iterator_adaptor(X) {}
692
693 explicit operator bool() const { return bool(wrapped()); }
694 DIEValue &operator*() const { return wrapped()->V; }
695 };
696
698 const_value_iterator, ListTy::const_iterator,
699 std::forward_iterator_tag, const DIEValue> {
700 using iterator_adaptor =
701 iterator_adaptor_base<const_value_iterator, ListTy::const_iterator,
702 std::forward_iterator_tag, const DIEValue>;
703
704 public:
708 explicit const_value_iterator(ListTy::const_iterator X)
709 : iterator_adaptor(X) {}
710
711 explicit operator bool() const { return bool(wrapped()); }
712 const DIEValue &operator*() const { return wrapped()->V; }
713 };
714
717
719 List.push_back(*new (Alloc) Node(V));
720 return value_iterator(ListTy::toIterator(List.back()));
721 }
722 template <class T>
724 dwarf::Form Form, T &&Value) {
725 return addValue(Alloc, DIEValue(Attribute, Form, std::forward<T>(Value)));
726 }
727
728 /// Take ownership of the nodes in \p Other, and append them to the back of
729 /// the list.
730 void takeValues(DIEValueList &Other) { List.takeNodes(Other.List); }
731
733 return make_range(value_iterator(List.begin()), value_iterator(List.end()));
734 }
736 return make_range(const_value_iterator(List.begin()),
738 }
739};
740
741//===--------------------------------------------------------------------===//
742/// A structured debug information entry. Has an abbreviation which
743/// describes its organization.
745 friend class IntrusiveBackList<DIE>;
746 friend class DIEUnit;
747
748 /// Dwarf unit relative offset.
749 unsigned Offset = 0;
750 /// Size of instance + children.
751 unsigned Size = 0;
752 unsigned AbbrevNumber = ~0u;
753 /// Dwarf tag code.
755 /// Set to true to force a DIE to emit an abbreviation that says it has
756 /// children even when it doesn't. This is used for unit testing purposes.
757 bool ForceChildren = false;
758 /// Children DIEs.
759 IntrusiveBackList<DIE> Children;
760
761 /// The owner is either the parent DIE for children of other DIEs, or a
762 /// DIEUnit which contains this DIE as its unit DIE.
764
765 explicit DIE(dwarf::Tag Tag) : Tag(Tag) {}
766
767public:
768 DIE() = delete;
769 DIE(const DIE &RHS) = delete;
770 DIE(DIE &&RHS) = delete;
771 DIE &operator=(const DIE &RHS) = delete;
772 DIE &operator=(const DIE &&RHS) = delete;
773
775 return new (Alloc) DIE(Tag);
776 }
777
778 // Accessors.
779 unsigned getAbbrevNumber() const { return AbbrevNumber; }
780 dwarf::Tag getTag() const { return Tag; }
781 /// Get the compile/type unit relative offset of this DIE.
782 unsigned getOffset() const {
783 // A real Offset can't be zero because the unit headers are at offset zero.
784 assert(Offset && "Offset being queried before it's been computed.");
785 return Offset;
786 }
787 unsigned getSize() const {
788 // A real Size can't be zero because it includes the non-empty abbrev code.
789 assert(Size && "Size being queried before it's been ocmputed.");
790 return Size;
791 }
792 bool hasChildren() const { return ForceChildren || !Children.empty(); }
793 void setForceChildren(bool B) { ForceChildren = B; }
794
799
801 return make_range(Children.begin(), Children.end());
802 }
804 return make_range(Children.begin(), Children.end());
805 }
806
807 DIE *getParent() const;
808
809 /// Generate the abbreviation for this DIE.
810 ///
811 /// Calculate the abbreviation for this, which should be uniqued and
812 /// eventually used to call \a setAbbrevNumber().
814
815 /// Set the abbreviation number for this DIE.
816 void setAbbrevNumber(unsigned I) { AbbrevNumber = I; }
817
818 /// Get the absolute offset within the .debug_info or .debug_types section
819 /// for this DIE.
821
822 /// Compute the offset of this DIE and all its children.
823 ///
824 /// This function gets called just before we are going to generate the debug
825 /// information and gives each DIE a chance to figure out its CU relative DIE
826 /// offset, unique its abbreviation and fill in the abbreviation code, and
827 /// return the unit offset that points to where the next DIE will be emitted
828 /// within the debug unit section. After this function has been called for all
829 /// DIE objects, the DWARF can be generated since all DIEs will be able to
830 /// properly refer to other DIE objects since all DIEs have calculated their
831 /// offsets.
832 ///
833 /// \param FormParams Used when calculating sizes.
834 /// \param AbbrevSet the abbreviation used to unique DIE abbreviations.
835 /// \param CUOffset the compile/type unit relative offset in bytes.
836 /// \returns the offset for the DIE that follows this DIE within the
837 /// current compile/type unit.
839 DIEAbbrevSet &AbbrevSet, unsigned CUOffset);
840
841 /// Climb up the parent chain to get the compile unit or type unit DIE that
842 /// this DIE belongs to.
843 ///
844 /// \returns the compile or type unit DIE that owns this DIE, or NULL if
845 /// this DIE hasn't been added to a unit DIE.
846 const DIE *getUnitDie() const;
847
848 /// Climb up the parent chain to get the compile unit or type unit that this
849 /// DIE belongs to.
850 ///
851 /// \returns the DIEUnit that represents the compile or type unit that owns
852 /// this DIE, or NULL if this DIE hasn't been added to a unit DIE.
853 DIEUnit *getUnit() const;
854
855 void setOffset(unsigned O) { Offset = O; }
856 void setSize(unsigned S) { Size = S; }
857
858 /// Add a child to the DIE.
859 DIE &addChild(DIE *Child) {
860 assert(!Child->getParent() && "Child should be orphaned");
861 Child->Owner = this;
862 Children.push_back(*Child);
863 return Children.back();
864 }
865
867 assert(!Child->getParent() && "Child should be orphaned");
868 Child->Owner = this;
869 Children.push_front(*Child);
870 return Children.front();
871 }
872
873 /// Find a value in the DIE with the attribute given.
874 ///
875 /// Returns a default-constructed DIEValue (where \a DIEValue::getType()
876 /// gives \a DIEValue::isNone) if no such attribute exists.
878
879 void print(raw_ostream &O, unsigned IndentCount = 0) const;
880 void dump() const;
881};
882
883//===--------------------------------------------------------------------===//
884/// Represents a compile or type unit.
885class DIEUnit {
886 /// The compile unit or type unit DIE. This variable must be an instance of
887 /// DIE so that we can calculate the DIEUnit from any DIE by traversing the
888 /// parent backchain and getting the Unit DIE, and then casting itself to a
889 /// DIEUnit. This allows us to be able to find the DIEUnit for any DIE without
890 /// having to store a pointer to the DIEUnit in each DIE instance.
891 DIE Die;
892 /// The section this unit will be emitted in. This may or may not be set to
893 /// a valid section depending on the client that is emitting DWARF.
894 MCSection *Section = nullptr;
895 uint64_t Offset = 0; /// .debug_info or .debug_types absolute section offset.
896protected:
897 virtual ~DIEUnit() = default;
898
899public:
900 explicit DIEUnit(dwarf::Tag UnitTag);
901 DIEUnit(const DIEUnit &RHS) = delete;
902 DIEUnit(DIEUnit &&RHS) = delete;
903 void operator=(const DIEUnit &RHS) = delete;
904 void operator=(const DIEUnit &&RHS) = delete;
905 /// Set the section that this DIEUnit will be emitted into.
906 ///
907 /// This function is used by some clients to set the section. Not all clients
908 /// that emit DWARF use this section variable.
909 void setSection(MCSection *Section) {
910 assert(!this->Section);
911 this->Section = Section;
912 }
913
915 return nullptr;
916 }
917
918 /// Return the section that this DIEUnit will be emitted into.
919 ///
920 /// \returns Section pointer which can be NULL.
921 MCSection *getSection() const { return Section; }
922 void setDebugSectionOffset(uint64_t O) { Offset = O; }
923 uint64_t getDebugSectionOffset() const { return Offset; }
924 DIE &getUnitDie() { return Die; }
925 const DIE &getUnitDie() const { return Die; }
926};
927
928struct BasicDIEUnit final : DIEUnit {
929 explicit BasicDIEUnit(dwarf::Tag UnitTag) : DIEUnit(UnitTag) {}
930};
931
932//===--------------------------------------------------------------------===//
933/// DIELoc - Represents an expression location.
934//
935class DIELoc : public DIEValueList {
936 mutable unsigned Size = 0; // Size in bytes excluding size header.
937
938public:
939 DIELoc() = default;
940
941 /// Calculate the size of the location expression.
942 unsigned computeSize(const dwarf::FormParams &FormParams) const;
943
944 // TODO: move setSize() and Size to DIEValueList.
945 void setSize(unsigned size) { Size = size; }
946
947 /// BestForm - Choose the best form for data.
948 ///
949 dwarf::Form BestForm(unsigned DwarfVersion) const {
950 if (DwarfVersion > 3)
951 return dwarf::DW_FORM_exprloc;
952 // Pre-DWARF4 location expressions were blocks and not exprloc.
953 if ((unsigned char)Size == Size)
954 return dwarf::DW_FORM_block1;
955 if ((unsigned short)Size == Size)
956 return dwarf::DW_FORM_block2;
957 if ((unsigned int)Size == Size)
958 return dwarf::DW_FORM_block4;
959 return dwarf::DW_FORM_block;
960 }
961
962 void emitValue(const AsmPrinter *Asm, dwarf::Form Form) const;
963 unsigned sizeOf(const dwarf::FormParams &, dwarf::Form Form) const;
964
965 void print(raw_ostream &O) const;
966};
967
968//===--------------------------------------------------------------------===//
969/// DIEBlock - Represents a block of values.
970//
971class DIEBlock : public DIEValueList {
972 mutable unsigned Size = 0; // Size in bytes excluding size header.
973
974public:
975 DIEBlock() = default;
976
977 /// Calculate the size of the location expression.
978 unsigned computeSize(const dwarf::FormParams &FormParams) const;
979
980 // TODO: move setSize() and Size to DIEValueList.
981 void setSize(unsigned size) { Size = size; }
982
983 /// BestForm - Choose the best form for data.
984 ///
986 if ((unsigned char)Size == Size)
987 return dwarf::DW_FORM_block1;
988 if ((unsigned short)Size == Size)
989 return dwarf::DW_FORM_block2;
990 if ((unsigned int)Size == Size)
991 return dwarf::DW_FORM_block4;
992 return dwarf::DW_FORM_block;
993 }
994
995 void emitValue(const AsmPrinter *Asm, dwarf::Form Form) const;
996 unsigned sizeOf(const dwarf::FormParams &, dwarf::Form Form) const;
997
998 void print(raw_ostream &O) const;
999};
1000
1001} // end namespace llvm
1002
1003#endif // LLVM_CODEGEN_DIE_H
This file defines the BumpPtrAllocator interface.
basic Basic Alias true
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
dxil metadata DXIL Metadata Emit
Returns the sub type a function will return at a given Idx Should correspond to the result type of an ExtractValue instruction executed with just that one unsigned Idx
This file contains constants used for implementing Dwarf debug support.
uint64_t Offset
uint64_t Addr
uint64_t Size
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
This file defines a hash set that can be used to remove duplication of nodes in a graph.
#define F(x, y, z)
Definition: MD5.cpp:55
#define I(x, y, z)
Definition: MD5.cpp:58
Load MIR Sample Profile
#define T
This file defines the PointerIntPair class.
This file defines the PointerUnion class, which is a discriminated union of pointer types.
uint32_t Number
Definition: Profile.cpp:47
const NodeList & List
Definition: RDFGraph.cpp:199
Basic Register Allocator
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file defines the SmallVector class.
Value * RHS
This class is intended to be used as a driving class for all asm writers.
Definition: AsmPrinter.h:84
Allocate memory in an ever growing pool, as if by bump-pointer.
Definition: Allocator.h:66
Dwarf abbreviation data, describes one attribute of a Dwarf abbreviation.
Definition: DIE.h:49
dwarf::Form getForm() const
Definition: DIE.h:68
dwarf::Attribute getAttribute() const
Accessors.
Definition: DIE.h:67
DIEAbbrevData(dwarf::Attribute A, int64_t V)
Definition: DIE.h:62
int64_t getValue() const
Definition: DIE.h:69
DIEAbbrevData(dwarf::Attribute A, dwarf::Form F)
Definition: DIE.h:60
Helps unique DIEAbbrev objects and assigns abbreviation numbers.
Definition: DIE.h:140
DIEAbbrevSet(BumpPtrAllocator &A)
Definition: DIE.h:150
DIEAbbrev & uniqueAbbreviation(DIE &Die)
Generate the abbreviation declaration for a DIE and return a pointer to the generated abbreviation.
Definition: DIE.cpp:140
Dwarf abbreviation, describes the organization of a debug information object.
Definition: DIE.h:79
void print(raw_ostream &O) const
Definition: DIE.cpp:103
void AddImplicitConstAttribute(dwarf::Attribute Attribute, int64_t Value)
Adds attribute with DW_FORM_implicit_const value.
Definition: DIE.h:114
unsigned getNumber() const
Definition: DIE.h:101
void AddAttribute(dwarf::Attribute Attribute, dwarf::Form Form)
Adds another set of attribute information to the abbreviation.
Definition: DIE.h:109
void AddAttribute(const DIEAbbrevData &AbbrevData)
Adds another set of attribute information to the abbreviation.
Definition: DIE.h:119
const SmallVectorImpl< DIEAbbrevData > & getData() const
Definition: DIE.h:103
DIEAbbrev(dwarf::Tag T, bool C)
Definition: DIE.h:96
void setChildrenFlag(bool hasChild)
Definition: DIE.h:104
dwarf::Tag getTag() const
Accessors.
Definition: DIE.h:100
void setNumber(unsigned N)
Definition: DIE.h:105
void dump() const
Definition: DIE.cpp:126
bool hasChildren() const
Definition: DIE.h:102
A BaseTypeRef DIE.
Definition: DIE.h:355
void print(raw_ostream &O) const
Definition: DIE.cpp:869
unsigned sizeOf(const dwarf::FormParams &FormParams, dwarf::Form Form) const
Definition: DIE.cpp:855
void emitValue(const AsmPrinter *AP, dwarf::Form Form) const
EmitValue - Emit label value.
Definition: DIE.cpp:863
DIEAddrOffset(uint64_t Idx, const MCSymbol *Hi, const MCSymbol *Lo)
Definition: DIE.h:360
A BaseTypeRef DIE.
Definition: DIE.h:240
uint64_t getIndex() const
Definition: DIE.h:255
void emitValue(const AsmPrinter *AP, dwarf::Form Form) const
EmitValue - Emit base type reference.
Definition: DIE.cpp:521
void print(raw_ostream &O) const
Definition: DIE.cpp:532
DIEBaseTypeRef(const DwarfCompileUnit *TheCU, uint64_t Idx)
Definition: DIE.h:246
unsigned sizeOf(const dwarf::FormParams &, dwarf::Form) const
sizeOf - Determine size of the base type reference in bytes.
Definition: DIE.cpp:527
DIEBlock - Represents a block of values.
Definition: DIE.h:971
unsigned sizeOf(const dwarf::FormParams &, dwarf::Form Form) const
sizeOf - Determine size of block data in bytes.
Definition: DIE.cpp:793
void setSize(unsigned size)
Definition: DIE.h:981
dwarf::Form BestForm() const
BestForm - Choose the best form for data.
Definition: DIE.h:985
void print(raw_ostream &O) const
Definition: DIE.cpp:806
DIEBlock()=default
void emitValue(const AsmPrinter *Asm, dwarf::Form Form) const
EmitValue - Emit block data.
Definition: DIE.cpp:773
unsigned computeSize(const dwarf::FormParams &FormParams) const
Calculate the size of the location expression.
Definition: DIE.cpp:762
A simple label difference DIE.
Definition: DIE.h:261
DIEDelta(const MCSymbol *Hi, const MCSymbol *Lo)
Definition: DIE.h:266
void print(raw_ostream &O) const
Definition: DIE.cpp:562
unsigned sizeOf(const dwarf::FormParams &FormParams, dwarf::Form Form) const
SizeOf - Determine size of delta value in bytes.
Definition: DIE.cpp:547
void emitValue(const AsmPrinter *AP, dwarf::Form Form) const
EmitValue - Emit delta value.
Definition: DIE.cpp:540
A pointer to another debug information entry.
Definition: DIE.h:319
void emitValue(const AsmPrinter *AP, dwarf::Form Form) const
EmitValue - Emit debug information entry offset.
Definition: DIE.cpp:649
void print(raw_ostream &O) const
Definition: DIE.cpp:704
unsigned sizeOf(const dwarf::FormParams &FormParams, dwarf::Form Form) const
Definition: DIE.cpp:682
DIE & getEntry() const
Definition: DIE.h:326
DIEEntry()=delete
DIEEntry(DIE &E)
Definition: DIE.h:324
An expression DIE.
Definition: DIE.h:206
void print(raw_ostream &O) const
Definition: DIE.cpp:481
const MCExpr * getValue() const
Get MCExpr.
Definition: DIE.h:213
DIEExpr(const MCExpr *E)
Definition: DIE.h:210
void emitValue(const AsmPrinter *AP, dwarf::Form Form) const
EmitValue - Emit expression value.
Definition: DIE.cpp:460
unsigned sizeOf(const dwarf::FormParams &FormParams, dwarf::Form Form) const
SizeOf - Determine size of expression value in bytes.
Definition: DIE.cpp:466
A container for inline string values.
Definition: DIE.h:297
void emitValue(const AsmPrinter *AP, dwarf::Form Form) const
Definition: DIE.cpp:624
~DIEInlineString()=default
void print(raw_ostream &O) const
Definition: DIE.cpp:639
unsigned sizeOf(const dwarf::FormParams &, dwarf::Form) const
Definition: DIE.cpp:633
StringRef getString() const
Grab the string out of the object.
Definition: DIE.h:307
DIEInlineString(StringRef Str, Allocator &A)
Definition: DIE.h:302
An integer value DIE.
Definition: DIE.h:168
DIEInteger(uint64_t I)
Definition: DIE.h:172
unsigned sizeOf(const dwarf::FormParams &FormParams, dwarf::Form Form) const
sizeOf - Determine size of integer value in bytes.
Definition: DIE.cpp:427
uint64_t getValue() const
Definition: DIE.h:195
void setValue(uint64_t Val)
Definition: DIE.h:196
void print(raw_ostream &O) const
Definition: DIE.cpp:449
void emitValue(const AsmPrinter *Asm, dwarf::Form Form) const
EmitValue - Emit integer of appropriate size.
Definition: DIE.cpp:370
static dwarf::Form BestForm(bool IsSigned, uint64_t Int)
Choose the best form for integer.
Definition: DIE.h:175
A label DIE.
Definition: DIE.h:223
const MCSymbol * getValue() const
Get MCSymbol.
Definition: DIE.h:230
void emitValue(const AsmPrinter *AP, dwarf::Form Form) const
EmitValue - Emit label value.
Definition: DIE.cpp:489
void print(raw_ostream &O) const
Definition: DIE.cpp:515
unsigned sizeOf(const dwarf::FormParams &FormParams, dwarf::Form Form) const
sizeOf - Determine size of label value in bytes.
Definition: DIE.cpp:497
DIELabel(const MCSymbol *L)
Definition: DIE.h:227
Represents a pointer to a location list in the debug_loc section.
Definition: DIE.h:337
void print(raw_ostream &O) const
Definition: DIE.cpp:849
unsigned sizeOf(const dwarf::FormParams &FormParams, dwarf::Form Form) const
Definition: DIE.cpp:814
DIELocList(size_t I)
Definition: DIE.h:342
void emitValue(const AsmPrinter *AP, dwarf::Form Form) const
EmitValue - Emit label value.
Definition: DIE.cpp:838
size_t getValue() const
Grab the current index out.
Definition: DIE.h:345
DIELoc - Represents an expression location.
Definition: DIE.h:935
void setSize(unsigned size)
Definition: DIE.h:945
void print(raw_ostream &O) const
Definition: DIE.cpp:754
unsigned sizeOf(const dwarf::FormParams &, dwarf::Form Form) const
sizeOf - Determine size of location data in bytes.
Definition: DIE.cpp:741
void emitValue(const AsmPrinter *Asm, dwarf::Form Form) const
EmitValue - Emit location data.
Definition: DIE.cpp:723
unsigned computeSize(const dwarf::FormParams &FormParams) const
Calculate the size of the location expression.
Definition: DIE.cpp:712
dwarf::Form BestForm(unsigned DwarfVersion) const
BestForm - Choose the best form for data.
Definition: DIE.h:949
DIELoc()=default
A container for string pool string values.
Definition: DIE.h:278
void emitValue(const AsmPrinter *AP, dwarf::Form Form) const
EmitValue - Emit string value.
Definition: DIE.cpp:572
DIEString(DwarfStringPoolEntryRef S)
Definition: DIE.h:282
void print(raw_ostream &O) const
Definition: DIE.cpp:617
unsigned sizeOf(const dwarf::FormParams &FormParams, dwarf::Form Form) const
sizeOf - Determine size of delta value in bytes.
Definition: DIE.cpp:596
StringRef getString() const
Grab the string out of the object.
Definition: DIE.h:285
Represents a compile or type unit.
Definition: DIE.h:885
void setSection(MCSection *Section)
Set the section that this DIEUnit will be emitted into.
Definition: DIE.h:909
void operator=(const DIEUnit &&RHS)=delete
DIEUnit(DIEUnit &&RHS)=delete
void operator=(const DIEUnit &RHS)=delete
const DIE & getUnitDie() const
Definition: DIE.h:925
DIEUnit(const DIEUnit &RHS)=delete
virtual const MCSymbol * getCrossSectionRelativeBaseAddress() const
Definition: DIE.h:914
void setDebugSectionOffset(uint64_t O)
Definition: DIE.h:922
MCSection * getSection() const
Return the section that this DIEUnit will be emitted into.
Definition: DIE.h:921
DIE & getUnitDie()
Definition: DIE.h:924
virtual ~DIEUnit()=default
.debug_info or .debug_types absolute section offset.
uint64_t getDebugSectionOffset() const
Definition: DIE.h:923
const DIEValue & operator*() const
Definition: DIE.h:712
const_value_iterator(DIEValueList::value_iterator X)
Definition: DIE.h:706
const_value_iterator(ListTy::const_iterator X)
Definition: DIE.h:708
value_iterator(ListTy::iterator X)
Definition: DIE.h:691
DIEValue & operator*() const
Definition: DIE.h:694
A list of DIE values.
Definition: DIE.h:667
void takeValues(DIEValueList &Other)
Take ownership of the nodes in Other, and append them to the back of the list.
Definition: DIE.h:730
value_range values()
Definition: DIE.h:732
value_iterator addValue(BumpPtrAllocator &Alloc, const DIEValue &V)
Definition: DIE.h:718
const_value_range values() const
Definition: DIE.h:735
value_iterator addValue(BumpPtrAllocator &Alloc, dwarf::Attribute Attribute, dwarf::Form Form, T &&Value)
Definition: DIE.h:723
void print(raw_ostream &O) const
Definition: DIE.cpp:346
void emitValue(const AsmPrinter *AP) const
Emit value via the Dwarf writer.
Definition: DIE.cpp:321
DIEValue()=default
unsigned sizeOf(const dwarf::FormParams &FormParams) const
Return the size of a value in bytes.
Definition: DIE.cpp:333
dwarf::Form getForm() const
Definition: DIE.h:494
Type getType() const
Accessors.
Definition: DIE.h:492
~DIEValue()
Definition: DIE.h:475
DIEValue(const DIEValue &X)
Definition: DIE.h:462
DIEValue & operator=(const DIEValue &X)
Definition: DIE.h:466
dwarf::Attribute getAttribute() const
Definition: DIE.h:493
void dump() const
Definition: DIE.cpp:359
A structured debug information entry.
Definition: DIE.h:744
DIEValue findAttribute(dwarf::Attribute Attribute) const
Find a value in the DIE with the attribute given.
Definition: DIE.cpp:216
void print(raw_ostream &O, unsigned IndentCount=0) const
Definition: DIE.cpp:242
unsigned getAbbrevNumber() const
Definition: DIE.h:779
DIE(DIE &&RHS)=delete
unsigned getSize() const
Definition: DIE.h:787
const_child_range children() const
Definition: DIE.h:803
DIE & addChild(DIE *Child)
Add a child to the DIE.
Definition: DIE.h:859
DIE(const DIE &RHS)=delete
DIEAbbrev generateAbbrev() const
Generate the abbreviation for this DIE.
Definition: DIE.cpp:180
unsigned computeOffsetsAndAbbrevs(const dwarf::FormParams &FormParams, DIEAbbrevSet &AbbrevSet, unsigned CUOffset)
Compute the offset of this DIE and all its children.
Definition: DIE.cpp:272
DIE & addChildFront(DIE *Child)
Definition: DIE.h:866
void setSize(unsigned S)
Definition: DIE.h:856
static DIE * get(BumpPtrAllocator &Alloc, dwarf::Tag Tag)
Definition: DIE.h:774
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
child_range children()
Definition: DIE.h:800
DIE & operator=(const DIE &RHS)=delete
DIE()=delete
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
void setAbbrevNumber(unsigned I)
Set the abbreviation number for this DIE.
Definition: DIE.h:816
unsigned getOffset() const
Get the compile/type unit relative offset of this DIE.
Definition: DIE.h:782
void setOffset(unsigned O)
Definition: DIE.h:855
void setForceChildren(bool B)
Definition: DIE.h:793
bool hasChildren() const
Definition: DIE.h:792
uint64_t getDebugSectionOffset() const
Get the absolute offset within the .debug_info or .debug_types section for this DIE.
Definition: DIE.cpp:191
dwarf::Tag getTag() const
Definition: DIE.h:780
void dump() const
Definition: DIE.cpp:267
DIE & operator=(const DIE &&RHS)=delete
DIE * getParent() const
Definition: DIE.cpp:176
DwarfStringPoolEntryRef: Dwarf string pool entry reference.
Node - This class is used to maintain the singly linked bucket list in a folding set.
Definition: FoldingSet.h:136
FoldingSetNodeID - This class is used to gather all the unique data bits of a node.
Definition: FoldingSet.h:318
FoldingSet - This template class is used to instantiate a specialized implementation of the folding s...
Definition: FoldingSet.h:520
bool operator==(const const_iterator &X) const
Definition: DIE.h:636
const_iterator(typename IntrusiveBackList< T >::iterator X)
Definition: DIE.h:625
const_iterator & operator++()
Definition: DIE.h:628
bool operator==(const iterator &X) const
Definition: DIE.h:614
void takeNodes(IntrusiveBackList< T > &Other)
Definition: DIE.h:576
const T & back() const
Definition: DIE.h:568
iterator end()
Definition: DIE.h:645
const T & front() const
Definition: DIE.h:572
void push_front(T &N)
Definition: DIE.h:566
iterator begin()
Definition: DIE.h:639
void push_back(T &N)
Definition: DIE.h:565
static const_iterator toIterator(const T &N)
Definition: DIE.h:649
const_iterator begin() const
Definition: DIE.h:642
const_iterator end() const
Definition: DIE.h:646
static iterator toIterator(T &N)
Definition: DIE.h:648
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:35
Instances of this class represent a uniqued identifier for a section in the current translation unit.
Definition: MCSection.h:39
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:41
PointerIntPair - This class implements a pair of a pointer and small integer.
A discriminated union of two or more pointer types, with the discriminator in the low bit of the poin...
Definition: PointerUnion.h:118
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: SmallVector.h:577
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1200
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
LLVM Value Representation.
Definition: Value.h:74
CRTP base class for adapting an iterator to a different type.
Definition: iterator.h:237
CRTP base class which implements the entire standard iterator facade in terms of a minimal subset of ...
Definition: iterator.h:80
A range adaptor for a pair of iterators.
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:52
This provides a very simple, boring adaptor for a begin and end iterator into a range type.
@ C
The default llvm calling convention, compatible with C.
Definition: CallingConv.h:34
Attribute
Attributes.
Definition: Dwarf.h:123
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
auto size(R &&Range, std::enable_if_t< std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits< decltype(Range.begin())>::iterator_category >::value, void > *=nullptr)
Get the size of a range.
Definition: STLExtras.h:1777
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
OutputIt copy(R &&Range, OutputIt Out)
Definition: STLExtras.h:1921
#define N
BasicDIEUnit(dwarf::Tag UnitTag)
Definition: DIE.h:929
void push_back(Node &N)
Definition: DIE.h:537
bool empty() const
Definition: DIE.h:535
void push_front(Node &N)
Definition: DIE.h:548
PointerIntPair< IntrusiveBackListNode *, 1 > Next
Definition: DIE.h:521
IntrusiveBackListNode * getNext() const
Definition: DIE.h:525
A helper struct providing information about the byte size of DW_FORM values that vary in size dependi...
Definition: Dwarf.h:731