LLVM  14.0.0git
DwarfDebug.h
Go to the documentation of this file.
1 //===- llvm/CodeGen/DwarfDebug.h - Dwarf Debug Framework --------*- 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 debug info into asm files.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_LIB_CODEGEN_ASMPRINTER_DWARFDEBUG_H
14 #define LLVM_LIB_CODEGEN_ASMPRINTER_DWARFDEBUG_H
15 
16 #include "AddressPool.h"
17 #include "DebugLocStream.h"
18 #include "DebugLocEntry.h"
19 #include "DwarfFile.h"
20 #include "llvm/ADT/ArrayRef.h"
21 #include "llvm/ADT/DenseMap.h"
22 #include "llvm/ADT/DenseSet.h"
23 #include "llvm/ADT/MapVector.h"
24 #include "llvm/ADT/STLExtras.h"
25 #include "llvm/ADT/SetVector.h"
26 #include "llvm/ADT/SmallPtrSet.h"
27 #include "llvm/ADT/SmallVector.h"
28 #include "llvm/ADT/StringMap.h"
29 #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 DIE;
53 class DwarfCompileUnit;
54 class DwarfExpression;
55 class DwarfTypeUnit;
56 class DwarfUnit;
57 class LexicalScope;
58 class MachineFunction;
59 class MCSection;
60 class MCSymbol;
61 class Module;
62 
63 //===----------------------------------------------------------------------===//
64 /// This class is defined as the common parent of DbgVariable and DbgLabel
65 /// such that it could levarage polymorphism to extract common code for
66 /// DbgVariable and DbgLabel.
67 class DbgEntity {
68  const DINode *Entity;
69  const DILocation *InlinedAt;
70  DIE *TheDIE = nullptr;
71  unsigned SubclassID;
72 
73 public:
77  };
78 
79  DbgEntity(const DINode *N, const DILocation *IA, unsigned ID)
80  : Entity(N), InlinedAt(IA), SubclassID(ID) {}
81  virtual ~DbgEntity() {}
82 
83  /// Accessors.
84  /// @{
85  const DINode *getEntity() const { return Entity; }
86  const DILocation *getInlinedAt() const { return InlinedAt; }
87  DIE *getDIE() const { return TheDIE; }
88  unsigned getDbgEntityID() const { return SubclassID; }
89  /// @}
90 
91  void setDIE(DIE &D) { TheDIE = &D; }
92 
93  static bool classof(const DbgEntity *N) {
94  switch (N->getDbgEntityID()) {
95  default:
96  return false;
97  case DbgVariableKind:
98  case DbgLabelKind:
99  return true;
100  }
101  }
102 };
103 
104 //===----------------------------------------------------------------------===//
105 /// This class is used to track local variable information.
106 ///
107 /// Variables can be created from allocas, in which case they're generated from
108 /// the MMI table. Such variables can have multiple expressions and frame
109 /// indices.
110 ///
111 /// Variables can be created from \c DBG_VALUE instructions. Those whose
112 /// location changes over time use \a DebugLocListIndex, while those with a
113 /// single location use \a ValueLoc and (optionally) a single entry of \a Expr.
114 ///
115 /// Variables that have been optimized out use none of these fields.
116 class DbgVariable : public DbgEntity {
117  /// Index of the entry list in DebugLocs.
118  unsigned DebugLocListIndex = ~0u;
119  /// DW_OP_LLVM_tag_offset value from DebugLocs.
120  Optional<uint8_t> DebugLocListTagOffset;
121 
122  /// Single value location description.
123  std::unique_ptr<DbgValueLoc> ValueLoc = nullptr;
124 
125  struct FrameIndexExpr {
126  int FI;
127  const DIExpression *Expr;
128  };
130  FrameIndexExprs; /// Frame index + expression.
131 
132 public:
133  /// Construct a DbgVariable.
134  ///
135  /// Creates a variable without any DW_AT_location. Call \a initializeMMI()
136  /// for MMI entries, or \a initializeDbgValue() for DBG_VALUE instructions.
138  : DbgEntity(V, IA, DbgVariableKind) {}
139 
140  /// Initialize from the MMI table.
141  void initializeMMI(const DIExpression *E, int FI) {
142  assert(FrameIndexExprs.empty() && "Already initialized?");
143  assert(!ValueLoc.get() && "Already initialized?");
144 
145  assert((!E || E->isValid()) && "Expected valid expression");
146  assert(FI != std::numeric_limits<int>::max() && "Expected valid index");
147 
148  FrameIndexExprs.push_back({FI, E});
149  }
150 
151  // Initialize variable's location.
153  assert(FrameIndexExprs.empty() && "Already initialized?");
154  assert(!ValueLoc && "Already initialized?");
155  assert(!Value.getExpression()->isFragment() && "Fragments not supported.");
156 
157  ValueLoc = std::make_unique<DbgValueLoc>(Value);
158  if (auto *E = ValueLoc->getExpression())
159  if (E->getNumElements())
160  FrameIndexExprs.push_back({0, E});
161  }
162 
163  /// Initialize from a DBG_VALUE instruction.
165 
166  // Accessors.
167  const DILocalVariable *getVariable() const {
168  return cast<DILocalVariable>(getEntity());
169  }
170 
172  assert(ValueLoc.get() && FrameIndexExprs.size() <= 1);
173  return FrameIndexExprs.size() ? FrameIndexExprs[0].Expr : nullptr;
174  }
175 
176  void setDebugLocListIndex(unsigned O) { DebugLocListIndex = O; }
177  unsigned getDebugLocListIndex() const { return DebugLocListIndex; }
178  void setDebugLocListTagOffset(uint8_t O) { DebugLocListTagOffset = O; }
179  Optional<uint8_t> getDebugLocListTagOffset() const { return DebugLocListTagOffset; }
180  StringRef getName() const { return getVariable()->getName(); }
181  const DbgValueLoc *getValueLoc() const { return ValueLoc.get(); }
182  /// Get the FI entries, sorted by fragment offset.
184  bool hasFrameIndexExprs() const { return !FrameIndexExprs.empty(); }
185  void addMMIEntry(const DbgVariable &V);
186 
187  // Translate tag to proper Dwarf tag.
188  dwarf::Tag getTag() const {
189  // FIXME: Why don't we just infer this tag and store it all along?
190  if (getVariable()->isParameter())
191  return dwarf::DW_TAG_formal_parameter;
192 
193  return dwarf::DW_TAG_variable;
194  }
195 
196  /// Return true if DbgVariable is artificial.
197  bool isArtificial() const {
198  if (getVariable()->isArtificial())
199  return true;
200  if (getType()->isArtificial())
201  return true;
202  return false;
203  }
204 
205  bool isObjectPointer() const {
206  if (getVariable()->isObjectPointer())
207  return true;
208  if (getType()->isObjectPointer())
209  return true;
210  return false;
211  }
212 
213  bool hasComplexAddress() const {
214  assert(ValueLoc.get() && "Expected DBG_VALUE, not MMI variable");
215  assert((FrameIndexExprs.empty() ||
216  (FrameIndexExprs.size() == 1 &&
217  FrameIndexExprs[0].Expr->getNumElements())) &&
218  "Invalid Expr for DBG_VALUE");
219  return !FrameIndexExprs.empty();
220  }
221 
222  const DIType *getType() const;
223 
224  static bool classof(const DbgEntity *N) {
225  return N->getDbgEntityID() == DbgVariableKind;
226  }
227 };
228 
229 //===----------------------------------------------------------------------===//
230 /// This class is used to track label information.
231 ///
232 /// Labels are collected from \c DBG_LABEL instructions.
233 class DbgLabel : public DbgEntity {
234  const MCSymbol *Sym; /// Symbol before DBG_LABEL instruction.
235 
236 public:
237  /// We need MCSymbol information to generate DW_AT_low_pc.
238  DbgLabel(const DILabel *L, const DILocation *IA, const MCSymbol *Sym = nullptr)
239  : DbgEntity(L, IA, DbgLabelKind), Sym(Sym) {}
240 
241  /// Accessors.
242  /// @{
243  const DILabel *getLabel() const { return cast<DILabel>(getEntity()); }
244  const MCSymbol *getSymbol() const { return Sym; }
245 
246  StringRef getName() const { return getLabel()->getName(); }
247  /// @}
248 
249  /// Translate tag to proper Dwarf tag.
250  dwarf::Tag getTag() const {
251  return dwarf::DW_TAG_label;
252  }
253 
254  static bool classof(const DbgEntity *N) {
255  return N->getDbgEntityID() == DbgLabelKind;
256  }
257 };
258 
259 /// Used for tracking debug info about call site parameters.
261 private:
262  unsigned Register; ///< Parameter register at the callee entry point.
263  DbgValueLoc Value; ///< Corresponding location for the parameter value at
264  ///< the call site.
265 public:
267  : Register(Reg), Value(Val) {
268  assert(Reg && "Parameter register cannot be undef");
269  }
270 
271  unsigned getRegister() const { return Register; }
272  DbgValueLoc getValue() const { return Value; }
273 };
274 
275 /// Collection used for storing debug call site parameters.
277 
278 /// Helper used to pair up a symbol and its DWARF compile unit.
279 struct SymbolCU {
281 
282  const MCSymbol *Sym;
284 };
285 
286 /// The kind of accelerator tables we should emit.
287 enum class AccelTableKind {
288  Default, ///< Platform default.
289  None, ///< None.
290  Apple, ///< .apple_names, .apple_namespaces, .apple_types, .apple_objc.
291  Dwarf, ///< DWARF v5 .debug_names.
292 };
293 
294 /// Collects and handles dwarf debug information.
295 class DwarfDebug : public DebugHandlerBase {
296  /// All DIEValues are allocated through this allocator.
297  BumpPtrAllocator DIEValueAllocator;
298 
299  /// Maps MDNode with its corresponding DwarfCompileUnit.
301 
302  /// Maps a CU DIE with its corresponding DwarfCompileUnit.
304 
305  /// List of all labels used in aranges generation.
306  std::vector<SymbolCU> ArangeLabels;
307 
308  /// Size of each symbol emitted (for those symbols that have a specific size).
310 
311  /// Collection of abstract variables/labels.
312  SmallVector<std::unique_ptr<DbgEntity>, 64> ConcreteEntities;
313 
314  /// Collection of DebugLocEntry. Stored in a linked list so that DIELocLists
315  /// can refer to them in spite of insertions into this list.
316  DebugLocStream DebugLocs;
317 
318  /// This is a collection of subprogram MDNodes that are processed to
319  /// create DIEs.
322  ProcessedSPNodes;
323 
324  /// If nonnull, stores the current machine function we're processing.
325  const MachineFunction *CurFn = nullptr;
326 
327  /// If nonnull, stores the CU in which the previous subprogram was contained.
328  const DwarfCompileUnit *PrevCU = nullptr;
329 
330  /// As an optimization, there is no need to emit an entry in the directory
331  /// table for the same directory as DW_AT_comp_dir.
332  StringRef CompilationDir;
333 
334  /// Holder for the file specific debug information.
335  DwarfFile InfoHolder;
336 
337  /// Holders for the various debug information flags that we might need to
338  /// have exposed. See accessor functions below for description.
339 
340  /// Map from MDNodes for user-defined types to their type signatures. Also
341  /// used to keep track of which types we have emitted type units for.
342  DenseMap<const MDNode *, uint64_t> TypeSignatures;
343 
345 
346  SmallVector<
347  std::pair<std::unique_ptr<DwarfTypeUnit>, const DICompositeType *>, 1>
348  TypeUnitsUnderConstruction;
349 
350  /// Whether to use the GNU TLS opcode (instead of the standard opcode).
351  bool UseGNUTLSOpcode;
352 
353  /// Whether to use DWARF 2 bitfields (instead of the DWARF 4 format).
354  bool UseDWARF2Bitfields;
355 
356  /// Whether to emit all linkage names, or just abstract subprograms.
357  bool UseAllLinkageNames;
358 
359  /// Use inlined strings.
360  bool UseInlineStrings = false;
361 
362  /// Allow emission of .debug_ranges section.
363  bool UseRangesSection = true;
364 
365  /// True if the sections itself must be used as references and don't create
366  /// temp symbols inside DWARF sections.
367  bool UseSectionsAsReferences = false;
368 
369  ///Allow emission of the .debug_loc section.
370  bool UseLocSection = true;
371 
372  /// Generate DWARF v4 type units.
373  bool GenerateTypeUnits;
374 
375  /// Emit a .debug_macro section instead of .debug_macinfo.
376  bool UseDebugMacroSection;
377 
378  /// Avoid using DW_OP_convert due to consumer incompatibilities.
379  bool EnableOpConvert;
380 
381 public:
382  enum class MinimizeAddrInV5 {
383  Default,
384  Disabled,
385  Ranges,
386  Expressions,
387  Form,
388  };
389 
390 private:
391  /// Force the use of DW_AT_ranges even for single-entry range lists.
393 
394  /// DWARF5 Experimental Options
395  /// @{
396  AccelTableKind TheAccelTableKind;
397  bool HasAppleExtensionAttributes;
398  bool HasSplitDwarf;
399 
400  /// Whether to generate the DWARF v5 string offsets table.
401  /// It consists of a series of contributions, each preceded by a header.
402  /// The pre-DWARF v5 string offsets table for split dwarf is, in contrast,
403  /// a monolithic sequence of string offsets.
404  bool UseSegmentedStringOffsetsTable;
405 
406  /// Enable production of call site parameters needed to print the debug entry
407  /// values. Useful for testing purposes when a debugger does not support the
408  /// feature yet.
409  bool EmitDebugEntryValues;
410 
411  /// Separated Dwarf Variables
412  /// In general these will all be for bits that are left in the
413  /// original object file, rather than things that are meant
414  /// to be in the .dwo sections.
415 
416  /// Holder for the skeleton information.
417  DwarfFile SkeletonHolder;
418 
419  /// Store file names for type units under fission in a line table
420  /// header that will be emitted into debug_line.dwo.
421  // FIXME: replace this with a map from comp_dir to table so that we
422  // can emit multiple tables during LTO each of which uses directory
423  // 0, referencing the comp_dir of all the type units that use it.
424  MCDwarfDwoLineTable SplitTypeUnitFileTable;
425  /// @}
426 
427  /// True iff there are multiple CUs in this module.
428  bool SingleCU;
429  bool IsDarwin;
430 
431  /// Map for tracking Fortran deferred CHARACTER lengths.
433 
434  AddressPool AddrPool;
435 
436  /// Accelerator tables.
437  AccelTable<DWARF5AccelTableData> AccelDebugNames;
442 
443  /// Identify a debugger for "tuning" the debug info.
444  ///
445  /// The "tuning" should be used to set defaults for individual feature flags
446  /// in DwarfDebug; if a given feature has a more specific command-line option,
447  /// that option should take precedence over the tuning.
448  DebuggerKind DebuggerTuning = DebuggerKind::Default;
449 
450  MCDwarfDwoLineTable *getDwoLineTable(const DwarfCompileUnit &);
451 
453  return InfoHolder.getUnits();
454  }
455 
456  using InlinedEntity = DbgValueHistoryMap::InlinedEntity;
457 
458  void ensureAbstractEntityIsCreated(DwarfCompileUnit &CU,
459  const DINode *Node,
460  const MDNode *Scope);
461  void ensureAbstractEntityIsCreatedIfScoped(DwarfCompileUnit &CU,
462  const DINode *Node,
463  const MDNode *Scope);
464 
465  DbgEntity *createConcreteEntity(DwarfCompileUnit &TheCU,
466  LexicalScope &Scope,
467  const DINode *Node,
468  const DILocation *Location,
469  const MCSymbol *Sym = nullptr);
470 
471  /// Construct a DIE for this abstract scope.
472  void constructAbstractSubprogramScopeDIE(DwarfCompileUnit &SrcCU, LexicalScope *Scope);
473 
474  /// Construct DIEs for call site entries describing the calls in \p MF.
475  void constructCallSiteEntryDIEs(const DISubprogram &SP, DwarfCompileUnit &CU,
476  DIE &ScopeDIE, const MachineFunction &MF);
477 
478  template <typename DataT>
479  void addAccelNameImpl(const DICompileUnit &CU, AccelTable<DataT> &AppleAccel,
480  StringRef Name, const DIE &Die);
481 
482  void finishEntityDefinitions();
483 
484  void finishSubprogramDefinitions();
485 
486  /// Finish off debug information after all functions have been
487  /// processed.
488  void finalizeModuleInfo();
489 
490  /// Emit the debug info section.
491  void emitDebugInfo();
492 
493  /// Emit the abbreviation section.
494  void emitAbbreviations();
495 
496  /// Emit the string offsets table header.
497  void emitStringOffsetsTableHeader();
498 
499  /// Emit a specified accelerator table.
500  template <typename AccelTableT>
501  void emitAccel(AccelTableT &Accel, MCSection *Section, StringRef TableName);
502 
503  /// Emit DWARF v5 accelerator table.
504  void emitAccelDebugNames();
505 
506  /// Emit visible names into a hashed accelerator table section.
507  void emitAccelNames();
508 
509  /// Emit objective C classes and categories into a hashed
510  /// accelerator table section.
511  void emitAccelObjC();
512 
513  /// Emit namespace dies into a hashed accelerator table.
514  void emitAccelNamespaces();
515 
516  /// Emit type dies into a hashed accelerator table.
517  void emitAccelTypes();
518 
519  /// Emit visible names and types into debug pubnames and pubtypes sections.
520  void emitDebugPubSections();
521 
522  void emitDebugPubSection(bool GnuStyle, StringRef Name,
523  DwarfCompileUnit *TheU,
524  const StringMap<const DIE *> &Globals);
525 
526  /// Emit null-terminated strings into a debug str section.
527  void emitDebugStr();
528 
529  /// Emit variable locations into a debug loc section.
530  void emitDebugLoc();
531 
532  /// Emit variable locations into a debug loc dwo section.
533  void emitDebugLocDWO();
534 
535  void emitDebugLocImpl(MCSection *Sec);
536 
537  /// Emit address ranges into a debug aranges section.
538  void emitDebugARanges();
539 
540  /// Emit address ranges into a debug ranges section.
541  void emitDebugRanges();
542  void emitDebugRangesDWO();
543  void emitDebugRangesImpl(const DwarfFile &Holder, MCSection *Section);
544 
545  /// Emit macros into a debug macinfo section.
546  void emitDebugMacinfo();
547  /// Emit macros into a debug macinfo.dwo section.
548  void emitDebugMacinfoDWO();
549  void emitDebugMacinfoImpl(MCSection *Section);
550  void emitMacro(DIMacro &M);
551  void emitMacroFile(DIMacroFile &F, DwarfCompileUnit &U);
552  void emitMacroFileImpl(DIMacroFile &F, DwarfCompileUnit &U,
553  unsigned StartFile, unsigned EndFile,
554  StringRef (*MacroFormToString)(unsigned Form));
555  void handleMacroNodes(DIMacroNodeArray Nodes, DwarfCompileUnit &U);
556 
557  /// DWARF 5 Experimental Split Dwarf Emitters
558 
559  /// Initialize common features of skeleton units.
560  void initSkeletonUnit(const DwarfUnit &U, DIE &Die,
561  std::unique_ptr<DwarfCompileUnit> NewU);
562 
563  /// Construct the split debug info compile unit for the debug info section.
564  /// In DWARF v5, the skeleton unit DIE may have the following attributes:
565  /// DW_AT_addr_base, DW_AT_comp_dir, DW_AT_dwo_name, DW_AT_high_pc,
566  /// DW_AT_low_pc, DW_AT_ranges, DW_AT_stmt_list, and DW_AT_str_offsets_base.
567  /// Prior to DWARF v5 it may also have DW_AT_GNU_dwo_id. DW_AT_GNU_dwo_name
568  /// is used instead of DW_AT_dwo_name, Dw_AT_GNU_addr_base instead of
569  /// DW_AT_addr_base, and DW_AT_GNU_ranges_base instead of DW_AT_rnglists_base.
570  DwarfCompileUnit &constructSkeletonCU(const DwarfCompileUnit &CU);
571 
572  /// Emit the debug info dwo section.
573  void emitDebugInfoDWO();
574 
575  /// Emit the debug abbrev dwo section.
576  void emitDebugAbbrevDWO();
577 
578  /// Emit the debug line dwo section.
579  void emitDebugLineDWO();
580 
581  /// Emit the dwo stringoffsets table header.
582  void emitStringOffsetsTableHeaderDWO();
583 
584  /// Emit the debug str dwo section.
585  void emitDebugStrDWO();
586 
587  /// Emit DWO addresses.
588  void emitDebugAddr();
589 
590  /// Flags to let the linker know we have emitted new style pubnames. Only
591  /// emit it here if we don't have a skeleton CU for split dwarf.
592  void addGnuPubAttributes(DwarfCompileUnit &U, DIE &D) const;
593 
594  /// Create new DwarfCompileUnit for the given metadata node with tag
595  /// DW_TAG_compile_unit.
596  DwarfCompileUnit &getOrCreateDwarfCompileUnit(const DICompileUnit *DIUnit);
597  void finishUnitAttributes(const DICompileUnit *DIUnit,
598  DwarfCompileUnit &NewCU);
599 
600  /// Construct imported_module or imported_declaration DIE.
601  void constructAndAddImportedEntityDIE(DwarfCompileUnit &TheCU,
602  const DIImportedEntity *N);
603 
604  /// Register a source line with debug info. Returns the unique
605  /// label that was emitted and which provides correspondence to the
606  /// source line list.
607  void recordSourceLine(unsigned Line, unsigned Col, const MDNode *Scope,
608  unsigned Flags);
609 
610  /// Populate LexicalScope entries with variables' info.
611  void collectEntityInfo(DwarfCompileUnit &TheCU, const DISubprogram *SP,
612  DenseSet<InlinedEntity> &ProcessedVars);
613 
614  /// Build the location list for all DBG_VALUEs in the
615  /// function that describe the same variable. If the resulting
616  /// list has only one entry that is valid for entire variable's
617  /// scope return true.
618  bool buildLocationList(SmallVectorImpl<DebugLocEntry> &DebugLoc,
619  const DbgValueHistoryMap::Entries &Entries);
620 
621  /// Collect variable information from the side table maintained by MF.
622  void collectVariableInfoFromMFTable(DwarfCompileUnit &TheCU,
623  DenseSet<InlinedEntity> &P);
624 
625  /// Emit the reference to the section.
626  void emitSectionReference(const DwarfCompileUnit &CU);
627 
628 protected:
629  /// Gather pre-function debug information.
630  void beginFunctionImpl(const MachineFunction *MF) override;
631 
632  /// Gather and emit post-function debug information.
633  void endFunctionImpl(const MachineFunction *MF) override;
634 
635  /// Get Dwarf compile unit ID for line table.
636  unsigned getDwarfCompileUnitIDForLineTable(const DwarfCompileUnit &CU);
637 
638  void skippedNonDebugFunction() override;
639 
640 public:
641  //===--------------------------------------------------------------------===//
642  // Main entry points.
643  //
644  DwarfDebug(AsmPrinter *A);
645 
646  ~DwarfDebug() override;
647 
648  /// Emit all Dwarf sections that should come prior to the
649  /// content.
650  void beginModule(Module *M) override;
651 
652  /// Emit all Dwarf sections that should come after the content.
653  void endModule() override;
654 
655  /// Emits inital debug location directive.
656  DebugLoc emitInitialLocDirective(const MachineFunction &MF, unsigned CUID);
657 
658  /// Process beginning of an instruction.
659  void beginInstruction(const MachineInstr *MI) override;
660 
661  /// Perform an MD5 checksum of \p Identifier and return the lower 64 bits.
662  static uint64_t makeTypeSignature(StringRef Identifier);
663 
664  /// Add a DIE to the set of types that we're going to pull into
665  /// type units.
666  void addDwarfTypeUnitType(DwarfCompileUnit &CU, StringRef Identifier,
667  DIE &Die, const DICompositeType *CTy);
668 
670  DwarfDebug *DD;
671  decltype(DwarfDebug::TypeUnitsUnderConstruction) TypeUnitsUnderConstruction;
672  bool AddrPoolUsed;
673  friend class DwarfDebug;
675  public:
678  };
679 
681 
682  /// Add a label so that arange data can be generated for it.
683  void addArangeLabel(SymbolCU SCU) { ArangeLabels.push_back(SCU); }
684 
685  /// For symbols that have a size designated (e.g. common symbols),
686  /// this tracks that size.
687  void setSymbolSize(const MCSymbol *Sym, uint64_t Size) override {
688  SymSize[Sym] = Size;
689  }
690 
691  /// Returns whether we should emit all DW_AT_[MIPS_]linkage_name.
692  /// If not, we still might emit certain cases.
693  bool useAllLinkageNames() const { return UseAllLinkageNames; }
694 
695  /// Returns whether to use DW_OP_GNU_push_tls_address, instead of the
696  /// standard DW_OP_form_tls_address opcode
697  bool useGNUTLSOpcode() const { return UseGNUTLSOpcode; }
698 
699  /// Returns whether to use the DWARF2 format for bitfields instyead of the
700  /// DWARF4 format.
701  bool useDWARF2Bitfields() const { return UseDWARF2Bitfields; }
702 
703  /// Returns whether to use inline strings.
704  bool useInlineStrings() const { return UseInlineStrings; }
705 
706  /// Returns whether ranges section should be emitted.
707  bool useRangesSection() const { return UseRangesSection; }
708 
709  /// Returns whether range encodings should be used for single entry range
710  /// lists.
711  bool alwaysUseRanges() const {
712  return MinimizeAddr == MinimizeAddrInV5::Ranges;
713  }
714 
715  // Returns whether novel exprloc addrx+offset encodings should be used to
716  // reduce debug_addr size.
718  return MinimizeAddr == MinimizeAddrInV5::Expressions;
719  }
720 
721  // Returns whether addrx+offset LLVM extension form should be used to reduce
722  // debug_addr size.
723  bool useAddrOffsetForm() const {
724  return MinimizeAddr == MinimizeAddrInV5::Form;
725  }
726 
727  /// Returns whether to use sections as labels rather than temp symbols.
728  bool useSectionsAsReferences() const {
729  return UseSectionsAsReferences;
730  }
731 
732  /// Returns whether .debug_loc section should be emitted.
733  bool useLocSection() const { return UseLocSection; }
734 
735  /// Returns whether to generate DWARF v4 type units.
736  bool generateTypeUnits() const { return GenerateTypeUnits; }
737 
738  // Experimental DWARF5 features.
739 
740  /// Returns what kind (if any) of accelerator tables to emit.
741  AccelTableKind getAccelTableKind() const { return TheAccelTableKind; }
742 
744  return HasAppleExtensionAttributes;
745  }
746 
747  /// Returns whether or not to change the current debug info for the
748  /// split dwarf proposal support.
749  bool useSplitDwarf() const { return HasSplitDwarf; }
750 
751  /// Returns whether to generate a string offsets table with (possibly shared)
752  /// contributions from each CU and type unit. This implies the use of
753  /// DW_FORM_strx* indirect references with DWARF v5 and beyond. Note that
754  /// DW_FORM_GNU_str_index is also an indirect reference, but it is used with
755  /// a pre-DWARF v5 implementation of split DWARF sections, which uses a
756  /// monolithic string offsets table.
758  return UseSegmentedStringOffsetsTable;
759  }
760 
761  bool emitDebugEntryValues() const {
762  return EmitDebugEntryValues;
763  }
764 
765  bool useOpConvert() const {
766  return EnableOpConvert;
767  }
768 
769  bool shareAcrossDWOCUs() const;
770 
771  /// Returns the Dwarf Version.
772  uint16_t getDwarfVersion() const;
773 
774  /// Returns a suitable DWARF form to represent a section offset, i.e.
775  /// * DW_FORM_sec_offset for DWARF version >= 4;
776  /// * DW_FORM_data8 for 64-bit DWARFv3;
777  /// * DW_FORM_data4 for 32-bit DWARFv3 and DWARFv2.
779 
780  /// Returns the previous CU that was being updated
781  const DwarfCompileUnit *getPrevCU() const { return PrevCU; }
782  void setPrevCU(const DwarfCompileUnit *PrevCU) { this->PrevCU = PrevCU; }
783 
784  /// Returns the entries for the .debug_loc section.
785  const DebugLocStream &getDebugLocs() const { return DebugLocs; }
786 
787  /// Emit an entry for the debug loc section. This can be used to
788  /// handle an entry that's going to be emitted into the debug loc section.
789  void emitDebugLocEntry(ByteStreamer &Streamer,
790  const DebugLocStream::Entry &Entry,
791  const DwarfCompileUnit *CU);
792 
793  /// Emit the location for a debug loc entry, including the size header.
795  const DwarfCompileUnit *CU);
796 
797  void addSubprogramNames(const DICompileUnit &CU, const DISubprogram *SP,
798  DIE &Die);
799 
800  AddressPool &getAddressPool() { return AddrPool; }
801 
802  void addAccelName(const DICompileUnit &CU, StringRef Name, const DIE &Die);
803 
804  void addAccelObjC(const DICompileUnit &CU, StringRef Name, const DIE &Die);
805 
807  const DIE &Die);
808 
809  void addAccelType(const DICompileUnit &CU, StringRef Name, const DIE &Die,
810  char Flags);
811 
812  const MachineFunction *getCurrentFunction() const { return CurFn; }
813 
814  /// A helper function to check whether the DIE for a given Scope is
815  /// going to be null.
817 
818  /// Find the matching DwarfCompileUnit for the given CU DIE.
819  DwarfCompileUnit *lookupCU(const DIE *Die) { return CUDieMap.lookup(Die); }
820  const DwarfCompileUnit *lookupCU(const DIE *Die) const {
821  return CUDieMap.lookup(Die);
822  }
823 
824  unsigned getStringTypeLoc(const DIStringType *ST) const {
825  return StringTypeLocMap.lookup(ST);
826  }
827 
828  void addStringTypeLoc(const DIStringType *ST, unsigned Loc) {
829  assert(ST);
830  if (Loc)
831  StringTypeLocMap[ST] = Loc;
832  }
833 
834  /// \defgroup DebuggerTuning Predicates to tune DWARF for a given debugger.
835  ///
836  /// Returns whether we are "tuning" for a given debugger.
837  /// @{
838  bool tuneForGDB() const { return DebuggerTuning == DebuggerKind::GDB; }
839  bool tuneForLLDB() const { return DebuggerTuning == DebuggerKind::LLDB; }
840  bool tuneForSCE() const { return DebuggerTuning == DebuggerKind::SCE; }
841  bool tuneForDBX() const { return DebuggerTuning == DebuggerKind::DBX; }
842  /// @}
843 
844  const MCSymbol *getSectionLabel(const MCSection *S);
845  void insertSectionLabel(const MCSymbol *S);
846 
847  static void emitDebugLocValue(const AsmPrinter &AP, const DIBasicType *BT,
848  const DbgValueLoc &Value,
849  DwarfExpression &DwarfExpr);
850 
851  /// If the \p File has an MD5 checksum, return it as an MD5Result
852  /// allocated in the MCContext.
854 };
855 
856 } // end namespace llvm
857 
858 #endif // LLVM_LIB_CODEGEN_ASMPRINTER_DWARFDEBUG_H
llvm::Check::Size
@ Size
Definition: FileCheck.h:73
llvm::DwarfDebug::NonTypeUnitContext::~NonTypeUnitContext
~NonTypeUnitContext()
Definition: DwarfDebug.cpp:3445
llvm::DwarfDebug::MinimizeAddrInV5::Disabled
@ Disabled
llvm::DebugLocStream
Byte stream of .debug_loc entries.
Definition: DebugLocStream.h:31
llvm::DbgEntity::getInlinedAt
const DILocation * getInlinedAt() const
Definition: DwarfDebug.h:86
MCDwarf.h
MI
IRTranslator LLVM IR MI
Definition: IRTranslator.cpp:105
MachineInstr.h
llvm
This file implements support for optimizing divisions by a constant.
Definition: AllocatorList.h:23
llvm::DIType
Base class for types.
Definition: DebugInfoMetadata.h:662
Reg
unsigned Reg
Definition: MachineSink.cpp:1566
llvm::MCSymbol
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:41
llvm::DwarfDebug::getAddressPool
AddressPool & getAddressPool()
Definition: DwarfDebug.h:800
llvm::DwarfDebug::emitDebugLocEntry
void emitDebugLocEntry(ByteStreamer &Streamer, const DebugLocStream::Entry &Entry, const DwarfCompileUnit *CU)
Emit an entry for the debug loc section.
Definition: DwarfDebug.cpp:2499
llvm::DwarfDebug::useGNUTLSOpcode
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:697
llvm::SymbolCU::Sym
const MCSymbol * Sym
Definition: DwarfDebug.h:282
Metadata.h
DebugLocStream.h
llvm::DbgEntity::DbgEntityKind
DbgEntityKind
Definition: DwarfDebug.h:74
llvm::DwarfDebug::getStringTypeLoc
unsigned getStringTypeLoc(const DIStringType *ST) const
Definition: DwarfDebug.h:824
llvm::DbgEntity
This class is defined as the common parent of DbgVariable and DbgLabel such that it could levarage po...
Definition: DwarfDebug.h:67
llvm::DebuggerKind
DebuggerKind
Identify a debugger for "tuning" the debug info.
Definition: TargetOptions.h:97
llvm::AccelTableKind::Dwarf
@ Dwarf
DWARF v5 .debug_names.
DebugInfoMetadata.h
llvm::DenseMapBase< DenseMap< KeyT, ValueT, DenseMapInfo< KeyT >, llvm::detail::DenseMapPair< KeyT, ValueT > >, KeyT, ValueT, DenseMapInfo< KeyT >, llvm::detail::DenseMapPair< KeyT, ValueT > >::lookup
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:197
llvm::DbgEntity::~DbgEntity
virtual ~DbgEntity()
Definition: DwarfDebug.h:81
llvm::DbgLabel::getTag
dwarf::Tag getTag() const
Translate tag to proper Dwarf tag.
Definition: DwarfDebug.h:250
StringRef.h
P
This currently compiles esp xmm0 movsd esp eax eax esp ret We should use not the dag combiner This is because dagcombine2 needs to be able to see through the X86ISD::Wrapper which DAGCombine can t really do The code for turning x load into a single vector load is target independent and should be moved to the dag combiner The code for turning x load into a vector load can only handle a direct load from a global or a direct load from the stack It should be generalized to handle any load from P
Definition: README-SSE.txt:411
llvm::DwarfCompileUnit
Definition: DwarfCompileUnit.h:47
llvm::DwarfDebug::emitDebugEntryValues
bool emitDebugEntryValues() const
Definition: DwarfDebug.h:761
llvm::SmallVector< FrameIndexExpr, 1 >
llvm::DbgVariable::initializeDbgValue
void initializeDbgValue(DbgValueLoc Value)
Definition: DwarfDebug.h:152
llvm::DebugLocStream::Entry
Definition: DebugLocStream.h:40
llvm::DIStringType
String type, Fortran CHARACTER(n)
Definition: DebugInfoMetadata.h:837
llvm::LexicalScope
LexicalScope - This class is used to track scope information.
Definition: LexicalScopes.h:44
llvm::dwarf::Form
Form
Definition: Dwarf.h:131
llvm::DbgVariable::getDebugLocListIndex
unsigned getDebugLocListIndex() const
Definition: DwarfDebug.h:177
llvm::DwarfDebug::addAccelName
void addAccelName(const DICompileUnit &CU, StringRef Name, const DIE &Die)
Definition: DwarfDebug.cpp:3486
MapVector.h
Allocator.h
llvm::DwarfDebug::skippedNonDebugFunction
void skippedNonDebugFunction() override
Definition: DwarfDebug.cpp:2175
llvm::DILocation
Debug location.
Definition: DebugInfoMetadata.h:1580
llvm::DbgLabel::getLabel
const DILabel * getLabel() const
Accessors.
Definition: DwarfDebug.h:243
llvm::DILabel::getName
StringRef getName() const
Definition: DebugInfoMetadata.h:3232
DenseMap.h
llvm::DwarfFile::getUnits
const SmallVectorImpl< std::unique_ptr< DwarfCompileUnit > > & getUnits()
Definition: DwarfFile.h:101
llvm::DbgEntity::setDIE
void setDIE(DIE &D)
Definition: DwarfDebug.h:91
llvm::DwarfDebug::addAccelObjC
void addAccelObjC(const DICompileUnit &CU, StringRef Name, const DIE &Die)
Definition: DwarfDebug.cpp:3491
llvm::DbgCallSiteParam::DbgCallSiteParam
DbgCallSiteParam(unsigned Reg, DbgValueLoc Val)
Definition: DwarfDebug.h:266
llvm::DwarfDebug::setSymbolSize
void setSymbolSize(const MCSymbol *Sym, uint64_t Size) override
For symbols that have a size designated (e.g.
Definition: DwarfDebug.h:687
llvm::Optional< uint8_t >
llvm::DwarfDebug::endModule
void endModule() override
Emit all Dwarf sections that should come after the content.
Definition: DwarfDebug.cpp:1409
llvm::MapVector
This class implements a map that also provides access to all stored values in a deterministic order.
Definition: MapVector.h:37
llvm::SmallPtrSet
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
Definition: SmallPtrSet.h:449
llvm::DbgVariable::getName
StringRef getName() const
Definition: DwarfDebug.h:180
llvm::DwarfDebug::NonTypeUnitContext
Definition: DwarfDebug.h:669
llvm::DIE
A structured debug information entry.
Definition: DIE.h:739
STLExtras.h
llvm::AccelTable
This class holds an abstract representation of an Accelerator Table, consisting of a sequence of buck...
Definition: AccelTable.h:197
llvm::DIExpression
DWARF expression.
Definition: DebugInfoMetadata.h:2586
llvm::DbgLabel::getName
StringRef getName() const
Definition: DwarfDebug.h:246
llvm::DbgLabel
This class is used to track label information.
Definition: DwarfDebug.h:233
llvm::dwarf::Tag
Tag
Definition: Dwarf.h:104
llvm::DebuggerKind::GDB
@ GDB
Tune debug info for gdb.
llvm::DwarfDebug::useSectionsAsReferences
bool useSectionsAsReferences() const
Returns whether to use sections as labels rather than temp symbols.
Definition: DwarfDebug.h:728
DebugLocEntry.h
llvm::DwarfDebug::emitDebugLocEntryLocation
void emitDebugLocEntryLocation(const DebugLocStream::Entry &Entry, const DwarfCompileUnit *CU)
Emit the location for a debug loc entry, including the size header.
Definition: DwarfDebug.cpp:2671
llvm::DbgVariable::DbgVariable
DbgVariable(const DILocalVariable *V, const DILocation *IA)
Frame index + expression.
Definition: DwarfDebug.h:137
llvm::DwarfDebug::addDwarfTypeUnitType
void addDwarfTypeUnitType(DwarfCompileUnit &CU, StringRef Identifier, DIE &Die, const DICompositeType *CTy)
Add a DIE to the set of types that we're going to pull into type units.
Definition: DwarfDebug.cpp:3352
F
#define F(x, y, z)
Definition: MD5.cpp:56
llvm::DbgVariable::isArtificial
bool isArtificial() const
Return true if DbgVariable is artificial.
Definition: DwarfDebug.h:197
llvm::DbgEntity::getDIE
DIE * getDIE() const
Definition: DwarfDebug.h:87
llvm::DwarfExpression
Base class containing the logic for constructing DWARF expressions independently of whether they are ...
Definition: DwarfExpression.h:106
llvm::ARMBuildAttrs::Section
@ Section
Legacy Tags.
Definition: ARMBuildAttributes.h:78
llvm::DwarfDebug::insertSectionLabel
void insertSectionLabel(const MCSymbol *S)
Definition: DwarfDebug.cpp:3527
llvm::DwarfDebug::addAccelNamespace
void addAccelNamespace(const DICompileUnit &CU, StringRef Name, const DIE &Die)
Definition: DwarfDebug.cpp:3498
llvm::DwarfDebug::isLexicalScopeDIENull
bool isLexicalScopeDIENull(LexicalScope *Scope)
A helper function to check whether the DIE for a given Scope is going to be null.
Definition: DwarfDebug.cpp:537
DwarfFile.h
llvm::AccelTableKind::None
@ None
None.
llvm::DbgLabel::DbgLabel
DbgLabel(const DILabel *L, const DILocation *IA, const MCSymbol *Sym=nullptr)
Symbol before DBG_LABEL instruction.
Definition: DwarfDebug.h:238
llvm::DwarfDebug::useAllLinkageNames
bool useAllLinkageNames() const
Returns whether we should emit all DW_AT_[MIPS_]linkage_name.
Definition: DwarfDebug.h:693
llvm::DwarfDebug::getMD5AsBytes
Optional< MD5::MD5Result > getMD5AsBytes(const DIFile *File) const
If the File has an MD5 checksum, return it as an MD5Result allocated in the MCContext.
Definition: DwarfDebug.cpp:3533
llvm::DILocalVariable
Local variable.
Definition: DebugInfoMetadata.h:3097
E
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
llvm::DbgEntity::getDbgEntityID
unsigned getDbgEntityID() const
Definition: DwarfDebug.h:88
llvm::DwarfDebug::addSubprogramNames
void addSubprogramNames(const DICompileUnit &CU, const DISubprogram *SP, DIE &Die)
Definition: DwarfDebug.cpp:503
llvm::AccelTableKind::Apple
@ Apple
.apple_names, .apple_namespaces, .apple_types, .apple_objc.
llvm::DwarfDebug::getCurrentFunction
const MachineFunction * getCurrentFunction() const
Definition: DwarfDebug.h:812
llvm::DwarfDebug::alwaysUseRanges
bool alwaysUseRanges() const
Returns whether range encodings should be used for single entry range lists.
Definition: DwarfDebug.h:711
llvm::DwarfDebug::useAddrOffsetForm
bool useAddrOffsetForm() const
Definition: DwarfDebug.h:723
DebugHandlerBase.h
DbgEntityHistoryCalculator.h
llvm::BitTracker
Definition: BitTracker.h:35
DenseSet.h
llvm::DbgVariable::isObjectPointer
bool isObjectPointer() const
Definition: DwarfDebug.h:205
AccelTable.h
llvm::DbgValueHistoryMap::InlinedEntity
std::pair< const DINode *, const DILocation * > InlinedEntity
Definition: DbgEntityHistoryCalculator.h:97
llvm::DbgEntity::DbgLabelKind
@ DbgLabelKind
Definition: DwarfDebug.h:76
DebugLoc.h
SmallPtrSet.h
StringMap.h
llvm::DbgVariable
This class is used to track local variable information.
Definition: DwarfDebug.h:116
llvm::DbgVariable::getTag
dwarf::Tag getTag() const
Definition: DwarfDebug.h:188
llvm::SymbolCU::SymbolCU
SymbolCU(DwarfCompileUnit *CU, const MCSymbol *Sym)
Definition: DwarfDebug.h:280
llvm::DwarfDebug::addStringTypeLoc
void addStringTypeLoc(const DIStringType *ST, unsigned Loc)
Definition: DwarfDebug.h:828
AddressPool.h
llvm::DbgVariable::hasFrameIndexExprs
bool hasFrameIndexExprs() const
Definition: DwarfDebug.h:184
llvm::DbgCallSiteParam
Used for tracking debug info about call site parameters.
Definition: DwarfDebug.h:260
llvm::DwarfDebug::lookupCU
DwarfCompileUnit * lookupCU(const DIE *Die)
Find the matching DwarfCompileUnit for the given CU DIE.
Definition: DwarfDebug.h:819
llvm::DebuggerKind::DBX
@ DBX
Tune debug info for dbx.
llvm::DwarfDebug::MinimizeAddrInV5
MinimizeAddrInV5
Definition: DwarfDebug.h:382
llvm::DwarfDebug::useAddrOffsetExpressions
bool useAddrOffsetExpressions() const
Definition: DwarfDebug.h:717
llvm::DwarfDebug::getDwarfSectionOffsetForm
dwarf::Form getDwarfSectionOffsetForm() const
Returns a suitable DWARF form to represent a section offset, i.e.
Definition: DwarfDebug.cpp:3512
llvm::RISCVFenceField::O
@ O
Definition: RISCVBaseInfo.h:206
LiveDebugValues::DbgValue
Class recording the (high level) value of a variable.
Definition: InstrRefBasedImpl.h:225
llvm::DwarfDebug::tuneForLLDB
bool tuneForLLDB() const
Definition: DwarfDebug.h:839
llvm::DwarfDebug::beginModule
void beginModule(Module *M) override
Emit all Dwarf sections that should come prior to the content.
Definition: DwarfDebug.cpp:1147
llvm::MachineInstr
Representation of each machine instruction.
Definition: MachineInstr.h:64
llvm::DwarfDebug
Collects and handles dwarf debug information.
Definition: DwarfDebug.h:295
uint64_t
D
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
llvm::DwarfDebug::getAccelTableKind
AccelTableKind getAccelTableKind() const
Returns what kind (if any) of accelerator tables to emit.
Definition: DwarfDebug.h:741
llvm::ARM_MB::ST
@ ST
Definition: ARMBaseInfo.h:73
llvm::DwarfDebug::DwarfDebug
DwarfDebug(AsmPrinter *A)
Definition: DwarfDebug.cpp:350
llvm::BumpPtrAllocatorImpl
Allocate memory in an ever growing pool, as if by bump-pointer.
Definition: Allocator.h:67
llvm::DbgVariable::setDebugLocListIndex
void setDebugLocListIndex(unsigned O)
Definition: DwarfDebug.h:176
llvm::DenseMap
Definition: DenseMap.h:714
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::DICompileUnit
Compile unit.
Definition: DebugInfoMetadata.h:1335
ArrayRef.h
llvm::DwarfDebug::emitInitialLocDirective
DebugLoc emitInitialLocDirective(const MachineFunction &MF, unsigned CUID)
Emits inital debug location directive.
Definition: DwarfDebug.cpp:2125
llvm::DwarfDebug::tuneForGDB
bool tuneForGDB() const
Definition: DwarfDebug.h:838
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::DwarfDebug::endFunctionImpl
void endFunctionImpl(const MachineFunction *MF) override
Gather and emit post-function debug information.
Definition: DwarfDebug.cpp:2184
llvm::DbgEntity::DbgEntity
DbgEntity(const DINode *N, const DILocation *IA, unsigned ID)
Definition: DwarfDebug.h:79
llvm::SymbolCU::CU
DwarfCompileUnit * CU
Definition: DwarfDebug.h:283
llvm::DbgCallSiteParam::getRegister
unsigned getRegister() const
Definition: DwarfDebug.h:271
llvm::DwarfDebug::tuneForDBX
bool tuneForDBX() const
Definition: DwarfDebug.h:841
llvm::DwarfDebug::beginInstruction
void beginInstruction(const MachineInstr *MI) override
Process beginning of an instruction.
Definition: DwarfDebug.cpp:1959
llvm::DbgValueHistoryMap::Entries
SmallVector< Entry, 4 > Entries
Definition: DbgEntityHistoryCalculator.h:96
llvm::DwarfDebug::beginFunctionImpl
void beginFunctionImpl(const MachineFunction *MF) override
Gather pre-function debug information.
Definition: DwarfDebug.cpp:2145
llvm::DIVariable::getName
StringRef getName() const
Definition: DebugInfoMetadata.h:2532
llvm::DbgVariable::getValueLoc
const DbgValueLoc * getValueLoc() const
Definition: DwarfDebug.h:181
llvm::DIBasicType
Basic type, like 'int' or 'float'.
Definition: DebugInfoMetadata.h:769
llvm::MachineFunction
Definition: MachineFunction.h:234
TargetOptions.h
llvm::DICompositeType
Composite types.
Definition: DebugInfoMetadata.h:1060
llvm::ArrayRef
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: APInt.h:32
llvm::DwarfDebug::getDebugLocs
const DebugLocStream & getDebugLocs() const
Returns the entries for the .debug_loc section.
Definition: DwarfDebug.h:785
llvm::DbgVariable::initializeMMI
void initializeMMI(const DIExpression *E, int FI)
Initialize from the MMI table.
Definition: DwarfDebug.h:141
llvm::DbgEntity::classof
static bool classof(const DbgEntity *N)
Definition: DwarfDebug.h:93
llvm::MCDwarfDwoLineTable
Definition: MCDwarf.h:301
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
Dwarf.h
llvm::DebuggerKind::Default
@ Default
No specific tuning requested.
llvm::DINode
Tagged DWARF-like metadata node.
Definition: DebugInfoMetadata.h:127
llvm::DbgEntity::getEntity
const DINode * getEntity() const
Accessors.
Definition: DwarfDebug.h:85
llvm::DbgEntity::DbgVariableKind
@ DbgVariableKind
Definition: DwarfDebug.h:75
llvm::MCSection
Instances of this class represent a uniqued identifier for a section in the current translation unit.
Definition: MCSection.h:39
llvm::DwarfDebug::addArangeLabel
void addArangeLabel(SymbolCU SCU)
Add a label so that arange data can be generated for it.
Definition: DwarfDebug.h:683
S
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
Definition: README.txt:210
Module
Machine Check Debug Module
Definition: MachineCheckDebugify.cpp:122
llvm::DwarfDebug::generateTypeUnits
bool generateTypeUnits() const
Returns whether to generate DWARF v4 type units.
Definition: DwarfDebug.h:736
Node
Definition: ItaniumDemangle.h:235
llvm::DbgVariable::setDebugLocListTagOffset
void setDebugLocListTagOffset(uint8_t O)
Definition: DwarfDebug.h:178
llvm::DwarfDebug::shareAcrossDWOCUs
bool shareAcrossDWOCUs() const
Definition: DwarfDebug.cpp:561
llvm::Register
Wrapper class representing virtual and physical registers.
Definition: Register.h:19
llvm::DwarfDebug::MinimizeAddrInV5::Default
@ Default
llvm::DwarfDebug::enterNonTypeUnitContext
NonTypeUnitContext enterNonTypeUnitContext()
Definition: DwarfDebug.cpp:3450
llvm::DwarfDebug::getSectionLabel
const MCSymbol * getSectionLabel(const MCSection *S)
Definition: DwarfDebug.cpp:3521
llvm::DwarfDebug::lookupCU
const DwarfCompileUnit * lookupCU(const DIE *Die) const
Definition: DwarfDebug.h:820
llvm::DbgLabel::classof
static bool classof(const DbgEntity *N)
Definition: DwarfDebug.h:254
llvm::DbgVariable::getFrameIndexExprs
ArrayRef< FrameIndexExpr > getFrameIndexExprs() const
Get the FI entries, sorted by fragment offset.
Definition: DwarfDebug.cpp:275
llvm::DwarfDebug::emitDebugLocValue
static void emitDebugLocValue(const AsmPrinter &AP, const DIBasicType *BT, const DbgValueLoc &Value, DwarfExpression &DwarfExpr)
Definition: DwarfDebug.cpp:2546
llvm::DwarfDebug::useLocSection
bool useLocSection() const
Returns whether .debug_loc section should be emitted.
Definition: DwarfDebug.h:733
llvm::DwarfDebug::getPrevCU
const DwarfCompileUnit * getPrevCU() const
Returns the previous CU that was being updated.
Definition: DwarfDebug.h:781
llvm::DwarfDebug::useAppleExtensionAttributes
bool useAppleExtensionAttributes() const
Definition: DwarfDebug.h:743
llvm::DwarfDebug::getDwarfCompileUnitIDForLineTable
unsigned getDwarfCompileUnitIDForLineTable(const DwarfCompileUnit &CU)
Get Dwarf compile unit ID for line table.
Definition: DwarfDebug.cpp:2164
llvm::GraphProgram::Name
Name
Definition: GraphWriter.h:52
llvm::AddressPool
Definition: AddressPool.h:23
uint16_t
llvm::DbgLabel::getSymbol
const MCSymbol * getSymbol() const
Definition: DwarfDebug.h:244
llvm::DwarfDebug::useInlineStrings
bool useInlineStrings() const
Returns whether to use inline strings.
Definition: DwarfDebug.h:704
llvm::DwarfDebug::useSegmentedStringOffsetsTable
bool useSegmentedStringOffsetsTable() const
Returns whether to generate a string offsets table with (possibly shared) contributions from each CU ...
Definition: DwarfDebug.h:757
llvm::AccelTableKind::Default
@ Default
Dwarf for DWARF5 or later, Apple otherwise.
llvm::AsmPrinter
This class is intended to be used as a driving class for all asm writers.
Definition: AsmPrinter.h:81
llvm::DwarfFile
Definition: DwarfFile.h:49
llvm::DbgVariable::getSingleExpression
const DIExpression * getSingleExpression() const
Definition: DwarfDebug.h:171
llvm::DbgValueLoc
The location of a single variable, composed of an expression and 0 or more DbgValueLocEntries.
Definition: DebugLocEntry.h:108
llvm::DwarfDebug::useOpConvert
bool useOpConvert() const
Definition: DwarfDebug.h:765
llvm::DwarfDebug::makeTypeSignature
static uint64_t makeTypeSignature(StringRef Identifier)
Perform an MD5 checksum of Identifier and return the lower 64 bits.
Definition: DwarfDebug.cpp:3341
SmallVector.h
N
#define N
llvm::DbgVariable::getVariable
const DILocalVariable * getVariable() const
Definition: DwarfDebug.h:167
llvm::DwarfDebug::tuneForSCE
bool tuneForSCE() const
Definition: DwarfDebug.h:840
llvm::max
Align max(MaybeAlign Lhs, Align Rhs)
Definition: Alignment.h:340
llvm::DwarfDebug::addAccelType
void addAccelType(const DICompileUnit &CU, StringRef Name, const DIE &Die, char Flags)
Definition: DwarfDebug.cpp:3503
llvm::DwarfDebug::useDWARF2Bitfields
bool useDWARF2Bitfields() const
Returns whether to use the DWARF2 format for bitfields instyead of the DWARF4 format.
Definition: DwarfDebug.h:701
llvm::DebugHandlerBase
Base class for debug information backends.
Definition: DebugHandlerBase.h:53
llvm::DwarfDebug::MinimizeAddrInV5::Ranges
@ Ranges
llvm::DISubprogram
Subprogram description.
Definition: DebugInfoMetadata.h:1820
llvm::SmallVectorImpl
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: APFloat.h:43
llvm::DbgVariable::classof
static bool classof(const DbgEntity *N)
Definition: DwarfDebug.h:224
llvm::DwarfDebug::getDwarfVersion
uint16_t getDwarfVersion() const
Returns the Dwarf Version.
Definition: DwarfDebug.cpp:3508
llvm::DwarfDebug::setPrevCU
void setPrevCU(const DwarfCompileUnit *PrevCU)
Definition: DwarfDebug.h:782
llvm::DILabel
Label.
Definition: DebugInfoMetadata.h:3185
llvm::DbgVariable::hasComplexAddress
bool hasComplexAddress() const
Definition: DwarfDebug.h:213
llvm::DwarfDebug::useRangesSection
bool useRangesSection() const
Returns whether ranges section should be emitted.
Definition: DwarfDebug.h:707
llvm::DwarfDebug::MinimizeAddrInV5::Form
@ Form
llvm::DbgVariable::addMMIEntry
void addMMIEntry(const DbgVariable &V)
Definition: DwarfDebug.cpp:293
llvm::DebuggerKind::SCE
@ SCE
Tune debug info for SCE targets (e.g. PS4).
llvm::SetVector
A vector that has set insertion semantics.
Definition: SetVector.h:40
llvm::ByteStreamer
Definition: ByteStreamer.h:24
llvm::DebuggerKind::LLDB
@ LLDB
Tune debug info for lldb.
llvm::SymbolCU
Helper used to pair up a symbol and its DWARF compile unit.
Definition: DwarfDebug.h:279
CU
Definition: AArch64AsmBackend.cpp:501
llvm::Value
LLVM Value Representation.
Definition: Value.h:74
llvm::DwarfDebug::~DwarfDebug
~DwarfDebug() override
File
Instrumentation for Order File
Definition: InstrOrderFile.cpp:205
llvm::AccelTableKind
AccelTableKind
The kind of accelerator tables we should emit.
Definition: DWARFLinker.h:25
llvm::ISD::MCSymbol
@ MCSymbol
Definition: ISDOpcodes.h:172
llvm::DwarfDebug::MinimizeAddrInV5::Expressions
@ Expressions
SetVector.h
llvm::DIFile
File.
Definition: DebugInfoMetadata.h:530
llvm::DbgVariable::getType
const DIType * getType() const
Definition: DwarfDebug.cpp:231
llvm::Intrinsic::ID
unsigned ID
Definition: TargetTransformInfo.h:37
llvm::DbgVariable::getDebugLocListTagOffset
Optional< uint8_t > getDebugLocListTagOffset() const
Definition: DwarfDebug.h:179
llvm::DbgCallSiteParam::getValue
DbgValueLoc getValue() const
Definition: DwarfDebug.h:272