LLVM  13.0.0git
DwarfCompileUnit.h
Go to the documentation of this file.
1 //===- llvm/CodeGen/DwarfCompileUnit.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_DWARFCOMPILEUNIT_H
14 #define LLVM_LIB_CODEGEN_ASMPRINTER_DWARFCOMPILEUNIT_H
15 
16 #include "DwarfDebug.h"
17 #include "DwarfUnit.h"
18 #include "llvm/ADT/ArrayRef.h"
19 #include "llvm/ADT/DenseMap.h"
20 #include "llvm/ADT/SmallVector.h"
21 #include "llvm/ADT/StringMap.h"
22 #include "llvm/ADT/StringRef.h"
27 #include "llvm/Support/Casting.h"
28 #include <algorithm>
29 #include <cassert>
30 #include <cstdint>
31 #include <memory>
32 
33 namespace llvm {
34 
35 class AsmPrinter;
36 class DIE;
37 class DIELoc;
38 class DIEValueList;
39 class DwarfFile;
40 class GlobalVariable;
41 class MCExpr;
42 class MCSymbol;
43 class MDNode;
44 
45 enum class UnitKind { Skeleton, Full };
46 
47 class DwarfCompileUnit final : public DwarfUnit {
48  /// A numeric ID unique among all CUs in the module
49  unsigned UniqueID;
50  bool HasRangeLists = false;
51 
52  /// The start of the unit line section, this is also
53  /// reused in appyStmtList.
54  MCSymbol *LineTableStartSym;
55 
56  /// Skeleton unit associated with this unit.
57  DwarfCompileUnit *Skeleton = nullptr;
58 
59  /// The start of the unit within its section.
60  MCSymbol *LabelBegin = nullptr;
61 
62  /// The start of the unit macro info within macro section.
63  MCSymbol *MacroLabelBegin;
64 
67 
68  ImportedEntityMap ImportedEntities;
69 
70  /// GlobalNames - A map of globally visible named entities for this unit.
71  StringMap<const DIE *> GlobalNames;
72 
73  /// GlobalTypes - A map of globally visible types for this unit.
74  StringMap<const DIE *> GlobalTypes;
75 
76  // List of ranges for a given compile unit.
78 
79  // The base address of this unit, if any. Used for relative references in
80  // ranges/locs.
81  const MCSymbol *BaseAddress = nullptr;
82 
83  DenseMap<const MDNode *, DIE *> AbstractSPDies;
85 
86  /// DWO ID for correlating skeleton and split units.
87  uint64_t DWOId = 0;
88 
89  /// Construct a DIE for the given DbgVariable without initializing the
90  /// DbgVariable's DIE reference.
91  DIE *constructVariableDIEImpl(const DbgVariable &DV, bool Abstract);
92 
93  bool isDwoUnit() const override;
94 
95  DenseMap<const MDNode *, DIE *> &getAbstractSPDies() {
96  if (isDwoUnit() && !DD->shareAcrossDWOCUs())
97  return AbstractSPDies;
98  return DU->getAbstractSPDies();
99  }
100 
102  if (isDwoUnit() && !DD->shareAcrossDWOCUs())
103  return AbstractEntities;
104  return DU->getAbstractEntities();
105  }
106 
107  void finishNonUnitTypeDIE(DIE& D, const DICompositeType *CTy) override;
108 
109 public:
110  DwarfCompileUnit(unsigned UID, const DICompileUnit *Node, AsmPrinter *A,
111  DwarfDebug *DW, DwarfFile *DWU,
113 
114  bool hasRangeLists() const { return HasRangeLists; }
115  unsigned getUniqueID() const { return UniqueID; }
116 
118  return Skeleton;
119  }
120 
121  bool includeMinimalInlineScopes() const;
122 
123  void initStmtList();
124 
125  /// Apply the DW_AT_stmt_list from this compile unit to the specified DIE.
126  void applyStmtList(DIE &D);
127 
128  /// Get line table start symbol for this unit.
129  MCSymbol *getLineTableStartSym() const { return LineTableStartSym; }
130 
131  /// A pair of GlobalVariable and DIExpression.
132  struct GlobalExpr {
135  };
136 
137  struct BaseTypeRef {
140  unsigned BitSize;
142  DIE *Die = nullptr;
143  };
144 
145  std::vector<BaseTypeRef> ExprRefedBaseTypes;
146 
147  /// Get or create global variable DIE.
148  DIE *
150  ArrayRef<GlobalExpr> GlobalExprs);
151 
153  ArrayRef<GlobalExpr> GlobalExprs);
154 
155  void addLocationAttribute(DIE *ToDIE, const DIGlobalVariable *GV,
156  ArrayRef<GlobalExpr> GlobalExprs);
157 
158  /// addLabelAddress - Add a dwarf label attribute data and value using
159  /// either DW_FORM_addr or DW_FORM_GNU_addr_index.
161  const MCSymbol *Label);
162 
163  /// addLocalLabelAddress - Add a dwarf label attribute data and value using
164  /// DW_FORM_addr only.
166  const MCSymbol *Label);
167 
168  DwarfCompileUnit &getCU() override { return *this; }
169 
170  unsigned getOrCreateSourceID(const DIFile *File) override;
171 
173  DIScope *Scope = IE->getScope();
174  assert(Scope && "Invalid Scope encoding!");
175  if (!isa<DILocalScope>(Scope))
176  // No need to add imported enities that are not local declaration.
177  return;
178 
179  auto *LocalScope = cast<DILocalScope>(Scope)->getNonLexicalBlockFileScope();
180  ImportedEntities[LocalScope].push_back(IE);
181  }
182 
183  /// addRange - Add an address range to the list of ranges for this unit.
184  void addRange(RangeSpan Range);
185 
186  void attachLowHighPC(DIE &D, const MCSymbol *Begin, const MCSymbol *End);
187 
188  /// Find DIE for the given subprogram and attach appropriate
189  /// DW_AT_low_pc and DW_AT_high_pc attributes. If there are global
190  /// variables in this scope then create and insert DIEs for these
191  /// variables.
193 
195  SmallVectorImpl<DIE *> &FinalChildren);
196 
197  /// A helper function to construct a RangeSpanList for a given
198  /// lexical scope.
199  void addScopeRangeList(DIE &ScopeDIE, SmallVector<RangeSpan, 2> Range);
200 
202 
204  const SmallVectorImpl<InsnRange> &Ranges);
205 
206  /// This scope represents inlined body of a function. Construct
207  /// DIE to represent this concrete inlined copy of the function.
209 
210  /// Construct new DW_TAG_lexical_block for this scope and
211  /// attach DW_AT_low_pc/DW_AT_high_pc labels.
213 
214  /// constructVariableDIE - Construct a DIE for the given DbgVariable.
215  DIE *constructVariableDIE(DbgVariable &DV, bool Abstract = false);
216 
218  DIE *&ObjectPointer);
219 
220  /// Construct a DIE for the given DbgLabel.
222 
223  /// A helper function to create children of a Scope DIE.
225  SmallVectorImpl<DIE *> &Children,
226  bool *HasNonScopeChildren = nullptr);
227 
228  void createBaseTypeDIEs();
229 
230  /// Construct a DIE for this subprogram scope.
233 
235 
237 
238  /// Whether to use the GNU analog for a DWARF5 tag, attribute, or location
239  /// atom. Only applicable when emitting otherwise DWARF4-compliant debug info.
240  bool useGNUAnalogForDwarf5Feature() const;
241 
242  /// This takes a DWARF 5 tag and returns it or a GNU analog.
244 
245  /// This takes a DWARF 5 attribute and returns it or a GNU analog.
247 
248  /// This takes a DWARF 5 location atom and either returns it or a GNU analog.
250 
251  /// Construct a call site entry DIE describing a call within \p Scope to a
252  /// callee described by \p CalleeDIE.
253  /// \p CalleeDIE is a declaration or definition subprogram DIE for the callee.
254  /// For indirect calls \p CalleeDIE is set to nullptr.
255  /// \p IsTail specifies whether the call is a tail call.
256  /// \p PCAddr points to the PC value after the call instruction.
257  /// \p CallAddr points to the PC value at the call instruction (or is null).
258  /// \p CallReg is a register location for an indirect call. For direct calls
259  /// the \p CallReg is set to 0.
260  DIE &constructCallSiteEntryDIE(DIE &ScopeDIE, DIE *CalleeDIE, bool IsTail,
261  const MCSymbol *PCAddr,
262  const MCSymbol *CallAddr, unsigned CallReg);
263  /// Construct call site parameter DIEs for the \p CallSiteDIE. The \p Params
264  /// were collected by the \ref collectCallSiteParameters.
265  /// Note: The order of parameters does not matter, since debuggers recognize
266  /// call site parameters by the DW_AT_location attribute.
267  void constructCallSiteParmEntryDIEs(DIE &CallSiteDIE,
269 
270  /// Construct import_module DIE.
272 
274  void finishEntityDefinition(const DbgEntity *Entity);
275 
276  /// Find abstract variable associated with Var.
280 
281  /// Set the skeleton unit associated with this unit.
282  void setSkeleton(DwarfCompileUnit &Skel) { Skeleton = &Skel; }
283 
284  unsigned getHeaderSize() const override {
285  // DWARF v5 added the DWO ID to the header for split/skeleton units.
286  unsigned DWOIdSize =
287  DD->getDwarfVersion() >= 5 && DD->useSplitDwarf() ? sizeof(uint64_t)
288  : 0;
289  return DwarfUnit::getHeaderSize() + DWOIdSize;
290  }
291  unsigned getLength() {
292  return Asm->getUnitLengthFieldByteSize() + // Length field
294  }
295 
296  void emitHeader(bool UseOffsets) override;
297 
298  /// Add the DW_AT_addr_base attribute to the unit DIE.
299  void addAddrTableBase();
300 
302  assert(LabelBegin && "LabelBegin is not initialized");
303  return LabelBegin;
304  }
305 
307  return MacroLabelBegin;
308  }
309 
310  /// Add a new global name to the compile unit.
311  void addGlobalName(StringRef Name, const DIE &Die,
312  const DIScope *Context) override;
313 
314  /// Add a new global name present in a type unit to this compile unit.
316 
317  /// Add a new global type to the compile unit.
318  void addGlobalType(const DIType *Ty, const DIE &Die,
319  const DIScope *Context) override;
320 
321  /// Add a new global type present in a type unit to this compile unit.
322  void addGlobalTypeUnitType(const DIType *Ty, const DIScope *Context);
323 
324  const StringMap<const DIE *> &getGlobalNames() const { return GlobalNames; }
325  const StringMap<const DIE *> &getGlobalTypes() const { return GlobalTypes; }
326 
327  /// Add DW_AT_location attribute for a DbgVariable based on provided
328  /// MachineLocation.
329  void addVariableAddress(const DbgVariable &DV, DIE &Die,
330  MachineLocation Location);
331  /// Add an address attribute to a die based on the location provided.
333  const MachineLocation &Location);
334 
335  /// Start with the address based on the location provided, and generate the
336  /// DWARF information necessary to find the actual variable (navigating the
337  /// extra location information encoded in the type) based on the starting
338  /// location. Add the DWARF information to the die.
339  void addComplexAddress(const DbgVariable &DV, DIE &Die,
341  const MachineLocation &Location);
342 
343  /// Add a Dwarf loclistptr attribute data and value.
344  void addLocationList(DIE &Die, dwarf::Attribute Attribute, unsigned Index);
345  void applyVariableAttributes(const DbgVariable &Var, DIE &VariableDie);
346 
347  /// Add a Dwarf expression attribute data and value.
348  void addExpr(DIELoc &Die, dwarf::Form Form, const MCExpr *Expr);
349 
351  DIE &SPDie);
352 
353  void applyLabelAttributes(const DbgLabel &Label, DIE &LabelDie);
354 
355  /// getRanges - Get the list of ranges for this unit.
356  const SmallVectorImpl<RangeSpan> &getRanges() const { return CURanges; }
358 
359  void setBaseAddress(const MCSymbol *Base) { BaseAddress = Base; }
360  const MCSymbol *getBaseAddress() const { return BaseAddress; }
361 
362  uint64_t getDWOId() const { return DWOId; }
363  void setDWOId(uint64_t DwoId) { DWOId = DwoId; }
364 
365  bool hasDwarfPubSections() const;
366 
367  void addBaseTypeRef(DIEValueList &Die, int64_t Idx);
368 };
369 
370 } // end namespace llvm
371 
372 #endif // LLVM_LIB_CODEGEN_ASMPRINTER_DWARFCOMPILEUNIT_H
llvm::DwarfCompileUnit::DwarfCompileUnit
DwarfCompileUnit(unsigned UID, const DICompileUnit *Node, AsmPrinter *A, DwarfDebug *DW, DwarfFile *DWU, UnitKind Kind=UnitKind::Full)
Definition: DwarfCompileUnit.cpp:58
llvm::DwarfCompileUnit::emitHeader
void emitHeader(bool UseOffsets) override
Emit the header for this unit, not including the initial length field.
Definition: DwarfCompileUnit.cpp:1332
llvm::DwarfCompileUnit::addGlobalName
void addGlobalName(StringRef Name, const DIE &Die, const DIScope *Context) override
Add a new global name to the compile unit.
Definition: DwarfCompileUnit.cpp:1365
llvm::DwarfCompileUnit::constructSubprogramScopeDIE
DIE & constructSubprogramScopeDIE(const DISubprogram *Sub, LexicalScope *Scope)
Construct a DIE for this subprogram scope.
Definition: DwarfCompileUnit.cpp:1033
llvm::MachineLocation
Definition: MachineLocation.h:22
llvm::DwarfCompileUnit::getCU
DwarfCompileUnit & getCU() override
Definition: DwarfCompileUnit.h:168
llvm
Definition: AllocatorList.h:23
llvm::DIType
Base class for types.
Definition: DebugInfoMetadata.h:662
llvm::MCSymbol
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:41
llvm::DwarfCompileUnit::constructInlinedScopeDIE
DIE * constructInlinedScopeDIE(LexicalScope *Scope)
This scope represents inlined body of a function.
Definition: DwarfCompileUnit.cpp:643
llvm::DwarfCompileUnit::getLineTableStartSym
MCSymbol * getLineTableStartSym() const
Get line table start symbol for this unit.
Definition: DwarfCompileUnit.h:129
llvm::DwarfCompileUnit::ExprRefedBaseTypes
std::vector< BaseTypeRef > ExprRefedBaseTypes
Definition: DwarfCompileUnit.h:145
llvm::DwarfCompileUnit::getGlobalNames
const StringMap< const DIE * > & getGlobalNames() const
Definition: DwarfCompileUnit.h:324
llvm::DbgEntity
This class is defined as the common parent of DbgVariable and DbgLabel such that it could levarage po...
Definition: DwarfDebug.h:67
DebugInfoMetadata.h
llvm::Attribute
Definition: Attributes.h:52
StringRef.h
llvm::DwarfCompileUnit
Definition: DwarfCompileUnit.h:47
llvm::DwarfFile::getAbstractSPDies
DenseMap< const MDNode *, DIE * > & getAbstractSPDies()
Definition: DwarfFile.h:165
llvm::DwarfUnit::DU
DwarfFile * DU
Definition: DwarfUnit.h:53
llvm::SmallVector
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1167
llvm::DwarfCompileUnit::createAndAddScopeChildren
DIE * createAndAddScopeChildren(LexicalScope *Scope, DIE &ScopeDIE)
Definition: DwarfCompileUnit.cpp:1061
llvm::LexicalScope
LexicalScope - This class is used to track scope information.
Definition: LexicalScopes.h:44
llvm::dwarf::Form
Form
Definition: Dwarf.h:131
llvm::DwarfCompileUnit::addLabelAddress
void addLabelAddress(DIE &Die, dwarf::Attribute Attribute, const MCSymbol *Label)
addLabelAddress - Add a dwarf label attribute data and value using either DW_FORM_addr or DW_FORM_GNU...
Definition: DwarfCompileUnit.cpp:68
llvm::GlobalVariable
Definition: GlobalVariable.h:40
llvm::RangeSpan
Definition: DwarfFile.h:36
llvm::DwarfCompileUnit::attachRangesOrLowHighPC
void attachRangesOrLowHighPC(DIE &D, SmallVector< RangeSpan, 2 > Ranges)
Definition: DwarfCompileUnit.cpp:592
DenseMap.h
llvm::DwarfCompileUnit::createBaseTypeDIEs
void createBaseTypeDIEs()
Definition: DwarfCompileUnit.cpp:1543
llvm::DwarfCompileUnit::updateSubprogramScopeDIE
DIE & updateSubprogramScopeDIE(const DISubprogram *SP)
Find DIE for the given subprogram and attach appropriate DW_AT_low_pc and DW_AT_high_pc attributes.
Definition: DwarfCompileUnit.cpp:414
llvm::DwarfCompileUnit::getGlobalTypes
const StringMap< const DIE * > & getGlobalTypes() const
Definition: DwarfCompileUnit.h:325
llvm::DIE
A structured debug information entry.
Definition: DIE.h:739
llvm::DIExpression
DWARF expression.
Definition: DebugInfoMetadata.h:2554
llvm::DbgLabel
This class is used to track label information.
Definition: DwarfDebug.h:233
llvm::dwarf::Tag
Tag
Definition: Dwarf.h:104
llvm::DwarfCompileUnit::getOrCreateCommonBlock
DIE * getOrCreateCommonBlock(const DICommonBlock *CB, ArrayRef< GlobalExpr > GlobalExprs)
Definition: DwarfCompileUnit.cpp:332
llvm::DwarfCompileUnit::constructLexicalScopeDIE
DIE * constructLexicalScopeDIE(LexicalScope *Scope)
Construct new DW_TAG_lexical_block for this scope and attach DW_AT_low_pc/DW_AT_high_pc labels.
Definition: DwarfCompileUnit.cpp:677
llvm::DwarfCompileUnit::constructLabelDIE
DIE * constructLabelDIE(DbgLabel &DL, const LexicalScope &Scope)
Construct a DIE for the given DbgLabel.
Definition: DwarfCompileUnit.cpp:697
llvm::dwarf::Attribute
Attribute
Attributes.
Definition: Dwarf.h:124
llvm::DwarfCompileUnit::GlobalExpr::Expr
const DIExpression * Expr
Definition: DwarfCompileUnit.h:134
llvm::DwarfCompileUnit::BaseTypeRef::BaseTypeRef
BaseTypeRef(unsigned BitSize, dwarf::TypeKind Encoding)
Definition: DwarfCompileUnit.h:138
Context
LLVMContext & Context
Definition: NVVMIntrRange.cpp:66
llvm::DwarfCompileUnit::getExistingAbstractEntity
DbgEntity * getExistingAbstractEntity(const DINode *Node)
Definition: DwarfCompileUnit.cpp:1309
llvm::DwarfCompileUnit::takeRanges
SmallVector< RangeSpan, 2 > takeRanges()
Definition: DwarfCompileUnit.h:357
llvm::DwarfCompileUnit::addScopeRangeList
void addScopeRangeList(DIE &ScopeDIE, SmallVector< RangeSpan, 2 > Range)
A helper function to construct a RangeSpanList for a given lexical scope.
Definition: DwarfCompileUnit.cpp:559
llvm::DwarfCompileUnit::setDWOId
void setDWOId(uint64_t DwoId)
Definition: DwarfCompileUnit.h:363
llvm::DwarfCompileUnit::getDwarf5OrGNUAttr
dwarf::Attribute getDwarf5OrGNUAttr(dwarf::Attribute Attr) const
This takes a DWARF 5 attribute and returns it or a GNU analog.
Definition: DwarfCompileUnit.cpp:1131
DbgEntityHistoryCalculator.h
llvm::DwarfCompileUnit::BaseTypeRef::Die
DIE * Die
Definition: DwarfCompileUnit.h:142
llvm::DwarfCompileUnit::constructVariableDIE
DIE * constructVariableDIE(DbgVariable &DV, bool Abstract=false)
constructVariableDIE - Construct a DIE for the given DbgVariable.
Definition: DwarfCompileUnit.cpp:691
llvm::DwarfCompileUnit::addLocationList
void addLocationList(DIE &Die, dwarf::Attribute Attribute, unsigned Index)
Add a Dwarf loclistptr attribute data and value.
Definition: DwarfCompileUnit.cpp:1468
llvm::UnitKind
UnitKind
Definition: DwarfCompileUnit.h:45
llvm::DwarfCompileUnit::addLocationAttribute
void addLocationAttribute(DIE *ToDIE, const DIGlobalVariable *GV, ArrayRef< GlobalExpr > GlobalExprs)
Definition: DwarfCompileUnit.cpp:199
LexicalScopes.h
llvm::DbgValueHistoryMap::InlinedEntity
std::pair< const DINode *, const DILocation * > InlinedEntity
Definition: DbgEntityHistoryCalculator.h:97
llvm::DwarfCompileUnit::getDWOId
uint64_t getDWOId() const
Definition: DwarfCompileUnit.h:362
llvm::DwarfCompileUnit::addBaseTypeRef
void addBaseTypeRef(DIEValueList &Die, int64_t Idx)
Definition: DwarfCompileUnit.cpp:1538
llvm::DwarfCompileUnit::initStmtList
void initStmtList()
Definition: DwarfCompileUnit.cpp:370
DwarfDebug.h
StringMap.h
llvm::DbgVariable
This class is used to track local variable information.
Definition: DwarfDebug.h:116
llvm::DwarfCompileUnit::applySubprogramAttributesToDefinition
void applySubprogramAttributesToDefinition(const DISubprogram *SP, DIE &SPDie)
Definition: DwarfCompileUnit.cpp:1508
llvm::DwarfCompileUnit::attachLowHighPC
void attachLowHighPC(DIE &D, const MCSymbol *Begin, const MCSymbol *End)
Definition: DwarfCompileUnit.cpp:397
llvm::lltok::Kind
Kind
Definition: LLToken.h:18
llvm::DIE::getSize
unsigned getSize() const
Definition: DIE.h:778
llvm::StringMap
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
Definition: StringMap.h:108
llvm::DwarfCompileUnit::constructAbstractSubprogramScopeDIE
void constructAbstractSubprogramScopeDIE(LexicalScope *Scope)
Definition: DwarfCompileUnit.cpp:1074
llvm::DwarfCompileUnit::getDwarf5OrGNULocationAtom
dwarf::LocationAtom getDwarf5OrGNULocationAtom(dwarf::LocationAtom Loc) const
This takes a DWARF 5 location atom and either returns it or a GNU analog.
Definition: DwarfCompileUnit.cpp:1153
llvm::ARM_PROC::IE
@ IE
Definition: ARMBaseInfo.h:27
llvm::DICommonBlock
Definition: DebugInfoMetadata.h:2988
llvm::DwarfCompileUnit::setSkeleton
void setSkeleton(DwarfCompileUnit &Skel)
Set the skeleton unit associated with this unit.
Definition: DwarfCompileUnit.h:282
llvm::DwarfCompileUnit::addVariableAddress
void addVariableAddress(const DbgVariable &DV, DIE &Die, MachineLocation Location)
Add DW_AT_location attribute for a DbgVariable based on provided MachineLocation.
Definition: DwarfCompileUnit.cpp:1406
llvm::DwarfCompileUnit::GlobalExpr
A pair of GlobalVariable and DIExpression.
Definition: DwarfCompileUnit.h:132
llvm::DwarfCompileUnit::getMacroLabelBegin
MCSymbol * getMacroLabelBegin() const
Definition: DwarfCompileUnit.h:306
llvm::DwarfCompileUnit::getOrCreateGlobalVariableDIE
DIE * getOrCreateGlobalVariableDIE(const DIGlobalVariable *GV, ArrayRef< GlobalExpr > GlobalExprs)
Get or create global variable DIE.
Definition: DwarfCompileUnit.cpp:135
llvm::DwarfCompileUnit::hasDwarfPubSections
bool hasDwarfPubSections() const
Definition: DwarfCompileUnit.cpp:1347
Index
uint32_t Index
Definition: ELFObjHandler.cpp:84
llvm::DwarfDebug
Collects and handles dwarf debug information.
Definition: DwarfDebug.h:295
D
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
llvm::DwarfCompileUnit::addGlobalNameForTypeUnit
void addGlobalNameForTypeUnit(StringRef Name, const DIScope *Context)
Add a new global name present in a type unit to this compile unit.
Definition: DwarfCompileUnit.cpp:1373
llvm::DIGlobalVariable
Global variables.
Definition: DebugInfoMetadata.h:2908
move
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
Definition: README.txt:546
llvm::DenseMap< const MDNode *, ImportedEntityList >
llvm::DwarfDebug::useSplitDwarf
bool useSplitDwarf() const
Returns whether or not to change the current debug info for the split dwarf proposal support.
Definition: DwarfDebug.h:749
llvm::DwarfCompileUnit::getOrCreateSourceID
unsigned getOrCreateSourceID(const DIFile *File) override
Look up the source ID for the given file.
Definition: DwarfCompileUnit.cpp:120
llvm::DICompileUnit
Compile unit.
Definition: DebugInfoMetadata.h:1317
llvm::DIImportedEntity
An imported module (C++ using directive or similar).
Definition: DebugInfoMetadata.h:3281
llvm::DwarfCompileUnit::finishSubprogramDefinition
void finishSubprogramDefinition(const DISubprogram *SP)
Definition: DwarfCompileUnit.cpp:1271
llvm::DIELoc
DIELoc - Represents an expression location.
Definition: DIE.h:922
ArrayRef.h
llvm::DwarfUnit::Asm
AsmPrinter * Asm
Target of Dwarf emission.
Definition: DwarfUnit.h:46
llvm::DwarfCompileUnit::addGlobalType
void addGlobalType(const DIType *Ty, const DIE &Die, const DIScope *Context) override
Add a new global type to the compile unit.
Definition: DwarfCompileUnit.cpp:1386
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::DwarfCompileUnit::finishEntityDefinition
void finishEntityDefinition(const DbgEntity *Entity)
Definition: DwarfCompileUnit.cpp:1285
llvm::DwarfCompileUnit::constructScopeDIE
void constructScopeDIE(LexicalScope *Scope, SmallVectorImpl< DIE * > &FinalChildren)
Definition: DwarfCompileUnit.cpp:505
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:67
llvm::DwarfCompileUnit::constructImportedEntityDIE
DIE * constructImportedEntityDIE(const DIImportedEntity *Module)
Construct import_module DIE.
Definition: DwarfCompileUnit.cpp:1243
llvm::DwarfCompileUnit::BaseTypeRef::BitSize
unsigned BitSize
Definition: DwarfCompileUnit.h:140
llvm::DwarfCompileUnit::addComplexAddress
void addComplexAddress(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...
Definition: DwarfCompileUnit.cpp:1440
llvm::DICompositeType
Composite types.
Definition: DebugInfoMetadata.h:1051
llvm::ArrayRef
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: APInt.h:32
llvm::DwarfCompileUnit::applyLabelAttributes
void applyLabelAttributes(const DbgLabel &Label, DIE &LabelDie)
Definition: DwarfCompileUnit.cpp:1493
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
Dwarf.h
llvm::DwarfFile::getAbstractEntities
DenseMap< const DINode *, std::unique_ptr< DbgEntity > > & getAbstractEntities()
Definition: DwarfFile.h:169
llvm::DINode
Tagged DWARF-like metadata node.
Definition: DebugInfoMetadata.h:127
llvm::DwarfCompileUnit::addRange
void addRange(RangeSpan Range)
addRange - Add an address range to the list of ranges for this unit.
Definition: DwarfCompileUnit.cpp:351
llvm::DwarfCompileUnit::addAddrTableBase
void addAddrTableBase()
Add the DW_AT_addr_base attribute to the unit DIE.
Definition: DwarfCompileUnit.cpp:1529
DL
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Definition: AArch64SLSHardening.cpp:76
llvm::DwarfCompileUnit::getBaseAddress
const MCSymbol * getBaseAddress() const
Definition: DwarfCompileUnit.h:360
Node
Definition: ItaniumDemangle.h:114
llvm::DwarfCompileUnit::applyVariableAttributes
void applyVariableAttributes(const DbgVariable &Var, DIE &VariableDie)
Definition: DwarfCompileUnit.cpp:1476
llvm::AsmPrinter::getUnitLengthFieldByteSize
unsigned int getUnitLengthFieldByteSize() const
Returns 4 for DWARF32 and 12 for DWARF64.
Definition: AsmPrinter.cpp:3591
llvm::DwarfDebug::shareAcrossDWOCUs
bool shareAcrossDWOCUs() const
Definition: DwarfDebug.cpp:561
llvm::DwarfCompileUnit::BaseTypeRef::Encoding
dwarf::TypeKind Encoding
Definition: DwarfCompileUnit.h:141
llvm::dwarf::TypeKind
TypeKind
Definition: Dwarf.h:150
llvm::DwarfCompileUnit::setBaseAddress
void setBaseAddress(const MCSymbol *Base)
Definition: DwarfCompileUnit.h:359
llvm::DwarfUnit::DD
DwarfDebug * DD
Definition: DwarfUnit.h:52
llvm::DwarfCompileUnit::BaseTypeRef
Definition: DwarfCompileUnit.h:137
llvm::GraphProgram::Name
Name
Definition: GraphWriter.h:52
llvm::DwarfCompileUnit::createAbstractEntity
void createAbstractEntity(const DINode *Node, LexicalScope *Scope)
Definition: DwarfCompileUnit.cpp:1317
llvm::DIScope
Base class for scope-like contexts.
Definition: DebugInfoMetadata.h:476
llvm::DwarfCompileUnit::useGNUAnalogForDwarf5Feature
bool useGNUAnalogForDwarf5Feature() const
Whether to use the GNU analog for a DWARF5 tag, attribute, or location atom.
Definition: DwarfCompileUnit.cpp:1113
llvm::DwarfCompileUnit::getLength
unsigned getLength()
Definition: DwarfCompileUnit.h:291
Casting.h
llvm::DwarfCompileUnit::applyStmtList
void applyStmtList(DIE &D)
Apply the DW_AT_stmt_list from this compile unit to the specified DIE.
Definition: DwarfCompileUnit.cpp:391
llvm::DwarfCompileUnit::addGlobalTypeUnitType
void addGlobalTypeUnitType(const DIType *Ty, const DIScope *Context)
Add a new global type present in a type unit to this compile unit.
Definition: DwarfCompileUnit.cpp:1394
llvm::DwarfCompileUnit::addLocalLabelAddress
void addLocalLabelAddress(DIE &Die, dwarf::Attribute Attribute, const MCSymbol *Label)
addLocalLabelAddress - Add a dwarf label attribute data and value using DW_FORM_addr only.
Definition: DwarfCompileUnit.cpp:108
DwarfUnit.h
llvm::AsmPrinter
This class is intended to be used as a driving class for all asm writers.
Definition: AsmPrinter.h:82
llvm::UnitKind::Full
@ Full
llvm::DwarfFile
Definition: DwarfFile.h:49
llvm::DwarfCompileUnit::includeMinimalInlineScopes
bool includeMinimalInlineScopes() const
Definition: DwarfCompileUnit.cpp:1524
llvm::DwarfCompileUnit::getSkeleton
DwarfCompileUnit * getSkeleton() const
Definition: DwarfCompileUnit.h:117
llvm::DwarfCompileUnit::constructCallSiteParmEntryDIEs
void constructCallSiteParmEntryDIEs(DIE &CallSiteDIE, SmallVector< DbgCallSiteParam, 4 > &Params)
Construct call site parameter DIEs for the CallSiteDIE.
Definition: DwarfCompileUnit.cpp:1219
llvm::DwarfCompileUnit::createScopeChildrenDIE
DIE * createScopeChildrenDIE(LexicalScope *Scope, SmallVectorImpl< DIE * > &Children, bool *HasNonScopeChildren=nullptr)
A helper function to create children of a Scope DIE.
Definition: DwarfCompileUnit.cpp:997
llvm::DwarfCompileUnit::addImportedEntity
void addImportedEntity(const DIImportedEntity *IE)
Definition: DwarfCompileUnit.h:172
SmallVector.h
llvm::DwarfCompileUnit::getHeaderSize
unsigned getHeaderSize() const override
Compute the size of a header for this unit, not including the initial length field.
Definition: DwarfCompileUnit.h:284
llvm::DwarfCompileUnit::getDwarf5OrGNUTag
dwarf::Tag getDwarf5OrGNUTag(dwarf::Tag Tag) const
This takes a DWARF 5 tag and returns it or a GNU analog.
Definition: DwarfCompileUnit.cpp:1117
llvm::UnitKind::Skeleton
@ Skeleton
llvm::DISubprogram
Subprogram description.
Definition: DebugInfoMetadata.h:1800
llvm::SmallVectorImpl
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: APFloat.h:43
llvm::DwarfDebug::getDwarfVersion
uint16_t getDwarfVersion() const
Returns the Dwarf Version.
Definition: DwarfDebug.cpp:3510
llvm::DwarfCompileUnit::GlobalExpr::Var
const GlobalVariable * Var
Definition: DwarfCompileUnit.h:133
llvm::DwarfUnit
This dwarf writer support class manages information associated with a source file.
Definition: DwarfUnit.h:37
llvm::DwarfCompileUnit::hasRangeLists
bool hasRangeLists() const
Definition: DwarfCompileUnit.h:114
llvm::DIEValueList
A list of DIE values.
Definition: DIE.h:662
llvm::DwarfCompileUnit::addAddress
void addAddress(DIE &Die, dwarf::Attribute Attribute, const MachineLocation &Location)
Add an address attribute to a die based on the location provided.
Definition: DwarfCompileUnit.cpp:1415
llvm::DwarfCompileUnit::getUniqueID
unsigned getUniqueID() const
Definition: DwarfCompileUnit.h:115
llvm::DwarfCompileUnit::getLabelBegin
MCSymbol * getLabelBegin() const
Definition: DwarfCompileUnit.h:301
llvm::DwarfCompileUnit::getRanges
const SmallVectorImpl< RangeSpan > & getRanges() const
getRanges - Get the list of ranges for this unit.
Definition: DwarfCompileUnit.h:356
llvm::MCExpr
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:35
File
Instrumentation for Order File
Definition: InstrOrderFile.cpp:206
llvm::DIEUnit::getUnitDie
DIE & getUnitDie()
Definition: DIE.h:911
llvm::DwarfUnit::getHeaderSize
virtual unsigned getHeaderSize() const
Compute the size of a header for this unit, not including the initial length field.
Definition: DwarfUnit.h:268
llvm::dwarf::LocationAtom
LocationAtom
Definition: Dwarf.h:137
llvm::ISD::MCSymbol
@ MCSymbol
Definition: ISDOpcodes.h:165
llvm::sampleprof::Base
@ Base
Definition: Discriminator.h:58
llvm::DIFile
File.
Definition: DebugInfoMetadata.h:530
llvm::DwarfCompileUnit::InlinedEntity
DbgValueHistoryMap::InlinedEntity InlinedEntity
Find abstract variable associated with Var.
Definition: DwarfCompileUnit.h:277
llvm::DwarfCompileUnit::addExpr
void addExpr(DIELoc &Die, dwarf::Form Form, const MCExpr *Expr)
Add a Dwarf expression attribute data and value.
Definition: DwarfCompileUnit.cpp:1503
llvm::DwarfCompileUnit::constructCallSiteEntryDIE
DIE & constructCallSiteEntryDIE(DIE &ScopeDIE, DIE *CalleeDIE, bool IsTail, const MCSymbol *PCAddr, const MCSymbol *CallAddr, unsigned CallReg)
Construct a call site entry DIE describing a call within Scope to a callee described by CalleeDIE.
Definition: DwarfCompileUnit.cpp:1164