b8e4c6cde5dceb2dabb48b480d2a99c4b79d0325
[oota-llvm.git] / include / llvm / Analysis / DebugInfo.h
1 //===--- llvm/Analysis/DebugInfo.h - Debug Information Helpers --*- 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 defines a bunch of datatypes that are useful for creating and
11 // walking debug info in LLVM IR form. They essentially provide wrappers around
12 // the information in the global variables that's needed when constructing the
13 // DWARF information.
14 //
15 //===----------------------------------------------------------------------===//
16
17 #ifndef LLVM_ANALYSIS_DEBUGINFO_H
18 #define LLVM_ANALYSIS_DEBUGINFO_H
19
20 #include "llvm/Target/TargetMachine.h"
21 #include "llvm/ADT/StringMap.h"
22 #include "llvm/ADT/DenseMap.h"
23 #include "llvm/ADT/SmallVector.h"
24 #include "llvm/Support/Dwarf.h"
25
26 namespace llvm {
27   class BasicBlock;
28   class Constant;
29   class Function;
30   class GlobalVariable;
31   class Module;
32   class Type;
33   class Value;
34   struct DbgStopPointInst;
35   struct DbgDeclareInst;
36   struct DbgFuncStartInst;
37   struct DbgRegionStartInst;
38   struct DbgRegionEndInst;
39   class DebugLoc;
40   struct DebugLocTracker;
41   class Instruction;
42   class LLVMContext;
43
44   class DIDescriptor {
45   protected:    
46     GlobalVariable *DbgGV;
47
48     /// DIDescriptor constructor.  If the specified GV is non-null, this checks
49     /// to make sure that the tag in the descriptor matches 'RequiredTag'.  If
50     /// not, the debug info is corrupt and we ignore it.
51     DIDescriptor(GlobalVariable *GV, unsigned RequiredTag);
52
53     const std::string &getStringField(unsigned Elt, std::string &Result) const;
54     unsigned getUnsignedField(unsigned Elt) const {
55       return (unsigned)getUInt64Field(Elt);
56     }
57     uint64_t getUInt64Field(unsigned Elt) const;
58     DIDescriptor getDescriptorField(unsigned Elt) const;
59
60     template <typename DescTy>
61     DescTy getFieldAs(unsigned Elt) const {
62       return DescTy(getDescriptorField(Elt).getGV());
63     }
64
65     GlobalVariable *getGlobalVariableField(unsigned Elt) const;
66
67   public:
68     explicit DIDescriptor() : DbgGV(0) {}
69     explicit DIDescriptor(GlobalVariable *GV) : DbgGV(GV) {}
70
71     bool isNull() const { return DbgGV == 0; }
72
73     GlobalVariable *getGV() const { return DbgGV; }
74
75     unsigned getVersion() const {
76       return getUnsignedField(0) & LLVMDebugVersionMask;
77     }
78
79     unsigned getTag() const {
80       return getUnsignedField(0) & ~LLVMDebugVersionMask;
81     }
82
83     /// ValidDebugInfo - Return true if V represents valid debug info value.
84     static bool ValidDebugInfo(Value *V, CodeGenOpt::Level OptLevel);
85
86     /// dump - print descriptor.
87     void dump() const;
88   };
89
90   /// DISubrange - This is used to represent ranges, for array bounds.
91   class DISubrange : public DIDescriptor {
92   public:
93     explicit DISubrange(GlobalVariable *GV = 0)
94       : DIDescriptor(GV, dwarf::DW_TAG_subrange_type) {}
95
96     int64_t getLo() const { return (int64_t)getUInt64Field(1); }
97     int64_t getHi() const { return (int64_t)getUInt64Field(2); }
98   };
99
100   /// DIArray - This descriptor holds an array of descriptors.
101   class DIArray : public DIDescriptor {
102   public:
103     explicit DIArray(GlobalVariable *GV = 0) : DIDescriptor(GV) {}
104
105     unsigned getNumElements() const;
106     DIDescriptor getElement(unsigned Idx) const {
107       return getDescriptorField(Idx);
108     }
109   };
110
111   /// DICompileUnit - A wrapper for a compile unit.
112   class DICompileUnit : public DIDescriptor {
113   public:
114     explicit DICompileUnit(GlobalVariable *GV = 0)
115       : DIDescriptor(GV, dwarf::DW_TAG_compile_unit) {}
116
117     unsigned getLanguage() const     { return getUnsignedField(2); }
118     const std::string &getFilename(std::string &F) const {
119       return getStringField(3, F);
120     }
121     const std::string &getDirectory(std::string &F) const {
122       return getStringField(4, F);
123     }
124     const std::string &getProducer(std::string &F) const {
125       return getStringField(5, F);
126     }
127     
128     /// isMain - Each input file is encoded as a separate compile unit in LLVM
129     /// debugging information output. However, many target specific tool chains
130     /// prefer to encode only one compile unit in an object file. In this 
131     /// situation, the LLVM code generator will include  debugging information
132     /// entities in the compile unit that is marked as main compile unit. The 
133     /// code generator accepts maximum one main compile unit per module. If a
134     /// module does not contain any main compile unit then the code generator 
135     /// will emit multiple compile units in the output object file.
136
137     bool isMain() const                { return getUnsignedField(6); }
138     bool isOptimized() const           { return getUnsignedField(7); }
139     const std::string &getFlags(std::string &F) const {
140       return getStringField(8, F);
141     }
142     unsigned getRunTimeVersion() const { return getUnsignedField(9); }
143
144     /// Verify - Verify that a compile unit is well formed.
145     bool Verify() const;
146
147     /// dump - print compile unit.
148     void dump() const;
149   };
150
151   /// DIEnumerator - A wrapper for an enumerator (e.g. X and Y in 'enum {X,Y}').
152   /// FIXME: it seems strange that this doesn't have either a reference to the
153   /// type/precision or a file/line pair for location info.
154   class DIEnumerator : public DIDescriptor {
155   public:
156     explicit DIEnumerator(GlobalVariable *GV = 0)
157       : DIDescriptor(GV, dwarf::DW_TAG_enumerator) {}
158
159     const std::string &getName(std::string &F) const {
160       return getStringField(1, F);
161     }
162     uint64_t getEnumValue() const { return getUInt64Field(2); }
163   };
164
165   /// DIType - This is a wrapper for a type.
166   /// FIXME: Types should be factored much better so that CV qualifiers and
167   /// others do not require a huge and empty descriptor full of zeros.
168   class DIType : public DIDescriptor {
169   public:
170     enum {
171       FlagPrivate   = 1 << 0,
172       FlagProtected = 1 << 1,
173       FlagFwdDecl   = 1 << 2
174     };
175
176   protected:
177     DIType(GlobalVariable *GV, unsigned Tag) : DIDescriptor(GV, Tag) {}
178     // This ctor is used when the Tag has already been validated by a derived
179     // ctor.
180     DIType(GlobalVariable *GV, bool, bool) : DIDescriptor(GV) {}
181
182   public:
183     /// isDerivedType - Return true if the specified tag is legal for
184     /// DIDerivedType.
185     static bool isDerivedType(unsigned TAG);
186
187     /// isCompositeType - Return true if the specified tag is legal for
188     /// DICompositeType.
189     static bool isCompositeType(unsigned TAG);
190
191     /// isBasicType - Return true if the specified tag is legal for
192     /// DIBasicType.
193     static bool isBasicType(unsigned TAG) {
194       return TAG == dwarf::DW_TAG_base_type;
195     }
196
197     /// Verify - Verify that a type descriptor is well formed.
198     bool Verify() const;
199   public:
200     explicit DIType(GlobalVariable *GV);
201     explicit DIType() {}
202     virtual ~DIType() {}
203
204     DIDescriptor getContext() const     { return getDescriptorField(1); }
205     const std::string &getName(std::string &F) const {
206       return getStringField(2, F);
207     }
208     DICompileUnit getCompileUnit() const{ return getFieldAs<DICompileUnit>(3); }
209     unsigned getLineNumber() const      { return getUnsignedField(4); }
210     uint64_t getSizeInBits() const      { return getUInt64Field(5); }
211     uint64_t getAlignInBits() const     { return getUInt64Field(6); }
212     // FIXME: Offset is only used for DW_TAG_member nodes.  Making every type
213     // carry this is just plain insane.
214     uint64_t getOffsetInBits() const    { return getUInt64Field(7); }
215     unsigned getFlags() const           { return getUnsignedField(8); }
216     bool isPrivate() const              { return 
217         (getFlags() & FlagPrivate) != 0; 
218     }
219     bool isProtected() const            { 
220       return (getFlags() & FlagProtected) != 0; 
221     }
222     bool isForwardDecl() const          {
223         return (getFlags() & FlagFwdDecl) != 0; 
224     }
225
226     /// dump - print type.
227     void dump() const;
228   };
229
230   /// DIBasicType - A basic type, like 'int' or 'float'.
231   class DIBasicType : public DIType {
232   public:
233     explicit DIBasicType(GlobalVariable *GV)
234       : DIType(GV, dwarf::DW_TAG_base_type) {}
235
236     unsigned getEncoding() const { return getUnsignedField(9); }
237
238     /// dump - print basic type.
239     void dump() const;
240   };
241
242   /// DIDerivedType - A simple derived type, like a const qualified type,
243   /// a typedef, a pointer or reference, etc.
244   class DIDerivedType : public DIType {
245   protected:
246     explicit DIDerivedType(GlobalVariable *GV, bool, bool)
247       : DIType(GV, true, true) {}
248   public:
249     explicit DIDerivedType(GlobalVariable *GV)
250       : DIType(GV, true, true) {
251       if (GV && !isDerivedType(getTag()))
252         DbgGV = 0;
253     }
254
255     DIType getTypeDerivedFrom() const { return getFieldAs<DIType>(9); }
256
257     /// getOriginalTypeSize - If this type is derived from a base type then
258     /// return base type size.
259     uint64_t getOriginalTypeSize() const;
260     /// dump - print derived type.
261     void dump() const;
262
263     /// replaceAllUsesWith - Replace all uses of debug info referenced by
264     /// this descriptor. After this completes, the current debug info value
265     /// is erased.
266     void replaceAllUsesWith(DIDescriptor &D);
267   };
268
269   /// DICompositeType - This descriptor holds a type that can refer to multiple
270   /// other types, like a function or struct.
271   /// FIXME: Why is this a DIDerivedType??
272   class DICompositeType : public DIDerivedType {
273   public:
274     explicit DICompositeType(GlobalVariable *GV)
275       : DIDerivedType(GV, true, true) {
276       if (GV && !isCompositeType(getTag()))
277         DbgGV = 0;
278     }
279
280     DIArray getTypeArray() const { return getFieldAs<DIArray>(10); }
281     unsigned getRunTimeLang() const { return getUnsignedField(11); }
282
283     /// Verify - Verify that a composite type descriptor is well formed.
284     bool Verify() const;
285
286     /// dump - print composite type.
287     void dump() const;
288   };
289
290   /// DIGlobal - This is a common class for global variables and subprograms.
291   class DIGlobal : public DIDescriptor {
292   protected:
293     explicit DIGlobal(GlobalVariable *GV, unsigned RequiredTag)
294       : DIDescriptor(GV, RequiredTag) {}
295
296     /// isSubprogram - Return true if the specified tag is legal for
297     /// DISubprogram.
298     static bool isSubprogram(unsigned TAG) {
299       return TAG == dwarf::DW_TAG_subprogram;
300     }
301
302     /// isGlobalVariable - Return true if the specified tag is legal for
303     /// DIGlobalVariable.
304     static bool isGlobalVariable(unsigned TAG) {
305       return TAG == dwarf::DW_TAG_variable;
306     }
307
308   public:
309     virtual ~DIGlobal() {}
310
311     DIDescriptor getContext() const     { return getDescriptorField(2); }
312     const std::string &getName(std::string &F) const {
313       return getStringField(3, F);
314     }
315     const std::string &getDisplayName(std::string &F) const {
316       return getStringField(4, F);
317     }
318     const std::string &getLinkageName(std::string &F) const {
319       return getStringField(5, F);
320     }
321     DICompileUnit getCompileUnit() const{ return getFieldAs<DICompileUnit>(6); }
322     unsigned getLineNumber() const      { return getUnsignedField(7); }
323     DIType getType() const              { return getFieldAs<DIType>(8); }
324
325     /// isLocalToUnit - Return true if this subprogram is local to the current
326     /// compile unit, like 'static' in C.
327     unsigned isLocalToUnit() const      { return getUnsignedField(9); }
328     unsigned isDefinition() const       { return getUnsignedField(10); }
329
330     /// dump - print global.
331     void dump() const;
332   };
333
334   /// DISubprogram - This is a wrapper for a subprogram (e.g. a function).
335   class DISubprogram : public DIGlobal {
336   public:
337     explicit DISubprogram(GlobalVariable *GV = 0)
338       : DIGlobal(GV, dwarf::DW_TAG_subprogram) {}
339
340     DICompositeType getType() const { return getFieldAs<DICompositeType>(8); }
341
342     /// getReturnTypeName - Subprogram return types are encoded either as
343     /// DIType or as DICompositeType.
344     const std::string &getReturnTypeName(std::string &F) const {
345       DICompositeType DCT(getFieldAs<DICompositeType>(8));
346       if (!DCT.isNull()) {
347         DIArray A = DCT.getTypeArray();
348         DIType T(A.getElement(0).getGV());
349         return T.getName(F);
350       }
351       DIType T(getFieldAs<DIType>(8));
352       return T.getName(F);
353     }
354
355     /// Verify - Verify that a subprogram descriptor is well formed.
356     bool Verify() const;
357
358     /// dump - print subprogram.
359     void dump() const;
360
361     /// describes - Return true if this subprogram provides debugging
362     /// information for the function F.
363     bool describes(const Function *F);
364   };
365
366   /// DIGlobalVariable - This is a wrapper for a global variable.
367   class DIGlobalVariable : public DIGlobal {
368   public:
369     explicit DIGlobalVariable(GlobalVariable *GV = 0)
370       : DIGlobal(GV, dwarf::DW_TAG_variable) {}
371
372     GlobalVariable *getGlobal() const { return getGlobalVariableField(11); }
373
374     /// Verify - Verify that a global variable descriptor is well formed.
375     bool Verify() const;
376
377     /// dump - print global variable.
378     void dump() const;
379   };
380
381   /// DIVariable - This is a wrapper for a variable (e.g. parameter, local,
382   /// global etc).
383   class DIVariable : public DIDescriptor {
384   public:
385     explicit DIVariable(GlobalVariable *GV = 0)
386       : DIDescriptor(GV) {
387       if (GV && !isVariable(getTag()))
388         DbgGV = 0;
389     }
390
391     DIDescriptor getContext() const { return getDescriptorField(1); }
392     const std::string &getName(std::string &F) const {
393       return getStringField(2, F);
394     }
395     DICompileUnit getCompileUnit() const{ return getFieldAs<DICompileUnit>(3); }
396     unsigned getLineNumber() const      { return getUnsignedField(4); }
397     DIType getType() const              { return getFieldAs<DIType>(5); }
398
399     /// isVariable - Return true if the specified tag is legal for DIVariable.
400     static bool isVariable(unsigned Tag);
401
402     /// Verify - Verify that a variable descriptor is well formed.
403     bool Verify() const;
404
405     /// dump - print variable.
406     void dump() const;
407   };
408
409   /// DIBlock - This is a wrapper for a block (e.g. a function, scope, etc).
410   class DIBlock : public DIDescriptor {
411   public:
412     explicit DIBlock(GlobalVariable *GV = 0)
413       : DIDescriptor(GV, dwarf::DW_TAG_lexical_block) {}
414
415     DIDescriptor getContext() const { return getDescriptorField(1); }
416   };
417
418   /// DIFactory - This object assists with the construction of the various
419   /// descriptors.
420   class DIFactory {
421     Module &M;
422     LLVMContext& VMContext;
423     
424     // Cached values for uniquing and faster lookups.
425     const Type *EmptyStructPtr; // "{}*".
426     Function *StopPointFn;   // llvm.dbg.stoppoint
427     Function *FuncStartFn;   // llvm.dbg.func.start
428     Function *RegionStartFn; // llvm.dbg.region.start
429     Function *RegionEndFn;   // llvm.dbg.region.end
430     Function *DeclareFn;     // llvm.dbg.declare
431     StringMap<Constant*> StringCache;
432     DenseMap<Constant*, DIDescriptor> SimpleConstantCache;
433
434     DIFactory(const DIFactory &);     // DO NOT IMPLEMENT
435     void operator=(const DIFactory&); // DO NOT IMPLEMENT
436   public:
437     explicit DIFactory(Module &m);
438
439     /// GetOrCreateArray - Create an descriptor for an array of descriptors. 
440     /// This implicitly uniques the arrays created.
441     DIArray GetOrCreateArray(DIDescriptor *Tys, unsigned NumTys);
442
443     /// GetOrCreateSubrange - Create a descriptor for a value range.  This
444     /// implicitly uniques the values returned.
445     DISubrange GetOrCreateSubrange(int64_t Lo, int64_t Hi);
446
447     /// CreateCompileUnit - Create a new descriptor for the specified compile
448     /// unit.
449     DICompileUnit CreateCompileUnit(unsigned LangID,
450                                     const std::string &Filename,
451                                     const std::string &Directory,
452                                     const std::string &Producer,
453                                     bool isMain = false,
454                                     bool isOptimized = false,
455                                     const char *Flags = "",
456                                     unsigned RunTimeVer = 0);
457
458     /// CreateEnumerator - Create a single enumerator value.
459     DIEnumerator CreateEnumerator(const std::string &Name, uint64_t Val);
460
461     /// CreateBasicType - Create a basic type like int, float, etc.
462     DIBasicType CreateBasicType(DIDescriptor Context, const std::string &Name,
463                                 DICompileUnit CompileUnit, unsigned LineNumber,
464                                 uint64_t SizeInBits, uint64_t AlignInBits,
465                                 uint64_t OffsetInBits, unsigned Flags,
466                                 unsigned Encoding);
467
468     /// CreateDerivedType - Create a derived type like const qualified type,
469     /// pointer, typedef, etc.
470     DIDerivedType CreateDerivedType(unsigned Tag, DIDescriptor Context,
471                                     const std::string &Name,
472                                     DICompileUnit CompileUnit,
473                                     unsigned LineNumber,
474                                     uint64_t SizeInBits, uint64_t AlignInBits,
475                                     uint64_t OffsetInBits, unsigned Flags,
476                                     DIType DerivedFrom);
477
478     /// CreateCompositeType - Create a composite type like array, struct, etc.
479     DICompositeType CreateCompositeType(unsigned Tag, DIDescriptor Context,
480                                         const std::string &Name,
481                                         DICompileUnit CompileUnit,
482                                         unsigned LineNumber,
483                                         uint64_t SizeInBits,
484                                         uint64_t AlignInBits,
485                                         uint64_t OffsetInBits, unsigned Flags,
486                                         DIType DerivedFrom,
487                                         DIArray Elements,
488                                         unsigned RunTimeLang = 0);
489
490     /// CreateSubprogram - Create a new descriptor for the specified subprogram.
491     /// See comments in DISubprogram for descriptions of these fields.
492     DISubprogram CreateSubprogram(DIDescriptor Context, const std::string &Name,
493                                   const std::string &DisplayName,
494                                   const std::string &LinkageName,
495                                   DICompileUnit CompileUnit, unsigned LineNo,
496                                   DIType Type, bool isLocalToUnit,
497                                   bool isDefinition);
498
499     /// CreateGlobalVariable - Create a new descriptor for the specified global.
500     DIGlobalVariable
501     CreateGlobalVariable(DIDescriptor Context, const std::string &Name,
502                          const std::string &DisplayName,
503                          const std::string &LinkageName, 
504                          DICompileUnit CompileUnit,
505                          unsigned LineNo, DIType Type, bool isLocalToUnit,
506                          bool isDefinition, llvm::GlobalVariable *GV);
507
508     /// CreateVariable - Create a new descriptor for the specified variable.
509     DIVariable CreateVariable(unsigned Tag, DIDescriptor Context,
510                               const std::string &Name,
511                               DICompileUnit CompileUnit, unsigned LineNo,
512                               DIType Type);
513
514     /// CreateBlock - This creates a descriptor for a lexical block with the
515     /// specified parent context.
516     DIBlock CreateBlock(DIDescriptor Context);
517
518     /// InsertStopPoint - Create a new llvm.dbg.stoppoint intrinsic invocation,
519     /// inserting it at the end of the specified basic block.
520     void InsertStopPoint(DICompileUnit CU, unsigned LineNo, unsigned ColNo,
521                          BasicBlock *BB);
522
523     /// InsertSubprogramStart - Create a new llvm.dbg.func.start intrinsic to
524     /// mark the start of the specified subprogram.
525     void InsertSubprogramStart(DISubprogram SP, BasicBlock *BB);
526
527     /// InsertRegionStart - Insert a new llvm.dbg.region.start intrinsic call to
528     /// mark the start of a region for the specified scoping descriptor.
529     void InsertRegionStart(DIDescriptor D, BasicBlock *BB);
530
531     /// InsertRegionEnd - Insert a new llvm.dbg.region.end intrinsic call to
532     /// mark the end of a region for the specified scoping descriptor.
533     void InsertRegionEnd(DIDescriptor D, BasicBlock *BB);
534
535     /// InsertDeclare - Insert a new llvm.dbg.declare intrinsic call.
536     void InsertDeclare(llvm::Value *Storage, DIVariable D, BasicBlock *BB);
537
538   private:
539     Constant *GetTagConstant(unsigned TAG);
540     Constant *GetStringConstant(const std::string &String);
541
542     /// getCastToEmpty - Return the descriptor as a Constant* with type '{}*'.
543     Constant *getCastToEmpty(DIDescriptor D);
544   };
545
546   /// Finds the stoppoint coressponding to this instruction, that is the
547   /// stoppoint that dominates this instruction 
548   const DbgStopPointInst *findStopPoint(const Instruction *Inst);
549
550   /// Finds the stoppoint corresponding to first real (non-debug intrinsic) 
551   /// instruction in this Basic Block, and returns the stoppoint for it.
552   const DbgStopPointInst *findBBStopPoint(const BasicBlock *BB);
553
554   /// Finds the dbg.declare intrinsic corresponding to this value if any.
555   /// It looks through pointer casts too.
556   const DbgDeclareInst *findDbgDeclare(const Value *V, bool stripCasts = true);
557
558   /// Find the debug info descriptor corresponding to this global variable.
559   Value *findDbgGlobalDeclare(GlobalVariable *V);
560
561   bool getLocationInfo(const Value *V, std::string &DisplayName, 
562                        std::string &Type, unsigned &LineNo, std::string &File,
563                        std::string &Dir); 
564
565   /// CollectDebugInfoAnchors - Collect debugging information anchors.
566   void CollectDebugInfoAnchors(Module &M,
567                                SmallVector<GlobalVariable *, 2> &CompileUnits,
568                                SmallVector<GlobalVariable *, 4> &GlobalVars,
569                                SmallVector<GlobalVariable *, 4> &Subprograms);
570
571   /// isValidDebugInfoIntrinsic - Return true if SPI is a valid debug 
572   /// info intrinsic.
573   bool isValidDebugInfoIntrinsic(DbgStopPointInst &SPI, 
574                                  CodeGenOpt::Level OptLev);
575
576   /// isValidDebugInfoIntrinsic - Return true if FSI is a valid debug 
577   /// info intrinsic.
578   bool isValidDebugInfoIntrinsic(DbgFuncStartInst &FSI,
579                                  CodeGenOpt::Level OptLev);
580
581   /// isValidDebugInfoIntrinsic - Return true if RSI is a valid debug 
582   /// info intrinsic.
583   bool isValidDebugInfoIntrinsic(DbgRegionStartInst &RSI,
584                                  CodeGenOpt::Level OptLev);
585
586   /// isValidDebugInfoIntrinsic - Return true if REI is a valid debug 
587   /// info intrinsic.
588   bool isValidDebugInfoIntrinsic(DbgRegionEndInst &REI,
589                                  CodeGenOpt::Level OptLev);
590
591   /// isValidDebugInfoIntrinsic - Return true if DI is a valid debug 
592   /// info intrinsic.
593   bool isValidDebugInfoIntrinsic(DbgDeclareInst &DI,
594                                  CodeGenOpt::Level OptLev);
595
596   /// ExtractDebugLocation - Extract debug location information 
597   /// from llvm.dbg.stoppoint intrinsic.
598   DebugLoc ExtractDebugLocation(DbgStopPointInst &SPI,
599                                 DebugLocTracker &DebugLocInfo);
600
601   /// ExtractDebugLocation - Extract debug location information 
602   /// from llvm.dbg.func_start intrinsic.
603   DebugLoc ExtractDebugLocation(DbgFuncStartInst &FSI,
604                                 DebugLocTracker &DebugLocInfo);
605
606   /// isInlinedFnStart - Return true if FSI is starting an inlined function.
607   bool isInlinedFnStart(DbgFuncStartInst &FSI, const Function *CurrentFn);
608
609   /// isInlinedFnEnd - Return true if REI is ending an inlined function.
610   bool isInlinedFnEnd(DbgRegionEndInst &REI, const Function *CurrentFn);
611
612 } // end namespace llvm
613
614 #endif