Remove dead code. NFC.
[oota-llvm.git] / lib / CodeGen / AsmPrinter / DwarfDebug.h
1 //===-- llvm/CodeGen/DwarfDebug.h - Dwarf Debug Framework ------*- C++ -*--===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file contains support for writing dwarf debug info into asm files.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef LLVM_LIB_CODEGEN_ASMPRINTER_DWARFDEBUG_H
15 #define LLVM_LIB_CODEGEN_ASMPRINTER_DWARFDEBUG_H
16
17 #include "AsmPrinterHandler.h"
18 #include "DbgValueHistoryCalculator.h"
19 #include "DebugLocEntry.h"
20 #include "DebugLocList.h"
21 #include "DwarfAccelTable.h"
22 #include "DwarfFile.h"
23 #include "llvm/ADT/DenseMap.h"
24 #include "llvm/ADT/FoldingSet.h"
25 #include "llvm/ADT/MapVector.h"
26 #include "llvm/ADT/SmallPtrSet.h"
27 #include "llvm/ADT/StringMap.h"
28 #include "llvm/CodeGen/DIE.h"
29 #include "llvm/CodeGen/LexicalScopes.h"
30 #include "llvm/CodeGen/MachineInstr.h"
31 #include "llvm/IR/DebugInfo.h"
32 #include "llvm/IR/DebugLoc.h"
33 #include "llvm/MC/MCDwarf.h"
34 #include "llvm/MC/MachineLocation.h"
35 #include "llvm/Support/Allocator.h"
36 #include <memory>
37
38 namespace llvm {
39
40 class AsmPrinter;
41 class ByteStreamer;
42 class ConstantInt;
43 class ConstantFP;
44 class DwarfCompileUnit;
45 class DwarfDebug;
46 class DwarfTypeUnit;
47 class DwarfUnit;
48 class MachineModuleInfo;
49
50 //===----------------------------------------------------------------------===//
51 /// \brief This class is used to record source line correspondence.
52 class SrcLineInfo {
53   unsigned Line;     // Source line number.
54   unsigned Column;   // Source column.
55   unsigned SourceID; // Source ID number.
56   MCSymbol *Label;   // Label in code ID number.
57 public:
58   SrcLineInfo(unsigned L, unsigned C, unsigned S, MCSymbol *label)
59       : Line(L), Column(C), SourceID(S), Label(label) {}
60
61   // Accessors
62   unsigned getLine() const { return Line; }
63   unsigned getColumn() const { return Column; }
64   unsigned getSourceID() const { return SourceID; }
65   MCSymbol *getLabel() const { return Label; }
66 };
67
68 //===----------------------------------------------------------------------===//
69 /// \brief This class is used to track local variable information.
70 ///
71 /// - Variables whose location changes over time have a DotDebugLocOffset and
72 ///   the other fields are not used.
73 ///
74 /// - Variables that are described by multiple MMI table entries have multiple
75 ///   expressions and frame indices.
76 class DbgVariable {
77   DIVariable Var;             /// Variable Descriptor.
78   SmallVector<DIExpression, 1> Expr; /// Complex address location expression.
79   DIE *TheDIE;                /// Variable DIE.
80   unsigned DotDebugLocOffset; /// Offset in DotDebugLocEntries.
81   const MachineInstr *MInsn;  /// DBG_VALUE instruction of the variable.
82   SmallVector<int, 1> FrameIndex; /// Frame index of the variable.
83   DwarfDebug *DD;
84
85 public:
86   /// Construct a DbgVariable from a DIVariable.
87     DbgVariable(DIVariable V, DIExpression E, DwarfDebug *DD, int FI = ~0)
88     : Var(V), Expr(1, E), TheDIE(nullptr), DotDebugLocOffset(~0U),
89       MInsn(nullptr), DD(DD) {
90     FrameIndex.push_back(FI);
91     assert(Var.Verify());
92     assert(!E || E->isValid());
93   }
94
95   /// Construct a DbgVariable from a DEBUG_VALUE.
96   /// AbstractVar may be NULL.
97   DbgVariable(const MachineInstr *DbgValue, DwarfDebug *DD)
98       : Var(DbgValue->getDebugVariable()),
99         Expr(1, DbgValue->getDebugExpression()), TheDIE(nullptr),
100         DotDebugLocOffset(~0U), MInsn(DbgValue), DD(DD) {
101     FrameIndex.push_back(~0);
102   }
103
104   // Accessors.
105   DIVariable getVariable() const { return Var; }
106   const ArrayRef<DIExpression> getExpression() const { return Expr; }
107   void setDIE(DIE &D) { TheDIE = &D; }
108   DIE *getDIE() const { return TheDIE; }
109   void setDotDebugLocOffset(unsigned O) { DotDebugLocOffset = O; }
110   unsigned getDotDebugLocOffset() const { return DotDebugLocOffset; }
111   StringRef getName() const { return Var.getName(); }
112   const MachineInstr *getMInsn() const { return MInsn; }
113   const ArrayRef<int> getFrameIndex() const { return FrameIndex; }
114
115   void addMMIEntry(const DbgVariable &V) {
116     assert(  DotDebugLocOffset == ~0U &&   !MInsn && "not an MMI entry");
117     assert(V.DotDebugLocOffset == ~0U && !V.MInsn && "not an MMI entry");
118     assert(V.Var == Var && "conflicting DIVariable");
119
120     if (V.getFrameIndex().back() != ~0) {
121       auto E = V.getExpression();
122       auto FI = V.getFrameIndex();
123       Expr.append(E.begin(), E.end());
124       FrameIndex.append(FI.begin(), FI.end());
125     }
126     assert(Expr.size() > 1
127            ? std::all_of(Expr.begin(), Expr.end(),
128                          [](DIExpression &E) { return E.isBitPiece(); })
129            : (true && "conflicting locations for variable"));
130   }
131
132   // Translate tag to proper Dwarf tag.
133   dwarf::Tag getTag() const {
134     if (Var.getTag() == dwarf::DW_TAG_arg_variable)
135       return dwarf::DW_TAG_formal_parameter;
136
137     return dwarf::DW_TAG_variable;
138   }
139   /// \brief Return true if DbgVariable is artificial.
140   bool isArtificial() const {
141     if (Var.isArtificial())
142       return true;
143     if (getType().isArtificial())
144       return true;
145     return false;
146   }
147
148   bool isObjectPointer() const {
149     if (Var.isObjectPointer())
150       return true;
151     if (getType().isObjectPointer())
152       return true;
153     return false;
154   }
155
156   bool variableHasComplexAddress() const {
157     assert(Var.isVariable() && "Invalid complex DbgVariable!");
158     assert(Expr.size() == 1 &&
159            "variableHasComplexAddress() invoked on multi-FI variable");
160     return Expr.back().getNumElements() > 0;
161   }
162   bool isBlockByrefVariable() const;
163   DIType getType() const;
164
165 private:
166   /// resolve - Look in the DwarfDebug map for the MDNode that
167   /// corresponds to the reference.
168   template <typename T> T resolve(DIRef<T> Ref) const;
169 };
170
171
172 /// \brief Helper used to pair up a symbol and its DWARF compile unit.
173 struct SymbolCU {
174   SymbolCU(DwarfCompileUnit *CU, const MCSymbol *Sym) : Sym(Sym), CU(CU) {}
175   const MCSymbol *Sym;
176   DwarfCompileUnit *CU;
177 };
178
179 /// \brief Collects and handles dwarf debug information.
180 class DwarfDebug : public AsmPrinterHandler {
181   // Target of Dwarf emission.
182   AsmPrinter *Asm;
183
184   // Collected machine module information.
185   MachineModuleInfo *MMI;
186
187   // All DIEValues are allocated through this allocator.
188   BumpPtrAllocator DIEValueAllocator;
189
190   // Maps MDNode with its corresponding DwarfCompileUnit.
191   MapVector<const MDNode *, DwarfCompileUnit *> CUMap;
192
193   // Maps subprogram MDNode with its corresponding DwarfCompileUnit.
194   MapVector<const MDNode *, DwarfCompileUnit *> SPMap;
195
196   // Maps a CU DIE with its corresponding DwarfCompileUnit.
197   DenseMap<const DIE *, DwarfCompileUnit *> CUDieMap;
198
199   // List of all labels used in aranges generation.
200   std::vector<SymbolCU> ArangeLabels;
201
202   // Size of each symbol emitted (for those symbols that have a specific size).
203   DenseMap<const MCSymbol *, uint64_t> SymSize;
204
205   LexicalScopes LScopes;
206
207   // Collection of abstract variables.
208   DenseMap<const MDNode *, std::unique_ptr<DbgVariable>> AbstractVariables;
209   SmallVector<std::unique_ptr<DbgVariable>, 64> ConcreteVariables;
210
211   // Collection of DebugLocEntry. Stored in a linked list so that DIELocLists
212   // can refer to them in spite of insertions into this list.
213   SmallVector<DebugLocList, 4> DotDebugLocEntries;
214
215   // This is a collection of subprogram MDNodes that are processed to
216   // create DIEs.
217   SmallPtrSet<const MDNode *, 16> ProcessedSPNodes;
218
219   // Maps instruction with label emitted before instruction.
220   DenseMap<const MachineInstr *, MCSymbol *> LabelsBeforeInsn;
221
222   // Maps instruction with label emitted after instruction.
223   DenseMap<const MachineInstr *, MCSymbol *> LabelsAfterInsn;
224
225   // History of DBG_VALUE and clobber instructions for each user variable.
226   // Variables are listed in order of appearance.
227   DbgValueHistoryMap DbgValues;
228
229   // Previous instruction's location information. This is used to determine
230   // label location to indicate scope boundries in dwarf debug info.
231   DebugLoc PrevInstLoc;
232   MCSymbol *PrevLabel;
233
234   // This location indicates end of function prologue and beginning of function
235   // body.
236   DebugLoc PrologEndLoc;
237
238   // If nonnull, stores the current machine function we're processing.
239   const MachineFunction *CurFn;
240
241   // If nonnull, stores the current machine instruction we're processing.
242   const MachineInstr *CurMI;
243
244   // If nonnull, stores the CU in which the previous subprogram was contained.
245   const DwarfCompileUnit *PrevCU;
246
247   // As an optimization, there is no need to emit an entry in the directory
248   // table for the same directory as DW_AT_comp_dir.
249   StringRef CompilationDir;
250
251   // Counter for assigning globally unique IDs for ranges.
252   unsigned GlobalRangeCount;
253
254   // Holder for the file specific debug information.
255   DwarfFile InfoHolder;
256
257   // Holders for the various debug information flags that we might need to
258   // have exposed. See accessor functions below for description.
259
260   // Holder for imported entities.
261   typedef SmallVector<std::pair<const MDNode *, const MDNode *>, 32>
262   ImportedEntityMap;
263   ImportedEntityMap ScopesWithImportedEntities;
264
265   // Map from MDNodes for user-defined types to the type units that describe
266   // them.
267   DenseMap<const MDNode *, const DwarfTypeUnit *> DwarfTypeUnits;
268
269   SmallVector<std::pair<std::unique_ptr<DwarfTypeUnit>, DICompositeType>, 1>
270       TypeUnitsUnderConstruction;
271
272   // Whether to emit the pubnames/pubtypes sections.
273   bool HasDwarfPubSections;
274
275   // Whether or not to use AT_ranges for compilation units.
276   bool HasCURanges;
277
278   // Whether we emitted a function into a section other than the default
279   // text.
280   bool UsedNonDefaultText;
281
282   // Whether to use the GNU TLS opcode (instead of the standard opcode).
283   bool UseGNUTLSOpcode;
284
285   // Version of dwarf we're emitting.
286   unsigned DwarfVersion;
287
288   // Maps from a type identifier to the actual MDNode.
289   DITypeIdentifierMap TypeIdentifierMap;
290
291   // DWARF5 Experimental Options
292   bool HasDwarfAccelTables;
293   bool HasSplitDwarf;
294
295   // Separated Dwarf Variables
296   // In general these will all be for bits that are left in the
297   // original object file, rather than things that are meant
298   // to be in the .dwo sections.
299
300   // Holder for the skeleton information.
301   DwarfFile SkeletonHolder;
302
303   /// Store file names for type units under fission in a line table header that
304   /// will be emitted into debug_line.dwo.
305   // FIXME: replace this with a map from comp_dir to table so that we can emit
306   // multiple tables during LTO each of which uses directory 0, referencing the
307   // comp_dir of all the type units that use it.
308   MCDwarfDwoLineTable SplitTypeUnitFileTable;
309
310   // True iff there are multiple CUs in this module.
311   bool SingleCU;
312   bool IsDarwin;
313   bool IsPS4;
314
315   AddressPool AddrPool;
316
317   DwarfAccelTable AccelNames;
318   DwarfAccelTable AccelObjC;
319   DwarfAccelTable AccelNamespace;
320   DwarfAccelTable AccelTypes;
321
322   DenseMap<const Function *, DISubprogram> FunctionDIs;
323
324   MCDwarfDwoLineTable *getDwoLineTable(const DwarfCompileUnit &);
325
326   const SmallVectorImpl<std::unique_ptr<DwarfUnit>> &getUnits() {
327     return InfoHolder.getUnits();
328   }
329
330   /// \brief Find abstract variable associated with Var.
331   DbgVariable *getExistingAbstractVariable(const DIVariable &DV,
332                                            DIVariable &Cleansed);
333   DbgVariable *getExistingAbstractVariable(const DIVariable &DV);
334   void createAbstractVariable(const DIVariable &DV, LexicalScope *Scope);
335   void ensureAbstractVariableIsCreated(const DIVariable &Var,
336                                        const MDNode *Scope);
337   void ensureAbstractVariableIsCreatedIfScoped(const DIVariable &Var,
338                                                const MDNode *Scope);
339
340   /// \brief Construct a DIE for this abstract scope.
341   void constructAbstractSubprogramScopeDIE(LexicalScope *Scope);
342
343   /// \brief Compute the size and offset of a DIE given an incoming Offset.
344   unsigned computeSizeAndOffset(DIE *Die, unsigned Offset);
345
346   /// \brief Compute the size and offset of all the DIEs.
347   void computeSizeAndOffsets();
348
349   /// \brief Collect info for variables that were optimized out.
350   void collectDeadVariables();
351
352   void finishVariableDefinitions();
353
354   void finishSubprogramDefinitions();
355
356   /// \brief Finish off debug information after all functions have been
357   /// processed.
358   void finalizeModuleInfo();
359
360   /// \brief Emit the debug info section.
361   void emitDebugInfo();
362
363   /// \brief Emit the abbreviation section.
364   void emitAbbreviations();
365
366   /// \brief Emit a specified accelerator table.
367   void emitAccel(DwarfAccelTable &Accel, const MCSection *Section,
368                  StringRef TableName);
369
370   /// \brief Emit visible names into a hashed accelerator table section.
371   void emitAccelNames();
372
373   /// \brief Emit objective C classes and categories into a hashed
374   /// accelerator table section.
375   void emitAccelObjC();
376
377   /// \brief Emit namespace dies into a hashed accelerator table.
378   void emitAccelNamespaces();
379
380   /// \brief Emit type dies into a hashed accelerator table.
381   void emitAccelTypes();
382
383   /// \brief Emit visible names into a debug pubnames section.
384   /// \param GnuStyle determines whether or not we want to emit
385   /// additional information into the table ala newer gcc for gdb
386   /// index.
387   void emitDebugPubNames(bool GnuStyle = false);
388
389   /// \brief Emit visible types into a debug pubtypes section.
390   /// \param GnuStyle determines whether or not we want to emit
391   /// additional information into the table ala newer gcc for gdb
392   /// index.
393   void emitDebugPubTypes(bool GnuStyle = false);
394
395   void emitDebugPubSection(
396       bool GnuStyle, const MCSection *PSec, StringRef Name,
397       const StringMap<const DIE *> &(DwarfCompileUnit::*Accessor)() const);
398
399   /// \brief Emit visible names into a debug str section.
400   void emitDebugStr();
401
402   /// \brief Emit visible names into a debug loc section.
403   void emitDebugLoc();
404
405   /// \brief Emit visible names into a debug loc dwo section.
406   void emitDebugLocDWO();
407
408   /// \brief Emit visible names into a debug aranges section.
409   void emitDebugARanges();
410
411   /// \brief Emit visible names into a debug ranges section.
412   void emitDebugRanges();
413
414   /// \brief Emit inline info using custom format.
415   void emitDebugInlineInfo();
416
417   /// DWARF 5 Experimental Split Dwarf Emitters
418
419   /// \brief Initialize common features of skeleton units.
420   void initSkeletonUnit(const DwarfUnit &U, DIE &Die,
421                         std::unique_ptr<DwarfUnit> NewU);
422
423   /// \brief Construct the split debug info compile unit for the debug info
424   /// section.
425   DwarfCompileUnit &constructSkeletonCU(const DwarfCompileUnit &CU);
426
427   /// \brief Construct the split debug info compile unit for the debug info
428   /// section.
429   DwarfTypeUnit &constructSkeletonTU(DwarfTypeUnit &TU);
430
431   /// \brief Emit the debug info dwo section.
432   void emitDebugInfoDWO();
433
434   /// \brief Emit the debug abbrev dwo section.
435   void emitDebugAbbrevDWO();
436
437   /// \brief Emit the debug line dwo section.
438   void emitDebugLineDWO();
439
440   /// \brief Emit the debug str dwo section.
441   void emitDebugStrDWO();
442
443   /// Flags to let the linker know we have emitted new style pubnames. Only
444   /// emit it here if we don't have a skeleton CU for split dwarf.
445   void addGnuPubAttributes(DwarfUnit &U, DIE &D) const;
446
447   /// \brief Create new DwarfCompileUnit for the given metadata node with tag
448   /// DW_TAG_compile_unit.
449   DwarfCompileUnit &constructDwarfCompileUnit(DICompileUnit DIUnit);
450
451   /// \brief Construct imported_module or imported_declaration DIE.
452   void constructAndAddImportedEntityDIE(DwarfCompileUnit &TheCU,
453                                         const MDNode *N);
454
455   /// \brief Register a source line with debug info. Returns the unique
456   /// label that was emitted and which provides correspondence to the
457   /// source line list.
458   void recordSourceLine(unsigned Line, unsigned Col, const MDNode *Scope,
459                         unsigned Flags);
460
461   /// \brief Indentify instructions that are marking the beginning of or
462   /// ending of a scope.
463   void identifyScopeMarkers();
464
465   /// \brief Populate LexicalScope entries with variables' info.
466   void collectVariableInfo(DwarfCompileUnit &TheCU, DISubprogram SP,
467                            SmallPtrSetImpl<const MDNode *> &ProcessedVars);
468
469   /// \brief Build the location list for all DBG_VALUEs in the
470   /// function that describe the same variable.
471   void buildLocationList(SmallVectorImpl<DebugLocEntry> &DebugLoc,
472                          const DbgValueHistoryMap::InstrRanges &Ranges);
473
474   /// \brief Collect variable information from the side table maintained
475   /// by MMI.
476   void collectVariableInfoFromMMITable(SmallPtrSetImpl<const MDNode *> &P);
477
478   /// \brief Ensure that a label will be emitted before MI.
479   void requestLabelBeforeInsn(const MachineInstr *MI) {
480     LabelsBeforeInsn.insert(std::make_pair(MI, nullptr));
481   }
482
483   /// \brief Ensure that a label will be emitted after MI.
484   void requestLabelAfterInsn(const MachineInstr *MI) {
485     LabelsAfterInsn.insert(std::make_pair(MI, nullptr));
486   }
487
488 public:
489   //===--------------------------------------------------------------------===//
490   // Main entry points.
491   //
492   DwarfDebug(AsmPrinter *A, Module *M);
493
494   ~DwarfDebug() override;
495
496   /// \brief Emit all Dwarf sections that should come prior to the
497   /// content.
498   void beginModule();
499
500   /// \brief Emit all Dwarf sections that should come after the content.
501   void endModule() override;
502
503   /// \brief Gather pre-function debug information.
504   void beginFunction(const MachineFunction *MF) override;
505
506   /// \brief Gather and emit post-function debug information.
507   void endFunction(const MachineFunction *MF) override;
508
509   /// \brief Process beginning of an instruction.
510   void beginInstruction(const MachineInstr *MI) override;
511
512   /// \brief Process end of an instruction.
513   void endInstruction() override;
514
515   /// \brief Add a DIE to the set of types that we're going to pull into
516   /// type units.
517   void addDwarfTypeUnitType(DwarfCompileUnit &CU, StringRef Identifier,
518                             DIE &Die, DICompositeType CTy);
519
520   /// \brief Add a label so that arange data can be generated for it.
521   void addArangeLabel(SymbolCU SCU) { ArangeLabels.push_back(SCU); }
522
523   /// \brief For symbols that have a size designated (e.g. common symbols),
524   /// this tracks that size.
525   void setSymbolSize(const MCSymbol *Sym, uint64_t Size) override {
526     SymSize[Sym] = Size;
527   }
528
529   /// \brief Returns whether to use DW_OP_GNU_push_tls_address, instead of the
530   /// standard DW_OP_form_tls_address opcode
531   bool useGNUTLSOpcode() const { return UseGNUTLSOpcode; }
532
533   // Experimental DWARF5 features.
534
535   /// \brief Returns whether or not to emit tables that dwarf consumers can
536   /// use to accelerate lookup.
537   bool useDwarfAccelTables() const { return HasDwarfAccelTables; }
538
539   /// \brief Returns whether or not to change the current debug info for the
540   /// split dwarf proposal support.
541   bool useSplitDwarf() const { return HasSplitDwarf; }
542
543   /// Returns the Dwarf Version.
544   unsigned getDwarfVersion() const { return DwarfVersion; }
545
546   /// Returns the previous CU that was being updated
547   const DwarfCompileUnit *getPrevCU() const { return PrevCU; }
548   void setPrevCU(const DwarfCompileUnit *PrevCU) { this->PrevCU = PrevCU; }
549
550   /// Returns the entries for the .debug_loc section.
551   const SmallVectorImpl<DebugLocList> &
552   getDebugLocEntries() const {
553     return DotDebugLocEntries;
554   }
555
556   /// \brief Emit an entry for the debug loc section. This can be used to
557   /// handle an entry that's going to be emitted into the debug loc section.
558   void emitDebugLocEntry(ByteStreamer &Streamer,
559                          const DebugLocEntry &Entry);
560   /// \brief emit a single value for the debug loc section.
561   void emitDebugLocValue(ByteStreamer &Streamer,
562                          const DebugLocEntry::Value &Value,
563                          unsigned PieceOffsetInBits = 0);
564   /// Emits an optimal (=sorted) sequence of DW_OP_pieces.
565   void emitLocPieces(ByteStreamer &Streamer,
566                      const DITypeIdentifierMap &Map,
567                      ArrayRef<DebugLocEntry::Value> Values);
568
569   /// Emit the location for a debug loc entry, including the size header.
570   void emitDebugLocEntryLocation(const DebugLocEntry &Entry);
571
572   /// Find the MDNode for the given reference.
573   template <typename T> T resolve(DIRef<T> Ref) const {
574     return Ref.resolve(TypeIdentifierMap);
575   }
576
577   /// \brief Return the TypeIdentifierMap.
578   const DITypeIdentifierMap &getTypeIdentifierMap() const {
579     return TypeIdentifierMap;
580   }
581
582   /// Find the DwarfCompileUnit for the given CU Die.
583   DwarfCompileUnit *lookupUnit(const DIE *CU) const {
584     return CUDieMap.lookup(CU);
585   }
586   /// isSubprogramContext - Return true if Context is either a subprogram
587   /// or another context nested inside a subprogram.
588   bool isSubprogramContext(const MDNode *Context);
589
590   void addSubprogramNames(DISubprogram SP, DIE &Die);
591
592   AddressPool &getAddressPool() { return AddrPool; }
593
594   void addAccelName(StringRef Name, const DIE &Die);
595
596   void addAccelObjC(StringRef Name, const DIE &Die);
597
598   void addAccelNamespace(StringRef Name, const DIE &Die);
599
600   void addAccelType(StringRef Name, const DIE &Die, char Flags);
601
602   const MachineFunction *getCurrentFunction() const { return CurFn; }
603
604   iterator_range<ImportedEntityMap::const_iterator>
605   findImportedEntitiesForScope(const MDNode *Scope) const {
606     return make_range(std::equal_range(
607         ScopesWithImportedEntities.begin(), ScopesWithImportedEntities.end(),
608         std::pair<const MDNode *, const MDNode *>(Scope, nullptr),
609         less_first()));
610   }
611
612   /// \brief A helper function to check whether the DIE for a given Scope is
613   /// going to be null.
614   bool isLexicalScopeDIENull(LexicalScope *Scope);
615
616   /// \brief Return Label preceding the instruction.
617   MCSymbol *getLabelBeforeInsn(const MachineInstr *MI);
618
619   /// \brief Return Label immediately following the instruction.
620   MCSymbol *getLabelAfterInsn(const MachineInstr *MI);
621
622   // FIXME: Consider rolling ranges up into DwarfDebug since we use a single
623   // range_base anyway, so there's no need to keep them as separate per-CU range
624   // lists. (though one day we might end up with a range.dwo section, in which
625   // case it'd go to DwarfFile)
626   unsigned getNextRangeNumber() { return GlobalRangeCount++; }
627
628   // FIXME: Sink these functions down into DwarfFile/Dwarf*Unit.
629
630   SmallPtrSet<const MDNode *, 16> &getProcessedSPNodes() {
631     return ProcessedSPNodes;
632   }
633 };
634 } // End of namespace llvm
635
636 #endif