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;
41 class DIGlobalVariable;
42 class DIImportedEntity;
46 class DILexicalBlockFile;
50 class DITemplateTypeParameter;
51 class DITemplateValueParameter;
56 LLVMContext &VMContext;
58 MDNode *TempEnumTypes;
59 MDNode *TempRetainTypes;
60 MDNode *TempSubprograms;
62 MDNode *TempImportedModules;
64 Function *DeclareFn; // llvm.dbg.declare
65 Function *ValueFn; // llvm.dbg.value
67 SmallVector<Value *, 4> AllEnumTypes;
68 /// Use TrackingVH to collect RetainTypes, since they can be updated
70 SmallVector<TrackingVH<MDNode>, 4> AllRetainTypes;
71 SmallVector<Value *, 4> AllSubprograms;
72 SmallVector<Value *, 4> AllGVs;
73 SmallVector<TrackingVH<MDNode>, 4> AllImportedModules;
75 /// Each subprogram's preserved local variables.
76 DenseMap<MDNode *, std::vector<TrackingVH<MDNode>>> PreservedVariables;
78 DIBuilder(const DIBuilder &) LLVM_DELETED_FUNCTION;
79 void operator=(const DIBuilder &) LLVM_DELETED_FUNCTION;
82 explicit DIBuilder(Module &M);
83 enum DebugEmissionKind { FullDebug=1, LineTablesOnly };
85 /// finalize - Construct any deferred debug info descriptors.
88 /// createCompileUnit - A CompileUnit provides an anchor for all debugging
89 /// information generated during this instance of compilation.
90 /// @param Lang Source programming language, eg. dwarf::DW_LANG_C99
91 /// @param File File name
92 /// @param Dir Directory
93 /// @param Producer Identify the producer of debugging information and code.
94 /// Usually this is a compiler version string.
95 /// @param isOptimized A boolean flag which indicates whether optimization
97 /// @param Flags This string lists command line options. This string is
98 /// directly embedded in debug info output which may be used
99 /// by a tool analyzing generated debugging information.
100 /// @param RV This indicates runtime version for languages like
102 /// @param SplitName The name of the file that we'll split debug info out
104 /// @param Kind The kind of debug information to generate.
105 /// @param EmitDebugInfo A boolean flag which indicates whether debug
106 /// information should be written to the final
107 /// output or not. When this is false, debug
108 /// information annotations will be present in
109 /// the IL but they are not written to the final
110 /// assembly or object file. This supports tracking
111 /// source location information in the back end
112 /// without actually changing the output (e.g.,
113 /// when using optimization remarks).
114 DICompileUnit createCompileUnit(unsigned Lang, StringRef File,
115 StringRef Dir, StringRef Producer,
116 bool isOptimized, StringRef Flags,
118 StringRef SplitName = StringRef(),
119 DebugEmissionKind Kind = FullDebug,
120 bool EmitDebugInfo = true);
122 /// createFile - Create a file descriptor to hold debugging information
124 DIFile createFile(StringRef Filename, StringRef Directory);
126 /// createEnumerator - Create a single enumerator value.
127 DIEnumerator createEnumerator(StringRef Name, int64_t Val);
129 /// \brief Create a DWARF unspecified type.
130 DIBasicType createUnspecifiedType(StringRef Name);
132 /// \brief Create C++11 nullptr type.
133 DIBasicType createNullPtrType();
135 /// createBasicType - Create debugging information entry for a basic
137 /// @param Name Type name.
138 /// @param SizeInBits Size of the type.
139 /// @param AlignInBits Type alignment.
140 /// @param Encoding DWARF encoding code, e.g. dwarf::DW_ATE_float.
141 DIBasicType createBasicType(StringRef Name, uint64_t SizeInBits,
142 uint64_t AlignInBits, unsigned Encoding);
144 /// createQualifiedType - Create debugging information entry for a qualified
145 /// type, e.g. 'const int'.
146 /// @param Tag Tag identifing type, e.g. dwarf::TAG_volatile_type
147 /// @param FromTy Base Type.
148 DIDerivedType createQualifiedType(unsigned Tag, DIType FromTy);
150 /// createPointerType - Create debugging information entry for a pointer.
151 /// @param PointeeTy Type pointed by this pointer.
152 /// @param SizeInBits Size.
153 /// @param AlignInBits Alignment. (optional)
154 /// @param Name Pointer type name. (optional)
156 createPointerType(DIType PointeeTy, uint64_t SizeInBits,
157 uint64_t AlignInBits = 0, StringRef Name = StringRef());
159 /// \brief Create debugging information entry for a pointer to member.
160 /// @param PointeeTy Type pointed to by this pointer.
161 /// @param Class Type for which this pointer points to members of.
162 DIDerivedType createMemberPointerType(DIType PointeeTy, DIType Class);
164 /// createReferenceType - Create debugging information entry for a c++
165 /// style reference or rvalue reference type.
166 DIDerivedType createReferenceType(unsigned Tag, DIType RTy);
168 /// createTypedef - Create debugging information entry for a typedef.
169 /// @param Ty Original type.
170 /// @param Name Typedef name.
171 /// @param File File where this type is defined.
172 /// @param LineNo Line number.
173 /// @param Context The surrounding context for the typedef.
174 DIDerivedType createTypedef(DIType Ty, StringRef Name, DIFile File,
175 unsigned LineNo, DIDescriptor Context);
177 /// createFriend - Create debugging information entry for a 'friend'.
178 DIDerivedType createFriend(DIType Ty, DIType FriendTy);
180 /// createInheritance - Create debugging information entry to establish
181 /// inheritance relationship between two types.
182 /// @param Ty Original type.
183 /// @param BaseTy Base type. Ty is inherits from base.
184 /// @param BaseOffset Base offset.
185 /// @param Flags Flags to describe inheritance attribute,
187 DIDerivedType createInheritance(DIType Ty, DIType BaseTy,
188 uint64_t BaseOffset, unsigned Flags);
190 /// createMemberType - Create debugging information entry for a member.
191 /// @param Scope Member scope.
192 /// @param Name Member name.
193 /// @param File File where this member is defined.
194 /// @param LineNo Line number.
195 /// @param SizeInBits Member size.
196 /// @param AlignInBits Member alignment.
197 /// @param OffsetInBits Member offset.
198 /// @param Flags Flags to encode member attribute, e.g. private
199 /// @param Ty Parent type.
201 createMemberType(DIDescriptor Scope, StringRef Name, DIFile File,
202 unsigned LineNo, uint64_t SizeInBits, uint64_t AlignInBits,
203 uint64_t OffsetInBits, unsigned Flags, DIType Ty);
205 /// createStaticMemberType - Create debugging information entry for a
206 /// C++ static data member.
207 /// @param Scope Member scope.
208 /// @param Name Member name.
209 /// @param File File where this member is declared.
210 /// @param LineNo Line number.
211 /// @param Ty Type of the static member.
212 /// @param Flags Flags to encode member attribute, e.g. private.
213 /// @param Val Const initializer of the member.
215 createStaticMemberType(DIDescriptor Scope, StringRef Name,
216 DIFile File, unsigned LineNo, DIType Ty,
217 unsigned Flags, llvm::Value *Val);
219 /// createObjCIVar - Create debugging information entry for Objective-C
220 /// instance variable.
221 /// @param Name Member name.
222 /// @param File File where this member is defined.
223 /// @param LineNo Line number.
224 /// @param SizeInBits Member size.
225 /// @param AlignInBits Member alignment.
226 /// @param OffsetInBits Member offset.
227 /// @param Flags Flags to encode member attribute, e.g. private
228 /// @param Ty Parent type.
229 /// @param PropertyNode Property associated with this ivar.
230 DIDerivedType createObjCIVar(StringRef Name, DIFile File,
231 unsigned LineNo, uint64_t SizeInBits,
232 uint64_t AlignInBits, uint64_t OffsetInBits,
233 unsigned Flags, DIType Ty,
234 MDNode *PropertyNode);
236 /// createObjCProperty - Create debugging information entry for Objective-C
238 /// @param Name Property name.
239 /// @param File File where this property is defined.
240 /// @param LineNumber Line number.
241 /// @param GetterName Name of the Objective C property getter selector.
242 /// @param SetterName Name of the Objective C property setter selector.
243 /// @param PropertyAttributes Objective C property attributes.
245 DIObjCProperty createObjCProperty(StringRef Name,
246 DIFile File, unsigned LineNumber,
247 StringRef GetterName,
248 StringRef SetterName,
249 unsigned PropertyAttributes,
252 /// createClassType - Create debugging information entry for a class.
253 /// @param Scope Scope in which this class is defined.
254 /// @param Name class name.
255 /// @param File File where this member is defined.
256 /// @param LineNumber Line number.
257 /// @param SizeInBits Member size.
258 /// @param AlignInBits Member alignment.
259 /// @param OffsetInBits Member offset.
260 /// @param Flags Flags to encode member attribute, e.g. private
261 /// @param Elements class members.
262 /// @param VTableHolder Debug info of the base class that contains vtable
263 /// for this type. This is used in
264 /// DW_AT_containing_type. See DWARF documentation
266 /// @param TemplateParms Template type parameters.
267 /// @param UniqueIdentifier A unique identifier for the class.
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 DIType VTableHolder = DIType(),
274 MDNode *TemplateParms = nullptr,
275 StringRef UniqueIdentifier = StringRef());
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 /// @param UniqueIdentifier A unique identifier for the struct.
288 DICompositeType createStructType(DIDescriptor Scope, StringRef Name,
289 DIFile File, unsigned LineNumber,
290 uint64_t SizeInBits, uint64_t AlignInBits,
291 unsigned Flags, DIType DerivedFrom,
292 DIArray Elements, unsigned RunTimeLang = 0,
293 DIType VTableHolder = DIType(),
294 StringRef UniqueIdentifier = StringRef());
296 /// createUnionType - Create debugging information entry for an union.
297 /// @param Scope Scope in which this union is defined.
298 /// @param Name Union 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 Union elements.
305 /// @param RunTimeLang Optional parameter, Objective-C runtime version.
306 /// @param UniqueIdentifier A unique identifier for the union.
307 DICompositeType createUnionType(
308 DIDescriptor Scope, StringRef Name, DIFile File, unsigned LineNumber,
309 uint64_t SizeInBits, uint64_t AlignInBits, unsigned Flags,
310 DIArray Elements, unsigned RunTimeLang = 0,
311 StringRef UniqueIdentifier = StringRef());
313 /// createTemplateTypeParameter - Create debugging information for template
315 /// @param Scope Scope in which this type is defined.
316 /// @param Name Type parameter name.
317 /// @param Ty Parameter type.
318 /// @param File File where this type parameter is defined.
319 /// @param LineNo Line number.
320 /// @param ColumnNo Column Number.
321 DITemplateTypeParameter
322 createTemplateTypeParameter(DIDescriptor Scope, StringRef Name, DIType Ty,
323 MDNode *File = nullptr, unsigned LineNo = 0,
324 unsigned ColumnNo = 0);
326 /// createTemplateValueParameter - Create debugging information for template
328 /// @param Scope Scope in which this type is defined.
329 /// @param Name Value parameter name.
330 /// @param Ty Parameter type.
331 /// @param Val Constant parameter value.
332 /// @param File File where this type parameter is defined.
333 /// @param LineNo Line number.
334 /// @param ColumnNo Column Number.
335 DITemplateValueParameter
336 createTemplateValueParameter(DIDescriptor Scope, StringRef Name,
337 DIType Ty, Value *Val, MDNode *File = nullptr,
338 unsigned LineNo = 0, unsigned ColumnNo = 0);
340 /// \brief Create debugging information for a template template parameter.
341 /// @param Scope Scope in which this type is defined.
342 /// @param Name Value parameter name.
343 /// @param Ty Parameter type.
344 /// @param Val The fully qualified name of the template.
345 /// @param File File where this type parameter is defined.
346 /// @param LineNo Line number.
347 /// @param ColumnNo Column Number.
348 DITemplateValueParameter
349 createTemplateTemplateParameter(DIDescriptor Scope, StringRef Name,
350 DIType Ty, StringRef Val,
351 MDNode *File = nullptr, unsigned LineNo = 0,
352 unsigned ColumnNo = 0);
354 /// \brief Create debugging information for a template parameter pack.
355 /// @param Scope Scope in which this type is defined.
356 /// @param Name Value parameter name.
357 /// @param Ty Parameter type.
358 /// @param Val An array of types in the pack.
359 /// @param File File where this type parameter is defined.
360 /// @param LineNo Line number.
361 /// @param ColumnNo Column Number.
362 DITemplateValueParameter
363 createTemplateParameterPack(DIDescriptor Scope, StringRef Name,
364 DIType Ty, DIArray Val, MDNode *File = nullptr,
365 unsigned LineNo = 0, unsigned ColumnNo = 0);
367 /// createArrayType - Create debugging information entry for an array.
368 /// @param Size Array size.
369 /// @param AlignInBits Alignment.
370 /// @param Ty Element type.
371 /// @param Subscripts Subscripts.
372 DICompositeType createArrayType(uint64_t Size, uint64_t AlignInBits,
373 DIType Ty, DIArray Subscripts);
375 /// createVectorType - Create debugging information entry for a vector type.
376 /// @param Size Array size.
377 /// @param AlignInBits Alignment.
378 /// @param Ty Element type.
379 /// @param Subscripts Subscripts.
380 DICompositeType createVectorType(uint64_t Size, uint64_t AlignInBits,
381 DIType Ty, DIArray Subscripts);
383 /// createEnumerationType - Create debugging information entry for an
385 /// @param Scope Scope in which this enumeration is defined.
386 /// @param Name Union name.
387 /// @param File File where this member is defined.
388 /// @param LineNumber Line number.
389 /// @param SizeInBits Member size.
390 /// @param AlignInBits Member alignment.
391 /// @param Elements Enumeration elements.
392 /// @param UnderlyingType Underlying type of a C++11/ObjC fixed enum.
393 /// @param UniqueIdentifier A unique identifier for the enum.
394 DICompositeType createEnumerationType(DIDescriptor Scope, StringRef Name,
395 DIFile File, unsigned LineNumber, uint64_t SizeInBits,
396 uint64_t AlignInBits, DIArray Elements, DIType UnderlyingType,
397 StringRef UniqueIdentifier = StringRef());
399 /// createSubroutineType - Create subroutine type.
400 /// @param File File in which this subroutine is defined.
401 /// @param ParameterTypes An array of subroutine parameter types. This
402 /// includes return type at 0th index.
403 /// @param Flags E.g.: LValueReference.
404 /// These flags are used to emit dwarf attributes.
405 DISubroutineType createSubroutineType(DIFile File,
406 DITypeArray ParameterTypes,
409 /// createArtificialType - Create a new DIType with "artificial" flag set.
410 DIType createArtificialType(DIType Ty);
412 /// createObjectPointerType - Create a new DIType with the "object pointer"
414 DIType createObjectPointerType(DIType Ty);
416 /// \brief Create a permanent forward-declared type.
417 DICompositeType createForwardDecl(unsigned Tag, StringRef Name,
418 DIDescriptor Scope, DIFile F,
419 unsigned Line, unsigned RuntimeLang = 0,
420 uint64_t SizeInBits = 0,
421 uint64_t AlignInBits = 0,
422 StringRef UniqueIdentifier = StringRef());
424 /// \brief Create a temporary forward-declared type.
425 DICompositeType createReplaceableForwardDecl(
426 unsigned Tag, StringRef Name, DIDescriptor Scope, DIFile F,
427 unsigned Line, unsigned RuntimeLang = 0, uint64_t SizeInBits = 0,
428 uint64_t AlignInBits = 0, StringRef UniqueIdentifier = StringRef());
430 /// retainType - Retain DIType in a module even if it is not referenced
431 /// through debug info anchors.
432 void retainType(DIType T);
434 /// createUnspecifiedParameter - Create unspecified parameter type
435 /// for a subroutine type.
436 DIBasicType createUnspecifiedParameter();
438 /// getOrCreateArray - Get a DIArray, create one if required.
439 DIArray getOrCreateArray(ArrayRef<Value *> Elements);
441 /// getOrCreateTypeArray - Get a DITypeArray, create one if required.
442 DITypeArray getOrCreateTypeArray(ArrayRef<Value *> Elements);
444 /// getOrCreateSubrange - Create a descriptor for a value range. This
445 /// implicitly uniques the values returned.
446 DISubrange getOrCreateSubrange(int64_t Lo, int64_t Count);
449 /// createGlobalVariable - Create a new descriptor for the specified
451 /// @param Context Variable scope.
452 /// @param Name Name of the variable.
453 /// @param LinkageName Mangled name of the variable.
454 /// @param File File where this variable is defined.
455 /// @param LineNo Line number.
456 /// @param Ty Variable Type.
457 /// @param isLocalToUnit Boolean flag indicate whether this variable is
458 /// externally visible or not.
459 /// @param Val llvm::Value of the variable.
460 /// @param Decl Reference to the corresponding declaration.
462 createGlobalVariable(DIDescriptor Context, StringRef Name,
463 StringRef LinkageName, DIFile File, unsigned LineNo,
464 DITypeRef Ty, bool isLocalToUnit, llvm::Value *Val,
465 MDNode *Decl = nullptr);
467 /// createTempGlobalVariableFwdDecl - Identical to createGlobalVariable
468 /// except that the resulting DbgNode is temporary and meant to be RAUWed.
470 createTempGlobalVariableFwdDecl(DIDescriptor Context, StringRef Name,
471 StringRef LinkageName, DIFile File,
472 unsigned LineNo, DITypeRef Ty,
473 bool isLocalToUnit, llvm::Value *Val,
474 MDNode *Decl = nullptr);
477 /// createLocalVariable - Create a new descriptor for the specified
479 /// @param Tag Dwarf TAG. Usually DW_TAG_auto_variable or
480 /// DW_TAG_arg_variable.
481 /// @param Scope Variable scope.
482 /// @param Name Variable name.
483 /// @param File File where this variable is defined.
484 /// @param LineNo Line number.
485 /// @param Ty Variable Type
486 /// @param AlwaysPreserve Boolean. Set to true if debug info for this
487 /// variable should be preserved in optimized build.
488 /// @param Flags Flags, e.g. artificial variable.
489 /// @param ArgNo If this variable is an argument then this argument's
490 /// number. 1 indicates 1st argument.
491 DIVariable createLocalVariable(unsigned Tag, DIDescriptor Scope,
493 DIFile File, unsigned LineNo,
494 DITypeRef Ty, bool AlwaysPreserve = false,
498 /// createExpression - Create a new descriptor for the specified
499 /// variable which has a complex address expression for its address.
500 /// @param Addr An array of complex address operations.
501 DIExpression createExpression(ArrayRef<int64_t> Addr = None);
503 /// createPieceExpression - Create a descriptor to describe one part
504 /// of aggregate variable that is fragmented across multiple Values.
506 /// @param OffsetInBytes Offset of the piece in bytes.
507 /// @param SizeInBytes Size of the piece in bytes.
508 DIExpression createPieceExpression(unsigned OffsetInBytes,
509 unsigned SizeInBytes);
511 /// createFunction - Create a new descriptor for the specified subprogram.
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 ScopeLine Set to the beginning of the scope this starts
522 /// @param Flags e.g. is this function prototyped or not.
523 /// These flags are used to emit dwarf attributes.
524 /// @param isOptimized True if optimization is ON.
525 /// @param Fn llvm::Function pointer.
526 /// @param TParam Function template parameters.
527 DISubprogram createFunction(DIDescriptor Scope, StringRef Name,
528 StringRef LinkageName,
529 DIFile File, unsigned LineNo,
530 DICompositeType Ty, bool isLocalToUnit,
534 bool isOptimized = false,
535 Function *Fn = nullptr,
536 MDNode *TParam = nullptr,
537 MDNode *Decl = nullptr);
539 /// createTempFunctionFwdDecl - Identical to createFunction,
540 /// except that the resulting DbgNode is meant to be RAUWed.
541 DISubprogram createTempFunctionFwdDecl(DIDescriptor Scope, StringRef Name,
542 StringRef LinkageName,
543 DIFile File, unsigned LineNo,
544 DICompositeType Ty, bool isLocalToUnit,
548 bool isOptimized = false,
549 Function *Fn = nullptr,
550 MDNode *TParam = nullptr,
551 MDNode *Decl = nullptr);
554 /// FIXME: this is added for dragonegg. Once we update dragonegg
555 /// to call resolve function, this will be removed.
556 DISubprogram createFunction(DIScopeRef Scope, StringRef Name,
557 StringRef LinkageName,
558 DIFile File, unsigned LineNo,
559 DICompositeType Ty, bool isLocalToUnit,
563 bool isOptimized = false,
564 Function *Fn = nullptr,
565 MDNode *TParam = nullptr,
566 MDNode *Decl = nullptr);
568 /// createMethod - Create a new descriptor for the specified C++ method.
569 /// See comments in DISubprogram for descriptions of these fields.
570 /// @param Scope Function scope.
571 /// @param Name Function name.
572 /// @param LinkageName Mangled function name.
573 /// @param File File where this variable is defined.
574 /// @param LineNo Line number.
575 /// @param Ty Function type.
576 /// @param isLocalToUnit True if this function is not externally visible..
577 /// @param isDefinition True if this is a function definition.
578 /// @param Virtuality Attributes describing virtualness. e.g. pure
579 /// virtual function.
580 /// @param VTableIndex Index no of this method in virtual table.
581 /// @param VTableHolder Type that holds vtable.
582 /// @param Flags e.g. is this function prototyped or not.
583 /// This flags are used to emit dwarf attributes.
584 /// @param isOptimized True if optimization is ON.
585 /// @param Fn llvm::Function pointer.
586 /// @param TParam Function template parameters.
587 DISubprogram createMethod(DIDescriptor Scope, StringRef Name,
588 StringRef LinkageName,
589 DIFile File, unsigned LineNo,
590 DICompositeType Ty, bool isLocalToUnit,
592 unsigned Virtuality = 0, unsigned VTableIndex = 0,
593 DIType VTableHolder = DIType(),
595 bool isOptimized = false,
596 Function *Fn = nullptr,
597 MDNode *TParam = nullptr);
599 /// createNameSpace - This creates new descriptor for a namespace
600 /// with the specified parent scope.
601 /// @param Scope Namespace scope
602 /// @param Name Name of this namespace
603 /// @param File Source file
604 /// @param LineNo Line number
605 DINameSpace createNameSpace(DIDescriptor Scope, StringRef Name,
606 DIFile File, unsigned LineNo);
609 /// createLexicalBlockFile - This creates a descriptor for a lexical
610 /// block with a new file attached. This merely extends the existing
611 /// lexical block as it crosses a file.
612 /// @param Scope Lexical block.
613 /// @param File Source file.
614 /// @param Discriminator DWARF path discriminator value.
615 DILexicalBlockFile createLexicalBlockFile(DIDescriptor Scope, DIFile File,
616 unsigned Discriminator = 0);
618 /// createLexicalBlock - This creates a descriptor for a lexical block
619 /// with the specified parent context.
620 /// @param Scope Parent lexical scope.
621 /// @param File Source file.
622 /// @param Line Line number.
623 /// @param Col Column number.
624 DILexicalBlock createLexicalBlock(DIDescriptor Scope, DIFile File,
625 unsigned Line, unsigned Col);
627 /// \brief Create a descriptor for an imported module.
628 /// @param Context The scope this module is imported into
629 /// @param NS The namespace being imported here
630 /// @param Line Line number
631 DIImportedEntity createImportedModule(DIScope Context, DINameSpace NS,
634 /// \brief Create a descriptor for an imported module.
635 /// @param Context The scope this module is imported into
636 /// @param NS An aliased namespace
637 /// @param Line Line number
638 DIImportedEntity createImportedModule(DIScope Context, DIImportedEntity NS,
641 /// \brief Create a descriptor for an imported function.
642 /// @param Context The scope this module is imported into
643 /// @param Decl The declaration (or definition) of a function, type, or
645 /// @param Line Line number
646 DIImportedEntity createImportedDeclaration(DIScope Context, DIDescriptor Decl,
648 StringRef Name = StringRef());
649 DIImportedEntity createImportedDeclaration(DIScope Context,
652 StringRef Name = StringRef());
654 /// insertDeclare - Insert a new llvm.dbg.declare intrinsic call.
655 /// @param Storage llvm::Value of the variable
656 /// @param VarInfo Variable's debug info descriptor.
657 /// @param Expr A complex location expression.
658 /// @param InsertAtEnd Location for the new intrinsic.
659 Instruction *insertDeclare(llvm::Value *Storage, DIVariable VarInfo,
660 DIExpression Expr, BasicBlock *InsertAtEnd);
662 /// insertDeclare - Insert a new llvm.dbg.declare intrinsic call.
663 /// @param Storage llvm::Value of the variable
664 /// @param VarInfo Variable's debug info descriptor.
665 /// @param Expr A complex location expression.
666 /// @param InsertBefore Location for the new intrinsic.
667 Instruction *insertDeclare(llvm::Value *Storage, DIVariable VarInfo,
668 DIExpression Expr, Instruction *InsertBefore);
670 /// insertDbgValueIntrinsic - Insert a new llvm.dbg.value intrinsic call.
671 /// @param Val llvm::Value of the variable
672 /// @param Offset Offset
673 /// @param VarInfo Variable's debug info descriptor.
674 /// @param Expr A complex location expression.
675 /// @param InsertAtEnd Location for the new intrinsic.
676 Instruction *insertDbgValueIntrinsic(llvm::Value *Val, uint64_t Offset,
677 DIVariable VarInfo, DIExpression Expr,
678 BasicBlock *InsertAtEnd);
680 /// insertDbgValueIntrinsic - Insert a new llvm.dbg.value intrinsic call.
681 /// @param Val llvm::Value of the variable
682 /// @param Offset Offset
683 /// @param VarInfo Variable's debug info descriptor.
684 /// @param Expr A complex location expression.
685 /// @param InsertBefore Location for the new intrinsic.
686 Instruction *insertDbgValueIntrinsic(llvm::Value *Val, uint64_t Offset,
687 DIVariable VarInfo, DIExpression Expr,
688 Instruction *InsertBefore);
690 } // end namespace llvm