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