1 //===-- llvm/CodeGen/DwarfDebug.h - Dwarf Debug Framework ------*- C++ -*--===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file contains support for writing dwarf debug info into asm files.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef CODEGEN_ASMPRINTER_DWARFDEBUG_H__
15 #define CODEGEN_ASMPRINTER_DWARFDEBUG_H__
16 
17 #include "DIE.h"
18 #include "llvm/ADT/DenseMap.h"
19 #include "llvm/ADT/FoldingSet.h"
20 #include "llvm/ADT/SetVector.h"
21 #include "llvm/ADT/SmallPtrSet.h"
22 #include "llvm/ADT/StringMap.h"
23 #include "llvm/CodeGen/AsmPrinter.h"
24 #include "llvm/CodeGen/LexicalScopes.h"
25 #include "llvm/DebugInfo.h"
26 #include "llvm/MC/MachineLocation.h"
27 #include "llvm/Support/Allocator.h"
28 #include "llvm/Support/DebugLoc.h"
29 
30 namespace llvm {
31 
32 class CompileUnit;
33 class ConstantInt;
34 class ConstantFP;
35 class DbgVariable;
36 class MachineFrameInfo;
37 class MachineModuleInfo;
38 class MachineOperand;
39 class MCAsmInfo;
40 class DIEAbbrev;
41 class DIE;
42 class DIEBlock;
43 class DIEEntry;
44 class DwarfDebug;
45 
46 //===----------------------------------------------------------------------===//
47 /// \brief This class is used to record source line correspondence.
48 class SrcLineInfo {
49   unsigned Line;                     // Source line number.
50   unsigned Column;                   // Source column.
51   unsigned SourceID;                 // Source ID number.
52   MCSymbol *Label;                   // Label in code ID number.
53 public:
54   SrcLineInfo(unsigned L, unsigned C, unsigned S, MCSymbol *label)
55     : Line(L), Column(C), SourceID(S), Label(label) {}
56 
57   // Accessors
58   unsigned getLine() const { return Line; }
59   unsigned getColumn() const { return Column; }
60   unsigned getSourceID() const { return SourceID; }
61   MCSymbol *getLabel() const { return Label; }
62 };
63 
64 /// \brief This struct describes location entries emitted in the .debug_loc
65 /// section.
66 typedef struct DotDebugLocEntry {
67   const MCSymbol *Begin;
68   const MCSymbol *End;
69   MachineLocation Loc;
70   const MDNode *Variable;
71   bool Merged;
72   bool Constant;
73   enum EntryType {
74     E_Location,
75     E_Integer,
76     E_ConstantFP,
77     E_ConstantInt
78   };
79   enum EntryType EntryKind;
80 
81   union {
82     int64_t Int;
83     const ConstantFP *CFP;
84     const ConstantInt *CIP;
85   } Constants;
86   DotDebugLocEntry()
87     : Begin(0), End(0), Variable(0), Merged(false),
88       Constant(false) { Constants.Int = 0;}
89   DotDebugLocEntry(const MCSymbol *B, const MCSymbol *E, MachineLocation &L,
90                    const MDNode *V)
91     : Begin(B), End(E), Loc(L), Variable(V), Merged(false),
92       Constant(false) { Constants.Int = 0; EntryKind = E_Location; }
93   DotDebugLocEntry(const MCSymbol *B, const MCSymbol *E, int64_t i)
94     : Begin(B), End(E), Variable(0), Merged(false),
95       Constant(true) { Constants.Int = i; EntryKind = E_Integer; }
96   DotDebugLocEntry(const MCSymbol *B, const MCSymbol *E, const ConstantFP *FPtr)
97     : Begin(B), End(E), Variable(0), Merged(false),
98       Constant(true) { Constants.CFP = FPtr; EntryKind = E_ConstantFP; }
99   DotDebugLocEntry(const MCSymbol *B, const MCSymbol *E,
100                    const ConstantInt *IPtr)
101     : Begin(B), End(E), Variable(0), Merged(false),
102       Constant(true) { Constants.CIP = IPtr; EntryKind = E_ConstantInt; }
103 
104   /// \brief Empty entries are also used as a trigger to emit temp label. Such
105   /// labels are referenced is used to find debug_loc offset for a given DIE.
106   bool isEmpty() { return Begin == 0 && End == 0; }
107   bool isMerged() { return Merged; }
108   void Merge(DotDebugLocEntry *Next) {
109     if (!(Begin && Loc == Next->Loc && End == Next->Begin))
110       return;
111     Next->Begin = Begin;
112     Merged = true;
113   }
114   bool isLocation() const    { return EntryKind == E_Location; }
115   bool isInt() const         { return EntryKind == E_Integer; }
116   bool isConstantFP() const  { return EntryKind == E_ConstantFP; }
117   bool isConstantInt() const { return EntryKind == E_ConstantInt; }
118   int64_t getInt()                    { return Constants.Int; }
119   const ConstantFP *getConstantFP()   { return Constants.CFP; }
120   const ConstantInt *getConstantInt() { return Constants.CIP; }
121 } DotDebugLocEntry;
122 
123 //===----------------------------------------------------------------------===//
124 /// \brief This class is used to track local variable information.
125 class DbgVariable {
126   DIVariable Var;                    // Variable Descriptor.
127   DIE *TheDIE;                       // Variable DIE.
128   unsigned DotDebugLocOffset;        // Offset in DotDebugLocEntries.
129   DbgVariable *AbsVar;               // Corresponding Abstract variable, if any.
130   const MachineInstr *MInsn;         // DBG_VALUE instruction of the variable.
131   int FrameIndex;
132 public:
133   // AbsVar may be NULL.
134   DbgVariable(DIVariable V, DbgVariable *AV)
135     : Var(V), TheDIE(0), DotDebugLocOffset(~0U), AbsVar(AV), MInsn(0),
136       FrameIndex(~0) {}
137 
138   // Accessors.
139   DIVariable getVariable()           const { return Var; }
140   void setDIE(DIE *D)                      { TheDIE = D; }
141   DIE *getDIE()                      const { return TheDIE; }
142   void setDotDebugLocOffset(unsigned O)    { DotDebugLocOffset = O; }
143   unsigned getDotDebugLocOffset()    const { return DotDebugLocOffset; }
144   StringRef getName()                const { return Var.getName(); }
145   DbgVariable *getAbstractVariable() const { return AbsVar; }
146   const MachineInstr *getMInsn()     const { return MInsn; }
147   void setMInsn(const MachineInstr *M)     { MInsn = M; }
148   int getFrameIndex()                const { return FrameIndex; }
149   void setFrameIndex(int FI)               { FrameIndex = FI; }
150   // Translate tag to proper Dwarf tag.
151   unsigned getTag()                  const {
152     if (Var.getTag() == dwarf::DW_TAG_arg_variable)
153       return dwarf::DW_TAG_formal_parameter;
154 
155     return dwarf::DW_TAG_variable;
156   }
157   /// \brief Return true if DbgVariable is artificial.
158   bool isArtificial()                const {
159     if (Var.isArtificial())
160       return true;
161     if (getType().isArtificial())
162       return true;
163     return false;
164   }
165 
166   bool isObjectPointer()             const {
167     if (Var.isObjectPointer())
168       return true;
169     if (getType().isObjectPointer())
170       return true;
171     return false;
172   }
173 
174   bool variableHasComplexAddress()   const {
175     assert(Var.Verify() && "Invalid complex DbgVariable!");
176     return Var.hasComplexAddress();
177   }
178   bool isBlockByrefVariable()        const {
179     assert(Var.Verify() && "Invalid complex DbgVariable!");
180     return Var.isBlockByrefVariable();
181   }
182   unsigned getNumAddrElements()      const {
183     assert(Var.Verify() && "Invalid complex DbgVariable!");
184     return Var.getNumAddrElements();
185   }
186   uint64_t getAddrElement(unsigned i) const {
187     return Var.getAddrElement(i);
188   }
189   DIType getType() const;
190 };
191 
192 
193 // A String->Symbol mapping of strings used by indirect
194 // references.
195 typedef StringMap<std::pair<MCSymbol*, unsigned>,
196                   BumpPtrAllocator&> StrPool;
197 
198 /// \brief Collects and handles information specific to a particular
199 /// collection of units.
200 class DwarfUnits {
201   // Target of Dwarf emission, used for sizing of abbreviations.
202   AsmPrinter *Asm;
203 
204   // Used to uniquely define abbreviations.
205   FoldingSet<DIEAbbrev> *AbbreviationsSet;
206 
207   // A list of all the unique abbreviations in use.
208   std::vector<DIEAbbrev *> *Abbreviations;
209 
210   // A pointer to all units in the section.
211   SmallVector<CompileUnit *, 1> CUs;
212 
213   // Collection of strings for this unit and assorted symbols.
214   StrPool StringPool;
215   unsigned NextStringPoolNumber;
216   std::string StringPref;
217 
218 public:
219   DwarfUnits(AsmPrinter *AP, FoldingSet<DIEAbbrev> *AS,
220              std::vector<DIEAbbrev *> *A, const char *Pref,
221              BumpPtrAllocator &DA) :
222     Asm(AP), AbbreviationsSet(AS), Abbreviations(A),
223     StringPool(DA), NextStringPoolNumber(0), StringPref(Pref) {}
224 
225   /// \brief Compute the size and offset of a DIE given an incoming Offset.
226   unsigned computeSizeAndOffset(DIE *Die, unsigned Offset);
227 
228   /// \brief Compute the size and offset of all the DIEs.
229   void computeSizeAndOffsets();
230 
231   /// \brief Define a unique number for the abbreviation.
232   void assignAbbrevNumber(DIEAbbrev &Abbrev);
233 
234   /// \brief Add a unit to the list of CUs.
235   void addUnit(CompileUnit *CU) { CUs.push_back(CU); }
236 
237   /// \brief Emit all of the units to the section listed with the given
238   /// abbreviation section.
239   void emitUnits(DwarfDebug *, const MCSection *, const MCSection *,
240                  const MCSymbol *);
241 
242   /// \brief Emit all of the strings to the section given.
243   void emitStrings(const MCSection *, const MCSection *, const MCSymbol *);
244 
245   /// \brief Returns the entry into the start of the pool.
246   MCSymbol *getStringPoolSym();
247 
248   /// \brief Returns an entry into the string pool with the given
249   /// string text.
250   MCSymbol *getStringPoolEntry(StringRef Str);
251 
252   /// \brief Returns the index into the string pool with the given
253   /// string text.
254   unsigned getStringPoolIndex(StringRef Str);
255 
256   /// \brief Returns the string pool.
257   StrPool *getStringPool() { return &StringPool; }
258 };
259 
260 /// \brief Collects and handles dwarf debug information.
261 class DwarfDebug {
262   // Target of Dwarf emission.
263   AsmPrinter *Asm;
264 
265   // Collected machine module information.
266   MachineModuleInfo *MMI;
267 
268   // All DIEValues are allocated through this allocator.
269   BumpPtrAllocator DIEValueAllocator;
270 
271   //===--------------------------------------------------------------------===//
272   // Attribute used to construct specific Dwarf sections.
273   //
274 
275   CompileUnit *FirstCU;
276 
277   // Maps MDNode with its corresponding CompileUnit.
278   DenseMap <const MDNode *, CompileUnit *> CUMap;
279 
280   // Maps subprogram MDNode with its corresponding CompileUnit.
281   DenseMap <const MDNode *, CompileUnit *> SPMap;
282 
283   // Used to uniquely define abbreviations.
284   FoldingSet<DIEAbbrev> AbbreviationsSet;
285 
286   // A list of all the unique abbreviations in use.
287   std::vector<DIEAbbrev *> Abbreviations;
288 
289   // Source id map, i.e. pair of source filename and directory,
290   // separated by a zero byte, mapped to a unique id.
291   StringMap<unsigned, BumpPtrAllocator&> SourceIdMap;
292 
293   // Provides a unique id per text section.
294   SetVector<const MCSection*> SectionMap;
295 
296   // List of Arguments (DbgValues) for current function.
297   SmallVector<DbgVariable *, 8> CurrentFnArguments;
298 
299   LexicalScopes LScopes;
300 
301   // Collection of abstract subprogram DIEs.
302   DenseMap<const MDNode *, DIE *> AbstractSPDies;
303 
304   // Collection of dbg variables of a scope.
305   DenseMap<LexicalScope *, SmallVector<DbgVariable *, 8> > ScopeVariables;
306 
307   // Collection of abstract variables.
308   DenseMap<const MDNode *, DbgVariable *> AbstractVariables;
309 
310   // Collection of DotDebugLocEntry.
311   SmallVector<DotDebugLocEntry, 4> DotDebugLocEntries;
312 
313   // Collection of subprogram DIEs that are marked (at the end of the module)
314   // as DW_AT_inline.
315   SmallPtrSet<DIE *, 4> InlinedSubprogramDIEs;
316 
317   // Keep track of inlined functions and their location.  This
318   // information is used to populate the debug_inlined section.
319   typedef std::pair<const MCSymbol *, DIE *> InlineInfoLabels;
320   DenseMap<const MDNode *, SmallVector<InlineInfoLabels, 4> > InlineInfo;
321   SmallVector<const MDNode *, 4> InlinedSPNodes;
322 
323   // This is a collection of subprogram MDNodes that are processed to
324   // create DIEs.
325   SmallPtrSet<const MDNode *, 16> ProcessedSPNodes;
326 
327   // Maps instruction with label emitted before instruction.
328   DenseMap<const MachineInstr *, MCSymbol *> LabelsBeforeInsn;
329 
330   // Maps instruction with label emitted after instruction.
331   DenseMap<const MachineInstr *, MCSymbol *> LabelsAfterInsn;
332 
333   // Every user variable mentioned by a DBG_VALUE instruction in order of
334   // appearance.
335   SmallVector<const MDNode*, 8> UserVariables;
336 
337   // For each user variable, keep a list of DBG_VALUE instructions in order.
338   // The list can also contain normal instructions that clobber the previous
339   // DBG_VALUE.
340   typedef DenseMap<const MDNode*, SmallVector<const MachineInstr*, 4> >
341     DbgValueHistoryMap;
342   DbgValueHistoryMap DbgValues;
343 
344   SmallVector<const MCSymbol *, 8> DebugRangeSymbols;
345 
346   // Previous instruction's location information. This is used to determine
347   // label location to indicate scope boundries in dwarf debug info.
348   DebugLoc PrevInstLoc;
349   MCSymbol *PrevLabel;
350 
351   // This location indicates end of function prologue and beginning of function
352   // body.
353   DebugLoc PrologEndLoc;
354 
355   struct FunctionDebugFrameInfo {
356     unsigned Number;
357     std::vector<MachineMove> Moves;
358 
359     FunctionDebugFrameInfo(unsigned Num, const std::vector<MachineMove> &M)
360       : Number(Num), Moves(M) {}
361   };
362 
363   std::vector<FunctionDebugFrameInfo> DebugFrames;
364 
365   // Section Symbols: these are assembler temporary labels that are emitted at
366   // the beginning of each supported dwarf section.  These are used to form
367   // section offsets and are created by EmitSectionLabels.
368   MCSymbol *DwarfInfoSectionSym, *DwarfAbbrevSectionSym;
369   MCSymbol *DwarfStrSectionSym, *TextSectionSym, *DwarfDebugRangeSectionSym;
370   MCSymbol *DwarfDebugLocSectionSym;
371   MCSymbol *FunctionBeginSym, *FunctionEndSym;
372   MCSymbol *DwarfAbbrevDWOSectionSym, *DwarfStrDWOSectionSym;
373 
374   // As an optimization, there is no need to emit an entry in the directory
375   // table for the same directory as DW_at_comp_dir.
376   StringRef CompilationDir;
377 
378   // Counter for assigning globally unique IDs for CUs.
379   unsigned GlobalCUIndexCount;
380 
381   // Holder for the file specific debug information.
382   DwarfUnits InfoHolder;
383 
384   // Holders for the various debug information flags that we might need to
385   // have exposed. See accessor functions below for description.
386 
387   // Whether or not we're emitting info for older versions of gdb on darwin.
388   bool IsDarwinGDBCompat;
389 
390   // DWARF5 Experimental Options
391   bool HasDwarfAccelTables;
392   bool HasSplitDwarf;
393 
394   // Separated Dwarf Variables
395   // In general these will all be for bits that are left in the
396   // original object file, rather than things that are meant
397   // to be in the .dwo sections.
398 
399   // The CU left in the original object file for separated debug info.
400   CompileUnit *SkeletonCU;
401 
402   // Used to uniquely define abbreviations for the skeleton emission.
403   FoldingSet<DIEAbbrev> SkeletonAbbrevSet;
404 
405   // A list of all the unique abbreviations in use.
406   std::vector<DIEAbbrev *> SkeletonAbbrevs;
407 
408   // Holder for the skeleton information.
409   DwarfUnits SkeletonHolder;
410 
411 private:
412 
413   void addScopeVariable(LexicalScope *LS, DbgVariable *Var);
414 
415   /// \brief Find abstract variable associated with Var.
416   DbgVariable *findAbstractVariable(DIVariable &Var, DebugLoc Loc);
417 
418   /// \brief Find DIE for the given subprogram and attach appropriate
419   /// DW_AT_low_pc and DW_AT_high_pc attributes. If there are global
420   /// variables in this scope then create and insert DIEs for these
421   /// variables.
422   DIE *updateSubprogramScopeDIE(CompileUnit *SPCU, const MDNode *SPNode);
423 
424   /// \brief Construct new DW_TAG_lexical_block for this scope and
425   /// attach DW_AT_low_pc/DW_AT_high_pc labels.
426   DIE *constructLexicalScopeDIE(CompileUnit *TheCU, LexicalScope *Scope);
427 
428   /// \brief This scope represents inlined body of a function. Construct
429   /// DIE to represent this concrete inlined copy of the function.
430   DIE *constructInlinedScopeDIE(CompileUnit *TheCU, LexicalScope *Scope);
431 
432   /// \brief Construct a DIE for this scope.
433   DIE *constructScopeDIE(CompileUnit *TheCU, LexicalScope *Scope);
434 
435   /// \brief Emit initial Dwarf sections with a label at the start of each one.
436   void emitSectionLabels();
437 
438   /// \brief Compute the size and offset of a DIE given an incoming Offset.
439   unsigned computeSizeAndOffset(DIE *Die, unsigned Offset);
440 
441   /// \brief Compute the size and offset of all the DIEs.
442   void computeSizeAndOffsets();
443 
444   /// \brief Attach DW_AT_inline attribute with inlined subprogram DIEs.
445   void computeInlinedDIEs();
446 
447   /// \brief Collect info for variables that were optimized out.
448   void collectDeadVariables();
449 
450   /// \brief Finish off debug information after all functions have been
451   /// processed.
452   void finalizeModuleInfo();
453 
454   /// \brief Emit labels to close any remaining sections that have been left
455   /// open.
456   void endSections();
457 
458   /// \brief Emit a set of abbreviations to the specific section.
459   void emitAbbrevs(const MCSection *, std::vector<DIEAbbrev*> *);
460 
461   /// \brief Emit the debug info section.
462   void emitDebugInfo();
463 
464   /// \brief Emit the abbreviation section.
465   void emitAbbreviations();
466 
467   /// \brief Emit the last address of the section and the end of
468   /// the line matrix.
469   void emitEndOfLineMatrix(unsigned SectionEnd);
470 
471   /// \brief Emit visible names into a hashed accelerator table section.
472   void emitAccelNames();
473 
474   /// \brief Emit objective C classes and categories into a hashed
475   /// accelerator table section.
476   void emitAccelObjC();
477 
478   /// \brief Emit namespace dies into a hashed accelerator table.
479   void emitAccelNamespaces();
480 
481   /// \brief Emit type dies into a hashed accelerator table.
482   void emitAccelTypes();
483 
484   /// \brief Emit visible types into a debug pubtypes section.
485   void emitDebugPubTypes();
486 
487   /// \brief Emit visible names into a debug str section.
488   void emitDebugStr();
489 
490   /// \brief Emit visible names into a debug loc section.
491   void emitDebugLoc();
492 
493   /// \brief Emit visible names into a debug aranges section.
494   void emitDebugARanges();
495 
496   /// \brief Emit visible names into a debug ranges section.
497   void emitDebugRanges();
498 
499   /// \brief Emit visible names into a debug macinfo section.
500   void emitDebugMacInfo();
501 
502   /// \brief Emit inline info using custom format.
503   void emitDebugInlineInfo();
504 
505   /// DWARF 5 Experimental Split Dwarf Emitters
506 
507   /// \brief Construct the split debug info compile unit for the debug info
508   /// section.
509   CompileUnit *constructSkeletonCU(const MDNode *);
510 
511   /// \brief Emit the local split debug info section.
512   void emitSkeletonCU(const MCSection *);
513 
514   /// \brief Emit the local split abbreviations.
515   void emitSkeletonAbbrevs(const MCSection *);
516 
517   /// \brief Emit the debug info dwo section.
518   void emitDebugInfoDWO();
519 
520   /// \brief Emit the debug abbrev dwo section.
521   void emitDebugAbbrevDWO();
522 
523   /// \brief Emit the debug str dwo section.
524   void emitDebugStrDWO();
525 
526   /// \brief Create new CompileUnit for the given metadata node with tag
527   /// DW_TAG_compile_unit.
528   CompileUnit *constructCompileUnit(const MDNode *N);
529 
530   /// \brief Construct subprogram DIE.
531   void constructSubprogramDIE(CompileUnit *TheCU, const MDNode *N);
532 
533   /// \brief Register a source line with debug info. Returns the unique
534   /// label that was emitted and which provides correspondence to the
535   /// source line list.
536   void recordSourceLine(unsigned Line, unsigned Col, const MDNode *Scope,
537                         unsigned Flags);
538 
539   /// \brief Indentify instructions that are marking the beginning of or
540   /// ending of a scope.
541   void identifyScopeMarkers();
542 
543   /// \brief If Var is an current function argument that add it in
544   /// CurrentFnArguments list.
545   bool addCurrentFnArgument(const MachineFunction *MF,
546                             DbgVariable *Var, LexicalScope *Scope);
547 
548   /// \brief Populate LexicalScope entries with variables' info.
549   void collectVariableInfo(const MachineFunction *,
550                            SmallPtrSet<const MDNode *, 16> &ProcessedVars);
551 
552   /// \brief Collect variable information from the side table maintained
553   /// by MMI.
554   void collectVariableInfoFromMMITable(const MachineFunction * MF,
555                                        SmallPtrSet<const MDNode *, 16> &P);
556 
557   /// \brief Ensure that a label will be emitted before MI.
558   void requestLabelBeforeInsn(const MachineInstr *MI) {
559     LabelsBeforeInsn.insert(std::make_pair(MI, (MCSymbol*)0));
560   }
561 
562   /// \brief Return Label preceding the instruction.
563   const MCSymbol *getLabelBeforeInsn(const MachineInstr *MI);
564 
565   /// \brief Ensure that a label will be emitted after MI.
566   void requestLabelAfterInsn(const MachineInstr *MI) {
567     LabelsAfterInsn.insert(std::make_pair(MI, (MCSymbol*)0));
568   }
569 
570   /// \brief Return Label immediately following the instruction.
571   const MCSymbol *getLabelAfterInsn(const MachineInstr *MI);
572 
573 public:
574   //===--------------------------------------------------------------------===//
575   // Main entry points.
576   //
577   DwarfDebug(AsmPrinter *A, Module *M);
578   ~DwarfDebug();
579 
580   /// \brief Collect debug info from named mdnodes such as llvm.dbg.enum
581   /// and llvm.dbg.ty
582   void collectInfoFromNamedMDNodes(const Module *M);
583 
584   /// \brief Collect debug info using DebugInfoFinder.
585   /// FIXME - Remove this when DragonEgg switches to DIBuilder.
586   bool collectLegacyDebugInfo(const Module *M);
587 
588   /// \brief Emit all Dwarf sections that should come prior to the
589   /// content.
590   void beginModule();
591 
592   /// \brief Emit all Dwarf sections that should come after the content.
593   void endModule();
594 
595   /// \brief Gather pre-function debug information.
596   void beginFunction(const MachineFunction *MF);
597 
598   /// \brief Gather and emit post-function debug information.
599   void endFunction(const MachineFunction *MF);
600 
601   /// \brief Process beginning of an instruction.
602   void beginInstruction(const MachineInstr *MI);
603 
604   /// \brief Process end of an instruction.
605   void endInstruction(const MachineInstr *MI);
606 
607   /// \brief Look up the source id with the given directory and source file
608   /// names. If none currently exists, create a new id and insert it in the
609   /// SourceIds map.
610   unsigned getOrCreateSourceID(StringRef DirName, StringRef FullName);
611 
612   /// \brief Recursively Emits a debug information entry.
613   void emitDIE(DIE *Die, std::vector<DIEAbbrev *> *Abbrevs);
614 
615   /// \brief Returns whether or not to limit some of our debug
616   /// output to the limitations of darwin gdb.
617   bool useDarwinGDBCompat() { return IsDarwinGDBCompat; }
618 
619   // Experimental DWARF5 features.
620 
621   /// \brief Returns whether or not to emit tables that dwarf consumers can
622   /// use to accelerate lookup.
623   bool useDwarfAccelTables() { return HasDwarfAccelTables; }
624 
625   /// \brief Returns whether or not to change the current debug info for the
626   /// split dwarf proposal support.
627   bool useSplitDwarf() { return HasSplitDwarf; }
628 };
629 } // End of namespace llvm
630 
631 #endif
632