1 //===-- llvm/CodeGen/DwarfDebug.h - Dwarf Debug Framework ------*- C++ -*--===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains support for writing dwarf debug info into asm files.
12 //===----------------------------------------------------------------------===//
14 #ifndef CODEGEN_ASMPRINTER_DWARFDEBUG_H__
15 #define CODEGEN_ASMPRINTER_DWARFDEBUG_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"
36 class MachineFrameInfo;
37 class MachineModuleInfo;
45 //===----------------------------------------------------------------------===//
46 /// \brief This class is used to record source line correspondence.
48 unsigned Line; // Source line number.
49 unsigned Column; // Source column.
50 unsigned SourceID; // Source ID number.
51 MCSymbol *Label; // Label in code ID number.
53 SrcLineInfo(unsigned L, unsigned C, unsigned S, MCSymbol *label)
54 : Line(L), Column(C), SourceID(S), Label(label) {}
57 unsigned getLine() const { return Line; }
58 unsigned getColumn() const { return Column; }
59 unsigned getSourceID() const { return SourceID; }
60 MCSymbol *getLabel() const { return Label; }
63 /// \brief This struct describes location entries emitted in the .debug_loc
65 class DotDebugLocEntry {
66 // Begin and end symbols for the address range that this location is valid.
67 const MCSymbol *Begin;
70 // Type of entry that this represents.
77 enum EntryType EntryKind;
81 const ConstantFP *CFP;
82 const ConstantInt *CIP;
85 // The location in the machine frame.
88 // The variable to which this location entry corresponds.
89 const MDNode *Variable;
91 // Whether this location has been merged.
95 DotDebugLocEntry() : Begin(0), End(0), Variable(0), Merged(false) {
98 DotDebugLocEntry(const MCSymbol *B, const MCSymbol *E, MachineLocation &L,
100 : Begin(B), End(E), Loc(L), Variable(V), Merged(false) {
102 EntryKind = E_Location;
104 DotDebugLocEntry(const MCSymbol *B, const MCSymbol *E, int64_t i)
105 : Begin(B), End(E), Variable(0), Merged(false) {
107 EntryKind = E_Integer;
109 DotDebugLocEntry(const MCSymbol *B, const MCSymbol *E, const ConstantFP *FPtr)
110 : Begin(B), End(E), Variable(0), Merged(false) {
111 Constants.CFP = FPtr;
112 EntryKind = E_ConstantFP;
114 DotDebugLocEntry(const MCSymbol *B, const MCSymbol *E,
115 const ConstantInt *IPtr)
116 : Begin(B), End(E), Variable(0), Merged(false) {
117 Constants.CIP = IPtr;
118 EntryKind = E_ConstantInt;
121 /// \brief Empty entries are also used as a trigger to emit temp label. Such
122 /// labels are referenced is used to find debug_loc offset for a given DIE.
123 bool isEmpty() { return Begin == 0 && End == 0; }
124 bool isMerged() { return Merged; }
125 void Merge(DotDebugLocEntry *Next) {
126 if (!(Begin && Loc == Next->Loc && End == Next->Begin))
131 bool isLocation() const { return EntryKind == E_Location; }
132 bool isInt() const { return EntryKind == E_Integer; }
133 bool isConstantFP() const { return EntryKind == E_ConstantFP; }
134 bool isConstantInt() const { return EntryKind == E_ConstantInt; }
135 int64_t getInt() const { return Constants.Int; }
136 const ConstantFP *getConstantFP() const { return Constants.CFP; }
137 const ConstantInt *getConstantInt() const { return Constants.CIP; }
138 const MDNode *getVariable() const { return Variable; }
139 const MCSymbol *getBeginSym() const { return Begin; }
140 const MCSymbol *getEndSym() const { return End; }
141 MachineLocation getLoc() const { return Loc; }
144 //===----------------------------------------------------------------------===//
145 /// \brief This class is used to track local variable information.
147 DIVariable Var; // Variable Descriptor.
148 DIE *TheDIE; // Variable DIE.
149 unsigned DotDebugLocOffset; // Offset in DotDebugLocEntries.
150 DbgVariable *AbsVar; // Corresponding Abstract variable, if any.
151 const MachineInstr *MInsn; // DBG_VALUE instruction of the variable.
154 // AbsVar may be NULL.
155 DbgVariable(DIVariable V, DbgVariable *AV)
156 : Var(V), TheDIE(0), DotDebugLocOffset(~0U), AbsVar(AV), MInsn(0),
160 DIVariable getVariable() const { return Var; }
161 void setDIE(DIE *D) { TheDIE = D; }
162 DIE *getDIE() const { return TheDIE; }
163 void setDotDebugLocOffset(unsigned O) { DotDebugLocOffset = O; }
164 unsigned getDotDebugLocOffset() const { return DotDebugLocOffset; }
165 StringRef getName() const { return Var.getName(); }
166 DbgVariable *getAbstractVariable() const { return AbsVar; }
167 const MachineInstr *getMInsn() const { return MInsn; }
168 void setMInsn(const MachineInstr *M) { MInsn = M; }
169 int getFrameIndex() const { return FrameIndex; }
170 void setFrameIndex(int FI) { FrameIndex = FI; }
171 // Translate tag to proper Dwarf tag.
172 uint16_t getTag() const {
173 if (Var.getTag() == dwarf::DW_TAG_arg_variable)
174 return dwarf::DW_TAG_formal_parameter;
176 return dwarf::DW_TAG_variable;
178 /// \brief Return true if DbgVariable is artificial.
179 bool isArtificial() const {
180 if (Var.isArtificial())
182 if (getType().isArtificial())
187 bool isObjectPointer() const {
188 if (Var.isObjectPointer())
190 if (getType().isObjectPointer())
195 bool variableHasComplexAddress() const {
196 assert(Var.isVariable() && "Invalid complex DbgVariable!");
197 return Var.hasComplexAddress();
199 bool isBlockByrefVariable() const {
200 assert(Var.isVariable() && "Invalid complex DbgVariable!");
201 return Var.isBlockByrefVariable();
203 unsigned getNumAddrElements() const {
204 assert(Var.isVariable() && "Invalid complex DbgVariable!");
205 return Var.getNumAddrElements();
207 uint64_t getAddrElement(unsigned i) const {
208 return Var.getAddrElement(i);
210 DIType getType() const;
213 /// \brief Collects and handles information specific to a particular
214 /// collection of units.
216 // Target of Dwarf emission, used for sizing of abbreviations.
219 // Used to uniquely define abbreviations.
220 FoldingSet<DIEAbbrev> *AbbreviationsSet;
222 // A list of all the unique abbreviations in use.
223 std::vector<DIEAbbrev *> *Abbreviations;
225 // A pointer to all units in the section.
226 SmallVector<CompileUnit *, 1> CUs;
228 // Collection of strings for this unit and assorted symbols.
229 // A String->Symbol mapping of strings used by indirect
231 typedef StringMap<std::pair<MCSymbol*, unsigned>,
232 BumpPtrAllocator&> StrPool;
234 unsigned NextStringPoolNumber;
235 std::string StringPref;
237 // Collection of addresses for this unit and assorted labels.
238 // A Symbol->unsigned mapping of addresses used by indirect
240 typedef DenseMap<const MCExpr *, unsigned> AddrPool;
241 AddrPool AddressPool;
242 unsigned NextAddrPoolNumber;
245 DwarfUnits(AsmPrinter *AP, FoldingSet<DIEAbbrev> *AS,
246 std::vector<DIEAbbrev *> *A, const char *Pref,
247 BumpPtrAllocator &DA)
248 : Asm(AP), AbbreviationsSet(AS), Abbreviations(A), StringPool(DA),
249 NextStringPoolNumber(0), StringPref(Pref), AddressPool(),
250 NextAddrPoolNumber(0) {}
252 /// \brief Compute the size and offset of a DIE given an incoming Offset.
253 unsigned computeSizeAndOffset(DIE *Die, unsigned Offset);
255 /// \brief Compute the size and offset of all the DIEs.
256 void computeSizeAndOffsets();
258 /// \brief Define a unique number for the abbreviation.
259 void assignAbbrevNumber(DIEAbbrev &Abbrev);
261 /// \brief Add a unit to the list of CUs.
262 void addUnit(CompileUnit *CU) { CUs.push_back(CU); }
264 /// \brief Emit all of the units to the section listed with the given
265 /// abbreviation section.
266 void emitUnits(DwarfDebug *DD, const MCSection *USection,
267 const MCSection *ASection, const MCSymbol *ASectionSym);
269 /// \brief Emit all of the strings to the section given.
270 void emitStrings(const MCSection *StrSection, const MCSection *OffsetSection,
271 const MCSymbol *StrSecSym);
273 /// \brief Emit all of the addresses to the section given.
274 void emitAddresses(const MCSection *AddrSection);
276 /// \brief Returns the entry into the start of the pool.
277 MCSymbol *getStringPoolSym();
279 /// \brief Returns an entry into the string pool with the given
281 MCSymbol *getStringPoolEntry(StringRef Str);
283 /// \brief Returns the index into the string pool with the given
285 unsigned getStringPoolIndex(StringRef Str);
287 /// \brief Returns the string pool.
288 StrPool *getStringPool() { return &StringPool; }
290 /// \brief Returns the index into the address pool with the given
292 unsigned getAddrPoolIndex(const MCExpr *Sym);
293 unsigned getAddrPoolIndex(const MCSymbol *Sym);
295 /// \brief Returns the address pool.
296 AddrPool *getAddrPool() { return &AddressPool; }
298 /// \brief for a given compile unit DIE, returns offset from beginning of
300 unsigned getCUOffset(DIE *Die);
303 /// \brief Helper used to pair up a symbol and it's DWARF compile unit.
305 SymbolCU(CompileUnit *CU, const MCSymbol *Sym) : Sym(Sym), CU(CU) {}
310 /// \brief Collects and handles dwarf debug information.
312 // Target of Dwarf emission.
315 // Collected machine module information.
316 MachineModuleInfo *MMI;
318 // All DIEValues are allocated through this allocator.
319 BumpPtrAllocator DIEValueAllocator;
321 // Handle to the a compile unit used for the inline extension handling.
322 CompileUnit *FirstCU;
324 // Maps MDNode with its corresponding CompileUnit.
325 DenseMap <const MDNode *, CompileUnit *> CUMap;
327 // Maps subprogram MDNode with its corresponding CompileUnit.
328 DenseMap <const MDNode *, CompileUnit *> SPMap;
330 // Used to uniquely define abbreviations.
331 FoldingSet<DIEAbbrev> AbbreviationsSet;
333 // A list of all the unique abbreviations in use.
334 std::vector<DIEAbbrev *> Abbreviations;
336 // Stores the current file ID for a given compile unit.
337 DenseMap <unsigned, unsigned> FileIDCUMap;
338 // Source id map, i.e. CUID, source filename and directory,
339 // separated by a zero byte, mapped to a unique id.
340 StringMap<unsigned, BumpPtrAllocator&> SourceIdMap;
342 // List of all labels used in aranges generation.
343 std::vector<SymbolCU> ArangeLabels;
345 // Size of each symbol emitted (for those symbols that have a specific size).
346 DenseMap <const MCSymbol *, uint64_t> SymSize;
348 // Provides a unique id per text section.
349 typedef DenseMap<const MCSection *, SmallVector<SymbolCU, 8> > SectionMapType;
350 SectionMapType SectionMap;
352 // List of arguments for current function.
353 SmallVector<DbgVariable *, 8> CurrentFnArguments;
355 LexicalScopes LScopes;
357 // Collection of abstract subprogram DIEs.
358 DenseMap<const MDNode *, DIE *> AbstractSPDies;
360 // Collection of dbg variables of a scope.
361 typedef DenseMap<LexicalScope *,
362 SmallVector<DbgVariable *, 8> > ScopeVariablesMap;
363 ScopeVariablesMap ScopeVariables;
365 // Collection of abstract variables.
366 DenseMap<const MDNode *, DbgVariable *> AbstractVariables;
368 // Collection of DotDebugLocEntry.
369 SmallVector<DotDebugLocEntry, 4> DotDebugLocEntries;
371 // Collection of subprogram DIEs that are marked (at the end of the module)
373 SmallPtrSet<DIE *, 4> InlinedSubprogramDIEs;
375 // This is a collection of subprogram MDNodes that are processed to
377 SmallPtrSet<const MDNode *, 16> ProcessedSPNodes;
379 // Maps instruction with label emitted before instruction.
380 DenseMap<const MachineInstr *, MCSymbol *> LabelsBeforeInsn;
382 // Maps instruction with label emitted after instruction.
383 DenseMap<const MachineInstr *, MCSymbol *> LabelsAfterInsn;
385 // Every user variable mentioned by a DBG_VALUE instruction in order of
387 SmallVector<const MDNode*, 8> UserVariables;
389 // For each user variable, keep a list of DBG_VALUE instructions in order.
390 // The list can also contain normal instructions that clobber the previous
392 typedef DenseMap<const MDNode*, SmallVector<const MachineInstr*, 4> >
394 DbgValueHistoryMap DbgValues;
396 SmallVector<const MCSymbol *, 8> DebugRangeSymbols;
398 // Previous instruction's location information. This is used to determine
399 // label location to indicate scope boundries in dwarf debug info.
400 DebugLoc PrevInstLoc;
403 // This location indicates end of function prologue and beginning of function
405 DebugLoc PrologEndLoc;
407 // Section Symbols: these are assembler temporary labels that are emitted at
408 // the beginning of each supported dwarf section. These are used to form
409 // section offsets and are created by EmitSectionLabels.
410 MCSymbol *DwarfInfoSectionSym, *DwarfAbbrevSectionSym;
411 MCSymbol *DwarfStrSectionSym, *TextSectionSym, *DwarfDebugRangeSectionSym;
412 MCSymbol *DwarfDebugLocSectionSym, *DwarfLineSectionSym, *DwarfAddrSectionSym;
413 MCSymbol *FunctionBeginSym, *FunctionEndSym;
414 MCSymbol *DwarfAbbrevDWOSectionSym, *DwarfStrDWOSectionSym;
415 MCSymbol *DwarfGnuPubNamesSectionSym, *DwarfGnuPubTypesSectionSym;
417 // As an optimization, there is no need to emit an entry in the directory
418 // table for the same directory as DW_AT_comp_dir.
419 StringRef CompilationDir;
421 // Counter for assigning globally unique IDs for CUs.
422 unsigned GlobalCUIndexCount;
424 // Holder for the file specific debug information.
425 DwarfUnits InfoHolder;
427 // Holders for the various debug information flags that we might need to
428 // have exposed. See accessor functions below for description.
430 // Whether or not we're emitting info for older versions of gdb on darwin.
431 bool IsDarwinGDBCompat;
433 // Holder for imported entities.
434 typedef SmallVector<std::pair<const MDNode *, const MDNode *>, 32>
436 ImportedEntityMap ScopesWithImportedEntities;
438 // Holder for types that are going to be extracted out into a type unit.
439 std::vector<DIE *> TypeUnits;
441 // Whether to emit the pubnames/pubtypes sections.
442 bool HasDwarfPubSections;
444 // Version of dwarf we're emitting.
445 unsigned DwarfVersion;
447 // DWARF5 Experimental Options
448 bool HasDwarfAccelTables;
451 // Separated Dwarf Variables
452 // In general these will all be for bits that are left in the
453 // original object file, rather than things that are meant
454 // to be in the .dwo sections.
456 // The CUs left in the original object file for separated debug info.
457 SmallVector<CompileUnit *, 1> SkeletonCUs;
459 // Used to uniquely define abbreviations for the skeleton emission.
460 FoldingSet<DIEAbbrev> SkeletonAbbrevSet;
462 // A list of all the unique abbreviations in use.
463 std::vector<DIEAbbrev *> SkeletonAbbrevs;
465 // Holder for the skeleton information.
466 DwarfUnits SkeletonHolder;
468 // Maps from a type identifier to the actual MDNode.
469 DITypeIdentifierMap TypeIdentifierMap;
473 void addScopeVariable(LexicalScope *LS, DbgVariable *Var);
475 /// \brief Find abstract variable associated with Var.
476 DbgVariable *findAbstractVariable(DIVariable &Var, DebugLoc Loc);
478 /// \brief Find DIE for the given subprogram and attach appropriate
479 /// DW_AT_low_pc and DW_AT_high_pc attributes. If there are global
480 /// variables in this scope then create and insert DIEs for these
482 DIE *updateSubprogramScopeDIE(CompileUnit *SPCU, const MDNode *SPNode);
484 /// \brief Construct new DW_TAG_lexical_block for this scope and
485 /// attach DW_AT_low_pc/DW_AT_high_pc labels.
486 DIE *constructLexicalScopeDIE(CompileUnit *TheCU, LexicalScope *Scope);
487 /// A helper function to check whether the DIE for a given Scope is going
489 bool isLexicalScopeDIENull(LexicalScope *Scope);
491 /// \brief This scope represents inlined body of a function. Construct
492 /// DIE to represent this concrete inlined copy of the function.
493 DIE *constructInlinedScopeDIE(CompileUnit *TheCU, LexicalScope *Scope);
495 /// \brief Construct a DIE for this scope.
496 DIE *constructScopeDIE(CompileUnit *TheCU, LexicalScope *Scope);
497 /// A helper function to create children of a Scope DIE.
498 DIE *createScopeChildrenDIE(CompileUnit *TheCU, LexicalScope *Scope,
499 SmallVectorImpl<DIE*> &Children);
501 /// \brief Emit initial Dwarf sections with a label at the start of each one.
502 void emitSectionLabels();
504 /// \brief Compute the size and offset of a DIE given an incoming Offset.
505 unsigned computeSizeAndOffset(DIE *Die, unsigned Offset);
507 /// \brief Compute the size and offset of all the DIEs.
508 void computeSizeAndOffsets();
510 /// \brief Attach DW_AT_inline attribute with inlined subprogram DIEs.
511 void computeInlinedDIEs();
513 /// \brief Collect info for variables that were optimized out.
514 void collectDeadVariables();
516 /// \brief Finish off debug information after all functions have been
518 void finalizeModuleInfo();
520 /// \brief Emit labels to close any remaining sections that have been left
524 /// \brief Emit a set of abbreviations to the specific section.
525 void emitAbbrevs(const MCSection *, std::vector<DIEAbbrev*> *);
527 /// \brief Emit the debug info section.
528 void emitDebugInfo();
530 /// \brief Emit the abbreviation section.
531 void emitAbbreviations();
533 /// \brief Emit the last address of the section and the end of
535 void emitEndOfLineMatrix(unsigned SectionEnd);
537 /// \brief Emit visible names into a hashed accelerator table section.
538 void emitAccelNames();
540 /// \brief Emit objective C classes and categories into a hashed
541 /// accelerator table section.
542 void emitAccelObjC();
544 /// \brief Emit namespace dies into a hashed accelerator table.
545 void emitAccelNamespaces();
547 /// \brief Emit type dies into a hashed accelerator table.
548 void emitAccelTypes();
550 /// \brief Emit visible names into a debug pubnames section.
551 /// \param GnuStyle determines whether or not we want to emit
552 /// additional information into the table ala newer gcc for gdb
554 void emitDebugPubNames(bool GnuStyle = false);
556 /// \brief Emit visible types into a debug pubtypes section.
557 /// \param GnuStyle determines whether or not we want to emit
558 /// additional information into the table ala newer gcc for gdb
560 void emitDebugPubTypes(bool GnuStyle = false);
562 /// \brief Emit visible names into a debug str section.
565 /// \brief Emit visible names into a debug loc section.
568 /// \brief Emit visible names into a debug aranges section.
569 void emitDebugARanges();
571 /// \brief Emit visible names into a debug ranges section.
572 void emitDebugRanges();
574 /// \brief Emit visible names into a debug macinfo section.
575 void emitDebugMacInfo();
577 /// \brief Emit inline info using custom format.
578 void emitDebugInlineInfo();
580 /// DWARF 5 Experimental Split Dwarf Emitters
582 /// \brief Construct the split debug info compile unit for the debug info
584 CompileUnit *constructSkeletonCU(const CompileUnit *CU);
586 /// \brief Emit the local split abbreviations.
587 void emitSkeletonAbbrevs(const MCSection *);
589 /// \brief Emit the debug info dwo section.
590 void emitDebugInfoDWO();
592 /// \brief Emit the debug abbrev dwo section.
593 void emitDebugAbbrevDWO();
595 /// \brief Emit the debug str dwo section.
596 void emitDebugStrDWO();
598 /// \brief Create new CompileUnit for the given metadata node with tag
599 /// DW_TAG_compile_unit.
600 CompileUnit *constructCompileUnit(const MDNode *N);
602 /// \brief Construct subprogram DIE.
603 void constructSubprogramDIE(CompileUnit *TheCU, const MDNode *N);
605 /// \brief Construct imported_module or imported_declaration DIE.
606 void constructImportedEntityDIE(CompileUnit *TheCU, const MDNode *N);
608 /// \brief Construct import_module DIE.
609 void constructImportedEntityDIE(CompileUnit *TheCU, const MDNode *N,
612 /// \brief Construct import_module DIE.
613 void constructImportedEntityDIE(CompileUnit *TheCU,
614 const DIImportedEntity &Module,
617 /// \brief Register a source line with debug info. Returns the unique
618 /// label that was emitted and which provides correspondence to the
619 /// source line list.
620 void recordSourceLine(unsigned Line, unsigned Col, const MDNode *Scope,
623 /// \brief Indentify instructions that are marking the beginning of or
624 /// ending of a scope.
625 void identifyScopeMarkers();
627 /// \brief If Var is an current function argument that add it in
628 /// CurrentFnArguments list.
629 bool addCurrentFnArgument(const MachineFunction *MF,
630 DbgVariable *Var, LexicalScope *Scope);
632 /// \brief Populate LexicalScope entries with variables' info.
633 void collectVariableInfo(const MachineFunction *,
634 SmallPtrSet<const MDNode *, 16> &ProcessedVars);
636 /// \brief Collect variable information from the side table maintained
638 void collectVariableInfoFromMMITable(const MachineFunction * MF,
639 SmallPtrSet<const MDNode *, 16> &P);
641 /// \brief Ensure that a label will be emitted before MI.
642 void requestLabelBeforeInsn(const MachineInstr *MI) {
643 LabelsBeforeInsn.insert(std::make_pair(MI, (MCSymbol*)0));
646 /// \brief Return Label preceding the instruction.
647 MCSymbol *getLabelBeforeInsn(const MachineInstr *MI);
649 /// \brief Ensure that a label will be emitted after MI.
650 void requestLabelAfterInsn(const MachineInstr *MI) {
651 LabelsAfterInsn.insert(std::make_pair(MI, (MCSymbol*)0));
654 /// \brief Return Label immediately following the instruction.
655 MCSymbol *getLabelAfterInsn(const MachineInstr *MI);
658 //===--------------------------------------------------------------------===//
659 // Main entry points.
661 DwarfDebug(AsmPrinter *A, Module *M);
664 /// \brief Emit all Dwarf sections that should come prior to the
668 /// \brief Emit all Dwarf sections that should come after the content.
671 /// \brief Gather pre-function debug information.
672 void beginFunction(const MachineFunction *MF);
674 /// \brief Gather and emit post-function debug information.
675 void endFunction(const MachineFunction *MF);
677 /// \brief Process beginning of an instruction.
678 void beginInstruction(const MachineInstr *MI);
680 /// \brief Process end of an instruction.
681 void endInstruction(const MachineInstr *MI);
683 /// \brief Add a DIE to the set of types that we're going to pull into
685 void addTypeUnitType(DIE *Die) { TypeUnits.push_back(Die); }
687 /// \brief Add a label so that arange data can be generated for it.
688 void addArangeLabel(SymbolCU SCU) { ArangeLabels.push_back(SCU); }
690 /// \brief For symbols that have a size designated (e.g. common symbols),
691 /// this tracks that size.
692 void setSymbolSize(const MCSymbol *Sym, uint64_t Size) { SymSize[Sym] = Size;}
694 /// \brief Look up the source id with the given directory and source file
695 /// names. If none currently exists, create a new id and insert it in the
697 unsigned getOrCreateSourceID(StringRef DirName, StringRef FullName,
700 /// \brief Recursively Emits a debug information entry.
701 void emitDIE(DIE *Die, std::vector<DIEAbbrev *> *Abbrevs);
703 /// \brief Returns whether or not to limit some of our debug
704 /// output to the limitations of darwin gdb.
705 bool useDarwinGDBCompat() { return IsDarwinGDBCompat; }
707 // Experimental DWARF5 features.
709 /// \brief Returns whether or not to emit tables that dwarf consumers can
710 /// use to accelerate lookup.
711 bool useDwarfAccelTables() { return HasDwarfAccelTables; }
713 /// \brief Returns whether or not to change the current debug info for the
714 /// split dwarf proposal support.
715 bool useSplitDwarf() { return HasSplitDwarf; }
717 /// Returns the Dwarf Version.
718 unsigned getDwarfVersion() const { return DwarfVersion; }
720 /// Find the MDNode for the given scope reference.
721 template <typename T>
722 T resolve(DIRef<T> Ref) const {
723 return Ref.resolve(TypeIdentifierMap);
726 /// isSubprogramContext - Return true if Context is either a subprogram
727 /// or another context nested inside a subprogram.
728 bool isSubprogramContext(const MDNode *Context);
731 } // End of namespace llvm