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