LLVM  12.0.0git
DwarfUnit.h
Go to the documentation of this file.
1 //===-- llvm/CodeGen/DwarfUnit.h - Dwarf Compile Unit ---*- 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 // This file contains support for writing dwarf compile unit.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_LIB_CODEGEN_ASMPRINTER_DWARFUNIT_H
14 #define LLVM_LIB_CODEGEN_ASMPRINTER_DWARFUNIT_H
15 
16 #include "DwarfDebug.h"
17 #include "llvm/ADT/DenseMap.h"
18 #include "llvm/ADT/Optional.h"
20 #include "llvm/CodeGen/DIE.h"
21 #include <string>
22 
23 namespace llvm {
24 
25 class ConstantFP;
26 class ConstantInt;
27 class DbgVariable;
28 class DwarfCompileUnit;
29 class MachineOperand;
30 class MCDwarfDwoLineTable;
31 class MCSymbol;
32 
33 //===----------------------------------------------------------------------===//
34 /// This dwarf writer support class manages information associated with a
35 /// source file.
36 class DwarfUnit : public DIEUnit {
37 protected:
38  /// MDNode for the compile unit.
40 
41  // All DIEValues are allocated through this allocator.
43 
44  /// Target of Dwarf emission.
46 
47  /// Emitted at the end of the CU and used to compute the CU Length field.
48  MCSymbol *EndLabel = nullptr;
49 
50  // Holders for some common dwarf information.
53 
54  /// An anonymous type for index type. Owned by DIEUnit.
56 
57  /// Tracks the mapping of unit level debug information variables to debug
58  /// information entries.
60 
61  /// A list of all the DIEBlocks in use.
62  std::vector<DIEBlock *> DIEBlocks;
63 
64  /// A list of all the DIELocs in use.
65  std::vector<DIELoc *> DIELocs;
66 
67  /// This map is used to keep track of subprogram DIEs that need
68  /// DW_AT_containing_type attribute. This attribute points to a DIE that
69  /// corresponds to the MDNode mapped with the subprogram DIE.
71 
73  DwarfFile *DWU);
74 
76 
77  bool isShareableAcrossCUs(const DINode *D) const;
78 
79 public:
80  // Accessors.
81  AsmPrinter* getAsmPrinter() const { return Asm; }
82  MCSymbol *getEndLabel() const { return EndLabel; }
84  const DICompileUnit *getCUNode() const { return CUNode; }
85  DwarfDebug &getDwarfDebug() const { return *DD; }
86 
87  /// Return true if this compile unit has something to write out.
88  bool hasContent() const { return getUnitDie().hasChildren(); }
89 
90  /// Get string containing language specific context for a global name.
91  ///
92  /// Walks the metadata parent chain in a language specific manner (using the
93  /// compile unit language) and returns it as a string. This is done at the
94  /// metadata level because DIEs may not currently have been added to the
95  /// parent context and walking the DIEs looking for names is more expensive
96  /// than walking the metadata.
97  std::string getParentContextString(const DIScope *Context) const;
98 
99  /// Add a new global name to the compile unit.
100  virtual void addGlobalName(StringRef Name, const DIE &Die,
101  const DIScope *Context) = 0;
102 
103  /// Add a new global type to the compile unit.
104  virtual void addGlobalType(const DIType *Ty, const DIE &Die,
105  const DIScope *Context) = 0;
106 
107  /// Returns the DIE map slot for the specified debug variable.
108  ///
109  /// We delegate the request to DwarfDebug when the MDNode can be part of the
110  /// type system, since DIEs for the type system can be shared across CUs and
111  /// the mappings are kept in DwarfDebug.
112  DIE *getDIE(const DINode *D) const;
113 
114  /// Returns a fresh newly allocated DIELoc.
116 
117  /// Insert DIE into the map.
118  ///
119  /// We delegate the request to DwarfDebug when the MDNode can be part of the
120  /// type system, since DIEs for the type system can be shared across CUs and
121  /// the mappings are kept in DwarfDebug.
122  void insertDIE(const DINode *Desc, DIE *D);
123 
124  void insertDIE(DIE *D);
125 
126  /// Add a flag that is true to the DIE.
128 
129  /// Add an unsigned integer attribute data and value.
132 
133  void addUInt(DIEValueList &Block, dwarf::Form Form, uint64_t Integer);
134 
135  /// Add an signed integer attribute data and value.
138 
139  void addSInt(DIELoc &Die, Optional<dwarf::Form> Form, int64_t Integer);
140 
141  /// Add a string attribute data and value.
142  ///
143  /// We always emit a reference to the string pool instead of immediate
144  /// strings so that DIEs have more predictable sizes. In the case of split
145  /// dwarf we emit an index into another table which gets us the static offset
146  /// into the string table.
148 
149  /// Add a Dwarf label attribute data and value.
153  const MCSymbol *Label);
154 
155  void addLabel(DIELoc &Die, dwarf::Form Form, const MCSymbol *Label);
156 
157  /// Add an offset into a section attribute data and value.
158  void addSectionOffset(DIE &Die, dwarf::Attribute Attribute, uint64_t Integer);
159 
160  /// Add a dwarf op address data and value using the form given and an
161  /// op of either DW_FORM_addr or DW_FORM_GNU_addr_index.
162  void addOpAddress(DIELoc &Die, const MCSymbol *Sym);
163 
164  /// Add a label delta attribute data and value.
166  const MCSymbol *Lo);
167 
168  /// Add a DIE attribute data and value.
169  void addDIEEntry(DIE &Die, dwarf::Attribute Attribute, DIE &Entry);
170 
171  /// Add a DIE attribute data and value.
173 
174  /// Add a type's DW_AT_signature and set the declaration flag.
175  void addDIETypeSignature(DIE &Die, uint64_t Signature);
176 
177  /// Add block data.
178  void addBlock(DIE &Die, dwarf::Attribute Attribute, DIELoc *Loc);
179 
180  /// Add block data.
182 
183  /// Add location information to specified debug information entry.
184  void addSourceLine(DIE &Die, unsigned Line, const DIFile *File);
185  void addSourceLine(DIE &Die, const DILocalVariable *V);
186  void addSourceLine(DIE &Die, const DIGlobalVariable *G);
187  void addSourceLine(DIE &Die, const DISubprogram *SP);
188  void addSourceLine(DIE &Die, const DILabel *L);
189  void addSourceLine(DIE &Die, const DIType *Ty);
190  void addSourceLine(DIE &Die, const DIObjCProperty *Ty);
191 
192  /// Add constant value entry in variable DIE.
193  void addConstantValue(DIE &Die, const ConstantInt *CI, const DIType *Ty);
194  void addConstantValue(DIE &Die, const APInt &Val, const DIType *Ty);
195  void addConstantValue(DIE &Die, const APInt &Val, bool Unsigned);
196  void addConstantValue(DIE &Die, uint64_t Val, const DIType *Ty);
197  void addConstantValue(DIE &Die, bool Unsigned, uint64_t Val);
198 
199  /// Add constant value entry in variable DIE.
200  void addConstantFPValue(DIE &Die, const ConstantFP *CFP);
201 
202  /// Add a linkage name, if it isn't empty.
204 
205  /// Add template parameters in buffer.
206  void addTemplateParams(DIE &Buffer, DINodeArray TParams);
207 
208  /// Add thrown types.
209  void addThrownTypes(DIE &Die, DINodeArray ThrownTypes);
210 
211  /// Add a new type attribute to the specified entity.
212  ///
213  /// This takes and attribute parameter because DW_AT_friend attributes are
214  /// also type references.
215  void addType(DIE &Entity, const DIType *Ty,
216  dwarf::Attribute Attribute = dwarf::DW_AT_type);
217 
219  DIE *getOrCreateModule(const DIModule *M);
220  DIE *getOrCreateSubprogramDIE(const DISubprogram *SP, bool Minimal = false);
221 
222  void applySubprogramAttributes(const DISubprogram *SP, DIE &SPDie,
223  bool SkipSPAttributes = false);
224 
225  /// Creates type DIE with specific context.
226  DIE *createTypeDIE(const DIScope *Context, DIE &ContextDIE, const DIType *Ty);
227 
228  /// Find existing DIE or create new DIE for the given type.
229  DIE *getOrCreateTypeDIE(const MDNode *TyNode);
230 
231  /// Get context owner's DIE.
233 
234  /// Construct DIEs for types that contain vtables.
236 
237  /// Construct function argument DIEs.
239 
240  /// Create a DIE with the given Tag, add the DIE to its parent, and
241  /// call insertDIE if MD is not null.
242  DIE &createAndAddDIE(unsigned Tag, DIE &Parent, const DINode *N = nullptr);
243 
246  }
247 
248  /// Compute the size of a header for this unit, not including the initial
249  /// length field.
250  virtual unsigned getHeaderSize() const {
251  return sizeof(int16_t) + // DWARF version number
252  Asm->getDwarfOffsetByteSize() + // Offset Into Abbrev. Section
253  sizeof(int8_t) + // Pointer Size (in bytes)
254  (DD->getDwarfVersion() >= 5 ? sizeof(int8_t)
255  : 0); // DWARF v5 unit type
256  }
257 
258  /// Emit the header for this unit, not including the initial length field.
259  virtual void emitHeader(bool UseOffsets) = 0;
260 
261  /// Add the DW_AT_str_offsets_base attribute to the unit DIE.
262  void addStringOffsetsStart();
263 
264  /// Add the DW_AT_rnglists_base attribute to the unit DIE.
265  void addRnglistsBase();
266 
267  virtual DwarfCompileUnit &getCU() = 0;
268 
269  void constructTypeDIE(DIE &Buffer, const DICompositeType *CTy);
270 
271  /// addSectionDelta - Add a label delta attribute data and value.
273  const MCSymbol *Hi, const MCSymbol *Lo);
274 
275  /// Add a Dwarf section label attribute data and value.
277  const MCSymbol *Label,
278  const MCSymbol *Sec);
279 
280  /// Get context owner's DIE.
281  DIE *createTypeDIE(const DICompositeType *Ty);
282 
283 protected:
284  ~DwarfUnit();
285 
286  /// Create new static data member DIE.
288 
289  /// Look up the source ID for the given file. If none currently exists,
290  /// create a new ID and insert it in the line table.
291  virtual unsigned getOrCreateSourceID(const DIFile *File) = 0;
292 
293  /// Emit the common part of the header for this unit.
294  void emitCommonHeader(bool UseOffsets, dwarf::UnitType UT);
295 
296 private:
297  void constructTypeDIE(DIE &Buffer, const DIBasicType *BTy);
298  void constructTypeDIE(DIE &Buffer, const DIStringType *BTy);
299  void constructTypeDIE(DIE &Buffer, const DIDerivedType *DTy);
300  void constructTypeDIE(DIE &Buffer, const DISubroutineType *CTy);
301  void constructSubrangeDIE(DIE &Buffer, const DISubrange *SR, DIE *IndexTy);
302  void constructGenericSubrangeDIE(DIE &Buffer, const DIGenericSubrange *SR,
303  DIE *IndexTy);
304  void constructArrayTypeDIE(DIE &Buffer, const DICompositeType *CTy);
305  void constructEnumTypeDIE(DIE &Buffer, const DICompositeType *CTy);
306  DIE &constructMemberDIE(DIE &Buffer, const DIDerivedType *DT);
307  void constructTemplateTypeParameterDIE(DIE &Buffer,
308  const DITemplateTypeParameter *TP);
309  void constructTemplateValueParameterDIE(DIE &Buffer,
310  const DITemplateValueParameter *TVP);
311 
312  /// Return the default lower bound for an array.
313  ///
314  /// If the DWARF version doesn't handle the language, return -1.
315  int64_t getDefaultLowerBound() const;
316 
317  /// Get an anonymous type for index type.
318  DIE *getIndexTyDie();
319 
320  /// Set D as anonymous type for index which can be reused later.
321  void setIndexTyDie(DIE *D) { IndexTyDie = D; }
322 
323  virtual void finishNonUnitTypeDIE(DIE& D, const DICompositeType *CTy) = 0;
324 
325  /// If this is a named finished type then include it in the list of types for
326  /// the accelerator tables.
327  void updateAcceleratorTables(const DIScope *Context, const DIType *Ty,
328  const DIE &TyDIE);
329 
330  virtual bool isDwoUnit() const = 0;
331  const MCSymbol *getCrossSectionRelativeBaseAddress() const override;
332 };
333 
334 class DwarfTypeUnit final : public DwarfUnit {
335  uint64_t TypeSignature;
336  const DIE *Ty;
338  MCDwarfDwoLineTable *SplitLineTable;
339  bool UsedLineTable = false;
340 
341  unsigned getOrCreateSourceID(const DIFile *File) override;
342  void finishNonUnitTypeDIE(DIE& D, const DICompositeType *CTy) override;
343  bool isDwoUnit() const override;
344 
345 public:
347  DwarfFile *DWU, MCDwarfDwoLineTable *SplitLineTable = nullptr);
348 
349  void setTypeSignature(uint64_t Signature) { TypeSignature = Signature; }
350  void setType(const DIE *Ty) { this->Ty = Ty; }
351 
352  /// Emit the header for this unit, not including the initial length field.
353  void emitHeader(bool UseOffsets) override;
354  unsigned getHeaderSize() const override {
355  return DwarfUnit::getHeaderSize() + sizeof(uint64_t) + // Type Signature
356  Asm->getDwarfOffsetByteSize(); // Type DIE Offset
357  }
358  void addGlobalName(StringRef Name, const DIE &Die,
359  const DIScope *Context) override;
360  void addGlobalType(const DIType *Ty, const DIE &Die,
361  const DIScope *Context) override;
362  DwarfCompileUnit &getCU() override { return CU; }
363 };
364 } // end llvm namespace
365 #endif
const DICompileUnit * getCUNode() const
Definition: DwarfUnit.h:84
DIE::value_iterator addSectionDelta(DIE &Die, dwarf::Attribute Attribute, const MCSymbol *Hi, const MCSymbol *Lo)
addSectionDelta - Add a label delta attribute data and value.
Definition: DwarfUnit.cpp:1729
void addFlag(DIE &Die, dwarf::Attribute Attribute)
Add a flag that is true to the DIE.
Definition: DwarfUnit.cpp:220
LLVMContext & Context
virtual unsigned getHeaderSize() const
Compute the size of a header for this unit, not including the initial length field.
Definition: DwarfUnit.h:250
void addLabelDelta(DIE &Die, dwarf::Attribute Attribute, const MCSymbol *Hi, const MCSymbol *Lo)
Add a label delta attribute data and value.
Definition: DwarfUnit.cpp:336
std::vector< DIELoc * > DIELocs
A list of all the DIELocs in use.
Definition: DwarfUnit.h:65
DIELoc - Represents an expression location.
Definition: DIE.h:905
This class represents lattice values for constants.
Definition: AllocatorList.h:23
DIE * getOrCreateStaticMemberDIE(const DIDerivedType *DT)
Create new static data member DIE.
Definition: DwarfUnit.cpp:1629
void addOpAddress(DIELoc &Die, const MCSymbol *Sym)
Add a dwarf op address data and value using the form given and an op of either DW_FORM_addr or DW_FOR...
Definition: DwarfUnit.cpp:318
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:41
Attribute
Attributes.
Definition: Dwarf.h:105
void addThrownTypes(DIE &Die, DINodeArray ThrownTypes)
Add thrown types.
Definition: DwarfUnit.cpp:510
void insertDIE(const DINode *Desc, DIE *D)
Insert DIE into the map.
Definition: DwarfUnit.cpp:208
Collects and handles dwarf debug information.
Definition: DwarfDebug.h:295
DwarfTypeUnit(DwarfCompileUnit &CU, AsmPrinter *A, DwarfDebug *DW, DwarfFile *DWU, MCDwarfDwoLineTable *SplitLineTable=nullptr)
Definition: DwarfUnit.cpp:95
bool hasChildren() const
Definition: DIE.h:762
Metadata node.
Definition: Metadata.h:870
bool useSegmentedStringOffsetsTable() const
Definition: DwarfUnit.h:244
void addType(DIE &Entity, const DIType *Ty, dwarf::Attribute Attribute=dwarf::DW_AT_type)
Add a new type attribute to the specified entity.
Definition: DwarfUnit.cpp:625
DIE::value_iterator addSectionLabel(DIE &Die, dwarf::Attribute Attribute, const MCSymbol *Label, const MCSymbol *Sec)
Add a Dwarf section label attribute data and value.
Definition: DwarfUnit.cpp:1737
virtual DwarfCompileUnit & getCU()=0
AsmPrinter * Asm
Target of Dwarf emission.
Definition: DwarfUnit.h:45
Tagged DWARF-like metadata node.
void constructTypeDIE(DIE &Buffer, const DICompositeType *CTy)
Definition: DwarfUnit.cpp:814
DIE * getDIE(const DINode *D) const
Returns the DIE map slot for the specified debug variable.
Definition: DwarfUnit.cpp:202
Array subrange.
bool isShareableAcrossCUs(const DINode *D) const
Check whether the DIE for this MDNode can be shared across CUs.
Definition: DwarfUnit.cpp:188
void addConstantFPValue(DIE &Die, const ConstantFP *CFP)
Add constant value entry in variable DIE.
Definition: DwarfUnit.cpp:437
void constructContainingTypeDIEs()
Construct DIEs for types that contain vtables.
Definition: DwarfUnit.cpp:1506
virtual void emitHeader(bool UseOffsets)=0
Emit the header for this unit, not including the initial length field.
void addConstantValue(DIE &Die, const ConstantInt *CI, const DIType *Ty)
Add constant value entry in variable DIE.
Definition: DwarfUnit.cpp:442
DIE * getOrCreateTypeDIE(const MDNode *TyNode)
Find existing DIE or create new DIE for the given type.
Definition: DwarfUnit.cpp:580
void addBlock(DIE &Die, dwarf::Attribute Attribute, DIELoc *Loc)
Add block data.
Definition: DwarfUnit.cpp:378
DenseMap< DIE *, const DINode * > ContainingTypeMap
This map is used to keep track of subprogram DIEs that need DW_AT_containing_type attribute.
Definition: DwarfUnit.h:70
void addString(DIE &Die, dwarf::Attribute Attribute, StringRef Str)
Add a string attribute data and value.
Definition: DwarfUnit.cpp:255
Subprogram description.
AsmPrinter * getAsmPrinter() const
Definition: DwarfUnit.h:81
A list of DIE values.
Definition: DIE.h:645
DwarfCompileUnit & getCU() override
Definition: DwarfUnit.h:362
MCSymbol * EndLabel
Emitted at the end of the CU and used to compute the CU Length field.
Definition: DwarfUnit.h:48
DIE * getOrCreateNameSpace(const DINamespace *NS)
Definition: DwarfUnit.cpp:1024
void applySubprogramAttributes(const DISubprogram *SP, DIE &SPDie, bool SkipSPAttributes=false)
Definition: DwarfUnit.cpp:1159
void addSourceLine(DIE &Die, unsigned Line, const DIFile *File)
Add location information to specified debug information entry.
Definition: DwarfUnit.cpp:392
void addGlobalName(StringRef Name, const DIE &Die, const DIScope *Context) override
Add a new global name to the compile unit.
Definition: DwarfUnit.cpp:1750
A pointer to another debug information entry.
Definition: DIE.h:314
This dwarf writer support class manages information associated with a source file.
Definition: DwarfUnit.h:36
DIEValueList::value_iterator addLabel(DIEValueList &Die, dwarf::Attribute Attribute, dwarf::Form Form, const MCSymbol *Label)
Add a Dwarf label attribute data and value.
Definition: DwarfUnit.cpp:289
bool applySubprogramDefinitionAttributes(const DISubprogram *SP, DIE &SPDie)
Definition: DwarfUnit.cpp:1108
Allocate memory in an ever growing pool, as if by bump-pointer.
Definition: Allocator.h:67
Instrumentation for Order File
String type, Fortran CHARACTER(n)
bool hasContent() const
Return true if this compile unit has something to write out.
Definition: DwarfUnit.h:88
A structured debug information entry.
Definition: DIE.h:722
DIELoc * getDIELoc()
Returns a fresh newly allocated DIELoc.
Definition: DwarfUnit.h:115
ConstantFP - Floating Point Values [float, double].
Definition: Constants.h:273
unsigned int getDwarfOffsetByteSize() const
Returns 4 for DWARF32 and 8 for DWARF64.
DIE & getUnitDie()
Definition: DIE.h:894
This class is intended to be used as a driving class for all asm writers.
Definition: AsmPrinter.h:82
DenseMap< const MDNode *, DIE * > MDNodeToDieMap
Tracks the mapping of unit level debug information variables to debug information entries.
Definition: DwarfUnit.h:59
virtual unsigned getOrCreateSourceID(const DIFile *File)=0
Look up the source ID for the given file.
void emitCommonHeader(bool UseOffsets, dwarf::UnitType UT)
Emit the common part of the header for this unit.
Definition: DwarfUnit.cpp:1676
DIE * getOrCreateSubprogramDIE(const DISubprogram *SP, bool Minimal=false)
Definition: DwarfUnit.cpp:1076
bool useSegmentedStringOffsetsTable() const
Returns whether to generate a string offsets table with (possibly shared) contributions from each CU ...
Definition: DwarfDebug.h:729
DwarfDebug & getDwarfDebug() const
Definition: DwarfUnit.h:85
void addSInt(DIEValueList &Die, dwarf::Attribute Attribute, Optional< dwarf::Form > Form, int64_t Integer)
Add an signed integer attribute data and value.
Definition: DwarfUnit.cpp:243
DIE * IndexTyDie
An anonymous type for index type. Owned by DIEUnit.
Definition: DwarfUnit.h:55
Base class for scope-like contexts.
std::string getParentContextString(const DIScope *Context) const
Get string containing language specific context for a global name.
Definition: DwarfUnit.cpp:631
UnitType
Constants for unit types in DWARF v5.
Definition: Dwarf.h:440
uint16_t getLanguage() const
Definition: DwarfUnit.h:83
unsigned getHeaderSize() const override
Compute the size of a header for this unit, not including the initial length field.
Definition: DwarfUnit.h:354
Base class for types.
This is the shared class of boolean and integer constants.
Definition: Constants.h:77
MCSymbol * getEndLabel() const
Definition: DwarfUnit.h:82
const DataFlowGraph & G
Definition: RDFGraph.cpp:202
void addLinkageName(DIE &Die, StringRef LinkageName)
Add a linkage name, if it isn't empty.
Definition: DwarfUnit.cpp:491
Represents a compile or type unit.
Definition: DIE.h:855
void addGlobalType(const DIType *Ty, const DIE &Die, const DIScope *Context) override
Add a new global type to the compile unit.
Definition: DwarfUnit.cpp:1755
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
void setTypeSignature(uint64_t Signature)
Definition: DwarfUnit.h:349
void addRnglistsBase()
Add the DW_AT_rnglists_base attribute to the unit DIE.
Definition: DwarfUnit.cpp:1775
void addTemplateParams(DIE &Buffer, DINodeArray TParams)
Add template parameters in buffer.
Definition: DwarfUnit.cpp:499
unsigned getSourceLanguage() const
DwarfDebug * DD
Definition: DwarfUnit.h:51
Class for arbitrary precision integers.
Definition: APInt.h:70
Represents a module in the programming language, for example, a Clang module, or a Fortran module.
void setType(const DIE *Ty)
Definition: DwarfUnit.h:350
void addDIEEntry(DIE &Die, dwarf::Attribute Attribute, DIE &Entry)
Add a DIE attribute data and value.
Definition: DwarfUnit.cpp:342
virtual void addGlobalType(const DIType *Ty, const DIE &Die, const DIScope *Context)=0
Add a new global type to the compile unit.
DIE * getOrCreateContextDIE(const DIScope *Context)
Get context owner's DIE.
Definition: DwarfUnit.cpp:517
Type array for a subprogram.
virtual void addGlobalName(StringRef Name, const DIE &Die, const DIScope *Context)=0
Add a new global name to the compile unit.
DIE & createAndAddDIE(unsigned Tag, DIE &Parent, const DINode *N=nullptr)
Create a DIE with the given Tag, add the DIE to its parent, and call insertDIE if MD is not null.
Definition: DwarfUnit.cpp:371
#define N
void emitHeader(bool UseOffsets) override
Emit the header for this unit, not including the initial length field.
Definition: DwarfUnit.cpp:1717
DIE * getOrCreateModule(const DIModule *M)
Definition: DwarfUnit.cpp:1045
const DICompileUnit * CUNode
MDNode for the compile unit.
Definition: DwarfUnit.h:39
void addSectionOffset(DIE &Die, dwarf::Attribute Attribute, uint64_t Integer)
Add an offset into a section attribute data and value.
Definition: DwarfUnit.cpp:300
void addDIETypeSignature(DIE &Die, uint64_t Signature)
Add a type's DW_AT_signature and set the declaration flag.
Definition: DwarfUnit.cpp:346
BumpPtrAllocator DIEValueAllocator
Definition: DwarfUnit.h:42
DIE * createTypeDIE(const DIScope *Context, DIE &ContextDIE, const DIType *Ty)
Creates type DIE with specific context.
Definition: DwarfUnit.cpp:547
void addStringOffsetsStart()
Add the DW_AT_str_offsets_base attribute to the unit DIE.
Definition: DwarfUnit.cpp:1768
std::vector< DIEBlock * > DIEBlocks
A list of all the DIEBlocks in use.
Definition: DwarfUnit.h:62
uint16_t getDwarfVersion() const
Returns the Dwarf Version.
void addUInt(DIEValueList &Die, dwarf::Attribute Attribute, Optional< dwarf::Form > Form, uint64_t Integer)
Add an unsigned integer attribute data and value.
Definition: DwarfUnit.cpp:229
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:57
DIEBlock - Represents a block of values.
Definition: DIE.h:942
DwarfFile * DU
Definition: DwarfUnit.h:52
void constructSubprogramArguments(DIE &Buffer, DITypeRefArray Args)
Construct function argument DIEs.
Definition: DwarfUnit.cpp:766
DwarfUnit(dwarf::Tag, const DICompileUnit *Node, AsmPrinter *A, DwarfDebug *DW, DwarfFile *DWU)
Definition: DwarfUnit.cpp:90
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
Basic type, like 'int' or 'float'.