LLVM  6.0.0svn
DwarfDebug.h
Go to the documentation of this file.
1 //===- llvm/CodeGen/DwarfDebug.h - Dwarf Debug Framework --------*- 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 debug info into asm files.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_LIB_CODEGEN_ASMPRINTER_DWARFDEBUG_H
15 #define LLVM_LIB_CODEGEN_ASMPRINTER_DWARFDEBUG_H
16 
17 #include "AddressPool.h"
19 #include "DebugHandlerBase.h"
20 #include "DebugLocStream.h"
21 #include "DwarfAccelTable.h"
22 #include "DwarfFile.h"
23 #include "llvm/ADT/ArrayRef.h"
24 #include "llvm/ADT/DenseMap.h"
25 #include "llvm/ADT/DenseSet.h"
26 #include "llvm/ADT/MapVector.h"
27 #include "llvm/ADT/STLExtras.h"
28 #include "llvm/ADT/SetVector.h"
29 #include "llvm/ADT/SmallPtrSet.h"
30 #include "llvm/ADT/SmallVector.h"
31 #include "llvm/ADT/StringMap.h"
32 #include "llvm/ADT/StringRef.h"
36 #include "llvm/IR/DebugLoc.h"
37 #include "llvm/IR/Metadata.h"
38 #include "llvm/MC/MCDwarf.h"
39 #include "llvm/Support/Allocator.h"
41 #include <cassert>
42 #include <cstdint>
43 #include <limits>
44 #include <memory>
45 #include <utility>
46 #include <vector>
47 
48 namespace llvm {
49 
50 class AsmPrinter;
51 class ByteStreamer;
52 class DebugLocEntry;
53 class DIE;
54 class DwarfCompileUnit;
55 class DwarfTypeUnit;
56 class DwarfUnit;
57 class LexicalScope;
58 class MachineFunction;
59 class MCSection;
60 class MCSymbol;
61 class MDNode;
62 class Module;
63 
64 //===----------------------------------------------------------------------===//
65 /// This class is used to track local variable information.
66 ///
67 /// Variables can be created from allocas, in which case they're generated from
68 /// the MMI table. Such variables can have multiple expressions and frame
69 /// indices.
70 ///
71 /// Variables can be created from \c DBG_VALUE instructions. Those whose
72 /// location changes over time use \a DebugLocListIndex, while those with a
73 /// single instruction use \a MInsn and (optionally) a single entry of \a Expr.
74 ///
75 /// Variables that have been optimized out use none of these fields.
76 class DbgVariable {
77  const DILocalVariable *Var; /// Variable Descriptor.
78  const DILocation *IA; /// Inlined at location.
79  DIE *TheDIE = nullptr; /// Variable DIE.
80  unsigned DebugLocListIndex = ~0u; /// Offset in DebugLocs.
81  const MachineInstr *MInsn = nullptr; /// DBG_VALUE instruction.
82 
83  struct FrameIndexExpr {
84  int FI;
85  const DIExpression *Expr;
86  };
88  FrameIndexExprs; /// Frame index + expression.
89 
90 public:
91  /// Construct a DbgVariable.
92  ///
93  /// Creates a variable without any DW_AT_location. Call \a initializeMMI()
94  /// for MMI entries, or \a initializeDbgValue() for DBG_VALUE instructions.
95  DbgVariable(const DILocalVariable *V, const DILocation *IA)
96  : Var(V), IA(IA) {}
97 
98  /// Initialize from the MMI table.
99  void initializeMMI(const DIExpression *E, int FI) {
100  assert(FrameIndexExprs.empty() && "Already initialized?");
101  assert(!MInsn && "Already initialized?");
102 
103  assert((!E || E->isValid()) && "Expected valid expression");
104  assert(FI != std::numeric_limits<int>::max() && "Expected valid index");
105 
106  FrameIndexExprs.push_back({FI, E});
107  }
108 
109  /// Initialize from a DBG_VALUE instruction.
110  void initializeDbgValue(const MachineInstr *DbgValue) {
111  assert(FrameIndexExprs.empty() && "Already initialized?");
112  assert(!MInsn && "Already initialized?");
113 
114  assert(Var == DbgValue->getDebugVariable() && "Wrong variable");
115  assert(IA == DbgValue->getDebugLoc()->getInlinedAt() && "Wrong inlined-at");
116 
117  MInsn = DbgValue;
118  if (auto *E = DbgValue->getDebugExpression())
119  if (E->getNumElements())
120  FrameIndexExprs.push_back({0, E});
121  }
122 
123  // Accessors.
124  const DILocalVariable *getVariable() const { return Var; }
125  const DILocation *getInlinedAt() const { return IA; }
126 
128  assert(MInsn && FrameIndexExprs.size() <= 1);
129  return FrameIndexExprs.size() ? FrameIndexExprs[0].Expr : nullptr;
130  }
131 
132  void setDIE(DIE &D) { TheDIE = &D; }
133  DIE *getDIE() const { return TheDIE; }
134  void setDebugLocListIndex(unsigned O) { DebugLocListIndex = O; }
135  unsigned getDebugLocListIndex() const { return DebugLocListIndex; }
136  StringRef getName() const { return Var->getName(); }
137  const MachineInstr *getMInsn() const { return MInsn; }
138  /// Get the FI entries, sorted by fragment offset.
140  bool hasFrameIndexExprs() const { return !FrameIndexExprs.empty(); }
141  void addMMIEntry(const DbgVariable &V);
142 
143  // Translate tag to proper Dwarf tag.
144  dwarf::Tag getTag() const {
145  // FIXME: Why don't we just infer this tag and store it all along?
146  if (Var->isParameter())
147  return dwarf::DW_TAG_formal_parameter;
148 
149  return dwarf::DW_TAG_variable;
150  }
151 
152  /// Return true if DbgVariable is artificial.
153  bool isArtificial() const {
154  if (Var->isArtificial())
155  return true;
156  if (getType()->isArtificial())
157  return true;
158  return false;
159  }
160 
161  bool isObjectPointer() const {
162  if (Var->isObjectPointer())
163  return true;
164  if (getType()->isObjectPointer())
165  return true;
166  return false;
167  }
168 
169  bool hasComplexAddress() const {
170  assert(MInsn && "Expected DBG_VALUE, not MMI variable");
171  assert((FrameIndexExprs.empty() ||
172  (FrameIndexExprs.size() == 1 &&
173  FrameIndexExprs[0].Expr->getNumElements())) &&
174  "Invalid Expr for DBG_VALUE");
175  return !FrameIndexExprs.empty();
176  }
177 
178  bool isBlockByrefVariable() const;
179  const DIType *getType() const;
180 
181 private:
182  template <typename T> T *resolve(TypedDINodeRef<T> Ref) const {
183  return Ref.resolve();
184  }
185 };
186 
187 /// Helper used to pair up a symbol and its DWARF compile unit.
188 struct SymbolCU {
189  SymbolCU(DwarfCompileUnit *CU, const MCSymbol *Sym) : Sym(Sym), CU(CU) {}
190 
191  const MCSymbol *Sym;
193 };
194 
195 /// Collects and handles dwarf debug information.
196 class DwarfDebug : public DebugHandlerBase {
197  /// All DIEValues are allocated through this allocator.
198  BumpPtrAllocator DIEValueAllocator;
199 
200  /// Maps MDNode with its corresponding DwarfCompileUnit.
202 
203  /// Maps a CU DIE with its corresponding DwarfCompileUnit.
205 
206  /// List of all labels used in aranges generation.
207  std::vector<SymbolCU> ArangeLabels;
208 
209  /// Size of each symbol emitted (for those symbols that have a specific size).
211 
212  /// Collection of abstract variables.
213  SmallVector<std::unique_ptr<DbgVariable>, 64> ConcreteVariables;
214 
215  /// Collection of DebugLocEntry. Stored in a linked list so that DIELocLists
216  /// can refer to them in spite of insertions into this list.
217  DebugLocStream DebugLocs;
218 
219  /// This is a collection of subprogram MDNodes that are processed to
220  /// create DIEs.
223  ProcessedSPNodes;
224 
225  /// If nonnull, stores the current machine function we're processing.
226  const MachineFunction *CurFn = nullptr;
227 
228  /// If nonnull, stores the CU in which the previous subprogram was contained.
229  const DwarfCompileUnit *PrevCU;
230 
231  /// As an optimization, there is no need to emit an entry in the directory
232  /// table for the same directory as DW_AT_comp_dir.
233  StringRef CompilationDir;
234 
235  /// Holder for the file specific debug information.
236  DwarfFile InfoHolder;
237 
238  /// Holders for the various debug information flags that we might need to
239  /// have exposed. See accessor functions below for description.
240 
241  /// Map from MDNodes for user-defined types to their type signatures. Also
242  /// used to keep track of which types we have emitted type units for.
243  DenseMap<const MDNode *, uint64_t> TypeSignatures;
244 
245  SmallVector<
246  std::pair<std::unique_ptr<DwarfTypeUnit>, const DICompositeType *>, 1>
247  TypeUnitsUnderConstruction;
248 
249  /// Whether to use the GNU TLS opcode (instead of the standard opcode).
250  bool UseGNUTLSOpcode;
251 
252  /// Whether to use DWARF 2 bitfields (instead of the DWARF 4 format).
253  bool UseDWARF2Bitfields;
254 
255  /// Whether to emit all linkage names, or just abstract subprograms.
256  bool UseAllLinkageNames;
257 
258  /// DWARF5 Experimental Options
259  /// @{
260  bool HasDwarfAccelTables;
261  bool HasAppleExtensionAttributes;
262  bool HasSplitDwarf;
263 
264  /// Separated Dwarf Variables
265  /// In general these will all be for bits that are left in the
266  /// original object file, rather than things that are meant
267  /// to be in the .dwo sections.
268 
269  /// Holder for the skeleton information.
270  DwarfFile SkeletonHolder;
271 
272  /// Store file names for type units under fission in a line table
273  /// header that will be emitted into debug_line.dwo.
274  // FIXME: replace this with a map from comp_dir to table so that we
275  // can emit multiple tables during LTO each of which uses directory
276  // 0, referencing the comp_dir of all the type units that use it.
277  MCDwarfDwoLineTable SplitTypeUnitFileTable;
278  /// @}
279 
280  /// True iff there are multiple CUs in this module.
281  bool SingleCU;
282  bool IsDarwin;
283 
284  AddressPool AddrPool;
285 
286  DwarfAccelTable AccelNames;
287  DwarfAccelTable AccelObjC;
288  DwarfAccelTable AccelNamespace;
289  DwarfAccelTable AccelTypes;
290 
291  // Identify a debugger for "tuning" the debug info.
292  DebuggerKind DebuggerTuning = DebuggerKind::Default;
293 
294  MCDwarfDwoLineTable *getDwoLineTable(const DwarfCompileUnit &);
295 
297  return InfoHolder.getUnits();
298  }
299 
300  using InlinedVariable = DbgValueHistoryMap::InlinedVariable;
301 
302  void ensureAbstractVariableIsCreated(DwarfCompileUnit &CU, InlinedVariable Var,
303  const MDNode *Scope);
304  void ensureAbstractVariableIsCreatedIfScoped(DwarfCompileUnit &CU, InlinedVariable Var,
305  const MDNode *Scope);
306 
307  DbgVariable *createConcreteVariable(DwarfCompileUnit &TheCU,
308  LexicalScope &Scope, InlinedVariable IV);
309 
310  /// Construct a DIE for this abstract scope.
311  void constructAbstractSubprogramScopeDIE(DwarfCompileUnit &SrcCU, LexicalScope *Scope);
312 
313  void finishVariableDefinitions();
314 
315  void finishSubprogramDefinitions();
316 
317  /// Finish off debug information after all functions have been
318  /// processed.
319  void finalizeModuleInfo();
320 
321  /// Emit the debug info section.
322  void emitDebugInfo();
323 
324  /// Emit the abbreviation section.
325  void emitAbbreviations();
326 
327  /// Emit a specified accelerator table.
328  void emitAccel(DwarfAccelTable &Accel, MCSection *Section,
329  StringRef TableName);
330 
331  /// Emit visible names into a hashed accelerator table section.
332  void emitAccelNames();
333 
334  /// Emit objective C classes and categories into a hashed
335  /// accelerator table section.
336  void emitAccelObjC();
337 
338  /// Emit namespace dies into a hashed accelerator table.
339  void emitAccelNamespaces();
340 
341  /// Emit type dies into a hashed accelerator table.
342  void emitAccelTypes();
343 
344  /// Emit visible names and types into debug pubnames and pubtypes sections.
345  void emitDebugPubSections();
346 
347  void emitDebugPubSection(bool GnuStyle, StringRef Name,
348  DwarfCompileUnit *TheU,
349  const StringMap<const DIE *> &Globals);
350 
351  /// Emit null-terminated strings into a debug str section.
352  void emitDebugStr();
353 
354  /// Emit variable locations into a debug loc section.
355  void emitDebugLoc();
356 
357  /// Emit variable locations into a debug loc dwo section.
358  void emitDebugLocDWO();
359 
360  /// Emit address ranges into a debug aranges section.
361  void emitDebugARanges();
362 
363  /// Emit address ranges into a debug ranges section.
364  void emitDebugRanges();
365 
366  /// Emit macros into a debug macinfo section.
367  void emitDebugMacinfo();
368  void emitMacro(DIMacro &M);
369  void emitMacroFile(DIMacroFile &F, DwarfCompileUnit &U);
370  void handleMacroNodes(DIMacroNodeArray Nodes, DwarfCompileUnit &U);
371 
372  /// DWARF 5 Experimental Split Dwarf Emitters
373 
374  /// Initialize common features of skeleton units.
375  void initSkeletonUnit(const DwarfUnit &U, DIE &Die,
376  std::unique_ptr<DwarfCompileUnit> NewU);
377 
378  /// Construct the split debug info compile unit for the debug info
379  /// section.
380  DwarfCompileUnit &constructSkeletonCU(const DwarfCompileUnit &CU);
381 
382  /// Emit the debug info dwo section.
383  void emitDebugInfoDWO();
384 
385  /// Emit the debug abbrev dwo section.
386  void emitDebugAbbrevDWO();
387 
388  /// Emit the debug line dwo section.
389  void emitDebugLineDWO();
390 
391  /// Emit the debug str dwo section.
392  void emitDebugStrDWO();
393 
394  /// Flags to let the linker know we have emitted new style pubnames. Only
395  /// emit it here if we don't have a skeleton CU for split dwarf.
396  void addGnuPubAttributes(DwarfCompileUnit &U, DIE &D) const;
397 
398  /// Create new DwarfCompileUnit for the given metadata node with tag
399  /// DW_TAG_compile_unit.
400  DwarfCompileUnit &getOrCreateDwarfCompileUnit(const DICompileUnit *DIUnit);
401 
402  /// Construct imported_module or imported_declaration DIE.
403  void constructAndAddImportedEntityDIE(DwarfCompileUnit &TheCU,
404  const DIImportedEntity *N);
405 
406  /// Register a source line with debug info. Returns the unique
407  /// label that was emitted and which provides correspondence to the
408  /// source line list.
409  void recordSourceLine(unsigned Line, unsigned Col, const MDNode *Scope,
410  unsigned Flags);
411 
412  /// Populate LexicalScope entries with variables' info.
413  void collectVariableInfo(DwarfCompileUnit &TheCU, const DISubprogram *SP,
414  DenseSet<InlinedVariable> &ProcessedVars);
415 
416  /// Build the location list for all DBG_VALUEs in the
417  /// function that describe the same variable.
418  void buildLocationList(SmallVectorImpl<DebugLocEntry> &DebugLoc,
419  const DbgValueHistoryMap::InstrRanges &Ranges);
420 
421  /// Collect variable information from the side table maintained by MF.
422  void collectVariableInfoFromMFTable(DwarfCompileUnit &TheCU,
424 
425 protected:
426  /// Gather pre-function debug information.
427  void beginFunctionImpl(const MachineFunction *MF) override;
428 
429  /// Gather and emit post-function debug information.
430  void endFunctionImpl(const MachineFunction *MF) override;
431 
432  void skippedNonDebugFunction() override;
433 
434 public:
435  //===--------------------------------------------------------------------===//
436  // Main entry points.
437  //
438  DwarfDebug(AsmPrinter *A, Module *M);
439 
440  ~DwarfDebug() override;
441 
442  /// Emit all Dwarf sections that should come prior to the
443  /// content.
444  void beginModule();
445 
446  /// Emit all Dwarf sections that should come after the content.
447  void endModule() override;
448 
449  /// Process beginning of an instruction.
450  void beginInstruction(const MachineInstr *MI) override;
451 
452  /// Perform an MD5 checksum of \p Identifier and return the lower 64 bits.
453  static uint64_t makeTypeSignature(StringRef Identifier);
454 
455  /// Add a DIE to the set of types that we're going to pull into
456  /// type units.
457  void addDwarfTypeUnitType(DwarfCompileUnit &CU, StringRef Identifier,
458  DIE &Die, const DICompositeType *CTy);
459 
460  /// Add a label so that arange data can be generated for it.
461  void addArangeLabel(SymbolCU SCU) { ArangeLabels.push_back(SCU); }
462 
463  /// For symbols that have a size designated (e.g. common symbols),
464  /// this tracks that size.
465  void setSymbolSize(const MCSymbol *Sym, uint64_t Size) override {
466  SymSize[Sym] = Size;
467  }
468 
469  /// Returns whether we should emit all DW_AT_[MIPS_]linkage_name.
470  /// If not, we still might emit certain cases.
471  bool useAllLinkageNames() const { return UseAllLinkageNames; }
472 
473  /// Returns whether to use DW_OP_GNU_push_tls_address, instead of the
474  /// standard DW_OP_form_tls_address opcode
475  bool useGNUTLSOpcode() const { return UseGNUTLSOpcode; }
476 
477  /// Returns whether to use the DWARF2 format for bitfields instyead of the
478  /// DWARF4 format.
479  bool useDWARF2Bitfields() const { return UseDWARF2Bitfields; }
480 
481  // Experimental DWARF5 features.
482 
483  /// Returns whether or not to emit tables that dwarf consumers can
484  /// use to accelerate lookup.
485  bool useDwarfAccelTables() const { return HasDwarfAccelTables; }
486 
488  return HasAppleExtensionAttributes;
489  }
490 
491  /// Returns whether or not to change the current debug info for the
492  /// split dwarf proposal support.
493  bool useSplitDwarf() const { return HasSplitDwarf; }
494 
495  bool shareAcrossDWOCUs() const;
496 
497  /// Returns the Dwarf Version.
498  uint16_t getDwarfVersion() const;
499 
500  /// Returns the previous CU that was being updated
501  const DwarfCompileUnit *getPrevCU() const { return PrevCU; }
502  void setPrevCU(const DwarfCompileUnit *PrevCU) { this->PrevCU = PrevCU; }
503 
504  /// Returns the entries for the .debug_loc section.
505  const DebugLocStream &getDebugLocs() const { return DebugLocs; }
506 
507  /// Emit an entry for the debug loc section. This can be used to
508  /// handle an entry that's going to be emitted into the debug loc section.
509  void emitDebugLocEntry(ByteStreamer &Streamer,
510  const DebugLocStream::Entry &Entry);
511 
512  /// Emit the location for a debug loc entry, including the size header.
513  void emitDebugLocEntryLocation(const DebugLocStream::Entry &Entry);
514 
515  /// Find the MDNode for the given reference.
516  template <typename T> T *resolve(TypedDINodeRef<T> Ref) const {
517  return Ref.resolve();
518  }
519 
520  void addSubprogramNames(const DISubprogram *SP, DIE &Die);
521 
522  AddressPool &getAddressPool() { return AddrPool; }
523 
524  void addAccelName(StringRef Name, const DIE &Die);
525 
526  void addAccelObjC(StringRef Name, const DIE &Die);
527 
528  void addAccelNamespace(StringRef Name, const DIE &Die);
529 
530  void addAccelType(StringRef Name, const DIE &Die, char Flags);
531 
532  const MachineFunction *getCurrentFunction() const { return CurFn; }
533 
534  /// A helper function to check whether the DIE for a given Scope is
535  /// going to be null.
536  bool isLexicalScopeDIENull(LexicalScope *Scope);
537 
538  /// Find the matching DwarfCompileUnit for the given CU DIE.
539  DwarfCompileUnit *lookupCU(const DIE *Die) { return CUDieMap.lookup(Die); }
540 
541  /// \defgroup DebuggerTuning Predicates to tune DWARF for a given debugger.
542  ///
543  /// Returns whether we are "tuning" for a given debugger.
544  /// @{
545  bool tuneForGDB() const { return DebuggerTuning == DebuggerKind::GDB; }
546  bool tuneForLLDB() const { return DebuggerTuning == DebuggerKind::LLDB; }
547  bool tuneForSCE() const { return DebuggerTuning == DebuggerKind::SCE; }
548  /// @}
549 };
550 
551 } // end namespace llvm
552 
553 #endif // LLVM_LIB_CODEGEN_ASMPRINTER_DWARFDEBUG_H
bool isObjectPointer() const
Instances of this class represent a uniqued identifier for a section in the current translation unit...
Definition: MCSection.h:39
void push_back(const T &Elt)
Definition: SmallVector.h:212
const DILocation * getInlinedAt() const
Definition: DwarfDebug.h:125
void setSymbolSize(const MCSymbol *Sym, uint64_t Size) override
For symbols that have a size designated (e.g.
Definition: DwarfDebug.h:465
GCNRegPressure max(const GCNRegPressure &P1, const GCNRegPressure &P2)
unsigned getDebugLocListIndex() const
Definition: DwarfDebug.h:135
void addMMIEntry(const DbgVariable &V)
Definition: DwarfDebug.cpp:227
Compute iterated dominance frontiers using a linear time algorithm.
Definition: AllocatorList.h:24
std::pair< const DILocalVariable *, const DILocation * > InlinedVariable
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:42
A Module instance is used to store all the information related to an LLVM module. ...
Definition: Module.h:63
LLVM_ATTRIBUTE_ALWAYS_INLINE size_type size() const
Definition: SmallVector.h:136
Implements a dense probed hash-table based set.
Definition: DenseSet.h:221
const DIType * getType() const
Definition: DwarfDebug.cpp:164
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
Definition: MachineInstr.h:268
DIE * getDIE() const
Definition: DwarfDebug.h:133
const DebugLocStream & getDebugLocs() const
Returns the entries for the .debug_loc section.
Definition: DwarfDebug.h:505
Collects and handles dwarf debug information.
Definition: DwarfDebug.h:196
This file contains the declarations for metadata subclasses.
bool useGNUTLSOpcode() const
Returns whether to use DW_OP_GNU_push_tls_address, instead of the standard DW_OP_form_tls_address opc...
Definition: DwarfDebug.h:475
bool useDwarfAccelTables() const
Returns whether or not to emit tables that dwarf consumers can use to accelerate lookup.
Definition: DwarfDebug.h:485
This class implements a map that also provides access to all stored values in a deterministic order...
Definition: MapVector.h:38
A debug info location.
Definition: DebugLoc.h:34
Metadata node.
Definition: Metadata.h:862
F(f)
LexicalScope - This class is used to track scope information.
Definition: LexicalScopes.h:45
const MachineFunction * getCurrentFunction() const
Definition: DwarfDebug.h:532
This file defines the MallocAllocator and BumpPtrAllocator interfaces.
DebuggerKind
Identify a debugger for "tuning" the debug info.
Definition: TargetOptions.h:92
bool useSplitDwarf() const
Returns whether or not to change the current debug info for the split dwarf proposal support...
Definition: DwarfDebug.h:493
void initializeDbgValue(const MachineInstr *DbgValue)
Initialize from a DBG_VALUE instruction.
Definition: DwarfDebug.h:110
void addArangeLabel(SymbolCU SCU)
Add a label so that arange data can be generated for it.
Definition: DwarfDebug.h:461
StringRef getName() const
bool isObjectPointer() const
Definition: DwarfDebug.h:161
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: APFloat.h:42
Holds a subclass of DINode.
AddressPool & getAddressPool()
Definition: DwarfDebug.h:522
Subprogram description.
const DIExpression * getSingleExpression() const
Definition: DwarfDebug.h:127
This class is used to track local variable information.
Definition: DwarfDebug.h:76
const DILocalVariable * getVariable() const
Definition: DwarfDebug.h:124
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Definition: APInt.h:33
const SmallVectorImpl< std::unique_ptr< DwarfCompileUnit > > & getUnits()
Definition: DwarfFile.h:61
const MachineInstr * getMInsn() const
Definition: DwarfDebug.h:137
Debug location.
const DwarfCompileUnit * getPrevCU() const
Returns the previous CU that was being updated.
Definition: DwarfDebug.h:501
bool hasComplexAddress() const
Definition: DwarfDebug.h:169
This dwarf writer support class manages information associated with a source file.
Definition: DwarfUnit.h:68
#define P(N)
DwarfCompileUnit * CU
Definition: DwarfDebug.h:192
bool tuneForLLDB() const
Definition: DwarfDebug.h:546
Allocate memory in an ever growing pool, as if by bump-pointer.
Definition: Allocator.h:138
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
void setDIE(DIE &D)
Definition: DwarfDebug.h:132
A structured debug information entry.
Definition: DIE.h:662
This class is intended to be used as a driving class for all asm writers.
Definition: AsmPrinter.h:77
bool useDWARF2Bitfields() const
Returns whether to use the DWARF2 format for bitfields instyead of the DWARF4 format.
Definition: DwarfDebug.h:479
bool hasFrameIndexExprs() const
Definition: DwarfDebug.h:140
dwarf::Tag getTag() const
Definition: DwarfDebug.h:144
T * resolve(TypedDINodeRef< T > Ref) const
Find the MDNode for the given reference.
Definition: DwarfDebug.h:516
Helper used to pair up a symbol and its DWARF compile unit.
Definition: DwarfDebug.h:188
void initializeMMI(const DIExpression *E, int FI)
Initialize from the MMI table.
Definition: DwarfDebug.h:99
bool useAllLinkageNames() const
Returns whether we should emit all DW_AT_[MIPS_]linkage_name.
Definition: DwarfDebug.h:471
SymbolCU(DwarfCompileUnit *CU, const MCSymbol *Sym)
Definition: DwarfDebug.h:189
const DIExpression * getDebugExpression() const
Return the complex address expression referenced by this DBG_VALUE instruction.
ArrayRef< FrameIndexExpr > getFrameIndexExprs() const
Get the FI entries, sorted by fragment offset.
Definition: DwarfDebug.cpp:209
An imported module (C++ using directive or similar).
bool tuneForGDB() const
Definition: DwarfDebug.h:545
void setPrevCU(const DwarfCompileUnit *PrevCU)
Definition: DwarfDebug.h:502
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements...
Definition: SmallPtrSet.h:418
Base class for types.
DwarfCompileUnit * lookupCU(const DIE *Die)
Find the matching DwarfCompileUnit for the given CU DIE.
Definition: DwarfDebug.h:539
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
bool useAppleExtensionAttributes() const
Definition: DwarfDebug.h:487
DWARF expression.
StringMap - This is an unconventional map that is specialized for handling keys that are "strings"...
Definition: StringMap.h:224
This file contains constants used for implementing Dwarf debug support.
StringRef getName() const
Definition: DwarfDebug.h:136
Representation of each machine instruction.
Definition: MachineInstr.h:59
bool isArtificial() const
LLVM_NODISCARD bool empty() const
Definition: SmallVector.h:61
bool isBlockByrefVariable() const
Definition: DwarfDebug.cpp:159
#define N
Base class for debug information backends.
ValueT lookup(const_arg_type_t< KeyT > Val) const
lookup - Return the entry for the specified key, or a default constructed value if no such entry exis...
Definition: DenseMap.h:181
void setDebugLocListIndex(unsigned O)
Definition: DwarfDebug.h:134
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
A vector that has set insertion semantics.
Definition: SetVector.h:41
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
const DILocalVariable * getDebugVariable() const
Return the debug variable referenced by this DBG_VALUE instruction.
unsigned getUnits(MCInstrInfo const &MCII, MCSubtargetInfo const &STI, MCInst const &MCI)
Return the slots used by the insn.
DbgVariable(const DILocalVariable *V, const DILocation *IA)
Frame index + expression.
Definition: DwarfDebug.h:95
IRTranslator LLVM IR MI
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49
bool tuneForSCE() const
Definition: DwarfDebug.h:547
Byte stream of .debug_loc entries.
bool isArtificial() const
Return true if DbgVariable is artificial.
Definition: DwarfDebug.h:153
const MCSymbol * Sym
Definition: DwarfDebug.h:191