1 //===--- llvm/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_DIBUILDER_H
16 #define LLVM_DIBUILDER_H
18 #include "llvm/ADT/ArrayRef.h"
19 #include "llvm/ADT/StringRef.h"
20 #include "llvm/DebugInfo.h"
21 #include "llvm/Support/DataTypes.h"
22 #include "llvm/Support/ValueHandle.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<Value *, 4> AllImportedModules;
77 DITemplateValueParameter
78 createTemplateValueParameter(unsigned Tag, DIDescriptor Scope,
79 StringRef Name, DIType Ty, Value *Val,
80 MDNode *File = 0, unsigned LineNo = 0,
81 unsigned ColumnNo = 0);
83 DIBuilder(const DIBuilder &) LLVM_DELETED_FUNCTION;
84 void operator=(const DIBuilder &) LLVM_DELETED_FUNCTION;
87 explicit DIBuilder(Module &M);
88 enum ComplexAddrKind { OpPlus=1, OpDeref };
90 /// finalize - Construct any deferred debug info descriptors.
93 /// createCompileUnit - A CompileUnit provides an anchor for all debugging
94 /// information generated during this instance of compilation.
95 /// @param Lang Source programming language, eg. dwarf::DW_LANG_C99
96 /// @param File File name
97 /// @param Dir Directory
98 /// @param Producer String identify producer of debugging information.
99 /// Usuall this is a compiler version string.
100 /// @param isOptimized A boolean flag which indicates whether optimization
102 /// @param Flags This string lists command line options. This string is
103 /// directly embedded in debug info output which may be used
104 /// by a tool analyzing generated debugging information.
105 /// @param RV This indicates runtime version for languages like
107 /// @param SplitName The name of the file that we'll split debug info out
109 DICompileUnit createCompileUnit(unsigned Lang, StringRef File,
110 StringRef Dir, StringRef Producer,
111 bool isOptimized, StringRef Flags,
113 StringRef SplitName = StringRef());
115 /// createFile - Create a file descriptor to hold debugging information
117 DIFile createFile(StringRef Filename, StringRef Directory);
119 /// createEnumerator - Create a single enumerator value.
120 DIEnumerator createEnumerator(StringRef Name, int64_t Val);
122 /// \brief Create a DWARF unspecified type.
123 DIBasicType createUnspecifiedType(StringRef Name);
125 /// \brief Create C++11 nullptr type.
126 DIBasicType createNullPtrType();
128 /// createBasicType - Create debugging information entry for a basic
130 /// @param Name Type name.
131 /// @param SizeInBits Size of the type.
132 /// @param AlignInBits Type alignment.
133 /// @param Encoding DWARF encoding code, e.g. dwarf::DW_ATE_float.
134 DIBasicType createBasicType(StringRef Name, uint64_t SizeInBits,
135 uint64_t AlignInBits, unsigned Encoding);
137 /// createQualifiedType - Create debugging information entry for a qualified
138 /// type, e.g. 'const int'.
139 /// @param Tag Tag identifing type, e.g. dwarf::TAG_volatile_type
140 /// @param FromTy Base Type.
141 DIDerivedType createQualifiedType(unsigned Tag, DIType FromTy);
143 /// createPointerType - Create debugging information entry for a pointer.
144 /// @param PointeeTy Type pointed by this pointer.
145 /// @param SizeInBits Size.
146 /// @param AlignInBits Alignment. (optional)
147 /// @param Name Pointer type name. (optional)
149 createPointerType(DIType PointeeTy, uint64_t SizeInBits,
150 uint64_t AlignInBits = 0, StringRef Name = StringRef());
152 /// \brief Create debugging information entry for a pointer to member.
153 /// @param PointeeTy Type pointed to by this pointer.
154 /// @param Class Type for which this pointer points to members of.
155 DIDerivedType createMemberPointerType(DIType PointeeTy, DIType Class);
157 /// createReferenceType - Create debugging information entry for a c++
158 /// style reference or rvalue reference type.
159 DIDerivedType createReferenceType(unsigned Tag, DIType RTy);
161 /// createTypedef - Create debugging information entry for a typedef.
162 /// @param Ty Original type.
163 /// @param Name Typedef name.
164 /// @param File File where this type is defined.
165 /// @param LineNo Line number.
166 /// @param Context The surrounding context for the typedef.
167 DIDerivedType createTypedef(DIType Ty, StringRef Name, DIFile File,
168 unsigned LineNo, DIDescriptor Context);
170 /// createFriend - Create debugging information entry for a 'friend'.
171 DIDerivedType createFriend(DIType Ty, DIType FriendTy);
173 /// createInheritance - Create debugging information entry to establish
174 /// inheritance relationship between two types.
175 /// @param Ty Original type.
176 /// @param BaseTy Base type. Ty is inherits from base.
177 /// @param BaseOffset Base offset.
178 /// @param Flags Flags to describe inheritance attribute,
180 DIDerivedType createInheritance(DIType Ty, DIType BaseTy,
181 uint64_t BaseOffset, unsigned Flags);
183 /// createMemberType - Create debugging information entry for a member.
184 /// @param Scope Member scope.
185 /// @param Name Member name.
186 /// @param File File where this member is defined.
187 /// @param LineNo Line number.
188 /// @param SizeInBits Member size.
189 /// @param AlignInBits Member alignment.
190 /// @param OffsetInBits Member offset.
191 /// @param Flags Flags to encode member attribute, e.g. private
192 /// @param Ty Parent type.
194 createMemberType(DIDescriptor Scope, StringRef Name, DIFile File,
195 unsigned LineNo, uint64_t SizeInBits, uint64_t AlignInBits,
196 uint64_t OffsetInBits, unsigned Flags, DIType Ty);
198 /// createStaticMemberType - Create debugging information entry for a
199 /// C++ static data member.
200 /// @param Scope Member scope.
201 /// @param Name Member name.
202 /// @param File File where this member is declared.
203 /// @param LineNo Line number.
204 /// @param Ty Type of the static member.
205 /// @param Flags Flags to encode member attribute, e.g. private.
206 /// @param Val Const initializer of the member.
208 createStaticMemberType(DIDescriptor Scope, StringRef Name,
209 DIFile File, unsigned LineNo, DIType Ty,
210 unsigned Flags, llvm::Value *Val);
212 /// createObjCIVar - Create debugging information entry for Objective-C
213 /// instance variable.
214 /// @param Name Member name.
215 /// @param File File where this member is defined.
216 /// @param LineNo Line number.
217 /// @param SizeInBits Member size.
218 /// @param AlignInBits Member alignment.
219 /// @param OffsetInBits Member offset.
220 /// @param Flags Flags to encode member attribute, e.g. private
221 /// @param Ty Parent type.
222 /// @param PropertyName Name of the Objective C property associated with
224 /// @param PropertyGetterName Name of the Objective C property getter
226 /// @param PropertySetterName Name of the Objective C property setter
228 /// @param PropertyAttributes Objective C property attributes.
229 DIDerivedType createObjCIVar(StringRef Name, DIFile File,
230 unsigned LineNo, uint64_t SizeInBits,
231 uint64_t AlignInBits, uint64_t OffsetInBits,
232 unsigned Flags, DIType Ty,
233 StringRef PropertyName = StringRef(),
234 StringRef PropertyGetterName = StringRef(),
235 StringRef PropertySetterName = StringRef(),
236 unsigned PropertyAttributes = 0);
238 /// createObjCIVar - Create debugging information entry for Objective-C
239 /// instance variable.
240 /// @param Name Member name.
241 /// @param File File where this member is defined.
242 /// @param LineNo Line number.
243 /// @param SizeInBits Member size.
244 /// @param AlignInBits Member alignment.
245 /// @param OffsetInBits Member offset.
246 /// @param Flags Flags to encode member attribute, e.g. private
247 /// @param Ty Parent type.
248 /// @param PropertyNode Property associated with this ivar.
249 DIDerivedType createObjCIVar(StringRef Name, DIFile File,
250 unsigned LineNo, uint64_t SizeInBits,
251 uint64_t AlignInBits, uint64_t OffsetInBits,
252 unsigned Flags, DIType Ty,
253 MDNode *PropertyNode);
255 /// createObjCProperty - Create debugging information entry for Objective-C
257 /// @param Name Property name.
258 /// @param File File where this property is defined.
259 /// @param LineNumber Line number.
260 /// @param GetterName Name of the Objective C property getter selector.
261 /// @param SetterName Name of the Objective C property setter selector.
262 /// @param PropertyAttributes Objective C property attributes.
264 DIObjCProperty createObjCProperty(StringRef Name,
265 DIFile File, unsigned LineNumber,
266 StringRef GetterName,
267 StringRef SetterName,
268 unsigned PropertyAttributes,
271 /// createClassType - Create debugging information entry for a class.
272 /// @param Scope Scope in which this class is defined.
273 /// @param Name class name.
274 /// @param File File where this member is defined.
275 /// @param LineNumber Line number.
276 /// @param SizeInBits Member size.
277 /// @param AlignInBits Member alignment.
278 /// @param OffsetInBits Member offset.
279 /// @param Flags Flags to encode member attribute, e.g. private
280 /// @param Elements class members.
281 /// @param VTableHolder Debug info of the base class that contains vtable
282 /// for this type. This is used in
283 /// DW_AT_containing_type. See DWARF documentation
285 /// @param TemplateParms Template type parameters.
286 /// @param UniqueIdentifier A unique identifier for the class.
287 DICompositeType createClassType(DIDescriptor Scope, StringRef Name,
288 DIFile File, unsigned LineNumber,
289 uint64_t SizeInBits, uint64_t AlignInBits,
290 uint64_t OffsetInBits, unsigned Flags,
291 DIType DerivedFrom, DIArray Elements,
292 DIType VTableHolder = DIType(),
293 MDNode *TemplateParms = 0,
294 StringRef UniqueIdentifier = StringRef());
296 /// createStructType - Create debugging information entry for a struct.
297 /// @param Scope Scope in which this struct is defined.
298 /// @param Name Struct name.
299 /// @param File File where this member is defined.
300 /// @param LineNumber Line number.
301 /// @param SizeInBits Member size.
302 /// @param AlignInBits Member alignment.
303 /// @param Flags Flags to encode member attribute, e.g. private
304 /// @param Elements Struct elements.
305 /// @param RunTimeLang Optional parameter, Objective-C runtime version.
306 /// @param UniqueIdentifier A unique identifier for the struct.
307 DICompositeType createStructType(DIDescriptor Scope, StringRef Name,
308 DIFile File, unsigned LineNumber,
309 uint64_t SizeInBits, uint64_t AlignInBits,
310 unsigned Flags, DIType DerivedFrom,
311 DIArray Elements, unsigned RunTimeLang = 0,
312 DIType VTableHolder = DIType(),
313 StringRef UniqueIdentifier = StringRef());
315 /// createUnionType - Create debugging information entry for an union.
316 /// @param Scope Scope in which this union is defined.
317 /// @param Name Union name.
318 /// @param File File where this member is defined.
319 /// @param LineNumber Line number.
320 /// @param SizeInBits Member size.
321 /// @param AlignInBits Member alignment.
322 /// @param Flags Flags to encode member attribute, e.g. private
323 /// @param Elements Union elements.
324 /// @param RunTimeLang Optional parameter, Objective-C runtime version.
325 /// @param UniqueIdentifier A unique identifier for the union.
326 DICompositeType createUnionType(
327 DIDescriptor Scope, StringRef Name, DIFile File, unsigned LineNumber,
328 uint64_t SizeInBits, uint64_t AlignInBits, unsigned Flags,
329 DIArray Elements, unsigned RunTimeLang = 0,
330 StringRef UniqueIdentifier = StringRef());
332 /// createTemplateTypeParameter - Create debugging information for template
334 /// @param Scope Scope in which this type is defined.
335 /// @param Name Type parameter name.
336 /// @param Ty Parameter type.
337 /// @param File File where this type parameter is defined.
338 /// @param LineNo Line number.
339 /// @param ColumnNo Column Number.
340 DITemplateTypeParameter
341 createTemplateTypeParameter(DIDescriptor Scope, StringRef Name, DIType Ty,
342 MDNode *File = 0, unsigned LineNo = 0,
343 unsigned ColumnNo = 0);
345 /// createTemplateValueParameter - Create debugging information for template
347 /// @param Scope Scope in which this type is defined.
348 /// @param Name Value parameter name.
349 /// @param Ty Parameter type.
350 /// @param Val Constant parameter value.
351 /// @param File File where this type parameter is defined.
352 /// @param LineNo Line number.
353 /// @param ColumnNo Column Number.
354 DITemplateValueParameter
355 createTemplateValueParameter(DIDescriptor Scope, StringRef Name,
356 DIType Ty, Value *Val, MDNode *File = 0,
357 unsigned LineNo = 0, unsigned ColumnNo = 0);
359 /// \brief Create debugging information for a template template parameter.
360 /// @param Scope Scope in which this type is defined.
361 /// @param Name Value parameter name.
362 /// @param Ty Parameter type.
363 /// @param Val The fully qualified name of the template.
364 /// @param File File where this type parameter is defined.
365 /// @param LineNo Line number.
366 /// @param ColumnNo Column Number.
367 DITemplateValueParameter
368 createTemplateTemplateParameter(DIDescriptor Scope, StringRef Name,
369 DIType Ty, StringRef Val, MDNode *File = 0,
370 unsigned LineNo = 0, unsigned ColumnNo = 0);
372 /// \brief Create debugging information for a template parameter pack.
373 /// @param Scope Scope in which this type is defined.
374 /// @param Name Value parameter name.
375 /// @param Ty Parameter type.
376 /// @param Val An array of types in the pack.
377 /// @param File File where this type parameter is defined.
378 /// @param LineNo Line number.
379 /// @param ColumnNo Column Number.
380 DITemplateValueParameter
381 createTemplateParameterPack(DIDescriptor Scope, StringRef Name,
382 DIType Ty, DIArray Val, MDNode *File = 0,
383 unsigned LineNo = 0, unsigned ColumnNo = 0);
385 /// createArrayType - Create debugging information entry for an array.
386 /// @param Size Array size.
387 /// @param AlignInBits Alignment.
388 /// @param Ty Element type.
389 /// @param Subscripts Subscripts.
390 DICompositeType createArrayType(uint64_t Size, uint64_t AlignInBits,
391 DIType Ty, DIArray Subscripts);
393 /// createVectorType - Create debugging information entry for a vector type.
394 /// @param Size Array size.
395 /// @param AlignInBits Alignment.
396 /// @param Ty Element type.
397 /// @param Subscripts Subscripts.
398 DICompositeType createVectorType(uint64_t Size, uint64_t AlignInBits,
399 DIType Ty, DIArray Subscripts);
401 /// createEnumerationType - Create debugging information entry for an
403 /// @param Scope Scope in which this enumeration is defined.
404 /// @param Name Union name.
405 /// @param File File where this member is defined.
406 /// @param LineNumber Line number.
407 /// @param SizeInBits Member size.
408 /// @param AlignInBits Member alignment.
409 /// @param Elements Enumeration elements.
410 /// @param UnderlyingType Underlying type of a C++11/ObjC fixed enum.
411 /// @param UniqueIdentifier A unique identifier for the enum.
412 DICompositeType createEnumerationType(DIDescriptor Scope, StringRef Name,
413 DIFile File, unsigned LineNumber, uint64_t SizeInBits,
414 uint64_t AlignInBits, DIArray Elements, DIType UnderlyingType,
415 StringRef UniqueIdentifier = StringRef());
417 /// createSubroutineType - Create subroutine type.
418 /// @param File File in which this subroutine is defined.
419 /// @param ParameterTypes An array of subroutine parameter types. This
420 /// includes return type at 0th index.
421 /// @param Flags E.g.: LValueReference.
422 /// These flags are used to emit dwarf attributes.
423 DICompositeType createSubroutineType(DIFile File, DIArray ParameterTypes,
426 /// createArtificialType - Create a new DIType with "artificial" flag set.
427 DIType createArtificialType(DIType Ty);
429 /// createObjectPointerType - Create a new DIType with the "object pointer"
431 DIType createObjectPointerType(DIType Ty);
433 /// createForwardDecl - Create a temporary forward-declared type.
434 DICompositeType createForwardDecl(unsigned Tag, StringRef Name,
435 DIDescriptor Scope, DIFile F,
436 unsigned Line, unsigned RuntimeLang = 0,
437 uint64_t SizeInBits = 0,
438 uint64_t AlignInBits = 0,
439 StringRef UniqueIdentifier = StringRef());
441 /// retainType - Retain DIType in a module even if it is not referenced
442 /// through debug info anchors.
443 void retainType(DIType T);
445 /// createUnspecifiedParameter - Create unspeicified type descriptor
446 /// for a subroutine type.
447 DIDescriptor createUnspecifiedParameter();
449 /// getOrCreateArray - Get a DIArray, create one if required.
450 DIArray getOrCreateArray(ArrayRef<Value *> Elements);
452 /// getOrCreateSubrange - Create a descriptor for a value range. This
453 /// implicitly uniques the values returned.
454 DISubrange getOrCreateSubrange(int64_t Lo, int64_t Count);
456 /// createGlobalVariable - Create a new descriptor for the specified global.
457 /// @param Name Name of the variable.
458 /// @param File File where this variable is defined.
459 /// @param LineNo Line number.
460 /// @param Ty Variable Type.
461 /// @param isLocalToUnit Boolean flag indicate whether this variable is
462 /// externally visible or not.
463 /// @param Val llvm::Value of the variable.
465 createGlobalVariable(StringRef Name, DIFile File, unsigned LineNo,
466 DIType Ty, bool isLocalToUnit, llvm::Value *Val);
468 /// \brief Create a new descriptor for the specified global.
469 /// @param Name Name of the variable.
470 /// @param LinkageName Mangled variable name.
471 /// @param File File where this variable is defined.
472 /// @param LineNo Line number.
473 /// @param Ty Variable Type.
474 /// @param isLocalToUnit Boolean flag indicate whether this variable is
475 /// externally visible or not.
476 /// @param Val llvm::Value of the variable.
478 createGlobalVariable(StringRef Name, StringRef LinkageName, DIFile File,
479 unsigned LineNo, DIType Ty, bool isLocalToUnit,
482 /// createStaticVariable - Create a new descriptor for the specified
484 /// @param Context Variable scope.
485 /// @param Name Name of the variable.
486 /// @param LinkageName Mangled name of the variable.
487 /// @param File File where this variable is defined.
488 /// @param LineNo Line number.
489 /// @param Ty Variable Type.
490 /// @param isLocalToUnit Boolean flag indicate whether this variable is
491 /// externally visible or not.
492 /// @param Val llvm::Value of the variable.
493 /// @param Decl Reference to the corresponding declaration.
495 createStaticVariable(DIDescriptor Context, StringRef Name,
496 StringRef LinkageName, DIFile File, unsigned LineNo,
497 DIType Ty, bool isLocalToUnit, llvm::Value *Val,
498 MDNode *Decl = NULL);
501 /// createLocalVariable - Create a new descriptor for the specified
503 /// @param Tag Dwarf TAG. Usually DW_TAG_auto_variable or
504 /// DW_TAG_arg_variable.
505 /// @param Scope Variable scope.
506 /// @param Name Variable name.
507 /// @param File File where this variable is defined.
508 /// @param LineNo Line number.
509 /// @param Ty Variable Type
510 /// @param AlwaysPreserve Boolean. Set to true if debug info for this
511 /// variable should be preserved in optimized build.
512 /// @param Flags Flags, e.g. artificial variable.
513 /// @param ArgNo If this variable is an argument then this argument's
514 /// number. 1 indicates 1st argument.
515 DIVariable createLocalVariable(unsigned Tag, DIDescriptor Scope,
517 DIFile File, unsigned LineNo,
518 DIType Ty, bool AlwaysPreserve = false,
523 /// createComplexVariable - Create a new descriptor for the specified
524 /// variable which has a complex address expression for its address.
525 /// @param Tag Dwarf TAG. Usually DW_TAG_auto_variable or
526 /// DW_TAG_arg_variable.
527 /// @param Scope Variable scope.
528 /// @param Name Variable name.
529 /// @param F File where this variable is defined.
530 /// @param LineNo Line number.
531 /// @param Ty Variable Type
532 /// @param Addr An array of complex address operations.
533 /// @param ArgNo If this variable is an argument then this argument's
534 /// number. 1 indicates 1st argument.
535 DIVariable createComplexVariable(unsigned Tag, DIDescriptor Scope,
536 StringRef Name, DIFile F, unsigned LineNo,
537 DIType Ty, ArrayRef<Value *> Addr,
540 /// createFunction - Create a new descriptor for the specified subprogram.
541 /// See comments in DISubprogram for descriptions of these fields.
542 /// @param Scope Function scope.
543 /// @param Name Function name.
544 /// @param LinkageName Mangled function name.
545 /// @param File File where this variable is defined.
546 /// @param LineNo Line number.
547 /// @param Ty Function type.
548 /// @param isLocalToUnit True if this function is not externally visible.
549 /// @param isDefinition True if this is a function definition.
550 /// @param ScopeLine Set to the beginning of the scope this starts
551 /// @param Flags e.g. is this function prototyped or not.
552 /// These flags are used to emit dwarf attributes.
553 /// @param isOptimized True if optimization is ON.
554 /// @param Fn llvm::Function pointer.
555 /// @param TParam Function template parameters.
556 DISubprogram createFunction(DIDescriptor Scope, StringRef Name,
557 StringRef LinkageName,
558 DIFile File, unsigned LineNo,
559 DICompositeType Ty, bool isLocalToUnit,
563 bool isOptimized = false,
568 /// FIXME: this is added for dragonegg. Once we update dragonegg
569 /// to call resolve function, this will be removed.
570 DISubprogram createFunction(DIScopeRef Scope, StringRef Name,
571 StringRef LinkageName,
572 DIFile File, unsigned LineNo,
573 DICompositeType Ty, bool isLocalToUnit,
577 bool isOptimized = false,
582 /// createMethod - Create a new descriptor for the specified C++ method.
583 /// See comments in DISubprogram for descriptions of these fields.
584 /// @param Scope Function scope.
585 /// @param Name Function name.
586 /// @param LinkageName Mangled function name.
587 /// @param File File where this variable is defined.
588 /// @param LineNo Line number.
589 /// @param Ty Function type.
590 /// @param isLocalToUnit True if this function is not externally visible..
591 /// @param isDefinition True if this is a function definition.
592 /// @param Virtuality Attributes describing virtualness. e.g. pure
593 /// virtual function.
594 /// @param VTableIndex Index no of this method in virtual table.
595 /// @param VTableHolder Type that holds vtable.
596 /// @param Flags e.g. is this function prototyped or not.
597 /// This flags are used to emit dwarf attributes.
598 /// @param isOptimized True if optimization is ON.
599 /// @param Fn llvm::Function pointer.
600 /// @param TParam Function template parameters.
601 DISubprogram createMethod(DIDescriptor Scope, StringRef Name,
602 StringRef LinkageName,
603 DIFile File, unsigned LineNo,
604 DICompositeType Ty, bool isLocalToUnit,
606 unsigned Virtuality = 0, unsigned VTableIndex = 0,
607 DIType VTableHolder = DIType(),
609 bool isOptimized = false,
613 /// createNameSpace - This creates new descriptor for a namespace
614 /// with the specified parent scope.
615 /// @param Scope Namespace scope
616 /// @param Name Name of this namespace
617 /// @param File Source file
618 /// @param LineNo Line number
619 DINameSpace createNameSpace(DIDescriptor Scope, StringRef Name,
620 DIFile File, unsigned LineNo);
623 /// createLexicalBlockFile - This creates a descriptor for a lexical
624 /// block with a new file attached. This merely extends the existing
625 /// lexical block as it crosses a file.
626 /// @param Scope Lexical block.
627 /// @param File Source file.
628 DILexicalBlockFile createLexicalBlockFile(DIDescriptor Scope,
631 /// createLexicalBlock - This creates a descriptor for a lexical block
632 /// with the specified parent context.
633 /// @param Scope Parent lexical scope.
634 /// @param File Source file
635 /// @param Line Line number
636 /// @param Col Column number
637 DILexicalBlock createLexicalBlock(DIDescriptor Scope, DIFile File,
638 unsigned Line, unsigned Col);
640 /// \brief Create a descriptor for an imported module.
641 /// @param Context The scope this module is imported into
642 /// @param NS The namespace being imported here
643 /// @param Line Line number
644 DIImportedEntity createImportedModule(DIScope Context, DINameSpace NS,
646 StringRef Name = StringRef());
648 /// \brief Create a descriptor for an imported module.
649 /// @param Context The scope this module is imported into
650 /// @param NS An aliased namespace
651 /// @param Line Line number
652 DIImportedEntity createImportedModule(DIScope Context, DIImportedEntity NS,
653 unsigned Line, StringRef Name);
655 /// \brief Create a descriptor for an imported function.
656 /// @param Context The scope this module is imported into
657 /// @param Decl The declaration (or definition) of a function, type, or
659 /// @param Line Line number
660 DIImportedEntity createImportedDeclaration(DIScope Context,
664 /// insertDeclare - Insert a new llvm.dbg.declare intrinsic call.
665 /// @param Storage llvm::Value of the variable
666 /// @param VarInfo Variable's debug info descriptor.
667 /// @param InsertAtEnd Location for the new intrinsic.
668 Instruction *insertDeclare(llvm::Value *Storage, DIVariable VarInfo,
669 BasicBlock *InsertAtEnd);
671 /// insertDeclare - Insert a new llvm.dbg.declare intrinsic call.
672 /// @param Storage llvm::Value of the variable
673 /// @param VarInfo Variable's debug info descriptor.
674 /// @param InsertBefore Location for the new intrinsic.
675 Instruction *insertDeclare(llvm::Value *Storage, DIVariable VarInfo,
676 Instruction *InsertBefore);
679 /// insertDbgValueIntrinsic - Insert a new llvm.dbg.value intrinsic call.
680 /// @param Val llvm::Value of the variable
681 /// @param Offset Offset
682 /// @param VarInfo Variable's debug info descriptor.
683 /// @param InsertAtEnd Location for the new intrinsic.
684 Instruction *insertDbgValueIntrinsic(llvm::Value *Val, uint64_t Offset,
686 BasicBlock *InsertAtEnd);
688 /// insertDbgValueIntrinsic - Insert a new llvm.dbg.value intrinsic call.
689 /// @param Val llvm::Value of the variable
690 /// @param Offset Offset
691 /// @param VarInfo Variable's debug info descriptor.
692 /// @param InsertBefore Location for the new intrinsic.
693 Instruction *insertDbgValueIntrinsic(llvm::Value *Val, uint64_t Offset,
695 Instruction *InsertBefore);
698 } // end namespace llvm