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