LLVM  8.0.1
DwarfUnit.h
Go to the documentation of this file.
1 //===-- llvm/CodeGen/DwarfUnit.h - Dwarf Compile Unit ---*- C++ -*--===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file contains support for writing dwarf compile unit.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_LIB_CODEGEN_ASMPRINTER_DWARFUNIT_H
15 #define LLVM_LIB_CODEGEN_ASMPRINTER_DWARFUNIT_H
16 
17 #include "DwarfDebug.h"
18 #include "llvm/ADT/DenseMap.h"
19 #include "llvm/ADT/Optional.h"
20 #include "llvm/ADT/StringMap.h"
22 #include "llvm/CodeGen/DIE.h"
23 #include "llvm/IR/DIBuilder.h"
24 #include "llvm/IR/DebugInfo.h"
25 #include "llvm/MC/MCDwarf.h"
26 #include "llvm/MC/MCExpr.h"
27 #include "llvm/MC/MCSection.h"
28 
29 namespace llvm {
30 
31 class MachineLocation;
32 class MachineOperand;
33 class ConstantInt;
34 class ConstantFP;
35 class DbgVariable;
36 class DwarfCompileUnit;
37 
38 //===----------------------------------------------------------------------===//
39 /// This dwarf writer support class manages information associated with a
40 /// source file.
41 class DwarfUnit : public DIEUnit {
42 protected:
43  /// MDNode for the compile unit.
45 
46  // All DIEValues are allocated through this allocator.
48 
49  /// Target of Dwarf emission.
51 
52  /// Emitted at the end of the CU and used to compute the CU Length field.
53  MCSymbol *EndLabel = nullptr;
54 
55  // Holders for some common dwarf information.
58 
59  /// An anonymous type for index type. Owned by DIEUnit.
61 
62  /// Tracks the mapping of unit level debug information variables to debug
63  /// information entries.
65 
66  /// A list of all the DIEBlocks in use.
67  std::vector<DIEBlock *> DIEBlocks;
68 
69  /// A list of all the DIELocs in use.
70  std::vector<DIELoc *> DIELocs;
71 
72  /// This map is used to keep track of subprogram DIEs that need
73  /// DW_AT_containing_type attribute. This attribute points to a DIE that
74  /// corresponds to the MDNode mapped with the subprogram DIE.
76 
78  DwarfFile *DWU);
79 
81 
82  bool shareAcrossDWOCUs() const;
83  bool isShareableAcrossCUs(const DINode *D) const;
84 
85 public:
86  // Accessors.
87  AsmPrinter* getAsmPrinter() const { return Asm; }
88  MCSymbol *getEndLabel() const { return EndLabel; }
89  uint16_t getLanguage() const { return CUNode->getSourceLanguage(); }
90  const DICompileUnit *getCUNode() const { return CUNode; }
91 
92  uint16_t getDwarfVersion() const { return DD->getDwarfVersion(); }
93 
94  /// Return true if this compile unit has something to write out.
95  bool hasContent() const { return getUnitDie().hasChildren(); }
96 
97  /// Get string containing language specific context for a global name.
98  ///
99  /// Walks the metadata parent chain in a language specific manner (using the
100  /// compile unit language) and returns it as a string. This is done at the
101  /// metadata level because DIEs may not currently have been added to the
102  /// parent context and walking the DIEs looking for names is more expensive
103  /// than walking the metadata.
104  std::string getParentContextString(const DIScope *Context) const;
105 
106  /// Add a new global name to the compile unit.
107  virtual void addGlobalName(StringRef Name, const DIE &Die,
108  const DIScope *Context) = 0;
109 
110  /// Add a new global type to the compile unit.
111  virtual void addGlobalType(const DIType *Ty, const DIE &Die,
112  const DIScope *Context) = 0;
113 
114  /// Returns the DIE map slot for the specified debug variable.
115  ///
116  /// We delegate the request to DwarfDebug when the MDNode can be part of the
117  /// type system, since DIEs for the type system can be shared across CUs and
118  /// the mappings are kept in DwarfDebug.
119  DIE *getDIE(const DINode *D) const;
120 
121  /// Returns a fresh newly allocated DIELoc.
123 
124  /// Insert DIE into the map.
125  ///
126  /// We delegate the request to DwarfDebug when the MDNode can be part of the
127  /// type system, since DIEs for the type system can be shared across CUs and
128  /// the mappings are kept in DwarfDebug.
129  void insertDIE(const DINode *Desc, DIE *D);
130 
131  /// Add a flag that is true to the DIE.
133 
134  /// Add an unsigned integer attribute data and value.
135  void addUInt(DIEValueList &Die, dwarf::Attribute Attribute,
137 
138  void addUInt(DIEValueList &Block, dwarf::Form Form, uint64_t Integer);
139 
140  /// Add an signed integer attribute data and value.
141  void addSInt(DIEValueList &Die, dwarf::Attribute Attribute,
142  Optional<dwarf::Form> Form, int64_t Integer);
143 
144  void addSInt(DIELoc &Die, Optional<dwarf::Form> Form, int64_t Integer);
145 
146  /// Add a string attribute data and value.
147  ///
148  /// We always emit a reference to the string pool instead of immediate
149  /// strings so that DIEs have more predictable sizes. In the case of split
150  /// dwarf we emit an index into another table which gets us the static offset
151  /// into the string table.
152  void addString(DIE &Die, dwarf::Attribute Attribute, StringRef Str);
153 
154  /// Add a Dwarf label attribute data and value.
156  dwarf::Attribute Attribute,
157  dwarf::Form Form,
158  const MCSymbol *Label);
159 
160  void addLabel(DIELoc &Die, dwarf::Form Form, const MCSymbol *Label);
161 
162  /// Add an offset into a section attribute data and value.
163  void addSectionOffset(DIE &Die, dwarf::Attribute Attribute, uint64_t Integer);
164 
165  /// Add a dwarf op address data and value using the form given and an
166  /// op of either DW_FORM_addr or DW_FORM_GNU_addr_index.
167  void addOpAddress(DIELoc &Die, const MCSymbol *Sym);
168 
169  /// Add a label delta attribute data and value.
170  void addLabelDelta(DIE &Die, dwarf::Attribute Attribute, const MCSymbol *Hi,
171  const MCSymbol *Lo);
172 
173  /// Add a DIE attribute data and value.
174  void addDIEEntry(DIE &Die, dwarf::Attribute Attribute, DIE &Entry);
175 
176  /// Add a DIE attribute data and value.
177  void addDIEEntry(DIE &Die, dwarf::Attribute Attribute, DIEEntry Entry);
178 
179  /// Add a type's DW_AT_signature and set the declaration flag.
180  void addDIETypeSignature(DIE &Die, uint64_t Signature);
181 
182  /// Add block data.
183  void addBlock(DIE &Die, dwarf::Attribute Attribute, DIELoc *Loc);
184 
185  /// Add block data.
186  void addBlock(DIE &Die, dwarf::Attribute Attribute, DIEBlock *Block);
187 
188  /// Add location information to specified debug information entry.
189  void addSourceLine(DIE &Die, unsigned Line, const DIFile *File);
190  void addSourceLine(DIE &Die, const DILocalVariable *V);
191  void addSourceLine(DIE &Die, const DIGlobalVariable *G);
192  void addSourceLine(DIE &Die, const DISubprogram *SP);
193  void addSourceLine(DIE &Die, const DILabel *L);
194  void addSourceLine(DIE &Die, const DIType *Ty);
195  void addSourceLine(DIE &Die, const DIObjCProperty *Ty);
196 
197  /// Add constant value entry in variable DIE.
198  void addConstantValue(DIE &Die, const MachineOperand &MO, const DIType *Ty);
199  void addConstantValue(DIE &Die, const ConstantInt *CI, const DIType *Ty);
200  void addConstantValue(DIE &Die, const APInt &Val, const DIType *Ty);
201  void addConstantValue(DIE &Die, const APInt &Val, bool Unsigned);
202  void addConstantValue(DIE &Die, bool Unsigned, uint64_t Val);
203 
204  /// Add constant value entry in variable DIE.
205  void addConstantFPValue(DIE &Die, const MachineOperand &MO);
206  void addConstantFPValue(DIE &Die, const ConstantFP *CFP);
207 
208  /// Add a linkage name, if it isn't empty.
210 
211  /// Add template parameters in buffer.
212  void addTemplateParams(DIE &Buffer, DINodeArray TParams);
213 
214  /// Add thrown types.
215  void addThrownTypes(DIE &Die, DINodeArray ThrownTypes);
216 
217  // FIXME: Should be reformulated in terms of addComplexAddress.
218  /// Start with the address based on the location provided, and generate the
219  /// DWARF information necessary to find the actual Block variable (navigating
220  /// the Block struct) based on the starting location. Add the DWARF
221  /// information to the die. Obsolete, please use addComplexAddress instead.
222  void addBlockByrefAddress(const DbgVariable &DV, DIE &Die,
223  dwarf::Attribute Attribute,
224  const MachineLocation &Location);
225 
226  /// Add a new type attribute to the specified entity.
227  ///
228  /// This takes and attribute parameter because DW_AT_friend attributes are
229  /// also type references.
230  void addType(DIE &Entity, const DIType *Ty,
231  dwarf::Attribute Attribute = dwarf::DW_AT_type);
232 
234  DIE *getOrCreateModule(const DIModule *M);
235  DIE *getOrCreateSubprogramDIE(const DISubprogram *SP, bool Minimal = false);
236 
237  void applySubprogramAttributes(const DISubprogram *SP, DIE &SPDie,
238  bool SkipSPAttributes = false);
239 
240  /// Find existing DIE or create new DIE for the given type.
241  DIE *getOrCreateTypeDIE(const MDNode *TyNode);
242 
243  /// Get context owner's DIE.
244  DIE *getOrCreateContextDIE(const DIScope *Context);
245 
246  /// Construct DIEs for types that contain vtables.
248 
249  /// Construct function argument DIEs.
251 
252  /// Create a DIE with the given Tag, add the DIE to its parent, and
253  /// call insertDIE if MD is not null.
254  DIE &createAndAddDIE(unsigned Tag, DIE &Parent, const DINode *N = nullptr);
255 
257  return DD->useSegmentedStringOffsetsTable();
258  }
259 
260  /// Compute the size of a header for this unit, not including the initial
261  /// length field.
262  virtual unsigned getHeaderSize() const {
263  return sizeof(int16_t) + // DWARF version number
264  sizeof(int32_t) + // Offset Into Abbrev. Section
265  sizeof(int8_t) + // Pointer Size (in bytes)
266  (DD->getDwarfVersion() >= 5 ? sizeof(int8_t)
267  : 0); // DWARF v5 unit type
268  }
269 
270  /// Emit the header for this unit, not including the initial length field.
271  virtual void emitHeader(bool UseOffsets) = 0;
272 
273  /// Add the DW_AT_str_offsets_base attribute to the unit DIE.
274  void addStringOffsetsStart();
275 
276  /// Add the DW_AT_rnglists_base attribute to the unit DIE.
277  void addRnglistsBase();
278 
279  /// Add the DW_AT_loclists_base attribute to the unit DIE.
280  void addLoclistsBase();
281 
282  virtual DwarfCompileUnit &getCU() = 0;
283 
284  void constructTypeDIE(DIE &Buffer, const DICompositeType *CTy);
285 
286  /// addSectionDelta - Add a label delta attribute data and value.
288  const MCSymbol *Hi, const MCSymbol *Lo);
289 
290  /// Add a Dwarf section label attribute data and value.
292  const MCSymbol *Label,
293  const MCSymbol *Sec);
294 
295  /// If the \p File has an MD5 checksum, return it as an MD5Result
296  /// allocated in the MCContext.
297  MD5::MD5Result *getMD5AsBytes(const DIFile *File) const;
298 
299 protected:
300  ~DwarfUnit();
301 
302  /// Create new static data member DIE.
304 
305  /// Look up the source ID for the given file. If none currently exists,
306  /// create a new ID and insert it in the line table.
307  virtual unsigned getOrCreateSourceID(const DIFile *File) = 0;
308 
309  /// Look in the DwarfDebug map for the MDNode that corresponds to the
310  /// reference.
311  template <typename T> T *resolve(TypedDINodeRef<T> Ref) const {
312  return Ref.resolve();
313  }
314 
315  /// If this is a named finished type then include it in the list of types for
316  /// the accelerator tables.
317  void updateAcceleratorTables(const DIScope *Context, const DIType *Ty,
318  const DIE &TyDIE);
319 
320  /// Emit the common part of the header for this unit.
321  void emitCommonHeader(bool UseOffsets, dwarf::UnitType UT);
322 
323 private:
324  void constructTypeDIE(DIE &Buffer, const DIBasicType *BTy);
325  void constructTypeDIE(DIE &Buffer, const DIDerivedType *DTy);
326  void constructTypeDIE(DIE &Buffer, const DISubroutineType *CTy);
327  void constructSubrangeDIE(DIE &Buffer, const DISubrange *SR, DIE *IndexTy);
328  void constructArrayTypeDIE(DIE &Buffer, const DICompositeType *CTy);
329  void constructEnumTypeDIE(DIE &Buffer, const DICompositeType *CTy);
330  DIE &constructMemberDIE(DIE &Buffer, const DIDerivedType *DT);
331  void constructTemplateTypeParameterDIE(DIE &Buffer,
332  const DITemplateTypeParameter *TP);
333  void constructTemplateValueParameterDIE(DIE &Buffer,
334  const DITemplateValueParameter *TVP);
335 
336  /// Return the default lower bound for an array.
337  ///
338  /// If the DWARF version doesn't handle the language, return -1.
339  int64_t getDefaultLowerBound() const;
340 
341  /// Get an anonymous type for index type.
342  DIE *getIndexTyDie();
343 
344  /// Set D as anonymous type for index which can be reused later.
345  void setIndexTyDie(DIE *D) { IndexTyDie = D; }
346 
347  virtual bool isDwoUnit() const = 0;
348  const MCSymbol *getCrossSectionRelativeBaseAddress() const override;
349 };
350 
351 class DwarfTypeUnit final : public DwarfUnit {
352  uint64_t TypeSignature;
353  const DIE *Ty;
355  MCDwarfDwoLineTable *SplitLineTable;
356  bool UsedLineTable = false;
357 
358  unsigned getOrCreateSourceID(const DIFile *File) override;
359  bool isDwoUnit() const override;
360 
361 public:
363  DwarfFile *DWU, MCDwarfDwoLineTable *SplitLineTable = nullptr);
364 
365  void setTypeSignature(uint64_t Signature) { TypeSignature = Signature; }
366  void setType(const DIE *Ty) { this->Ty = Ty; }
367 
368  /// Get context owner's DIE.
369  DIE *createTypeDIE(const DICompositeType *Ty);
370 
371  /// Emit the header for this unit, not including the initial length field.
372  void emitHeader(bool UseOffsets) override;
373  unsigned getHeaderSize() const override {
374  return DwarfUnit::getHeaderSize() + sizeof(uint64_t) + // Type Signature
375  sizeof(uint32_t); // Type DIE Offset
376  }
377  void addGlobalName(StringRef Name, const DIE &Die,
378  const DIScope *Context) override;
379  void addGlobalType(const DIType *Ty, const DIE &Die,
380  const DIScope *Context) override;
381  DwarfCompileUnit &getCU() override { return CU; }
382 };
383 } // end llvm namespace
384 #endif
const DICompileUnit * getCUNode() const
Definition: DwarfUnit.h:90
void updateAcceleratorTables(const DIScope *Context, const DIType *Ty, const DIE &TyDIE)
If this is a named finished type then include it in the list of types for the accelerator tables...
Definition: DwarfUnit.cpp:669
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:1607
void addFlag(DIE &Die, dwarf::Attribute Attribute)
Add a flag that is true to the DIE.
Definition: DwarfUnit.cpp:200
LLVMContext & Context
virtual unsigned getHeaderSize() const
Compute the size of a header for this unit, not including the initial length field.
Definition: DwarfUnit.h:262
void addLabelDelta(DIE &Die, dwarf::Attribute Attribute, const MCSymbol *Hi, const MCSymbol *Lo)
Add a label delta attribute data and value.
Definition: DwarfUnit.cpp:335
std::vector< DIELoc * > DIELocs
A list of all the DIELocs in use.
Definition: DwarfUnit.h:70
DIELoc - Represents an expression location.
Definition: DIE.h:846
This class represents lattice values for constants.
Definition: AllocatorList.h:24
DIE * getOrCreateStaticMemberDIE(const DIDerivedType *DT)
Create new static data member DIE.
Definition: DwarfUnit.cpp:1506
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:317
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:42
Attribute
Attributes.
Definition: Dwarf.h:115
void addThrownTypes(DIE &Die, DINodeArray ThrownTypes)
Add thrown types.
Definition: DwarfUnit.cpp:585
void insertDIE(const DINode *Desc, DIE *D)
Insert DIE into the map.
Definition: DwarfUnit.cpp:192
Collects and handles dwarf debug information.
Definition: DwarfDebug.h:281
bool hasChildren() const
Definition: DIE.h:702
MD5::MD5Result * getMD5AsBytes(const DIFile *File) const
If the File has an MD5 checksum, return it as an MD5Result allocated in the MCContext.
Definition: DwarfUnit.cpp:288
bool shareAcrossDWOCUs() const
void addLoclistsBase()
Add the DW_AT_loclists_base attribute to the unit DIE.
Definition: DwarfUnit.cpp:1666
Metadata node.
Definition: Metadata.h:864
bool useSegmentedStringOffsetsTable() const
Definition: DwarfUnit.h:256
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:687
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:1616
virtual DwarfCompileUnit & getCU()=0
AsmPrinter * Asm
Target of Dwarf emission.
Definition: DwarfUnit.h:50
Tagged DWARF-like metadata node.
void constructTypeDIE(DIE &Buffer, const DICompositeType *CTy)
Definition: DwarfUnit.cpp:836
DIE * getDIE(const DINode *D) const
Returns the DIE map slot for the specified debug variable.
Definition: DwarfUnit.cpp:186
T * resolve(TypedDINodeRef< T > Ref) const
Look in the DwarfDebug map for the MDNode that corresponds to the reference.
Definition: DwarfUnit.h:311
amdgpu Simplify well known AMD library false Value Value const Twine & Name
Array subrange.
bool isShareableAcrossCUs(const DINode *D) const
Check whether the DIE for this MDNode can be shared across CUs.
Definition: DwarfUnit.cpp:171
void addConstantFPValue(DIE &Die, const MachineOperand &MO)
Add constant value entry in variable DIE.
Definition: DwarfUnit.cpp:487
The access may reference the value stored in memory.
void constructContainingTypeDIEs()
Construct DIEs for types that contain vtables.
Definition: DwarfUnit.cpp:1383
virtual void emitHeader(bool UseOffsets)=0
Emit the header for this unit, not including the initial length field.
Holds a subclass of DINode.
void addBlockByrefAddress(const DbgVariable &DV, DIE &Die, dwarf::Attribute Attribute, const MachineLocation &Location)
Start with the address based on the location provided, and generate the DWARF information necessary t...
DIE * getOrCreateTypeDIE(const MDNode *TyNode)
Find existing DIE or create new DIE for the given type.
Definition: DwarfUnit.cpp:622
void addBlock(DIE &Die, dwarf::Attribute Attribute, DIELoc *Loc)
Add block data.
Definition: DwarfUnit.cpp:377
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:75
void addString(DIE &Die, dwarf::Attribute Attribute, StringRef Str)
Add a string attribute data and value.
Definition: DwarfUnit.cpp:235
Subprogram description.
AsmPrinter * getAsmPrinter() const
Definition: DwarfUnit.h:87
This class is used to track local variable information.
Definition: DwarfDebug.h:117
A list of DIE values.
Definition: DIE.h:589
DwarfCompileUnit & getCU() override
Definition: DwarfUnit.h:381
MCSymbol * EndLabel
Emitted at the end of the CU and used to compute the CU Length field.
Definition: DwarfUnit.h:53
DIE * getOrCreateNameSpace(const DINamespace *NS)
Definition: DwarfUnit.cpp:1038
void addConstantValue(DIE &Die, const MachineOperand &MO, const DIType *Ty)
Add constant value entry in variable DIE.
Definition: DwarfUnit.cpp:519
void applySubprogramAttributes(const DISubprogram *SP, DIE &SPDie, bool SkipSPAttributes=false)
Definition: DwarfUnit.cpp:1157
void addSourceLine(DIE &Die, unsigned Line, const DIFile *File)
Add location information to specified debug information entry.
Definition: DwarfUnit.cpp:391
A pointer to another debug information entry.
Definition: DIE.h:294
This dwarf writer support class manages information associated with a source file.
Definition: DwarfUnit.h:41
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:269
bool applySubprogramDefinitionAttributes(const DISubprogram *SP, DIE &SPDie)
Definition: DwarfUnit.cpp:1114
Allocate memory in an ever growing pool, as if by bump-pointer.
Definition: Allocator.h:141
bool hasContent() const
Return true if this compile unit has something to write out.
Definition: DwarfUnit.h:95
A structured debug information entry.
Definition: DIE.h:662
DIELoc * getDIELoc()
Returns a fresh newly allocated DIELoc.
Definition: DwarfUnit.h:122
ConstantFP - Floating Point Values [float, double].
Definition: Constants.h:264
DIE & getUnitDie()
Definition: DIE.h:834
This class is intended to be used as a driving class for all asm writers.
Definition: AsmPrinter.h:79
DenseMap< const MDNode *, DIE * > MDNodeToDieMap
Tracks the mapping of unit level debug information variables to debug information entries...
Definition: DwarfUnit.h:64
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:1553
DIE * getOrCreateSubprogramDIE(const DISubprogram *SP, bool Minimal=false)
Definition: DwarfUnit.cpp:1083
bool useSegmentedStringOffsetsTable() const
Returns whether to generate a string offsets table with (possibly shared) contributions from each CU ...
Definition: DwarfDebug.h:664
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:223
DIE * IndexTyDie
An anonymous type for index type. Owned by DIEUnit.
Definition: DwarfUnit.h:60
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:693
UnitType
Constants for unit types in DWARF v5.
Definition: Dwarf.h:330
uint16_t getLanguage() const
Definition: DwarfUnit.h:89
unsigned getHeaderSize() const override
Compute the size of a header for this unit, not including the initial length field.
Definition: DwarfUnit.h:373
Base class for types.
This is the shared class of boolean and integer constants.
Definition: Constants.h:84
MachineOperand class - Representation of each machine instruction operand.
MCSymbol * getEndLabel() const
Definition: DwarfUnit.h:88
const DataFlowGraph & G
Definition: RDFGraph.cpp:211
void addLinkageName(DIE &Die, StringRef LinkageName)
Add a linkage name, if it isn&#39;t empty.
Definition: DwarfUnit.cpp:566
Represents a compile or type unit.
Definition: DIE.h:788
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
void setTypeSignature(uint64_t Signature)
Definition: DwarfUnit.h:365
void addRnglistsBase()
Add the DW_AT_rnglists_base attribute to the unit DIE.
Definition: DwarfUnit.cpp:1657
void addTemplateParams(DIE &Buffer, DINodeArray TParams)
Add template parameters in buffer.
Definition: DwarfUnit.cpp:574
unsigned getSourceLanguage() const
DwarfDebug * DD
Definition: DwarfUnit.h:56
Class for arbitrary precision integers.
Definition: APInt.h:70
A (clang) module that has been imported by the compile unit.
void setType(const DIE *Ty)
Definition: DwarfUnit.h:366
void addDIEEntry(DIE &Die, dwarf::Attribute Attribute, DIE &Entry)
Add a DIE attribute data and value.
Definition: DwarfUnit.cpp:341
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&#39;s DIE.
Definition: DwarfUnit.cpp:592
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:370
#define N
DIE * getOrCreateModule(const DIModule *M)
Definition: DwarfUnit.cpp:1059
const DICompileUnit * CUNode
MDNode for the compile unit.
Definition: DwarfUnit.h:44
void addSectionOffset(DIE &Die, dwarf::Attribute Attribute, uint64_t Integer)
Add an offset into a section attribute data and value.
Definition: DwarfUnit.cpp:280
uint16_t getDwarfVersion() const
Definition: DwarfUnit.h:92
void addDIETypeSignature(DIE &Die, uint64_t Signature)
Add a type&#39;s DW_AT_signature and set the declaration flag.
Definition: DwarfUnit.cpp:345
BumpPtrAllocator DIEValueAllocator
Definition: DwarfUnit.h:47
void addStringOffsetsStart()
Add the DW_AT_str_offsets_base attribute to the unit DIE.
Definition: DwarfUnit.cpp:1650
std::vector< DIEBlock * > DIEBlocks
A list of all the DIEBlocks in use.
Definition: DwarfUnit.h:67
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:209
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49
DIEBlock - Represents a block of values.
Definition: DIE.h:880
DwarfFile * DU
Definition: DwarfUnit.h:57
void constructSubprogramArguments(DIE &Buffer, DITypeRefArray Args)
Construct function argument DIEs.
Definition: DwarfUnit.cpp:788
DwarfUnit(dwarf::Tag, const DICompileUnit *Node, AsmPrinter *A, DwarfDebug *DW, DwarfFile *DWU)
Definition: DwarfUnit.cpp:72
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
Basic type, like &#39;int&#39; or &#39;float&#39;.