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"
36 class DICompositeType;
42 class DIGlobalVariable;
43 class DIImportedEntity;
47 class DILexicalBlockFile;
51 class DITemplateTypeParameter;
52 class DITemplateValueParameter;
57 LLVMContext &VMContext;
59 MDNode *TempEnumTypes;
60 MDNode *TempRetainTypes;
61 MDNode *TempSubprograms;
63 MDNode *TempImportedModules;
65 Function *DeclareFn; // llvm.dbg.declare
66 Function *ValueFn; // llvm.dbg.value
68 SmallVector<Value *, 4> AllEnumTypes;
69 /// Use TrackingVH to collect RetainTypes, since they can be updated
71 SmallVector<TrackingVH<MDNode>, 4> AllRetainTypes;
72 SmallVector<Value *, 4> AllSubprograms;
73 SmallVector<Value *, 4> AllGVs;
74 SmallVector<TrackingVH<MDNode>, 4> AllImportedModules;
76 /// Each subprogram's preserved local variables.
77 DenseMap<MDNode *, std::vector<TrackingVH<MDNode>>> PreservedVariables;
79 DIBuilder(const DIBuilder &) LLVM_DELETED_FUNCTION;
80 void operator=(const DIBuilder &) LLVM_DELETED_FUNCTION;
83 explicit DIBuilder(Module &M);
84 enum DebugEmissionKind { FullDebug=1, LineTablesOnly };
86 /// finalize - Construct any deferred debug info descriptors.
89 /// createCompileUnit - A CompileUnit provides an anchor for all debugging
90 /// information generated during this instance of compilation.
91 /// @param Lang Source programming language, eg. dwarf::DW_LANG_C99
92 /// @param File File name
93 /// @param Dir Directory
94 /// @param Producer Identify the producer of debugging information and code.
95 /// Usually this is a compiler version string.
96 /// @param isOptimized A boolean flag which indicates whether optimization
98 /// @param Flags This string lists command line options. This string is
99 /// directly embedded in debug info output which may be used
100 /// by a tool analyzing generated debugging information.
101 /// @param RV This indicates runtime version for languages like
103 /// @param SplitName The name of the file that we'll split debug info out
105 /// @param Kind The kind of debug information to generate.
106 /// @param EmitDebugInfo A boolean flag which indicates whether debug
107 /// information should be written to the final
108 /// output or not. When this is false, debug
109 /// information annotations will be present in
110 /// the IL but they are not written to the final
111 /// assembly or object file. This supports tracking
112 /// source location information in the back end
113 /// without actually changing the output (e.g.,
114 /// when using optimization remarks).
115 DICompileUnit createCompileUnit(unsigned Lang, StringRef File,
116 StringRef Dir, StringRef Producer,
117 bool isOptimized, StringRef Flags,
119 StringRef SplitName = StringRef(),
120 DebugEmissionKind Kind = FullDebug,
121 bool EmitDebugInfo = true);
123 /// createFile - Create a file descriptor to hold debugging information
125 DIFile createFile(StringRef Filename, StringRef Directory);
127 /// createEnumerator - Create a single enumerator value.
128 DIEnumerator createEnumerator(StringRef Name, int64_t Val);
130 /// \brief Create a DWARF unspecified type.
131 DIBasicType createUnspecifiedType(StringRef Name);
133 /// \brief Create C++11 nullptr type.
134 DIBasicType createNullPtrType();
136 /// createBasicType - Create debugging information entry for a basic
138 /// @param Name Type name.
139 /// @param SizeInBits Size of the type.
140 /// @param AlignInBits Type alignment.
141 /// @param Encoding DWARF encoding code, e.g. dwarf::DW_ATE_float.
142 DIBasicType createBasicType(StringRef Name, uint64_t SizeInBits,
143 uint64_t AlignInBits, unsigned Encoding);
145 /// createQualifiedType - Create debugging information entry for a qualified
146 /// type, e.g. 'const int'.
147 /// @param Tag Tag identifing type, e.g. dwarf::TAG_volatile_type
148 /// @param FromTy Base Type.
149 DIDerivedType createQualifiedType(unsigned Tag, DIType FromTy);
151 /// createPointerType - Create debugging information entry for a pointer.
152 /// @param PointeeTy Type pointed by this pointer.
153 /// @param SizeInBits Size.
154 /// @param AlignInBits Alignment. (optional)
155 /// @param Name Pointer type name. (optional)
157 createPointerType(DIType PointeeTy, uint64_t SizeInBits,
158 uint64_t AlignInBits = 0, StringRef Name = StringRef());
160 /// \brief Create debugging information entry for a pointer to member.
161 /// @param PointeeTy Type pointed to by this pointer.
162 /// @param Class Type for which this pointer points to members of.
163 DIDerivedType createMemberPointerType(DIType PointeeTy, DIType Class);
165 /// createReferenceType - Create debugging information entry for a c++
166 /// style reference or rvalue reference type.
167 DIDerivedType createReferenceType(unsigned Tag, DIType RTy);
169 /// createTypedef - Create debugging information entry for a typedef.
170 /// @param Ty Original type.
171 /// @param Name Typedef name.
172 /// @param File File where this type is defined.
173 /// @param LineNo Line number.
174 /// @param Context The surrounding context for the typedef.
175 DIDerivedType createTypedef(DIType Ty, StringRef Name, DIFile File,
176 unsigned LineNo, DIDescriptor Context);
178 /// createFriend - Create debugging information entry for a 'friend'.
179 DIDerivedType createFriend(DIType Ty, DIType FriendTy);
181 /// createInheritance - Create debugging information entry to establish
182 /// inheritance relationship between two types.
183 /// @param Ty Original type.
184 /// @param BaseTy Base type. Ty is inherits from base.
185 /// @param BaseOffset Base offset.
186 /// @param Flags Flags to describe inheritance attribute,
188 DIDerivedType createInheritance(DIType Ty, DIType BaseTy,
189 uint64_t BaseOffset, unsigned Flags);
191 /// createMemberType - Create debugging information entry for a member.
192 /// @param Scope Member scope.
193 /// @param Name Member name.
194 /// @param File File where this member is defined.
195 /// @param LineNo Line number.
196 /// @param SizeInBits Member size.
197 /// @param AlignInBits Member alignment.
198 /// @param OffsetInBits Member offset.
199 /// @param Flags Flags to encode member attribute, e.g. private
200 /// @param Ty Parent type.
202 createMemberType(DIDescriptor Scope, StringRef Name, DIFile File,
203 unsigned LineNo, uint64_t SizeInBits, uint64_t AlignInBits,
204 uint64_t OffsetInBits, unsigned Flags, DIType Ty);
206 /// createStaticMemberType - Create debugging information entry for a
207 /// C++ static data member.
208 /// @param Scope Member scope.
209 /// @param Name Member name.
210 /// @param File File where this member is declared.
211 /// @param LineNo Line number.
212 /// @param Ty Type of the static member.
213 /// @param Flags Flags to encode member attribute, e.g. private.
214 /// @param Val Const initializer of the member.
215 DIDerivedType createStaticMemberType(DIDescriptor Scope, StringRef Name,
216 DIFile File, unsigned LineNo,
217 DIType Ty, unsigned Flags,
218 llvm::Constant *Val);
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 DIDerivedType 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);
237 /// createObjCProperty - Create debugging information entry for Objective-C
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.
246 DIObjCProperty createObjCProperty(StringRef Name,
247 DIFile File, unsigned LineNumber,
248 StringRef GetterName,
249 StringRef SetterName,
250 unsigned PropertyAttributes,
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
267 /// @param TemplateParms Template type parameters.
268 /// @param UniqueIdentifier A unique identifier for the class.
269 DICompositeType createClassType(DIDescriptor Scope, StringRef Name,
270 DIFile File, unsigned LineNumber,
271 uint64_t SizeInBits, uint64_t AlignInBits,
272 uint64_t OffsetInBits, unsigned Flags,
273 DIType DerivedFrom, DIArray Elements,
274 DIType VTableHolder = DIType(),
275 MDNode *TemplateParms = nullptr,
276 StringRef UniqueIdentifier = StringRef());
278 /// createStructType - Create debugging information entry for a struct.
279 /// @param Scope Scope in which this struct is defined.
280 /// @param Name Struct name.
281 /// @param File File where this member is defined.
282 /// @param LineNumber Line number.
283 /// @param SizeInBits Member size.
284 /// @param AlignInBits Member alignment.
285 /// @param Flags Flags to encode member attribute, e.g. private
286 /// @param Elements Struct elements.
287 /// @param RunTimeLang Optional parameter, Objective-C runtime version.
288 /// @param UniqueIdentifier A unique identifier for the struct.
289 DICompositeType createStructType(DIDescriptor Scope, StringRef Name,
290 DIFile File, unsigned LineNumber,
291 uint64_t SizeInBits, uint64_t AlignInBits,
292 unsigned Flags, DIType DerivedFrom,
293 DIArray Elements, unsigned RunTimeLang = 0,
294 DIType VTableHolder = DIType(),
295 StringRef UniqueIdentifier = StringRef());
297 /// createUnionType - Create debugging information entry for an union.
298 /// @param Scope Scope in which this union is defined.
299 /// @param Name Union name.
300 /// @param File File where this member is defined.
301 /// @param LineNumber Line number.
302 /// @param SizeInBits Member size.
303 /// @param AlignInBits Member alignment.
304 /// @param Flags Flags to encode member attribute, e.g. private
305 /// @param Elements Union elements.
306 /// @param RunTimeLang Optional parameter, Objective-C runtime version.
307 /// @param UniqueIdentifier A unique identifier for the union.
308 DICompositeType createUnionType(
309 DIDescriptor Scope, StringRef Name, DIFile File, unsigned LineNumber,
310 uint64_t SizeInBits, uint64_t AlignInBits, unsigned Flags,
311 DIArray Elements, unsigned RunTimeLang = 0,
312 StringRef UniqueIdentifier = StringRef());
314 /// createTemplateTypeParameter - Create debugging information for template
316 /// @param Scope Scope in which this type is defined.
317 /// @param Name Type parameter name.
318 /// @param Ty Parameter type.
319 /// @param File File where this type parameter is defined.
320 /// @param LineNo Line number.
321 /// @param ColumnNo Column Number.
322 DITemplateTypeParameter
323 createTemplateTypeParameter(DIDescriptor Scope, StringRef Name, DIType Ty,
324 MDNode *File = nullptr, unsigned LineNo = 0,
325 unsigned ColumnNo = 0);
327 /// createTemplateValueParameter - Create debugging information for template
329 /// @param Scope Scope in which this type is defined.
330 /// @param Name Value parameter name.
331 /// @param Ty Parameter type.
332 /// @param Val Constant parameter value.
333 /// @param File File where this type parameter is defined.
334 /// @param LineNo Line number.
335 /// @param ColumnNo Column Number.
336 DITemplateValueParameter
337 createTemplateValueParameter(DIDescriptor Scope, StringRef Name, DIType Ty,
338 Constant *Val, MDNode *File = nullptr,
339 unsigned LineNo = 0, unsigned ColumnNo = 0);
341 /// \brief Create debugging information for a template template parameter.
342 /// @param Scope Scope in which this type is defined.
343 /// @param Name Value parameter name.
344 /// @param Ty Parameter type.
345 /// @param Val The fully qualified name of the template.
346 /// @param File File where this type parameter is defined.
347 /// @param LineNo Line number.
348 /// @param ColumnNo Column Number.
349 DITemplateValueParameter
350 createTemplateTemplateParameter(DIDescriptor Scope, StringRef Name,
351 DIType Ty, StringRef Val,
352 MDNode *File = nullptr, unsigned LineNo = 0,
353 unsigned ColumnNo = 0);
355 /// \brief Create debugging information for a template parameter pack.
356 /// @param Scope Scope in which this type is defined.
357 /// @param Name Value parameter name.
358 /// @param Ty Parameter type.
359 /// @param Val An array of types in the pack.
360 /// @param File File where this type parameter is defined.
361 /// @param LineNo Line number.
362 /// @param ColumnNo Column Number.
363 DITemplateValueParameter
364 createTemplateParameterPack(DIDescriptor Scope, StringRef Name,
365 DIType Ty, DIArray Val, MDNode *File = nullptr,
366 unsigned LineNo = 0, unsigned ColumnNo = 0);
368 /// createArrayType - Create debugging information entry for an array.
369 /// @param Size Array size.
370 /// @param AlignInBits Alignment.
371 /// @param Ty Element type.
372 /// @param Subscripts Subscripts.
373 DICompositeType createArrayType(uint64_t Size, uint64_t AlignInBits,
374 DIType Ty, DIArray Subscripts);
376 /// createVectorType - Create debugging information entry for a vector type.
377 /// @param Size Array size.
378 /// @param AlignInBits Alignment.
379 /// @param Ty Element type.
380 /// @param Subscripts Subscripts.
381 DICompositeType createVectorType(uint64_t Size, uint64_t AlignInBits,
382 DIType Ty, DIArray Subscripts);
384 /// createEnumerationType - Create debugging information entry for an
386 /// @param Scope Scope in which this enumeration is defined.
387 /// @param Name Union name.
388 /// @param File File where this member is defined.
389 /// @param LineNumber Line number.
390 /// @param SizeInBits Member size.
391 /// @param AlignInBits Member alignment.
392 /// @param Elements Enumeration elements.
393 /// @param UnderlyingType Underlying type of a C++11/ObjC fixed enum.
394 /// @param UniqueIdentifier A unique identifier for the enum.
395 DICompositeType createEnumerationType(DIDescriptor Scope, StringRef Name,
396 DIFile File, unsigned LineNumber, uint64_t SizeInBits,
397 uint64_t AlignInBits, DIArray Elements, DIType UnderlyingType,
398 StringRef UniqueIdentifier = StringRef());
400 /// createSubroutineType - Create subroutine type.
401 /// @param File File in which this subroutine is defined.
402 /// @param ParameterTypes An array of subroutine parameter types. This
403 /// includes return type at 0th index.
404 /// @param Flags E.g.: LValueReference.
405 /// These flags are used to emit dwarf attributes.
406 DISubroutineType createSubroutineType(DIFile File,
407 DITypeArray ParameterTypes,
410 /// createArtificialType - Create a new DIType with "artificial" flag set.
411 DIType createArtificialType(DIType Ty);
413 /// createObjectPointerType - Create a new DIType with the "object pointer"
415 DIType createObjectPointerType(DIType Ty);
417 /// \brief Create a permanent forward-declared type.
418 DICompositeType createForwardDecl(unsigned Tag, StringRef Name,
419 DIDescriptor Scope, DIFile F,
420 unsigned Line, unsigned RuntimeLang = 0,
421 uint64_t SizeInBits = 0,
422 uint64_t AlignInBits = 0,
423 StringRef UniqueIdentifier = StringRef());
425 /// \brief Create a temporary forward-declared type.
426 DICompositeType createReplaceableForwardDecl(
427 unsigned Tag, StringRef Name, DIDescriptor Scope, DIFile F,
428 unsigned Line, unsigned RuntimeLang = 0, uint64_t SizeInBits = 0,
429 uint64_t AlignInBits = 0, StringRef UniqueIdentifier = StringRef());
431 /// retainType - Retain DIType in a module even if it is not referenced
432 /// through debug info anchors.
433 void retainType(DIType T);
435 /// createUnspecifiedParameter - Create unspecified parameter type
436 /// for a subroutine type.
437 DIBasicType createUnspecifiedParameter();
439 /// getOrCreateArray - Get a DIArray, create one if required.
440 DIArray getOrCreateArray(ArrayRef<Value *> Elements);
442 /// getOrCreateTypeArray - Get a DITypeArray, create one if required.
443 DITypeArray getOrCreateTypeArray(ArrayRef<Value *> Elements);
445 /// getOrCreateSubrange - Create a descriptor for a value range. This
446 /// implicitly uniques the values returned.
447 DISubrange getOrCreateSubrange(int64_t Lo, int64_t Count);
450 /// createGlobalVariable - Create a new descriptor for the specified
452 /// @param Context Variable scope.
453 /// @param Name Name of the variable.
454 /// @param LinkageName Mangled name of the variable.
455 /// @param File File where this variable is defined.
456 /// @param LineNo Line number.
457 /// @param Ty Variable Type.
458 /// @param isLocalToUnit Boolean flag indicate whether this variable is
459 /// externally visible or not.
460 /// @param Val llvm::Value of the variable.
461 /// @param Decl Reference to the corresponding declaration.
462 DIGlobalVariable createGlobalVariable(DIDescriptor Context, StringRef Name,
463 StringRef LinkageName, DIFile File,
464 unsigned LineNo, DITypeRef Ty,
467 MDNode *Decl = nullptr);
469 /// createTempGlobalVariableFwdDecl - Identical to createGlobalVariable
470 /// except that the resulting DbgNode is temporary and meant to be RAUWed.
471 DIGlobalVariable createTempGlobalVariableFwdDecl(
472 DIDescriptor Context, StringRef Name, StringRef LinkageName,
473 DIFile File, unsigned LineNo, DITypeRef Ty, bool isLocalToUnit,
474 llvm::Constant *Val, MDNode *Decl = nullptr);
476 /// createLocalVariable - Create a new descriptor for the specified
478 /// @param Tag Dwarf TAG. Usually DW_TAG_auto_variable or
479 /// DW_TAG_arg_variable.
480 /// @param Scope Variable scope.
481 /// @param Name Variable name.
482 /// @param File File where this variable is defined.
483 /// @param LineNo Line number.
484 /// @param Ty Variable Type
485 /// @param AlwaysPreserve Boolean. Set to true if debug info for this
486 /// variable should be preserved in optimized build.
487 /// @param Flags Flags, e.g. artificial variable.
488 /// @param ArgNo If this variable is an argument then this argument's
489 /// number. 1 indicates 1st argument.
490 DIVariable createLocalVariable(unsigned Tag, DIDescriptor Scope,
492 DIFile File, unsigned LineNo,
493 DITypeRef Ty, bool AlwaysPreserve = false,
497 /// createExpression - Create a new descriptor for the specified
498 /// variable which has a complex address expression for its address.
499 /// @param Addr An array of complex address operations.
500 DIExpression createExpression(ArrayRef<int64_t> Addr = None);
502 /// createPieceExpression - Create a descriptor to describe one part
503 /// of aggregate variable that is fragmented across multiple Values.
505 /// @param OffsetInBytes Offset of the piece in bytes.
506 /// @param SizeInBytes Size of the piece in bytes.
507 DIExpression createPieceExpression(unsigned OffsetInBytes,
508 unsigned SizeInBytes);
510 /// createFunction - Create a new descriptor for the specified subprogram.
511 /// See comments in DISubprogram for descriptions of these fields.
512 /// @param Scope Function scope.
513 /// @param Name Function name.
514 /// @param LinkageName Mangled function name.
515 /// @param File File where this variable is defined.
516 /// @param LineNo Line number.
517 /// @param Ty Function type.
518 /// @param isLocalToUnit True if this function is not externally visible.
519 /// @param isDefinition True if this is a function definition.
520 /// @param ScopeLine Set to the beginning of the scope this starts
521 /// @param Flags e.g. is this function prototyped or not.
522 /// These flags are used to emit dwarf attributes.
523 /// @param isOptimized True if optimization is ON.
524 /// @param Fn llvm::Function pointer.
525 /// @param TParam Function template parameters.
526 DISubprogram createFunction(DIDescriptor Scope, StringRef Name,
527 StringRef LinkageName,
528 DIFile File, unsigned LineNo,
529 DICompositeType Ty, bool isLocalToUnit,
533 bool isOptimized = false,
534 Function *Fn = nullptr,
535 MDNode *TParam = nullptr,
536 MDNode *Decl = nullptr);
538 /// createTempFunctionFwdDecl - Identical to createFunction,
539 /// except that the resulting DbgNode is meant to be RAUWed.
540 DISubprogram createTempFunctionFwdDecl(DIDescriptor Scope, StringRef Name,
541 StringRef LinkageName,
542 DIFile File, unsigned LineNo,
543 DICompositeType Ty, bool isLocalToUnit,
547 bool isOptimized = false,
548 Function *Fn = nullptr,
549 MDNode *TParam = nullptr,
550 MDNode *Decl = nullptr);
553 /// FIXME: this is added for dragonegg. Once we update dragonegg
554 /// to call resolve function, this will be removed.
555 DISubprogram createFunction(DIScopeRef Scope, StringRef Name,
556 StringRef LinkageName,
557 DIFile File, unsigned LineNo,
558 DICompositeType Ty, bool isLocalToUnit,
562 bool isOptimized = false,
563 Function *Fn = nullptr,
564 MDNode *TParam = nullptr,
565 MDNode *Decl = nullptr);
567 /// createMethod - Create a new descriptor for the specified C++ method.
568 /// See comments in DISubprogram for descriptions of these fields.
569 /// @param Scope Function scope.
570 /// @param Name Function name.
571 /// @param LinkageName Mangled function name.
572 /// @param File File where this variable is defined.
573 /// @param LineNo Line number.
574 /// @param Ty Function type.
575 /// @param isLocalToUnit True if this function is not externally visible..
576 /// @param isDefinition True if this is a function definition.
577 /// @param Virtuality Attributes describing virtualness. e.g. pure
578 /// virtual function.
579 /// @param VTableIndex Index no of this method in virtual table.
580 /// @param VTableHolder Type that holds vtable.
581 /// @param Flags e.g. is this function prototyped or not.
582 /// This flags are used to emit dwarf attributes.
583 /// @param isOptimized True if optimization is ON.
584 /// @param Fn llvm::Function pointer.
585 /// @param TParam Function template parameters.
586 DISubprogram createMethod(DIDescriptor Scope, StringRef Name,
587 StringRef LinkageName,
588 DIFile File, unsigned LineNo,
589 DICompositeType Ty, bool isLocalToUnit,
591 unsigned Virtuality = 0, unsigned VTableIndex = 0,
592 DIType VTableHolder = DIType(),
594 bool isOptimized = false,
595 Function *Fn = nullptr,
596 MDNode *TParam = nullptr);
598 /// createNameSpace - This creates new descriptor for a namespace
599 /// with the specified parent scope.
600 /// @param Scope Namespace scope
601 /// @param Name Name of this namespace
602 /// @param File Source file
603 /// @param LineNo Line number
604 DINameSpace createNameSpace(DIDescriptor Scope, StringRef Name,
605 DIFile File, unsigned LineNo);
608 /// createLexicalBlockFile - This creates a descriptor for a lexical
609 /// block with a new file attached. This merely extends the existing
610 /// lexical block as it crosses a file.
611 /// @param Scope Lexical block.
612 /// @param File Source file.
613 /// @param Discriminator DWARF path discriminator value.
614 DILexicalBlockFile createLexicalBlockFile(DIDescriptor Scope, DIFile File,
615 unsigned Discriminator = 0);
617 /// createLexicalBlock - This creates a descriptor for a lexical block
618 /// with the specified parent context.
619 /// @param Scope Parent lexical scope.
620 /// @param File Source file.
621 /// @param Line Line number.
622 /// @param Col Column number.
623 DILexicalBlock createLexicalBlock(DIDescriptor Scope, DIFile File,
624 unsigned Line, unsigned Col);
626 /// \brief Create a descriptor for an imported module.
627 /// @param Context The scope this module is imported into
628 /// @param NS The namespace being imported here
629 /// @param Line Line number
630 DIImportedEntity createImportedModule(DIScope Context, DINameSpace NS,
633 /// \brief Create a descriptor for an imported module.
634 /// @param Context The scope this module is imported into
635 /// @param NS An aliased namespace
636 /// @param Line Line number
637 DIImportedEntity createImportedModule(DIScope Context, DIImportedEntity NS,
640 /// \brief Create a descriptor for an imported function.
641 /// @param Context The scope this module is imported into
642 /// @param Decl The declaration (or definition) of a function, type, or
644 /// @param Line Line number
645 DIImportedEntity createImportedDeclaration(DIScope Context, DIDescriptor Decl,
647 StringRef Name = StringRef());
648 DIImportedEntity createImportedDeclaration(DIScope Context,
651 StringRef Name = StringRef());
653 /// insertDeclare - Insert a new llvm.dbg.declare intrinsic call.
654 /// @param Storage llvm::Value of the variable
655 /// @param VarInfo Variable's debug info descriptor.
656 /// @param Expr A complex location expression.
657 /// @param InsertAtEnd Location for the new intrinsic.
658 Instruction *insertDeclare(llvm::Value *Storage, DIVariable VarInfo,
659 DIExpression Expr, BasicBlock *InsertAtEnd);
661 /// insertDeclare - Insert a new llvm.dbg.declare intrinsic call.
662 /// @param Storage llvm::Value of the variable
663 /// @param VarInfo Variable's debug info descriptor.
664 /// @param Expr A complex location expression.
665 /// @param InsertBefore Location for the new intrinsic.
666 Instruction *insertDeclare(llvm::Value *Storage, DIVariable VarInfo,
667 DIExpression Expr, Instruction *InsertBefore);
669 /// insertDbgValueIntrinsic - Insert a new llvm.dbg.value intrinsic call.
670 /// @param Val llvm::Value of the variable
671 /// @param Offset Offset
672 /// @param VarInfo Variable's debug info descriptor.
673 /// @param Expr A complex location expression.
674 /// @param InsertAtEnd Location for the new intrinsic.
675 Instruction *insertDbgValueIntrinsic(llvm::Value *Val, uint64_t Offset,
676 DIVariable VarInfo, DIExpression Expr,
677 BasicBlock *InsertAtEnd);
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 Expr A complex location expression.
684 /// @param InsertBefore Location for the new intrinsic.
685 Instruction *insertDbgValueIntrinsic(llvm::Value *Val, uint64_t Offset,
686 DIVariable VarInfo, DIExpression Expr,
687 Instruction *InsertBefore);
689 } // end namespace llvm