1 //===- DIBuilder.h - Debug Information Builder ------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines a DIBuilder that is useful for creating debugging
11 // information entries in LLVM IR form.
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_IR_DIBUILDER_H
16 #define LLVM_IR_DIBUILDER_H
18 #include "llvm/ADT/ArrayRef.h"
19 #include "llvm/ADT/StringRef.h"
20 #include "llvm/IR/DebugInfo.h"
21 #include "llvm/IR/ValueHandle.h"
22 #include "llvm/Support/DataTypes.h"
35 class DICompositeType;
42 class DIGlobalVariable;
43 class DIImportedEntity;
47 class DILexicalBlockFile;
51 class DITemplateTypeParameter;
52 class DITemplateValueParameter;
58 LLVMContext &VMContext;
60 MDNode *TempEnumTypes;
61 MDNode *TempRetainTypes;
62 MDNode *TempSubprograms;
64 MDNode *TempImportedModules;
66 Function *DeclareFn; // llvm.dbg.declare
67 Function *ValueFn; // llvm.dbg.value
69 SmallVector<Value *, 4> AllEnumTypes;
70 /// Use TrackingVH to collect RetainTypes, since they can be updated
72 SmallVector<TrackingVH<MDNode>, 4> AllRetainTypes;
73 SmallVector<Value *, 4> AllSubprograms;
74 SmallVector<Value *, 4> AllGVs;
75 SmallVector<TrackingVH<MDNode>, 4> AllImportedModules;
77 // Private use for multiple types of template parameters.
78 DITemplateValueParameter
79 createTemplateValueParameter(unsigned Tag, DIDescriptor Scope,
80 StringRef Name, DIType Ty, Value *Val,
81 MDNode *File = 0, unsigned LineNo = 0,
82 unsigned ColumnNo = 0);
84 DIBuilder(const DIBuilder &) LLVM_DELETED_FUNCTION;
85 void operator=(const DIBuilder &) LLVM_DELETED_FUNCTION;
88 explicit DIBuilder(Module &M);
89 enum ComplexAddrKind { OpPlus=1, OpDeref };
90 enum DebugEmissionKind { FullDebug=1, LineTablesOnly };
92 /// finalize - Construct any deferred debug info descriptors.
95 /// createCompileUnit - A CompileUnit provides an anchor for all debugging
96 /// information generated during this instance of compilation.
97 /// @param Lang Source programming language, eg. dwarf::DW_LANG_C99
98 /// @param File File name
99 /// @param Dir Directory
100 /// @param Producer Identify the producer of debugging information and code.
101 /// Usually this is a compiler version string.
102 /// @param isOptimized A boolean flag which indicates whether optimization
104 /// @param Flags This string lists command line options. This string is
105 /// directly embedded in debug info output which may be used
106 /// by a tool analyzing generated debugging information.
107 /// @param RV This indicates runtime version for languages like
109 /// @param SplitName The name of the file that we'll split debug info out
111 DICompileUnit createCompileUnit(unsigned Lang, StringRef File,
112 StringRef Dir, StringRef Producer,
113 bool isOptimized, StringRef Flags,
115 StringRef SplitName = StringRef(),
116 DebugEmissionKind Kind = FullDebug);
118 /// createFile - Create a file descriptor to hold debugging information
120 DIFile createFile(StringRef Filename, StringRef Directory);
122 /// createEnumerator - Create a single enumerator value.
123 DIEnumerator createEnumerator(StringRef Name, int64_t Val);
125 /// \brief Create a DWARF unspecified type.
126 DIBasicType createUnspecifiedType(StringRef Name);
128 /// \brief Create C++11 nullptr type.
129 DIBasicType createNullPtrType();
131 /// createBasicType - Create debugging information entry for a basic
133 /// @param Name Type name.
134 /// @param SizeInBits Size of the type.
135 /// @param AlignInBits Type alignment.
136 /// @param Encoding DWARF encoding code, e.g. dwarf::DW_ATE_float.
137 DIBasicType createBasicType(StringRef Name, uint64_t SizeInBits,
138 uint64_t AlignInBits, unsigned Encoding);
140 /// createQualifiedType - Create debugging information entry for a qualified
141 /// type, e.g. 'const int'.
142 /// @param Tag Tag identifing type, e.g. dwarf::TAG_volatile_type
143 /// @param FromTy Base Type.
144 DIDerivedType createQualifiedType(unsigned Tag, DIType FromTy);
146 /// createPointerType - Create debugging information entry for a pointer.
147 /// @param PointeeTy Type pointed by this pointer.
148 /// @param SizeInBits Size.
149 /// @param AlignInBits Alignment. (optional)
150 /// @param Name Pointer type name. (optional)
152 createPointerType(DIType PointeeTy, uint64_t SizeInBits,
153 uint64_t AlignInBits = 0, StringRef Name = StringRef());
155 /// \brief Create debugging information entry for a pointer to member.
156 /// @param PointeeTy Type pointed to by this pointer.
157 /// @param Class Type for which this pointer points to members of.
158 DIDerivedType createMemberPointerType(DIType PointeeTy, DIType Class);
160 /// createReferenceType - Create debugging information entry for a c++
161 /// style reference or rvalue reference type.
162 DIDerivedType createReferenceType(unsigned Tag, DIType RTy);
164 /// createTypedef - Create debugging information entry for a typedef.
165 /// @param Ty Original type.
166 /// @param Name Typedef name.
167 /// @param File File where this type is defined.
168 /// @param LineNo Line number.
169 /// @param Context The surrounding context for the typedef.
170 DIDerivedType createTypedef(DIType Ty, StringRef Name, DIFile File,
171 unsigned LineNo, DIDescriptor Context);
173 /// createFriend - Create debugging information entry for a 'friend'.
174 DIDerivedType createFriend(DIType Ty, DIType FriendTy);
176 /// createInheritance - Create debugging information entry to establish
177 /// inheritance relationship between two types.
178 /// @param Ty Original type.
179 /// @param BaseTy Base type. Ty is inherits from base.
180 /// @param BaseOffset Base offset.
181 /// @param Flags Flags to describe inheritance attribute,
183 DIDerivedType createInheritance(DIType Ty, DIType BaseTy,
184 uint64_t BaseOffset, unsigned Flags);
186 /// createMemberType - Create debugging information entry for a member.
187 /// @param Scope Member scope.
188 /// @param Name Member name.
189 /// @param File File where this member is defined.
190 /// @param LineNo Line number.
191 /// @param SizeInBits Member size.
192 /// @param AlignInBits Member alignment.
193 /// @param OffsetInBits Member offset.
194 /// @param Flags Flags to encode member attribute, e.g. private
195 /// @param Ty Parent type.
197 createMemberType(DIDescriptor Scope, StringRef Name, DIFile File,
198 unsigned LineNo, uint64_t SizeInBits, uint64_t AlignInBits,
199 uint64_t OffsetInBits, unsigned Flags, DIType Ty);
201 /// createStaticMemberType - Create debugging information entry for a
202 /// C++ static data member.
203 /// @param Scope Member scope.
204 /// @param Name Member name.
205 /// @param File File where this member is declared.
206 /// @param LineNo Line number.
207 /// @param Ty Type of the static member.
208 /// @param Flags Flags to encode member attribute, e.g. private.
209 /// @param Val Const initializer of the member.
211 createStaticMemberType(DIDescriptor Scope, StringRef Name,
212 DIFile File, unsigned LineNo, DIType Ty,
213 unsigned Flags, llvm::Value *Val);
215 /// createObjCIVar - Create debugging information entry for Objective-C
216 /// instance variable.
217 /// @param Name Member name.
218 /// @param File File where this member is defined.
219 /// @param LineNo Line number.
220 /// @param SizeInBits Member size.
221 /// @param AlignInBits Member alignment.
222 /// @param OffsetInBits Member offset.
223 /// @param Flags Flags to encode member attribute, e.g. private
224 /// @param Ty Parent type.
225 /// @param PropertyName Name of the Objective C property associated with
227 /// @param PropertyGetterName Name of the Objective C property getter
229 /// @param PropertySetterName Name of the Objective C property setter
231 /// @param PropertyAttributes Objective C property attributes.
232 DIDerivedType createObjCIVar(StringRef Name, DIFile File,
233 unsigned LineNo, uint64_t SizeInBits,
234 uint64_t AlignInBits, uint64_t OffsetInBits,
235 unsigned Flags, DIType Ty,
236 StringRef PropertyName = StringRef(),
237 StringRef PropertyGetterName = StringRef(),
238 StringRef PropertySetterName = StringRef(),
239 unsigned PropertyAttributes = 0);
241 /// createObjCIVar - Create debugging information entry for Objective-C
242 /// instance variable.
243 /// @param Name Member name.
244 /// @param File File where this member is defined.
245 /// @param LineNo Line number.
246 /// @param SizeInBits Member size.
247 /// @param AlignInBits Member alignment.
248 /// @param OffsetInBits Member offset.
249 /// @param Flags Flags to encode member attribute, e.g. private
250 /// @param Ty Parent type.
251 /// @param PropertyNode Property associated with this ivar.
252 DIDerivedType createObjCIVar(StringRef Name, DIFile File,
253 unsigned LineNo, uint64_t SizeInBits,
254 uint64_t AlignInBits, uint64_t OffsetInBits,
255 unsigned Flags, DIType Ty,
256 MDNode *PropertyNode);
258 /// createObjCProperty - Create debugging information entry for Objective-C
260 /// @param Name Property name.
261 /// @param File File where this property is defined.
262 /// @param LineNumber Line number.
263 /// @param GetterName Name of the Objective C property getter selector.
264 /// @param SetterName Name of the Objective C property setter selector.
265 /// @param PropertyAttributes Objective C property attributes.
267 DIObjCProperty createObjCProperty(StringRef Name,
268 DIFile File, unsigned LineNumber,
269 StringRef GetterName,
270 StringRef SetterName,
271 unsigned PropertyAttributes,
274 /// createClassType - Create debugging information entry for a class.
275 /// @param Scope Scope in which this class is defined.
276 /// @param Name class name.
277 /// @param File File where this member is defined.
278 /// @param LineNumber Line number.
279 /// @param SizeInBits Member size.
280 /// @param AlignInBits Member alignment.
281 /// @param OffsetInBits Member offset.
282 /// @param Flags Flags to encode member attribute, e.g. private
283 /// @param Elements class members.
284 /// @param VTableHolder Debug info of the base class that contains vtable
285 /// for this type. This is used in
286 /// DW_AT_containing_type. See DWARF documentation
288 /// @param TemplateParms Template type parameters.
289 /// @param UniqueIdentifier A unique identifier for the class.
290 DICompositeType createClassType(DIDescriptor Scope, StringRef Name,
291 DIFile File, unsigned LineNumber,
292 uint64_t SizeInBits, uint64_t AlignInBits,
293 uint64_t OffsetInBits, unsigned Flags,
294 DIType DerivedFrom, DIArray Elements,
295 DIType VTableHolder = DIType(),
296 MDNode *TemplateParms = 0,
297 StringRef UniqueIdentifier = StringRef());
299 /// createStructType - Create debugging information entry for a struct.
300 /// @param Scope Scope in which this struct is defined.
301 /// @param Name Struct name.
302 /// @param File File where this member is defined.
303 /// @param LineNumber Line number.
304 /// @param SizeInBits Member size.
305 /// @param AlignInBits Member alignment.
306 /// @param Flags Flags to encode member attribute, e.g. private
307 /// @param Elements Struct elements.
308 /// @param RunTimeLang Optional parameter, Objective-C runtime version.
309 /// @param UniqueIdentifier A unique identifier for the struct.
310 DICompositeType createStructType(DIDescriptor Scope, StringRef Name,
311 DIFile File, unsigned LineNumber,
312 uint64_t SizeInBits, uint64_t AlignInBits,
313 unsigned Flags, DIType DerivedFrom,
314 DIArray Elements, unsigned RunTimeLang = 0,
315 DIType VTableHolder = DIType(),
316 StringRef UniqueIdentifier = StringRef());
318 /// createUnionType - Create debugging information entry for an union.
319 /// @param Scope Scope in which this union is defined.
320 /// @param Name Union name.
321 /// @param File File where this member is defined.
322 /// @param LineNumber Line number.
323 /// @param SizeInBits Member size.
324 /// @param AlignInBits Member alignment.
325 /// @param Flags Flags to encode member attribute, e.g. private
326 /// @param Elements Union elements.
327 /// @param RunTimeLang Optional parameter, Objective-C runtime version.
328 /// @param UniqueIdentifier A unique identifier for the union.
329 DICompositeType createUnionType(
330 DIDescriptor Scope, StringRef Name, DIFile File, unsigned LineNumber,
331 uint64_t SizeInBits, uint64_t AlignInBits, unsigned Flags,
332 DIArray Elements, unsigned RunTimeLang = 0,
333 StringRef UniqueIdentifier = StringRef());
335 /// createTemplateTypeParameter - Create debugging information for template
337 /// @param Scope Scope in which this type is defined.
338 /// @param Name Type parameter name.
339 /// @param Ty Parameter type.
340 /// @param File File where this type parameter is defined.
341 /// @param LineNo Line number.
342 /// @param ColumnNo Column Number.
343 DITemplateTypeParameter
344 createTemplateTypeParameter(DIDescriptor Scope, StringRef Name, DIType Ty,
345 MDNode *File = 0, unsigned LineNo = 0,
346 unsigned ColumnNo = 0);
348 /// createTemplateValueParameter - Create debugging information for template
350 /// @param Scope Scope in which this type is defined.
351 /// @param Name Value parameter name.
352 /// @param Ty Parameter type.
353 /// @param Val Constant parameter value.
354 /// @param File File where this type parameter is defined.
355 /// @param LineNo Line number.
356 /// @param ColumnNo Column Number.
357 DITemplateValueParameter
358 createTemplateValueParameter(DIDescriptor Scope, StringRef Name,
359 DIType Ty, Value *Val, MDNode *File = 0,
360 unsigned LineNo = 0, unsigned ColumnNo = 0);
362 /// \brief Create debugging information for a template template parameter.
363 /// @param Scope Scope in which this type is defined.
364 /// @param Name Value parameter name.
365 /// @param Ty Parameter type.
366 /// @param Val The fully qualified name of the template.
367 /// @param File File where this type parameter is defined.
368 /// @param LineNo Line number.
369 /// @param ColumnNo Column Number.
370 DITemplateValueParameter
371 createTemplateTemplateParameter(DIDescriptor Scope, StringRef Name,
372 DIType Ty, StringRef Val, MDNode *File = 0,
373 unsigned LineNo = 0, unsigned ColumnNo = 0);
375 /// \brief Create debugging information for a template parameter pack.
376 /// @param Scope Scope in which this type is defined.
377 /// @param Name Value parameter name.
378 /// @param Ty Parameter type.
379 /// @param Val An array of types in the pack.
380 /// @param File File where this type parameter is defined.
381 /// @param LineNo Line number.
382 /// @param ColumnNo Column Number.
383 DITemplateValueParameter
384 createTemplateParameterPack(DIDescriptor Scope, StringRef Name,
385 DIType Ty, DIArray Val, MDNode *File = 0,
386 unsigned LineNo = 0, unsigned ColumnNo = 0);
388 /// createArrayType - Create debugging information entry for an array.
389 /// @param Size Array size.
390 /// @param AlignInBits Alignment.
391 /// @param Ty Element type.
392 /// @param Subscripts Subscripts.
393 DICompositeType createArrayType(uint64_t Size, uint64_t AlignInBits,
394 DIType Ty, DIArray Subscripts);
396 /// createVectorType - Create debugging information entry for a vector type.
397 /// @param Size Array size.
398 /// @param AlignInBits Alignment.
399 /// @param Ty Element type.
400 /// @param Subscripts Subscripts.
401 DICompositeType createVectorType(uint64_t Size, uint64_t AlignInBits,
402 DIType Ty, DIArray Subscripts);
404 /// createEnumerationType - Create debugging information entry for an
406 /// @param Scope Scope in which this enumeration is defined.
407 /// @param Name Union name.
408 /// @param File File where this member is defined.
409 /// @param LineNumber Line number.
410 /// @param SizeInBits Member size.
411 /// @param AlignInBits Member alignment.
412 /// @param Elements Enumeration elements.
413 /// @param UnderlyingType Underlying type of a C++11/ObjC fixed enum.
414 /// @param UniqueIdentifier A unique identifier for the enum.
415 DICompositeType createEnumerationType(DIDescriptor Scope, StringRef Name,
416 DIFile File, unsigned LineNumber, uint64_t SizeInBits,
417 uint64_t AlignInBits, DIArray Elements, DIType UnderlyingType,
418 StringRef UniqueIdentifier = StringRef());
420 /// createSubroutineType - Create subroutine type.
421 /// @param File File in which this subroutine is defined.
422 /// @param ParameterTypes An array of subroutine parameter types. This
423 /// includes return type at 0th index.
424 /// @param Flags E.g.: LValueReference.
425 /// These flags are used to emit dwarf attributes.
426 DICompositeType createSubroutineType(DIFile File, DIArray ParameterTypes,
429 /// createArtificialType - Create a new DIType with "artificial" flag set.
430 DIType createArtificialType(DIType Ty);
432 /// createObjectPointerType - Create a new DIType with the "object pointer"
434 DIType createObjectPointerType(DIType Ty);
436 /// createForwardDecl - Create a temporary forward-declared type.
437 DICompositeType createForwardDecl(unsigned Tag, StringRef Name,
438 DIDescriptor Scope, DIFile F,
439 unsigned Line, unsigned RuntimeLang = 0,
440 uint64_t SizeInBits = 0,
441 uint64_t AlignInBits = 0,
442 StringRef UniqueIdentifier = StringRef());
444 /// retainType - Retain DIType in a module even if it is not referenced
445 /// through debug info anchors.
446 void retainType(DIType T);
448 /// createUnspecifiedParameter - Create unspecified type descriptor
449 /// for a subroutine type.
450 DIDescriptor createUnspecifiedParameter();
452 /// getOrCreateArray - Get a DIArray, create one if required.
453 DIArray getOrCreateArray(ArrayRef<Value *> Elements);
455 /// getOrCreateSubrange - Create a descriptor for a value range. This
456 /// implicitly uniques the values returned.
457 DISubrange getOrCreateSubrange(int64_t Lo, int64_t Count);
459 /// createGlobalVariable - Create a new descriptor for the specified global.
460 /// @param Name Name of the variable.
461 /// @param File File where this variable is defined.
462 /// @param LineNo Line number.
463 /// @param Ty Variable Type.
464 /// @param isLocalToUnit Boolean flag indicate whether this variable is
465 /// externally visible or not.
466 /// @param Val llvm::Value of the variable.
468 createGlobalVariable(StringRef Name, DIFile File, unsigned LineNo,
469 DITypeRef Ty, bool isLocalToUnit, llvm::Value *Val);
471 /// \brief Create a new descriptor for the specified global.
472 /// @param Name Name of the variable.
473 /// @param LinkageName Mangled variable name.
474 /// @param File File where this variable is defined.
475 /// @param LineNo Line number.
476 /// @param Ty Variable Type.
477 /// @param isLocalToUnit Boolean flag indicate whether this variable is
478 /// externally visible or not.
479 /// @param Val llvm::Value of the variable.
481 createGlobalVariable(StringRef Name, StringRef LinkageName, DIFile File,
482 unsigned LineNo, DITypeRef Ty, bool isLocalToUnit,
485 /// createStaticVariable - Create a new descriptor for the specified
487 /// @param Context Variable scope.
488 /// @param Name Name of the variable.
489 /// @param LinkageName Mangled name of the variable.
490 /// @param File File where this variable is defined.
491 /// @param LineNo Line number.
492 /// @param Ty Variable Type.
493 /// @param isLocalToUnit Boolean flag indicate whether this variable is
494 /// externally visible or not.
495 /// @param Val llvm::Value of the variable.
496 /// @param Decl Reference to the corresponding declaration.
498 createStaticVariable(DIDescriptor Context, StringRef Name,
499 StringRef LinkageName, DIFile File, unsigned LineNo,
500 DITypeRef Ty, bool isLocalToUnit, llvm::Value *Val,
501 MDNode *Decl = NULL);
504 /// createLocalVariable - Create a new descriptor for the specified
506 /// @param Tag Dwarf TAG. Usually DW_TAG_auto_variable or
507 /// DW_TAG_arg_variable.
508 /// @param Scope Variable scope.
509 /// @param Name Variable name.
510 /// @param File File where this variable is defined.
511 /// @param LineNo Line number.
512 /// @param Ty Variable Type
513 /// @param AlwaysPreserve Boolean. Set to true if debug info for this
514 /// variable should be preserved in optimized build.
515 /// @param Flags Flags, e.g. artificial variable.
516 /// @param ArgNo If this variable is an argument then this argument's
517 /// number. 1 indicates 1st argument.
518 DIVariable createLocalVariable(unsigned Tag, DIDescriptor Scope,
520 DIFile File, unsigned LineNo,
521 DITypeRef Ty, bool AlwaysPreserve = false,
526 /// createComplexVariable - Create a new descriptor for the specified
527 /// variable which has a complex address expression for its address.
528 /// @param Tag Dwarf TAG. Usually DW_TAG_auto_variable or
529 /// DW_TAG_arg_variable.
530 /// @param Scope Variable scope.
531 /// @param Name Variable name.
532 /// @param F File where this variable is defined.
533 /// @param LineNo Line number.
534 /// @param Ty Variable Type
535 /// @param Addr An array of complex address operations.
536 /// @param ArgNo If this variable is an argument then this argument's
537 /// number. 1 indicates 1st argument.
538 DIVariable createComplexVariable(unsigned Tag, DIDescriptor Scope,
539 StringRef Name, DIFile F, unsigned LineNo,
540 DITypeRef Ty, ArrayRef<Value *> Addr,
543 /// createFunction - Create a new descriptor for the specified subprogram.
544 /// See comments in DISubprogram for descriptions of these fields.
545 /// @param Scope Function scope.
546 /// @param Name Function name.
547 /// @param LinkageName Mangled function name.
548 /// @param File File where this variable is defined.
549 /// @param LineNo Line number.
550 /// @param Ty Function type.
551 /// @param isLocalToUnit True if this function is not externally visible.
552 /// @param isDefinition True if this is a function definition.
553 /// @param ScopeLine Set to the beginning of the scope this starts
554 /// @param Flags e.g. is this function prototyped or not.
555 /// These flags are used to emit dwarf attributes.
556 /// @param isOptimized True if optimization is ON.
557 /// @param Fn llvm::Function pointer.
558 /// @param TParam Function template parameters.
559 DISubprogram createFunction(DIDescriptor Scope, StringRef Name,
560 StringRef LinkageName,
561 DIFile File, unsigned LineNo,
562 DICompositeType Ty, bool isLocalToUnit,
566 bool isOptimized = false,
571 /// FIXME: this is added for dragonegg. Once we update dragonegg
572 /// to call resolve function, this will be removed.
573 DISubprogram createFunction(DIScopeRef Scope, StringRef Name,
574 StringRef LinkageName,
575 DIFile File, unsigned LineNo,
576 DICompositeType Ty, bool isLocalToUnit,
580 bool isOptimized = false,
585 /// createMethod - Create a new descriptor for the specified C++ method.
586 /// See comments in DISubprogram for descriptions of these fields.
587 /// @param Scope Function scope.
588 /// @param Name Function name.
589 /// @param LinkageName Mangled function name.
590 /// @param File File where this variable is defined.
591 /// @param LineNo Line number.
592 /// @param Ty Function type.
593 /// @param isLocalToUnit True if this function is not externally visible..
594 /// @param isDefinition True if this is a function definition.
595 /// @param Virtuality Attributes describing virtualness. e.g. pure
596 /// virtual function.
597 /// @param VTableIndex Index no of this method in virtual table.
598 /// @param VTableHolder Type that holds vtable.
599 /// @param Flags e.g. is this function prototyped or not.
600 /// This flags are used to emit dwarf attributes.
601 /// @param isOptimized True if optimization is ON.
602 /// @param Fn llvm::Function pointer.
603 /// @param TParam Function template parameters.
604 DISubprogram createMethod(DIDescriptor Scope, StringRef Name,
605 StringRef LinkageName,
606 DIFile File, unsigned LineNo,
607 DICompositeType Ty, bool isLocalToUnit,
609 unsigned Virtuality = 0, unsigned VTableIndex = 0,
610 DIType VTableHolder = DIType(),
612 bool isOptimized = false,
616 /// createNameSpace - This creates new descriptor for a namespace
617 /// with the specified parent scope.
618 /// @param Scope Namespace scope
619 /// @param Name Name of this namespace
620 /// @param File Source file
621 /// @param LineNo Line number
622 DINameSpace createNameSpace(DIDescriptor Scope, StringRef Name,
623 DIFile File, unsigned LineNo);
626 /// createLexicalBlockFile - This creates a descriptor for a lexical
627 /// block with a new file attached. This merely extends the existing
628 /// lexical block as it crosses a file.
629 /// @param Scope Lexical block.
630 /// @param File Source file.
631 DILexicalBlockFile createLexicalBlockFile(DIDescriptor Scope,
634 /// createLexicalBlock - This creates a descriptor for a lexical block
635 /// with the specified parent context.
636 /// @param Scope Parent lexical scope.
637 /// @param File Source file.
638 /// @param Line Line number.
639 /// @param Col Column number.
640 /// @param Discriminator DWARF path discriminator value.
641 DILexicalBlock createLexicalBlock(DIDescriptor Scope, DIFile File,
642 unsigned Line, unsigned Col,
643 unsigned Discriminator);
645 /// \brief Create a descriptor for an imported module.
646 /// @param Context The scope this module is imported into
647 /// @param NS The namespace being imported here
648 /// @param Line Line number
649 DIImportedEntity createImportedModule(DIScope Context, DINameSpace NS,
651 StringRef Name = StringRef());
653 /// \brief Create a descriptor for an imported module.
654 /// @param Context The scope this module is imported into
655 /// @param NS An aliased namespace
656 /// @param Line Line number
657 DIImportedEntity createImportedModule(DIScope Context, DIImportedEntity NS,
658 unsigned Line, StringRef Name);
660 /// \brief Create a descriptor for an imported function.
661 /// @param Context The scope this module is imported into
662 /// @param Decl The declaration (or definition) of a function, type, or
664 /// @param Line Line number
665 DIImportedEntity createImportedDeclaration(DIScope Context,
669 /// insertDeclare - Insert a new llvm.dbg.declare intrinsic call.
670 /// @param Storage llvm::Value of the variable
671 /// @param VarInfo Variable's debug info descriptor.
672 /// @param InsertAtEnd Location for the new intrinsic.
673 Instruction *insertDeclare(llvm::Value *Storage, DIVariable VarInfo,
674 BasicBlock *InsertAtEnd);
676 /// insertDeclare - Insert a new llvm.dbg.declare intrinsic call.
677 /// @param Storage llvm::Value of the variable
678 /// @param VarInfo Variable's debug info descriptor.
679 /// @param InsertBefore Location for the new intrinsic.
680 Instruction *insertDeclare(llvm::Value *Storage, DIVariable VarInfo,
681 Instruction *InsertBefore);
684 /// insertDbgValueIntrinsic - Insert a new llvm.dbg.value intrinsic call.
685 /// @param Val llvm::Value of the variable
686 /// @param Offset Offset
687 /// @param VarInfo Variable's debug info descriptor.
688 /// @param InsertAtEnd Location for the new intrinsic.
689 Instruction *insertDbgValueIntrinsic(llvm::Value *Val, uint64_t Offset,
691 BasicBlock *InsertAtEnd);
693 /// insertDbgValueIntrinsic - Insert a new llvm.dbg.value intrinsic call.
694 /// @param Val llvm::Value of the variable
695 /// @param Offset Offset
696 /// @param VarInfo Variable's debug info descriptor.
697 /// @param InsertBefore Location for the new intrinsic.
698 Instruction *insertDbgValueIntrinsic(llvm::Value *Val, uint64_t Offset,
700 Instruction *InsertBefore);
703 } // end namespace llvm