]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - contrib/llvm/include/llvm/DIBuilder.h
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / contrib / llvm / include / llvm / DIBuilder.h
1 //===--- llvm/DIBuilder.h - Debug Information Builder -----------*- 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 DIBuilder that is useful for creating debugging
11 // information entries in LLVM IR form.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef LLVM_DIBUILDER_H
16 #define LLVM_DIBUILDER_H
17
18 #include "llvm/ADT/ArrayRef.h"
19 #include "llvm/ADT/StringRef.h"
20 #include "llvm/Support/DataTypes.h"
21
22 namespace llvm {
23   class BasicBlock;
24   class Instruction;
25   class Function;
26   class Module;
27   class Value;
28   class LLVMContext;
29   class MDNode;
30   class StringRef;
31   class DIBasicType;
32   class DICompositeType;
33   class DIDerivedType;
34   class DIDescriptor;
35   class DIFile;
36   class DIEnumerator;
37   class DIType;
38   class DIArray;
39   class DIGlobalVariable;
40   class DIImportedModule;
41   class DINameSpace;
42   class DIVariable;
43   class DISubrange;
44   class DILexicalBlockFile;
45   class DILexicalBlock;
46   class DIScope;
47   class DISubprogram;
48   class DITemplateTypeParameter;
49   class DITemplateValueParameter;
50   class DIObjCProperty;
51
52   class DIBuilder {
53     private:
54     Module &M;
55     LLVMContext & VMContext;
56     MDNode *TheCU;
57
58     MDNode *TempEnumTypes;
59     MDNode *TempRetainTypes;
60     MDNode *TempSubprograms;
61     MDNode *TempGVs;
62     MDNode *TempImportedModules;
63
64     Function *DeclareFn;     // llvm.dbg.declare
65     Function *ValueFn;       // llvm.dbg.value
66
67     SmallVector<Value *, 4> AllEnumTypes;
68     SmallVector<Value *, 4> AllRetainTypes;
69     SmallVector<Value *, 4> AllSubprograms;
70     SmallVector<Value *, 4> AllGVs;
71     SmallVector<Value *, 4> AllImportedModules;
72
73     DIBuilder(const DIBuilder &) LLVM_DELETED_FUNCTION;
74     void operator=(const DIBuilder &) LLVM_DELETED_FUNCTION;
75
76     public:
77     explicit DIBuilder(Module &M);
78     const MDNode *getCU() { return TheCU; }
79     enum ComplexAddrKind { OpPlus=1, OpDeref };
80
81     /// finalize - Construct any deferred debug info descriptors.
82     void finalize();
83
84     /// createCompileUnit - A CompileUnit provides an anchor for all debugging
85     /// information generated during this instance of compilation.
86     /// @param Lang     Source programming language, eg. dwarf::DW_LANG_C99
87     /// @param File     File name
88     /// @param Dir      Directory
89     /// @param Producer String identify producer of debugging information.
90     ///                 Usuall this is a compiler version string.
91     /// @param isOptimized A boolean flag which indicates whether optimization
92     ///                    is ON or not.
93     /// @param Flags    This string lists command line options. This string is
94     ///                 directly embedded in debug info output which may be used
95     ///                 by a tool analyzing generated debugging information.
96     /// @param RV       This indicates runtime version for languages like
97     ///                 Objective-C.
98     /// @param SplitName The name of the file that we'll split debug info out
99     ///                  into.
100     void createCompileUnit(unsigned Lang, StringRef File, StringRef Dir,
101                            StringRef Producer, bool isOptimized,
102                            StringRef Flags, unsigned RV,
103                            StringRef SplitName = StringRef());
104
105     /// createFile - Create a file descriptor to hold debugging information
106     /// for a file.
107     DIFile createFile(StringRef Filename, StringRef Directory);
108
109     /// createEnumerator - Create a single enumerator value.
110     DIEnumerator createEnumerator(StringRef Name, uint64_t Val);
111
112     /// createNullPtrType - Create C++0x nullptr type.
113     DIType createNullPtrType(StringRef Name);
114
115     /// createBasicType - Create debugging information entry for a basic
116     /// type.
117     /// @param Name        Type name.
118     /// @param SizeInBits  Size of the type.
119     /// @param AlignInBits Type alignment.
120     /// @param Encoding    DWARF encoding code, e.g. dwarf::DW_ATE_float.
121     DIBasicType createBasicType(StringRef Name, uint64_t SizeInBits,
122                                 uint64_t AlignInBits, unsigned Encoding);
123
124     /// createQualifiedType - Create debugging information entry for a qualified
125     /// type, e.g. 'const int'.
126     /// @param Tag         Tag identifing type, e.g. dwarf::TAG_volatile_type
127     /// @param FromTy      Base Type.
128     DIDerivedType createQualifiedType(unsigned Tag, DIType FromTy);
129
130     /// createPointerType - Create debugging information entry for a pointer.
131     /// @param PointeeTy   Type pointed by this pointer.
132     /// @param SizeInBits  Size.
133     /// @param AlignInBits Alignment. (optional)
134     /// @param Name        Pointer type name. (optional)
135     DIDerivedType
136     createPointerType(DIType PointeeTy, uint64_t SizeInBits,
137                       uint64_t AlignInBits = 0, StringRef Name = StringRef());
138
139     /// \brief Create debugging information entry for a pointer to member.
140     /// @param PointeeTy Type pointed to by this pointer.
141     /// @param Class Type for which this pointer points to members of.
142     DIDerivedType createMemberPointerType(DIType PointeeTy, DIType Class);
143
144     /// createReferenceType - Create debugging information entry for a c++
145     /// style reference or rvalue reference type.
146     DIDerivedType createReferenceType(unsigned Tag, DIType RTy);
147
148     /// createTypedef - Create debugging information entry for a typedef.
149     /// @param Ty          Original type.
150     /// @param Name        Typedef name.
151     /// @param File        File where this type is defined.
152     /// @param LineNo      Line number.
153     /// @param Context     The surrounding context for the typedef.
154     DIDerivedType createTypedef(DIType Ty, StringRef Name, DIFile File,
155                                 unsigned LineNo, DIDescriptor Context);
156
157     /// createFriend - Create debugging information entry for a 'friend'.
158     DIType createFriend(DIType Ty, DIType FriendTy);
159
160     /// createInheritance - Create debugging information entry to establish
161     /// inheritance relationship between two types.
162     /// @param Ty           Original type.
163     /// @param BaseTy       Base type. Ty is inherits from base.
164     /// @param BaseOffset   Base offset.
165     /// @param Flags        Flags to describe inheritance attribute,
166     ///                     e.g. private
167     DIDerivedType createInheritance(DIType Ty, DIType BaseTy,
168                                     uint64_t BaseOffset, unsigned Flags);
169
170     /// createMemberType - Create debugging information entry for a member.
171     /// @param Scope        Member scope.
172     /// @param Name         Member name.
173     /// @param File         File where this member is defined.
174     /// @param LineNo       Line number.
175     /// @param SizeInBits   Member size.
176     /// @param AlignInBits  Member alignment.
177     /// @param OffsetInBits Member offset.
178     /// @param Flags        Flags to encode member attribute, e.g. private
179     /// @param Ty           Parent type.
180     DIDerivedType
181     createMemberType(DIDescriptor Scope, StringRef Name, DIFile File,
182                      unsigned LineNo, uint64_t SizeInBits, uint64_t AlignInBits,
183                      uint64_t OffsetInBits, unsigned Flags, DIType Ty);
184
185     /// createStaticMemberType - Create debugging information entry for a
186     /// C++ static data member.
187     /// @param Scope      Member scope.
188     /// @param Name       Member name.
189     /// @param File       File where this member is declared.
190     /// @param LineNo     Line number.
191     /// @param Ty         Type of the static member.
192     /// @param Flags      Flags to encode member attribute, e.g. private.
193     /// @param Val        Const initializer of the member.
194     DIType createStaticMemberType(DIDescriptor Scope, StringRef Name,
195                                   DIFile File, unsigned LineNo, DIType Ty,
196                                   unsigned Flags, llvm::Value *Val);
197
198     /// createObjCIVar - Create debugging information entry for Objective-C
199     /// instance variable.
200     /// @param Name         Member name.
201     /// @param File         File where this member is defined.
202     /// @param LineNo       Line number.
203     /// @param SizeInBits   Member size.
204     /// @param AlignInBits  Member alignment.
205     /// @param OffsetInBits Member offset.
206     /// @param Flags        Flags to encode member attribute, e.g. private
207     /// @param Ty           Parent type.
208     /// @param PropertyName Name of the Objective C property associated with
209     ///                     this ivar.
210     /// @param PropertyGetterName Name of the Objective C property getter
211     ///                           selector.
212     /// @param PropertySetterName Name of the Objective C property setter
213     ///                           selector.
214     /// @param PropertyAttributes Objective C property attributes.
215     DIType createObjCIVar(StringRef Name, DIFile File,
216                           unsigned LineNo, uint64_t SizeInBits,
217                           uint64_t AlignInBits, uint64_t OffsetInBits,
218                           unsigned Flags, DIType Ty,
219                           StringRef PropertyName = StringRef(),
220                           StringRef PropertyGetterName = StringRef(),
221                           StringRef PropertySetterName = StringRef(),
222                           unsigned PropertyAttributes = 0);
223
224     /// createObjCIVar - Create debugging information entry for Objective-C
225     /// instance variable.
226     /// @param Name         Member name.
227     /// @param File         File where this member is defined.
228     /// @param LineNo       Line number.
229     /// @param SizeInBits   Member size.
230     /// @param AlignInBits  Member alignment.
231     /// @param OffsetInBits Member offset.
232     /// @param Flags        Flags to encode member attribute, e.g. private
233     /// @param Ty           Parent type.
234     /// @param PropertyNode Property associated with this ivar.
235     DIType createObjCIVar(StringRef Name, DIFile File,
236                           unsigned LineNo, uint64_t SizeInBits,
237                           uint64_t AlignInBits, uint64_t OffsetInBits,
238                           unsigned Flags, DIType Ty,
239                           MDNode *PropertyNode);
240
241     /// createObjCProperty - Create debugging information entry for Objective-C
242     /// property.
243     /// @param Name         Property name.
244     /// @param File         File where this property is defined.
245     /// @param LineNumber   Line number.
246     /// @param GetterName   Name of the Objective C property getter selector.
247     /// @param SetterName   Name of the Objective C property setter selector.
248     /// @param PropertyAttributes Objective C property attributes.
249     /// @param Ty           Type.
250     DIObjCProperty createObjCProperty(StringRef Name,
251                                       DIFile File, unsigned LineNumber,
252                                       StringRef GetterName,
253                                       StringRef SetterName,
254                                       unsigned PropertyAttributes,
255                                       DIType Ty);
256
257     /// createClassType - Create debugging information entry for a class.
258     /// @param Scope        Scope in which this class is defined.
259     /// @param Name         class name.
260     /// @param File         File where this member is defined.
261     /// @param LineNumber   Line number.
262     /// @param SizeInBits   Member size.
263     /// @param AlignInBits  Member alignment.
264     /// @param OffsetInBits Member offset.
265     /// @param Flags        Flags to encode member attribute, e.g. private
266     /// @param Elements     class members.
267     /// @param VTableHolder Debug info of the base class that contains vtable
268     ///                     for this type. This is used in
269     ///                     DW_AT_containing_type. See DWARF documentation
270     ///                     for more info.
271     /// @param TemplateParms Template type parameters.
272     DICompositeType createClassType(DIDescriptor Scope, StringRef Name,
273                                     DIFile File, unsigned LineNumber,
274                                     uint64_t SizeInBits, uint64_t AlignInBits,
275                                     uint64_t OffsetInBits, unsigned Flags,
276                                     DIType DerivedFrom, DIArray Elements,
277                                     MDNode *VTableHolder = 0,
278                                     MDNode *TemplateParms = 0);
279
280     /// createStructType - Create debugging information entry for a struct.
281     /// @param Scope        Scope in which this struct is defined.
282     /// @param Name         Struct name.
283     /// @param File         File where this member is defined.
284     /// @param LineNumber   Line number.
285     /// @param SizeInBits   Member size.
286     /// @param AlignInBits  Member alignment.
287     /// @param Flags        Flags to encode member attribute, e.g. private
288     /// @param Elements     Struct elements.
289     /// @param RunTimeLang  Optional parameter, Objective-C runtime version.
290     DICompositeType createStructType(DIDescriptor Scope, StringRef Name,
291                                      DIFile File, unsigned LineNumber,
292                                      uint64_t SizeInBits, uint64_t AlignInBits,
293                                      unsigned Flags, DIType DerivedFrom,
294                                      DIArray Elements, unsigned RunTimeLang = 0,
295                                      MDNode *VTableHolder = 0);
296
297     /// createUnionType - Create debugging information entry for an union.
298     /// @param Scope        Scope in which this union is defined.
299     /// @param Name         Union name.
300     /// @param File         File where this member is defined.
301     /// @param LineNumber   Line number.
302     /// @param SizeInBits   Member size.
303     /// @param AlignInBits  Member alignment.
304     /// @param Flags        Flags to encode member attribute, e.g. private
305     /// @param Elements     Union elements.
306     /// @param RunTimeLang  Optional parameter, Objective-C runtime version.
307     DICompositeType createUnionType(
308         DIDescriptor Scope, StringRef Name, DIFile File, unsigned LineNumber,
309         uint64_t SizeInBits, uint64_t AlignInBits, unsigned Flags,
310         DIArray Elements, unsigned RunTimeLang = 0);
311
312     /// createTemplateTypeParameter - Create debugging information for template
313     /// type parameter.
314     /// @param Scope        Scope in which this type is defined.
315     /// @param Name         Type parameter name.
316     /// @param Ty           Parameter type.
317     /// @param File         File where this type parameter is defined.
318     /// @param LineNo       Line number.
319     /// @param ColumnNo     Column Number.
320     DITemplateTypeParameter
321     createTemplateTypeParameter(DIDescriptor Scope, StringRef Name, DIType Ty,
322                                 MDNode *File = 0, unsigned LineNo = 0,
323                                 unsigned ColumnNo = 0);
324
325     /// createTemplateValueParameter - Create debugging information for template
326     /// value parameter.
327     /// @param Scope        Scope in which this type is defined.
328     /// @param Name         Value parameter name.
329     /// @param Ty           Parameter type.
330     /// @param Value        Constant parameter value.
331     /// @param File         File where this type parameter is defined.
332     /// @param LineNo       Line number.
333     /// @param ColumnNo     Column Number.
334     DITemplateValueParameter
335     createTemplateValueParameter(DIDescriptor Scope, StringRef Name, DIType Ty,
336                                  uint64_t Value,
337                                  MDNode *File = 0, unsigned LineNo = 0,
338                                  unsigned ColumnNo = 0);
339
340     /// createArrayType - Create debugging information entry for an array.
341     /// @param Size         Array size.
342     /// @param AlignInBits  Alignment.
343     /// @param Ty           Element type.
344     /// @param Subscripts   Subscripts.
345     DICompositeType createArrayType(uint64_t Size, uint64_t AlignInBits,
346                                     DIType Ty, DIArray Subscripts);
347
348     /// createVectorType - Create debugging information entry for a vector type.
349     /// @param Size         Array size.
350     /// @param AlignInBits  Alignment.
351     /// @param Ty           Element type.
352     /// @param Subscripts   Subscripts.
353     DIType createVectorType(uint64_t Size, uint64_t AlignInBits,
354                             DIType Ty, DIArray Subscripts);
355
356     /// createEnumerationType - Create debugging information entry for an
357     /// enumeration.
358     /// @param Scope          Scope in which this enumeration is defined.
359     /// @param Name           Union name.
360     /// @param File           File where this member is defined.
361     /// @param LineNumber     Line number.
362     /// @param SizeInBits     Member size.
363     /// @param AlignInBits    Member alignment.
364     /// @param Elements       Enumeration elements.
365     /// @param UnderlyingType Underlying type of a C++11/ObjC fixed enum.
366     DICompositeType createEnumerationType(DIDescriptor Scope, StringRef Name,
367                                           DIFile File, unsigned LineNumber,
368                                           uint64_t SizeInBits,
369                                           uint64_t AlignInBits,
370                                           DIArray Elements,
371                                           DIType UnderlyingType);
372
373     /// createSubroutineType - Create subroutine type.
374     /// @param File           File in which this subroutine is defined.
375     /// @param ParameterTypes An array of subroutine parameter types. This
376     ///                       includes return type at 0th index.
377     DICompositeType createSubroutineType(DIFile File, DIArray ParameterTypes);
378
379     /// createArtificialType - Create a new DIType with "artificial" flag set.
380     DIType createArtificialType(DIType Ty);
381
382     /// createObjectPointerType - Create a new DIType with the "object pointer"
383     /// flag set.
384     DIType createObjectPointerType(DIType Ty);
385
386     /// createForwardDecl - Create a temporary forward-declared type.
387     DIType createForwardDecl(unsigned Tag, StringRef Name, DIDescriptor Scope,
388                              DIFile F, unsigned Line, unsigned RuntimeLang = 0,
389                              uint64_t SizeInBits = 0, uint64_t AlignInBits = 0);
390
391     /// retainType - Retain DIType in a module even if it is not referenced
392     /// through debug info anchors.
393     void retainType(DIType T);
394
395     /// createUnspecifiedParameter - Create unspeicified type descriptor
396     /// for a subroutine type.
397     DIDescriptor createUnspecifiedParameter();
398
399     /// getOrCreateArray - Get a DIArray, create one if required.
400     DIArray getOrCreateArray(ArrayRef<Value *> Elements);
401
402     /// getOrCreateSubrange - Create a descriptor for a value range.  This
403     /// implicitly uniques the values returned.
404     DISubrange getOrCreateSubrange(int64_t Lo, int64_t Count);
405
406     /// createGlobalVariable - Create a new descriptor for the specified global.
407     /// @param Name        Name of the variable.
408     /// @param File        File where this variable is defined.
409     /// @param LineNo      Line number.
410     /// @param Ty          Variable Type.
411     /// @param isLocalToUnit Boolean flag indicate whether this variable is
412     ///                      externally visible or not.
413     /// @param Val         llvm::Value of the variable.
414     DIGlobalVariable
415     createGlobalVariable(StringRef Name, DIFile File, unsigned LineNo,
416                          DIType Ty, bool isLocalToUnit, llvm::Value *Val);
417
418     /// \brief Create a new descriptor for the specified global.
419     /// @param Name        Name of the variable.
420     /// @param LinkageName Mangled variable name.
421     /// @param File        File where this variable is defined.
422     /// @param LineNo      Line number.
423     /// @param Ty          Variable Type.
424     /// @param isLocalToUnit Boolean flag indicate whether this variable is
425     ///                      externally visible or not.
426     /// @param Val         llvm::Value of the variable.
427     DIGlobalVariable
428     createGlobalVariable(StringRef Name, StringRef LinkageName, DIFile File,
429                          unsigned LineNo, DIType Ty, bool isLocalToUnit,
430                          llvm::Value *Val);
431
432     /// createStaticVariable - Create a new descriptor for the specified
433     /// variable.
434     /// @param Context     Variable scope.
435     /// @param Name        Name of the variable.
436     /// @param LinkageName Mangled  name of the variable.
437     /// @param File        File where this variable is defined.
438     /// @param LineNo      Line number.
439     /// @param Ty          Variable Type.
440     /// @param isLocalToUnit Boolean flag indicate whether this variable is
441     ///                      externally visible or not.
442     /// @param Val         llvm::Value of the variable.
443     /// @param Decl        Reference to the corresponding declaration.
444     DIGlobalVariable
445     createStaticVariable(DIDescriptor Context, StringRef Name,
446                          StringRef LinkageName, DIFile File, unsigned LineNo,
447                          DIType Ty, bool isLocalToUnit, llvm::Value *Val,
448                          MDNode *Decl = NULL);
449
450
451     /// createLocalVariable - Create a new descriptor for the specified
452     /// local variable.
453     /// @param Tag         Dwarf TAG. Usually DW_TAG_auto_variable or
454     ///                    DW_TAG_arg_variable.
455     /// @param Scope       Variable scope.
456     /// @param Name        Variable name.
457     /// @param File        File where this variable is defined.
458     /// @param LineNo      Line number.
459     /// @param Ty          Variable Type
460     /// @param AlwaysPreserve Boolean. Set to true if debug info for this
461     ///                       variable should be preserved in optimized build.
462     /// @param Flags          Flags, e.g. artificial variable.
463     /// @param ArgNo       If this variable is an arugment then this argument's
464     ///                    number. 1 indicates 1st argument.
465     DIVariable createLocalVariable(unsigned Tag, DIDescriptor Scope,
466                                    StringRef Name,
467                                    DIFile File, unsigned LineNo,
468                                    DIType Ty, bool AlwaysPreserve = false,
469                                    unsigned Flags = 0,
470                                    unsigned ArgNo = 0);
471
472
473     /// createComplexVariable - Create a new descriptor for the specified
474     /// variable which has a complex address expression for its address.
475     /// @param Tag         Dwarf TAG. Usually DW_TAG_auto_variable or
476     ///                    DW_TAG_arg_variable.
477     /// @param Scope       Variable scope.
478     /// @param Name        Variable name.
479     /// @param F           File where this variable is defined.
480     /// @param LineNo      Line number.
481     /// @param Ty          Variable Type
482     /// @param Addr        An array of complex address operations.
483     /// @param ArgNo       If this variable is an arugment then this argument's
484     ///                    number. 1 indicates 1st argument.
485     DIVariable createComplexVariable(unsigned Tag, DIDescriptor Scope,
486                                      StringRef Name, DIFile F, unsigned LineNo,
487                                      DIType Ty, ArrayRef<Value *> Addr,
488                                      unsigned ArgNo = 0);
489
490     /// createFunction - Create a new descriptor for the specified subprogram.
491     /// See comments in DISubprogram for descriptions of these fields.
492     /// @param Scope         Function scope.
493     /// @param Name          Function name.
494     /// @param LinkageName   Mangled function name.
495     /// @param File          File where this variable is defined.
496     /// @param LineNo        Line number.
497     /// @param Ty            Function type.
498     /// @param isLocalToUnit True if this function is not externally visible..
499     /// @param isDefinition  True if this is a function definition.
500     /// @param ScopeLine     Set to the beginning of the scope this starts
501     /// @param Flags         e.g. is this function prototyped or not.
502     ///                      This flags are used to emit dwarf attributes.
503     /// @param isOptimized   True if optimization is ON.
504     /// @param Fn            llvm::Function pointer.
505     /// @param TParam        Function template parameters.
506     DISubprogram createFunction(DIDescriptor Scope, StringRef Name,
507                                 StringRef LinkageName,
508                                 DIFile File, unsigned LineNo,
509                                 DIType Ty, bool isLocalToUnit,
510                                 bool isDefinition,
511                                 unsigned ScopeLine,
512                                 unsigned Flags = 0,
513                                 bool isOptimized = false,
514                                 Function *Fn = 0,
515                                 MDNode *TParam = 0,
516                                 MDNode *Decl = 0);
517
518     /// createMethod - Create a new descriptor for the specified C++ method.
519     /// See comments in DISubprogram for descriptions of these fields.
520     /// @param Scope         Function scope.
521     /// @param Name          Function name.
522     /// @param LinkageName   Mangled function name.
523     /// @param File          File where this variable is defined.
524     /// @param LineNo        Line number.
525     /// @param Ty            Function type.
526     /// @param isLocalToUnit True if this function is not externally visible..
527     /// @param isDefinition  True if this is a function definition.
528     /// @param Virtuality    Attributes describing virtualness. e.g. pure
529     ///                      virtual function.
530     /// @param VTableIndex   Index no of this method in virtual table.
531     /// @param VTableHolder  Type that holds vtable.
532     /// @param Flags         e.g. is this function prototyped or not.
533     ///                      This flags are used to emit dwarf attributes.
534     /// @param isOptimized   True if optimization is ON.
535     /// @param Fn            llvm::Function pointer.
536     /// @param TParam        Function template parameters.
537     DISubprogram createMethod(DIDescriptor Scope, StringRef Name,
538                               StringRef LinkageName,
539                               DIFile File, unsigned LineNo,
540                               DIType Ty, bool isLocalToUnit,
541                               bool isDefinition,
542                               unsigned Virtuality = 0, unsigned VTableIndex = 0,
543                               MDNode *VTableHolder = 0,
544                               unsigned Flags = 0,
545                               bool isOptimized = false,
546                               Function *Fn = 0,
547                               MDNode *TParam = 0);
548
549     /// createNameSpace - This creates new descriptor for a namespace
550     /// with the specified parent scope.
551     /// @param Scope       Namespace scope
552     /// @param Name        Name of this namespace
553     /// @param File        Source file
554     /// @param LineNo      Line number
555     DINameSpace createNameSpace(DIDescriptor Scope, StringRef Name,
556                                 DIFile File, unsigned LineNo);
557
558
559     /// createLexicalBlockFile - This creates a descriptor for a lexical
560     /// block with a new file attached. This merely extends the existing
561     /// lexical block as it crosses a file.
562     /// @param Scope       Lexical block.
563     /// @param File        Source file.
564     DILexicalBlockFile createLexicalBlockFile(DIDescriptor Scope,
565                                               DIFile File);
566
567     /// createLexicalBlock - This creates a descriptor for a lexical block
568     /// with the specified parent context.
569     /// @param Scope       Parent lexical scope.
570     /// @param File        Source file
571     /// @param Line        Line number
572     /// @param Col         Column number
573     DILexicalBlock createLexicalBlock(DIDescriptor Scope, DIFile File,
574                                       unsigned Line, unsigned Col);
575
576     /// \brief Create a descriptor for an imported module.
577     /// @param Context The scope this module is imported into
578     /// @param NS The namespace being imported here
579     /// @param Line Line number
580     DIImportedModule createImportedModule(DIScope Context, DINameSpace NS,
581                                           unsigned Line);
582
583     /// insertDeclare - Insert a new llvm.dbg.declare intrinsic call.
584     /// @param Storage     llvm::Value of the variable
585     /// @param VarInfo     Variable's debug info descriptor.
586     /// @param InsertAtEnd Location for the new intrinsic.
587     Instruction *insertDeclare(llvm::Value *Storage, DIVariable VarInfo,
588                                BasicBlock *InsertAtEnd);
589
590     /// insertDeclare - Insert a new llvm.dbg.declare intrinsic call.
591     /// @param Storage      llvm::Value of the variable
592     /// @param VarInfo      Variable's debug info descriptor.
593     /// @param InsertBefore Location for the new intrinsic.
594     Instruction *insertDeclare(llvm::Value *Storage, DIVariable VarInfo,
595                                Instruction *InsertBefore);
596
597
598     /// insertDbgValueIntrinsic - Insert a new llvm.dbg.value intrinsic call.
599     /// @param Val          llvm::Value of the variable
600     /// @param Offset       Offset
601     /// @param VarInfo      Variable's debug info descriptor.
602     /// @param InsertAtEnd Location for the new intrinsic.
603     Instruction *insertDbgValueIntrinsic(llvm::Value *Val, uint64_t Offset,
604                                          DIVariable VarInfo,
605                                          BasicBlock *InsertAtEnd);
606
607     /// insertDbgValueIntrinsic - Insert a new llvm.dbg.value intrinsic call.
608     /// @param Val          llvm::Value of the variable
609     /// @param Offset       Offset
610     /// @param VarInfo      Variable's debug info descriptor.
611     /// @param InsertBefore Location for the new intrinsic.
612     Instruction *insertDbgValueIntrinsic(llvm::Value *Val, uint64_t Offset,
613                                          DIVariable VarInfo,
614                                          Instruction *InsertBefore);
615
616   };
617 } // end namespace llvm
618
619 #endif