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