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