407ee70ceb96691affdf7c805dc63f46dc57211e
[oota-llvm.git] / 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     DICompositeType createEnumerationType(
366         DIDescriptor Scope, StringRef Name, DIFile File, unsigned LineNumber,
367         uint64_t SizeInBits, uint64_t AlignInBits, DIArray Elements,
368         DIType ClassType);
369
370     /// createSubroutineType - Create subroutine type.
371     /// @param File           File in which this subroutine is defined.
372     /// @param ParameterTypes An array of subroutine parameter types. This
373     ///                       includes return type at 0th index.
374     DICompositeType createSubroutineType(DIFile File, DIArray ParameterTypes);
375
376     /// createArtificialType - Create a new DIType with "artificial" flag set.
377     DIType createArtificialType(DIType Ty);
378
379     /// createObjectPointerType - Create a new DIType with the "object pointer"
380     /// flag set.
381     DIType createObjectPointerType(DIType Ty);
382
383     /// createForwardDecl - Create a temporary forward-declared type.
384     DIType createForwardDecl(unsigned Tag, StringRef Name, DIDescriptor Scope,
385                              DIFile F, unsigned Line, unsigned RuntimeLang = 0,
386                              uint64_t SizeInBits = 0, uint64_t AlignInBits = 0);
387
388     /// retainType - Retain DIType in a module even if it is not referenced 
389     /// through debug info anchors.
390     void retainType(DIType T);
391
392     /// createUnspecifiedParameter - Create unspeicified type descriptor
393     /// for a subroutine type.
394     DIDescriptor createUnspecifiedParameter();
395
396     /// getOrCreateArray - Get a DIArray, create one if required.
397     DIArray getOrCreateArray(ArrayRef<Value *> Elements);
398
399     /// getOrCreateSubrange - Create a descriptor for a value range.  This
400     /// implicitly uniques the values returned.
401     DISubrange getOrCreateSubrange(int64_t Lo, int64_t Count);
402
403     /// createGlobalVariable - Create a new descriptor for the specified global.
404     /// @param Name        Name of the variable.
405     /// @param File        File where this variable is defined.
406     /// @param LineNo      Line number.
407     /// @param Ty          Variable Type.
408     /// @param isLocalToUnit Boolean flag indicate whether this variable is
409     ///                      externally visible or not.
410     /// @param Val         llvm::Value of the variable.
411     DIGlobalVariable
412     createGlobalVariable(StringRef Name, DIFile File, unsigned LineNo,
413                          DIType Ty, bool isLocalToUnit, llvm::Value *Val);
414
415     /// \brief Create a new descriptor for the specified global.
416     /// @param Name        Name of the variable.
417     /// @param LinkageName Mangled variable name.
418     /// @param File        File where this variable is defined.
419     /// @param LineNo      Line number.
420     /// @param Ty          Variable Type.
421     /// @param isLocalToUnit Boolean flag indicate whether this variable is
422     ///                      externally visible or not.
423     /// @param Val         llvm::Value of the variable.
424     DIGlobalVariable
425     createGlobalVariable(StringRef Name, StringRef LinkageName, DIFile File,
426                          unsigned LineNo, DIType Ty, bool isLocalToUnit,
427                          llvm::Value *Val);
428
429     /// createStaticVariable - Create a new descriptor for the specified 
430     /// variable.
431     /// @param Context     Variable scope.
432     /// @param Name        Name of the variable.
433     /// @param LinkageName Mangled  name of the variable.
434     /// @param File        File where this variable is defined.
435     /// @param LineNo      Line number.
436     /// @param Ty          Variable Type.
437     /// @param isLocalToUnit Boolean flag indicate whether this variable is
438     ///                      externally visible or not.
439     /// @param Val         llvm::Value of the variable.
440     /// @param Decl        Reference to the corresponding declaration.
441     DIGlobalVariable
442     createStaticVariable(DIDescriptor Context, StringRef Name, 
443                          StringRef LinkageName, DIFile File, unsigned LineNo, 
444                          DIType Ty, bool isLocalToUnit, llvm::Value *Val,
445                          MDNode *Decl = NULL);
446
447
448     /// createLocalVariable - Create a new descriptor for the specified 
449     /// local variable.
450     /// @param Tag         Dwarf TAG. Usually DW_TAG_auto_variable or
451     ///                    DW_TAG_arg_variable.
452     /// @param Scope       Variable scope.
453     /// @param Name        Variable name.
454     /// @param File        File where this variable is defined.
455     /// @param LineNo      Line number.
456     /// @param Ty          Variable Type
457     /// @param AlwaysPreserve Boolean. Set to true if debug info for this
458     ///                       variable should be preserved in optimized build.
459     /// @param Flags          Flags, e.g. artificial variable.
460     /// @param ArgNo       If this variable is an arugment then this argument's
461     ///                    number. 1 indicates 1st argument.
462     DIVariable createLocalVariable(unsigned Tag, DIDescriptor Scope,
463                                    StringRef Name,
464                                    DIFile File, unsigned LineNo,
465                                    DIType Ty, bool AlwaysPreserve = false,
466                                    unsigned Flags = 0,
467                                    unsigned ArgNo = 0);
468
469
470     /// createComplexVariable - Create a new descriptor for the specified
471     /// variable which has a complex address expression for its address.
472     /// @param Tag         Dwarf TAG. Usually DW_TAG_auto_variable or
473     ///                    DW_TAG_arg_variable.
474     /// @param Scope       Variable scope.
475     /// @param Name        Variable name.
476     /// @param F           File where this variable is defined.
477     /// @param LineNo      Line number.
478     /// @param Ty          Variable Type
479     /// @param Addr        An array of complex address operations.
480     /// @param ArgNo       If this variable is an arugment then this argument's
481     ///                    number. 1 indicates 1st argument.
482     DIVariable createComplexVariable(unsigned Tag, DIDescriptor Scope,
483                                      StringRef Name, DIFile F, unsigned LineNo,
484                                      DIType Ty, ArrayRef<Value *> Addr,
485                                      unsigned ArgNo = 0);
486
487     /// createFunction - Create a new descriptor for the specified subprogram.
488     /// See comments in DISubprogram for descriptions of these fields.
489     /// @param Scope         Function scope.
490     /// @param Name          Function name.
491     /// @param LinkageName   Mangled function name.
492     /// @param File          File where this variable is defined.
493     /// @param LineNo        Line number.
494     /// @param Ty            Function type.
495     /// @param isLocalToUnit True if this function is not externally visible..
496     /// @param isDefinition  True if this is a function definition.
497     /// @param ScopeLine     Set to the beginning of the scope this starts
498     /// @param Flags         e.g. is this function prototyped or not.
499     ///                      This flags are used to emit dwarf attributes.
500     /// @param isOptimized   True if optimization is ON.
501     /// @param Fn            llvm::Function pointer.
502     /// @param TParam        Function template parameters.
503     DISubprogram createFunction(DIDescriptor Scope, StringRef Name,
504                                 StringRef LinkageName,
505                                 DIFile File, unsigned LineNo,
506                                 DIType Ty, bool isLocalToUnit,
507                                 bool isDefinition,
508                                 unsigned ScopeLine,
509                                 unsigned Flags = 0,
510                                 bool isOptimized = false,
511                                 Function *Fn = 0,
512                                 MDNode *TParam = 0,
513                                 MDNode *Decl = 0);
514
515     /// createMethod - Create a new descriptor for the specified C++ method.
516     /// See comments in DISubprogram for descriptions of these fields.
517     /// @param Scope         Function scope.
518     /// @param Name          Function name.
519     /// @param LinkageName   Mangled function name.
520     /// @param File          File where this variable is defined.
521     /// @param LineNo        Line number.
522     /// @param Ty            Function type.
523     /// @param isLocalToUnit True if this function is not externally visible..
524     /// @param isDefinition  True if this is a function definition.
525     /// @param Virtuality    Attributes describing virtualness. e.g. pure 
526     ///                      virtual function.
527     /// @param VTableIndex   Index no of this method in virtual table.
528     /// @param VTableHolder  Type that holds vtable.
529     /// @param Flags         e.g. is this function prototyped or not.
530     ///                      This flags are used to emit dwarf attributes.
531     /// @param isOptimized   True if optimization is ON.
532     /// @param Fn            llvm::Function pointer.
533     /// @param TParam        Function template parameters.
534     DISubprogram createMethod(DIDescriptor Scope, StringRef Name,
535                               StringRef LinkageName,
536                               DIFile File, unsigned LineNo,
537                               DIType Ty, bool isLocalToUnit,
538                               bool isDefinition,
539                               unsigned Virtuality = 0, unsigned VTableIndex = 0,
540                               MDNode *VTableHolder = 0,
541                               unsigned Flags = 0,
542                               bool isOptimized = false,
543                               Function *Fn = 0,
544                               MDNode *TParam = 0);
545
546     /// createNameSpace - This creates new descriptor for a namespace
547     /// with the specified parent scope.
548     /// @param Scope       Namespace scope
549     /// @param Name        Name of this namespace
550     /// @param File        Source file
551     /// @param LineNo      Line number
552     DINameSpace createNameSpace(DIDescriptor Scope, StringRef Name,
553                                 DIFile File, unsigned LineNo);
554
555
556     /// createLexicalBlockFile - This creates a descriptor for a lexical
557     /// block with a new file attached. This merely extends the existing
558     /// lexical block as it crosses a file.
559     /// @param Scope       Lexical block.
560     /// @param File        Source file.
561     DILexicalBlockFile createLexicalBlockFile(DIDescriptor Scope,
562                                               DIFile File);
563     
564     /// createLexicalBlock - This creates a descriptor for a lexical block
565     /// with the specified parent context.
566     /// @param Scope       Parent lexical scope.
567     /// @param File        Source file
568     /// @param Line        Line number
569     /// @param Col         Column number
570     DILexicalBlock createLexicalBlock(DIDescriptor Scope, DIFile File,
571                                       unsigned Line, unsigned Col);
572
573     /// \brief Create a descriptor for an imported module.
574     /// @param Context The scope this module is imported into
575     /// @param NS The namespace being imported here
576     /// @param LineNumber Line number
577     DIImportedModule createImportedModule(DIScope Context, DINameSpace NS,
578                                           unsigned Line);
579
580     /// insertDeclare - Insert a new llvm.dbg.declare intrinsic call.
581     /// @param Storage     llvm::Value of the variable
582     /// @param VarInfo     Variable's debug info descriptor.
583     /// @param InsertAtEnd Location for the new intrinsic.
584     Instruction *insertDeclare(llvm::Value *Storage, DIVariable VarInfo,
585                                BasicBlock *InsertAtEnd);
586
587     /// insertDeclare - Insert a new llvm.dbg.declare intrinsic call.
588     /// @param Storage      llvm::Value of the variable
589     /// @param VarInfo      Variable's debug info descriptor.
590     /// @param InsertBefore Location for the new intrinsic.
591     Instruction *insertDeclare(llvm::Value *Storage, DIVariable VarInfo,
592                                Instruction *InsertBefore);
593
594
595     /// insertDbgValueIntrinsic - Insert a new llvm.dbg.value intrinsic call.
596     /// @param Val          llvm::Value of the variable
597     /// @param Offset       Offset
598     /// @param VarInfo      Variable's debug info descriptor.
599     /// @param InsertAtEnd Location for the new intrinsic.
600     Instruction *insertDbgValueIntrinsic(llvm::Value *Val, uint64_t Offset,
601                                          DIVariable VarInfo, 
602                                          BasicBlock *InsertAtEnd);
603     
604     /// insertDbgValueIntrinsic - Insert a new llvm.dbg.value intrinsic call.
605     /// @param Val          llvm::Value of the variable
606     /// @param Offset       Offset
607     /// @param VarInfo      Variable's debug info descriptor.
608     /// @param InsertBefore Location for the new intrinsic.
609     Instruction *insertDbgValueIntrinsic(llvm::Value *Val, uint64_t Offset,
610                                          DIVariable VarInfo, 
611                                          Instruction *InsertBefore);
612
613   };
614 } // end namespace llvm
615
616 #endif