LLVM  5.0.0
DIBuilder.h
Go to the documentation of this file.
1 //===- DIBuilder.h - Debug Information Builder ------------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file defines a DIBuilder that is useful for creating debugging
11 // information entries in LLVM IR form.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_IR_DIBUILDER_H
16 #define LLVM_IR_DIBUILDER_H
17 
18 #include "llvm/ADT/ArrayRef.h"
19 #include "llvm/ADT/DenseMap.h"
20 #include "llvm/ADT/MapVector.h"
21 #include "llvm/ADT/None.h"
22 #include "llvm/ADT/SetVector.h"
23 #include "llvm/ADT/SmallVector.h"
24 #include "llvm/ADT/StringRef.h"
25 #include "llvm/IR/DebugInfo.h"
27 #include "llvm/IR/TrackingMDRef.h"
28 #include "llvm/Support/Casting.h"
29 #include <algorithm>
30 #include <cstdint>
31 
32 namespace llvm {
33 
34  class BasicBlock;
35  class Constant;
36  class Function;
37  class Instruction;
38  class LLVMContext;
39  class Module;
40  class Value;
41 
42  class DIBuilder {
43  Module &M;
44  LLVMContext &VMContext;
45 
46  DICompileUnit *CUNode; ///< The one compile unit created by this DIBuiler.
47  Function *DeclareFn; ///< llvm.dbg.declare
48  Function *ValueFn; ///< llvm.dbg.value
49 
50  SmallVector<Metadata *, 4> AllEnumTypes;
51  /// Track the RetainTypes, since they can be updated later on.
52  SmallVector<TrackingMDNodeRef, 4> AllRetainTypes;
53  SmallVector<Metadata *, 4> AllSubprograms;
55  SmallVector<TrackingMDNodeRef, 4> AllImportedModules;
56  /// Map Macro parent (which can be DIMacroFile or nullptr) to a list of
57  /// Metadata all of type DIMacroNode.
58  /// DIMacroNode's with nullptr parent are DICompileUnit direct children.
60 
61  /// Track nodes that may be unresolved.
62  SmallVector<TrackingMDNodeRef, 4> UnresolvedNodes;
63  bool AllowUnresolvedNodes;
64 
65  /// Each subprogram's preserved local variables.
66  ///
67  /// Do not use a std::vector. Some versions of libc++ apparently copy
68  /// instead of move on grow operations, and TrackingMDRef is expensive to
69  /// copy.
71 
72  /// Create a temporary.
73  ///
74  /// Create an \a temporary node and track it in \a UnresolvedNodes.
75  void trackIfUnresolved(MDNode *N);
76 
77  public:
78  /// Construct a builder for a module.
79  ///
80  /// If \c AllowUnresolved, collect unresolved nodes attached to the module
81  /// in order to resolve cycles during \a finalize().
82  explicit DIBuilder(Module &M, bool AllowUnresolved = true);
83  DIBuilder(const DIBuilder &) = delete;
84  DIBuilder &operator=(const DIBuilder &) = delete;
85 
86  /// Construct any deferred debug info descriptors.
87  void finalize();
88 
89  /// Finalize a specific subprogram - no new variables may be added to this
90  /// subprogram afterwards.
92 
93  /// 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 info.
97  /// \param Producer Identify the producer of debugging information
98  /// and code. Usually this is a compiler
99  /// version string.
100  /// \param isOptimized A boolean flag which indicates whether optimization
101  /// is enabled or not.
102  /// \param Flags This string lists command line options. This
103  /// string is directly embedded in debug info
104  /// output which may be used by a tool
105  /// analyzing generated debugging information.
106  /// \param RV This indicates runtime version for languages like
107  /// Objective-C.
108  /// \param SplitName The name of the file that we'll split debug info
109  /// out into.
110  /// \param Kind The kind of debug information to generate.
111  /// \param DWOId The DWOId if this is a split skeleton compile unit.
112  /// \param SplitDebugInlining Whether to emit inline debug info.
113  /// \param DebugInfoForProfiling Whether to emit extra debug info for
114  /// profile collection.
115  DICompileUnit *
116  createCompileUnit(unsigned Lang, DIFile *File, StringRef Producer,
117  bool isOptimized, StringRef Flags, unsigned RV,
118  StringRef SplitName = StringRef(),
120  DICompileUnit::DebugEmissionKind::FullDebug,
121  uint64_t DWOId = 0, bool SplitDebugInlining = true,
122  bool DebugInfoForProfiling = false);
123 
124  /// Create a file descriptor to hold debugging information for a file.
125  /// \param Filename File name.
126  /// \param Directory Directory.
127  /// \param CSKind Checksum kind (e.g. CSK_None, CSK_MD5, CSK_SHA1, etc.).
128  /// \param Checksum Checksum data.
129  DIFile *createFile(StringRef Filename, StringRef Directory,
131  StringRef Checksum = StringRef());
132 
133  /// Create debugging information entry for a macro.
134  /// \param Parent Macro parent (could be nullptr).
135  /// \param Line Source line number where the macro is defined.
136  /// \param MacroType DW_MACINFO_define or DW_MACINFO_undef.
137  /// \param Name Macro name.
138  /// \param Value Macro value.
139  DIMacro *createMacro(DIMacroFile *Parent, unsigned Line, unsigned MacroType,
141 
142  /// Create debugging information temporary entry for a macro file.
143  /// List of macro node direct children will be calculated by DIBuilder,
144  /// using the \p Parent relationship.
145  /// \param Parent Macro file parent (could be nullptr).
146  /// \param Line Source line number where the macro file is included.
147  /// \param File File descriptor containing the name of the macro file.
148  DIMacroFile *createTempMacroFile(DIMacroFile *Parent, unsigned Line,
149  DIFile *File);
150 
151  /// Create a single enumerator value.
152  DIEnumerator *createEnumerator(StringRef Name, int64_t Val);
153 
154  /// Create a DWARF unspecified type.
156 
157  /// Create C++11 nullptr type.
159 
160  /// Create debugging information entry for a basic
161  /// type.
162  /// \param Name Type name.
163  /// \param SizeInBits Size of the type.
164  /// \param Encoding DWARF encoding code, e.g. dwarf::DW_ATE_float.
165  DIBasicType *createBasicType(StringRef Name, uint64_t SizeInBits,
166  unsigned Encoding);
167 
168  /// Create debugging information entry for a qualified
169  /// type, e.g. 'const int'.
170  /// \param Tag Tag identifing type, e.g. dwarf::TAG_volatile_type
171  /// \param FromTy Base Type.
172  DIDerivedType *createQualifiedType(unsigned Tag, DIType *FromTy);
173 
174  /// Create debugging information entry for a pointer.
175  /// \param PointeeTy Type pointed by this pointer.
176  /// \param SizeInBits Size.
177  /// \param AlignInBits Alignment. (optional)
178  /// \param DWARFAddressSpace DWARF address space. (optional)
179  /// \param Name Pointer type name. (optional)
180  DIDerivedType *createPointerType(DIType *PointeeTy, uint64_t SizeInBits,
181  uint32_t AlignInBits = 0,
182  Optional<unsigned> DWARFAddressSpace =
183  None,
184  StringRef Name = "");
185 
186  /// Create debugging information entry for a pointer to member.
187  /// \param PointeeTy Type pointed to by this pointer.
188  /// \param SizeInBits Size.
189  /// \param AlignInBits Alignment. (optional)
190  /// \param Class Type for which this pointer points to members of.
191  DIDerivedType *
192  createMemberPointerType(DIType *PointeeTy, DIType *Class,
193  uint64_t SizeInBits, uint32_t AlignInBits = 0,
194  DINode::DIFlags Flags = DINode::FlagZero);
195 
196  /// Create debugging information entry for a c++
197  /// style reference or rvalue reference type.
198  DIDerivedType *createReferenceType(unsigned Tag, DIType *RTy,
199  uint64_t SizeInBits = 0,
200  uint32_t AlignInBits = 0,
201  Optional<unsigned> DWARFAddressSpace =
202  None);
203 
204  /// Create debugging information entry for a typedef.
205  /// \param Ty Original type.
206  /// \param Name Typedef name.
207  /// \param File File where this type is defined.
208  /// \param LineNo Line number.
209  /// \param Context The surrounding context for the typedef.
211  unsigned LineNo, DIScope *Context);
212 
213  /// Create debugging information entry for a 'friend'.
214  DIDerivedType *createFriend(DIType *Ty, DIType *FriendTy);
215 
216  /// Create debugging information entry to establish
217  /// inheritance relationship between two types.
218  /// \param Ty Original type.
219  /// \param BaseTy Base type. Ty is inherits from base.
220  /// \param BaseOffset Base offset.
221  /// \param Flags Flags to describe inheritance attribute,
222  /// e.g. private
224  uint64_t BaseOffset,
225  DINode::DIFlags Flags);
226 
227  /// Create debugging information entry for a member.
228  /// \param Scope Member scope.
229  /// \param Name Member name.
230  /// \param File File where this member is defined.
231  /// \param LineNo Line number.
232  /// \param SizeInBits Member size.
233  /// \param AlignInBits Member alignment.
234  /// \param OffsetInBits Member offset.
235  /// \param Flags Flags to encode member attribute, e.g. private
236  /// \param Ty Parent type.
238  DIFile *File, unsigned LineNo,
239  uint64_t SizeInBits,
240  uint32_t AlignInBits,
241  uint64_t OffsetInBits,
242  DINode::DIFlags Flags, DIType *Ty);
243 
244  /// Create debugging information entry for a bit field member.
245  /// \param Scope Member scope.
246  /// \param Name Member name.
247  /// \param File File where this member is defined.
248  /// \param LineNo Line number.
249  /// \param SizeInBits Member size.
250  /// \param OffsetInBits Member offset.
251  /// \param StorageOffsetInBits Member storage offset.
252  /// \param Flags Flags to encode member attribute.
253  /// \param Ty Parent type.
255  DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo,
256  uint64_t SizeInBits, uint64_t OffsetInBits,
257  uint64_t StorageOffsetInBits, DINode::DIFlags Flags, DIType *Ty);
258 
259  /// Create debugging information entry for a
260  /// C++ static data member.
261  /// \param Scope Member scope.
262  /// \param Name Member name.
263  /// \param File File where this member is declared.
264  /// \param LineNo Line number.
265  /// \param Ty Type of the static member.
266  /// \param Flags Flags to encode member attribute, e.g. private.
267  /// \param Val Const initializer of the member.
268  /// \param AlignInBits Member alignment.
270  DIFile *File, unsigned LineNo,
271  DIType *Ty, DINode::DIFlags Flags,
272  Constant *Val,
273  uint32_t AlignInBits = 0);
274 
275  /// Create debugging information entry for Objective-C
276  /// instance variable.
277  /// \param Name Member name.
278  /// \param File File where this member is defined.
279  /// \param LineNo Line number.
280  /// \param SizeInBits Member size.
281  /// \param AlignInBits Member alignment.
282  /// \param OffsetInBits Member offset.
283  /// \param Flags Flags to encode member attribute, e.g. private
284  /// \param Ty Parent type.
285  /// \param PropertyNode Property associated with this ivar.
286  DIDerivedType *createObjCIVar(StringRef Name, DIFile *File, unsigned LineNo,
287  uint64_t SizeInBits, uint32_t AlignInBits,
288  uint64_t OffsetInBits, DINode::DIFlags Flags,
289  DIType *Ty, MDNode *PropertyNode);
290 
291  /// Create debugging information entry for Objective-C
292  /// property.
293  /// \param Name Property name.
294  /// \param File File where this property is defined.
295  /// \param LineNumber Line number.
296  /// \param GetterName Name of the Objective C property getter selector.
297  /// \param SetterName Name of the Objective C property setter selector.
298  /// \param PropertyAttributes Objective C property attributes.
299  /// \param Ty Type.
301  unsigned LineNumber,
302  StringRef GetterName,
303  StringRef SetterName,
304  unsigned PropertyAttributes, DIType *Ty);
305 
306  /// Create debugging information entry for a class.
307  /// \param Scope Scope in which this class is defined.
308  /// \param Name class name.
309  /// \param File File where this member is defined.
310  /// \param LineNumber Line number.
311  /// \param SizeInBits Member size.
312  /// \param AlignInBits Member alignment.
313  /// \param OffsetInBits Member offset.
314  /// \param Flags Flags to encode member attribute, e.g. private
315  /// \param Elements class members.
316  /// \param VTableHolder Debug info of the base class that contains vtable
317  /// for this type. This is used in
318  /// DW_AT_containing_type. See DWARF documentation
319  /// for more info.
320  /// \param TemplateParms Template type parameters.
321  /// \param UniqueIdentifier A unique identifier for the class.
323  DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber,
324  uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits,
325  DINode::DIFlags Flags, DIType *DerivedFrom, DINodeArray Elements,
326  DIType *VTableHolder = nullptr, MDNode *TemplateParms = nullptr,
327  StringRef UniqueIdentifier = "");
328 
329  /// Create debugging information entry for a struct.
330  /// \param Scope Scope in which this struct is defined.
331  /// \param Name Struct name.
332  /// \param File File where this member is defined.
333  /// \param LineNumber Line number.
334  /// \param SizeInBits Member size.
335  /// \param AlignInBits Member alignment.
336  /// \param Flags Flags to encode member attribute, e.g. private
337  /// \param Elements Struct elements.
338  /// \param RunTimeLang Optional parameter, Objective-C runtime version.
339  /// \param UniqueIdentifier A unique identifier for the struct.
341  DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber,
342  uint64_t SizeInBits, uint32_t AlignInBits, DINode::DIFlags Flags,
343  DIType *DerivedFrom, DINodeArray Elements, unsigned RunTimeLang = 0,
344  DIType *VTableHolder = nullptr, StringRef UniqueIdentifier = "");
345 
346  /// Create debugging information entry for an union.
347  /// \param Scope Scope in which this union is defined.
348  /// \param Name Union name.
349  /// \param File File where this member is defined.
350  /// \param LineNumber Line number.
351  /// \param SizeInBits Member size.
352  /// \param AlignInBits Member alignment.
353  /// \param Flags Flags to encode member attribute, e.g. private
354  /// \param Elements Union elements.
355  /// \param RunTimeLang Optional parameter, Objective-C runtime version.
356  /// \param UniqueIdentifier A unique identifier for the union.
358  DIFile *File, unsigned LineNumber,
359  uint64_t SizeInBits, uint32_t AlignInBits,
360  DINode::DIFlags Flags,
361  DINodeArray Elements,
362  unsigned RunTimeLang = 0,
363  StringRef UniqueIdentifier = "");
364 
365  /// Create debugging information for template
366  /// type parameter.
367  /// \param Scope Scope in which this type is defined.
368  /// \param Name Type parameter name.
369  /// \param Ty Parameter type.
372 
373  /// Create debugging information for template
374  /// value parameter.
375  /// \param Scope Scope in which this type is defined.
376  /// \param Name Value parameter name.
377  /// \param Ty Parameter type.
378  /// \param Val Constant parameter value.
380  StringRef Name,
381  DIType *Ty,
382  Constant *Val);
383 
384  /// Create debugging information for a template template parameter.
385  /// \param Scope Scope in which this type is defined.
386  /// \param Name Value parameter name.
387  /// \param Ty Parameter type.
388  /// \param Val The fully qualified name of the template.
390  StringRef Name,
391  DIType *Ty,
392  StringRef Val);
393 
394  /// Create debugging information for a template parameter pack.
395  /// \param Scope Scope in which this type is defined.
396  /// \param Name Value parameter name.
397  /// \param Ty Parameter type.
398  /// \param Val An array of types in the pack.
400  StringRef Name,
401  DIType *Ty,
402  DINodeArray Val);
403 
404  /// Create debugging information entry for an array.
405  /// \param Size Array size.
406  /// \param AlignInBits Alignment.
407  /// \param Ty Element type.
408  /// \param Subscripts Subscripts.
409  DICompositeType *createArrayType(uint64_t Size, uint32_t AlignInBits,
410  DIType *Ty, DINodeArray Subscripts);
411 
412  /// Create debugging information entry for a vector type.
413  /// \param Size Array size.
414  /// \param AlignInBits Alignment.
415  /// \param Ty Element type.
416  /// \param Subscripts Subscripts.
417  DICompositeType *createVectorType(uint64_t Size, uint32_t AlignInBits,
418  DIType *Ty, DINodeArray Subscripts);
419 
420  /// Create debugging information entry for an
421  /// enumeration.
422  /// \param Scope Scope in which this enumeration is defined.
423  /// \param Name Union name.
424  /// \param File File where this member is defined.
425  /// \param LineNumber Line number.
426  /// \param SizeInBits Member size.
427  /// \param AlignInBits Member alignment.
428  /// \param Elements Enumeration elements.
429  /// \param UnderlyingType Underlying type of a C++11/ObjC fixed enum.
430  /// \param UniqueIdentifier A unique identifier for the enum.
432  DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber,
433  uint64_t SizeInBits, uint32_t AlignInBits, DINodeArray Elements,
434  DIType *UnderlyingType, StringRef UniqueIdentifier = "");
435 
436  /// Create subroutine type.
437  /// \param ParameterTypes An array of subroutine parameter types. This
438  /// includes return type at 0th index.
439  /// \param Flags E.g.: LValueReference.
440  /// These flags are used to emit dwarf attributes.
441  /// \param CC Calling convention, e.g. dwarf::DW_CC_normal
443  createSubroutineType(DITypeRefArray ParameterTypes,
444  DINode::DIFlags Flags = DINode::FlagZero,
445  unsigned CC = 0);
446 
447  /// Create a new DIType* with "artificial" flag set.
449 
450  /// Create a new DIType* with the "object pointer"
451  /// flag set.
453 
454  /// Create a permanent forward-declared type.
455  DICompositeType *createForwardDecl(unsigned Tag, StringRef Name,
456  DIScope *Scope, DIFile *F, unsigned Line,
457  unsigned RuntimeLang = 0,
458  uint64_t SizeInBits = 0,
459  uint32_t AlignInBits = 0,
460  StringRef UniqueIdentifier = "");
461 
462  /// Create a temporary forward-declared type.
464  unsigned Tag, StringRef Name, DIScope *Scope, DIFile *F, unsigned Line,
465  unsigned RuntimeLang = 0, uint64_t SizeInBits = 0,
466  uint32_t AlignInBits = 0, DINode::DIFlags Flags = DINode::FlagFwdDecl,
467  StringRef UniqueIdentifier = "");
468 
469  /// Retain DIScope* in a module even if it is not referenced
470  /// through debug info anchors.
471  void retainType(DIScope *T);
472 
473  /// Create unspecified parameter type
474  /// for a subroutine type.
476 
477  /// Get a DINodeArray, create one if required.
478  DINodeArray getOrCreateArray(ArrayRef<Metadata *> Elements);
479 
480  /// Get a DIMacroNodeArray, create one if required.
481  DIMacroNodeArray getOrCreateMacroArray(ArrayRef<Metadata *> Elements);
482 
483  /// Get a DITypeRefArray, create one if required.
485 
486  /// Create a descriptor for a value range. This
487  /// implicitly uniques the values returned.
488  DISubrange *getOrCreateSubrange(int64_t Lo, int64_t Count);
489 
490  /// Create a new descriptor for the specified variable.
491  /// \param Context Variable scope.
492  /// \param Name Name of the variable.
493  /// \param LinkageName Mangled name of the variable.
494  /// \param File File where this variable is defined.
495  /// \param LineNo Line number.
496  /// \param Ty Variable Type.
497  /// \param isLocalToUnit Boolean flag indicate whether this variable is
498  /// externally visible or not.
499  /// \param Expr The location of the global relative to the attached
500  /// GlobalVariable.
501  /// \param Decl Reference to the corresponding declaration.
502  /// \param AlignInBits Variable alignment(or 0 if no alignment attr was
503  /// specified)
505  DIScope *Context, StringRef Name, StringRef LinkageName, DIFile *File,
506  unsigned LineNo, DIType *Ty, bool isLocalToUnit,
507  DIExpression *Expr = nullptr, MDNode *Decl = nullptr,
508  uint32_t AlignInBits = 0);
509 
510  /// Identical to createGlobalVariable
511  /// except that the resulting DbgNode is temporary and meant to be RAUWed.
513  DIScope *Context, StringRef Name, StringRef LinkageName, DIFile *File,
514  unsigned LineNo, DIType *Ty, bool isLocalToUnit, MDNode *Decl = nullptr,
515  uint32_t AlignInBits = 0);
516 
517  /// Create a new descriptor for an auto variable. This is a local variable
518  /// that is not a subprogram parameter.
519  ///
520  /// \c Scope must be a \a DILocalScope, and thus its scope chain eventually
521  /// leads to a \a DISubprogram.
522  ///
523  /// If \c AlwaysPreserve, this variable will be referenced from its
524  /// containing subprogram, and will survive some optimizations.
526  createAutoVariable(DIScope *Scope, StringRef Name, DIFile *File,
527  unsigned LineNo, DIType *Ty, bool AlwaysPreserve = false,
528  DINode::DIFlags Flags = DINode::FlagZero,
529  uint32_t AlignInBits = 0);
530 
531  /// Create a new descriptor for a parameter variable.
532  ///
533  /// \c Scope must be a \a DILocalScope, and thus its scope chain eventually
534  /// leads to a \a DISubprogram.
535  ///
536  /// \c ArgNo is the index (starting from \c 1) of this variable in the
537  /// subprogram parameters. \c ArgNo should not conflict with other
538  /// parameters of the same subprogram.
539  ///
540  /// If \c AlwaysPreserve, this variable will be referenced from its
541  /// containing subprogram, and will survive some optimizations.
543  createParameterVariable(DIScope *Scope, StringRef Name, unsigned ArgNo,
544  DIFile *File, unsigned LineNo, DIType *Ty,
545  bool AlwaysPreserve = false,
546  DINode::DIFlags Flags = DINode::FlagZero);
547 
548  /// Create a new descriptor for the specified
549  /// variable which has a complex address expression for its address.
550  /// \param Addr An array of complex address operations.
553 
554  /// Create a descriptor to describe one part
555  /// of aggregate variable that is fragmented across multiple Values.
556  ///
557  /// \param OffsetInBits Offset of the piece in bits.
558  /// \param SizeInBits Size of the piece in bits.
559  DIExpression *createFragmentExpression(unsigned OffsetInBits,
560  unsigned SizeInBits);
561 
562  /// Create an expression for a variable that does not have an address, but
563  /// does have a constant value.
565  return DIExpression::get(
566  VMContext, {dwarf::DW_OP_constu, Val, dwarf::DW_OP_stack_value});
567  }
568 
569  /// Create a new descriptor for the specified subprogram.
570  /// See comments in DISubprogram* for descriptions of these fields.
571  /// \param Scope Function scope.
572  /// \param Name Function name.
573  /// \param LinkageName Mangled function name.
574  /// \param File File where this variable is defined.
575  /// \param LineNo Line number.
576  /// \param Ty Function type.
577  /// \param isLocalToUnit True if this function is not externally visible.
578  /// \param isDefinition True if this is a function definition.
579  /// \param ScopeLine Set to the beginning of the scope this starts
580  /// \param Flags e.g. is this function prototyped or not.
581  /// These flags are used to emit dwarf attributes.
582  /// \param isOptimized True if optimization is ON.
583  /// \param TParams Function template parameters.
584  /// \param ThrownTypes Exception types this function may throw.
586  DIScope *Scope, StringRef Name, StringRef LinkageName, DIFile *File,
587  unsigned LineNo, DISubroutineType *Ty, bool isLocalToUnit,
588  bool isDefinition, unsigned ScopeLine,
589  DINode::DIFlags Flags = DINode::FlagZero, bool isOptimized = false,
590  DITemplateParameterArray TParams = nullptr,
591  DISubprogram *Decl = nullptr, DITypeArray ThrownTypes = nullptr);
592 
593  /// Identical to createFunction,
594  /// except that the resulting DbgNode is meant to be RAUWed.
596  DIScope *Scope, StringRef Name, StringRef LinkageName, DIFile *File,
597  unsigned LineNo, DISubroutineType *Ty, bool isLocalToUnit,
598  bool isDefinition, unsigned ScopeLine,
599  DINode::DIFlags Flags = DINode::FlagZero, bool isOptimized = false,
600  DITemplateParameterArray TParams = nullptr,
601  DISubprogram *Decl = nullptr, DITypeArray ThrownTypes = nullptr);
602 
603  /// Create a new descriptor for the specified C++ method.
604  /// See comments in \a DISubprogram* for descriptions of these fields.
605  /// \param Scope Function scope.
606  /// \param Name Function name.
607  /// \param LinkageName Mangled function name.
608  /// \param File File where this variable is defined.
609  /// \param LineNo Line number.
610  /// \param Ty Function type.
611  /// \param isLocalToUnit True if this function is not externally visible..
612  /// \param isDefinition True if this is a function definition.
613  /// \param Virtuality Attributes describing virtualness. e.g. pure
614  /// virtual function.
615  /// \param VTableIndex Index no of this method in virtual table, or -1u if
616  /// unrepresentable.
617  /// \param ThisAdjustment
618  /// MS ABI-specific adjustment of 'this' that occurs
619  /// in the prologue.
620  /// \param VTableHolder Type that holds vtable.
621  /// \param Flags e.g. is this function prototyped or not.
622  /// This flags are used to emit dwarf attributes.
623  /// \param isOptimized True if optimization is ON.
624  /// \param TParams Function template parameters.
625  /// \param ThrownTypes Exception types this function may throw.
627  DIScope *Scope, StringRef Name, StringRef LinkageName, DIFile *File,
628  unsigned LineNo, DISubroutineType *Ty, bool isLocalToUnit,
629  bool isDefinition, unsigned Virtuality = 0, unsigned VTableIndex = 0,
630  int ThisAdjustment = 0, DIType *VTableHolder = nullptr,
631  DINode::DIFlags Flags = DINode::FlagZero, bool isOptimized = false,
632  DITemplateParameterArray TParams = nullptr,
633  DITypeArray ThrownTypes = nullptr);
634 
635  /// This creates new descriptor for a namespace with the specified
636  /// parent scope.
637  /// \param Scope Namespace scope
638  /// \param Name Name of this namespace
639  /// \param ExportSymbols True for C++ inline namespaces.
641  bool ExportSymbols);
642 
643  /// This creates new descriptor for a module with the specified
644  /// parent scope.
645  /// \param Scope Parent scope
646  /// \param Name Name of this module
647  /// \param ConfigurationMacros
648  /// A space-separated shell-quoted list of -D macro
649  /// definitions as they would appear on a command line.
650  /// \param IncludePath The path to the module map file.
651  /// \param ISysRoot The clang system root (value of -isysroot).
652  DIModule *createModule(DIScope *Scope, StringRef Name,
653  StringRef ConfigurationMacros,
654  StringRef IncludePath,
655  StringRef ISysRoot);
656 
657  /// This creates a descriptor for a lexical block with a new file
658  /// attached. This merely extends the existing
659  /// lexical block as it crosses a file.
660  /// \param Scope Lexical block.
661  /// \param File Source file.
662  /// \param Discriminator DWARF path discriminator value.
664  unsigned Discriminator = 0);
665 
666  /// This creates a descriptor for a lexical block with the
667  /// specified parent context.
668  /// \param Scope Parent lexical scope.
669  /// \param File Source file.
670  /// \param Line Line number.
671  /// \param Col Column number.
673  unsigned Line, unsigned Col);
674 
675  /// Create a descriptor for an imported module.
676  /// \param Context The scope this module is imported into
677  /// \param NS The namespace being imported here.
678  /// \param File File where the declaration is located.
679  /// \param Line Line number of the declaration.
681  DIFile *File, unsigned Line);
682 
683  /// Create a descriptor for an imported module.
684  /// \param Context The scope this module is imported into.
685  /// \param NS An aliased namespace.
686  /// \param File File where the declaration is located.
687  /// \param Line Line number of the declaration.
689  DIImportedEntity *NS, DIFile *File,
690  unsigned Line);
691 
692  /// Create a descriptor for an imported module.
693  /// \param Context The scope this module is imported into.
694  /// \param M The module being imported here
695  /// \param File File where the declaration is located.
696  /// \param Line Line number of the declaration.
698  DIFile *File, unsigned Line);
699 
700  /// Create a descriptor for an imported function.
701  /// \param Context The scope this module is imported into.
702  /// \param Decl The declaration (or definition) of a function, type, or
703  /// variable.
704  /// \param File File where the declaration is located.
705  /// \param Line Line number of the declaration.
707  DIFile *File, unsigned Line,
708  StringRef Name = "");
709 
710  /// Insert a new llvm.dbg.declare intrinsic call.
711  /// \param Storage llvm::Value of the variable
712  /// \param VarInfo Variable's debug info descriptor.
713  /// \param Expr A complex location expression.
714  /// \param DL Debug info location.
715  /// \param InsertAtEnd Location for the new intrinsic.
717  DIExpression *Expr, const DILocation *DL,
718  BasicBlock *InsertAtEnd);
719 
720  /// Insert a new llvm.dbg.declare intrinsic call.
721  /// \param Storage llvm::Value of the variable
722  /// \param VarInfo Variable's debug info descriptor.
723  /// \param Expr A complex location expression.
724  /// \param DL Debug info location.
725  /// \param InsertBefore Location for the new intrinsic.
727  DIExpression *Expr, const DILocation *DL,
728  Instruction *InsertBefore);
729 
730  /// Insert a new llvm.dbg.value intrinsic call.
731  /// \param Val llvm::Value of the variable
732  /// \param Offset Offset
733  /// \param VarInfo Variable's debug info descriptor.
734  /// \param Expr A complex location expression.
735  /// \param DL Debug info location.
736  /// \param InsertAtEnd Location for the new intrinsic.
738  DILocalVariable *VarInfo,
739  DIExpression *Expr,
740  const DILocation *DL,
741  BasicBlock *InsertAtEnd);
742 
743  /// Insert a new llvm.dbg.value intrinsic call.
744  /// \param Val llvm::Value of the variable
745  /// \param Offset Offset
746  /// \param VarInfo Variable's debug info descriptor.
747  /// \param Expr A complex location expression.
748  /// \param DL Debug info location.
749  /// \param InsertBefore Location for the new intrinsic.
751  DILocalVariable *VarInfo,
752  DIExpression *Expr,
753  const DILocation *DL,
754  Instruction *InsertBefore);
755 
756  /// Replace the vtable holder in the given composite type.
757  ///
758  /// If this creates a self reference, it may orphan some unresolved cycles
759  /// in the operands of \c T, so \a DIBuilder needs to track that.
761  DICompositeType *VTableHolder);
762 
763  /// Replace arrays on a composite type.
764  ///
765  /// If \c T is resolved, but the arrays aren't -- which can happen if \c T
766  /// has a self-reference -- \a DIBuilder needs to track the array to
767  /// resolve cycles.
768  void replaceArrays(DICompositeType *&T, DINodeArray Elements,
769  DINodeArray TParams = DINodeArray());
770 
771  /// Replace a temporary node.
772  ///
773  /// Call \a MDNode::replaceAllUsesWith() on \c N, replacing it with \c
774  /// Replacement.
775  ///
776  /// If \c Replacement is the same as \c N.get(), instead call \a
777  /// MDNode::replaceWithUniqued(). In this case, the uniqued node could
778  /// have a different address, so we return the final address.
779  template <class NodeTy>
780  NodeTy *replaceTemporary(TempMDNode &&N, NodeTy *Replacement) {
781  if (N.get() == Replacement)
782  return cast<NodeTy>(MDNode::replaceWithUniqued(std::move(N)));
783 
784  N->replaceAllUsesWith(Replacement);
785  return Replacement;
786  }
787  };
788 
789  // Create wrappers for C Binding types (see CBindingWrapping.h).
791 
792 } // end namespace llvm
793 
794 #endif // LLVM_IR_DIBUILDER_H
void finalize()
Construct any deferred debug info descriptors.
Definition: DIBuilder.cpp:57
DISubprogram * createTempFunctionFwdDecl(DIScope *Scope, StringRef Name, StringRef LinkageName, DIFile *File, unsigned LineNo, DISubroutineType *Ty, bool isLocalToUnit, bool isDefinition, unsigned ScopeLine, DINode::DIFlags Flags=DINode::FlagZero, bool isOptimized=false, DITemplateParameterArray TParams=nullptr, DISubprogram *Decl=nullptr, DITypeArray ThrownTypes=nullptr)
Identical to createFunction, except that the resulting DbgNode is meant to be RAUWed.
Definition: DIBuilder.cpp:703
DISubprogram * createFunction(DIScope *Scope, StringRef Name, StringRef LinkageName, DIFile *File, unsigned LineNo, DISubroutineType *Ty, bool isLocalToUnit, bool isDefinition, unsigned ScopeLine, DINode::DIFlags Flags=DINode::FlagZero, bool isOptimized=false, DITemplateParameterArray TParams=nullptr, DISubprogram *Decl=nullptr, DITypeArray ThrownTypes=nullptr)
Create a new descriptor for the specified subprogram.
Definition: DIBuilder.cpp:684
DIDerivedType * createPointerType(DIType *PointeeTy, uint64_t SizeInBits, uint32_t AlignInBits=0, Optional< unsigned > DWARFAddressSpace=None, StringRef Name="")
Create debugging information entry for a pointer.
Definition: DIBuilder.cpp:256
LLVMContext & Context
DIGlobalVariableExpression * createGlobalVariableExpression(DIScope *Context, StringRef Name, StringRef LinkageName, DIFile *File, unsigned LineNo, DIType *Ty, bool isLocalToUnit, DIExpression *Expr=nullptr, MDNode *Decl=nullptr, uint32_t AlignInBits=0)
Create a new descriptor for the specified variable.
Definition: DIBuilder.cpp:588
Various leaf nodes.
Definition: ISDOpcodes.h:60
A Module instance is used to store all the information related to an LLVM module. ...
Definition: Module.h:63
DINamespace * createNameSpace(DIScope *Scope, StringRef Name, bool ExportSymbols)
This creates new descriptor for a namespace with the specified parent scope.
Definition: DIBuilder.cpp:739
DIMacroNodeArray getOrCreateMacroArray(ArrayRef< Metadata * > Elements)
Get a DIMacroNodeArray, create one if required.
Definition: DIBuilder.cpp:560
DIDerivedType * createBitFieldMemberType(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo, uint64_t SizeInBits, uint64_t OffsetInBits, uint64_t StorageOffsetInBits, DINode::DIFlags Flags, DIType *Ty)
Create debugging information entry for a bit field member.
Definition: DIBuilder.cpp:330
DICompositeType * createUnionType(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber, uint64_t SizeInBits, uint32_t AlignInBits, DINode::DIFlags Flags, DINodeArray Elements, unsigned RunTimeLang=0, StringRef UniqueIdentifier="")
Create debugging information entry for an union.
Definition: DIBuilder.cpp:443
DataLayout DL
DICompositeType * createArrayType(uint64_t Size, uint32_t AlignInBits, DIType *Ty, DINodeArray Subscripts)
Create debugging information entry for an array.
Definition: DIBuilder.cpp:474
DICompositeType * createReplaceableCompositeType(unsigned Tag, StringRef Name, DIScope *Scope, DIFile *F, unsigned Line, unsigned RuntimeLang=0, uint64_t SizeInBits=0, uint32_t AlignInBits=0, DINode::DIFlags Flags=DINode::FlagFwdDecl, StringRef UniqueIdentifier="")
Create a temporary forward-declared type.
Definition: DIBuilder.cpp:541
DICompositeType * createClassType(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber, uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits, DINode::DIFlags Flags, DIType *DerivedFrom, DINodeArray Elements, DIType *VTableHolder=nullptr, MDNode *TemplateParms=nullptr, StringRef UniqueIdentifier="")
Create debugging information entry for a class.
Definition: DIBuilder.cpp:413
This class implements a map that also provides access to all stored values in a deterministic order...
Definition: MapVector.h:38
struct LLVMOpaqueDIBuilder * LLVMDIBuilderRef
Represents an LLVM debug info builder.
Definition: Types.h:104
DIGlobalVariable * createTempGlobalVariableFwdDecl(DIScope *Context, StringRef Name, StringRef LinkageName, DIFile *File, unsigned LineNo, DIType *Ty, bool isLocalToUnit, MDNode *Decl=nullptr, uint32_t AlignInBits=0)
Identical to createGlobalVariable except that the resulting DbgNode is temporary and meant to be RAUW...
Definition: DIBuilder.cpp:603
DISubrange * getOrCreateSubrange(int64_t Lo, int64_t Count)
Create a descriptor for a value range.
Definition: DIBuilder.cpp:575
Metadata node.
Definition: Metadata.h:862
DIMacro * createMacro(DIMacroFile *Parent, unsigned Line, unsigned MacroType, StringRef Name, StringRef Value=StringRef())
Create debugging information entry for a macro.
Definition: DIBuilder.cpp:205
void replaceArrays(DICompositeType *&T, DINodeArray Elements, DINodeArray TParams=DINodeArray())
Replace arrays on a composite type.
Definition: DIBuilder.cpp:893
DICompositeType * createForwardDecl(unsigned Tag, StringRef Name, DIScope *Scope, DIFile *F, unsigned Line, unsigned RuntimeLang=0, uint64_t SizeInBits=0, uint32_t AlignInBits=0, StringRef UniqueIdentifier="")
Create a permanent forward-declared type.
Definition: DIBuilder.cpp:527
DIDerivedType * createStaticMemberType(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo, DIType *Ty, DINode::DIFlags Flags, Constant *Val, uint32_t AlignInBits=0)
Create debugging information entry for a C++ static data member.
Definition: DIBuilder.cpp:344
DISubprogram * createMethod(DIScope *Scope, StringRef Name, StringRef LinkageName, DIFile *File, unsigned LineNo, DISubroutineType *Ty, bool isLocalToUnit, bool isDefinition, unsigned Virtuality=0, unsigned VTableIndex=0, int ThisAdjustment=0, DIType *VTableHolder=nullptr, DINode::DIFlags Flags=DINode::FlagZero, bool isOptimized=false, DITemplateParameterArray TParams=nullptr, DITypeArray ThrownTypes=nullptr)
Create a new descriptor for the specified C++ method.
Definition: DIBuilder.cpp:717
Instruction * insertDbgValueIntrinsic(llvm::Value *Val, uint64_t Offset, DILocalVariable *VarInfo, DIExpression *Expr, const DILocation *DL, BasicBlock *InsertAtEnd)
Insert a new llvm.dbg.value intrinsic call.
Definition: DIBuilder.cpp:849
DIType * createObjectPointerType(DIType *Ty)
Create a new DIType* with the "object pointer" flag set.
Definition: DIBuilder.cpp:508
DIImportedEntity * createImportedModule(DIScope *Context, DINamespace *NS, DIFile *File, unsigned Line)
Create a descriptor for an imported module.
Definition: DIBuilder.cpp:165
DIDerivedType * createMemberType(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo, uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits, DINode::DIFlags Flags, DIType *Ty)
Create debugging information entry for a member.
Definition: DIBuilder.cpp:313
DITypeRefArray getOrCreateTypeArray(ArrayRef< Metadata * > Elements)
Get a DITypeRefArray, create one if required.
Definition: DIBuilder.cpp:564
Tagged DWARF-like metadata node.
DILexicalBlockFile * createLexicalBlockFile(DIScope *Scope, DIFile *File, unsigned Discriminator=0)
This creates a descriptor for a lexical block with a new file attached.
Definition: DIBuilder.cpp:759
DINodeArray getOrCreateArray(ArrayRef< Metadata * > Elements)
Get a DINodeArray, create one if required.
Definition: DIBuilder.cpp:555
DITemplateTypeParameter * createTemplateTypeParameter(DIScope *Scope, StringRef Name, DIType *Ty)
Create debugging information for template type parameter.
Definition: DIBuilder.cpp:375
Array subrange.
Instruction * insertDeclare(llvm::Value *Storage, DILocalVariable *VarInfo, DIExpression *Expr, const DILocation *DL, BasicBlock *InsertAtEnd)
Insert a new llvm.dbg.declare intrinsic call.
Definition: DIBuilder.cpp:802
DIDerivedType * createTypedef(DIType *Ty, StringRef Name, DIFile *File, unsigned LineNo, DIScope *Context)
Create debugging information entry for a typedef.
Definition: DIBuilder.cpp:290
DIBasicType * createUnspecifiedType(StringRef Name)
Create a DWARF unspecified type.
Definition: DIBuilder.cpp:235
DIMacroFile * createTempMacroFile(DIMacroFile *Parent, unsigned Line, DIFile *File)
Create debugging information temporary entry for a macro file.
Definition: DIBuilder.cpp:217
DISubroutineType * createSubroutineType(DITypeRefArray ParameterTypes, DINode::DIFlags Flags=DINode::FlagZero, unsigned CC=0)
Create subroutine type.
Definition: DIBuilder.cpp:455
#define DEFINE_ISA_CONVERSION_FUNCTIONS(ty, ref)
DIEnumerator * createEnumerator(StringRef Name, int64_t Val)
Create a single enumerator value.
Definition: DIBuilder.cpp:230
Subprogram description.
#define F(x, y, z)
Definition: MD5.cpp:55
Enumeration value.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Definition: APInt.h:33
void replaceAllUsesWith(Metadata *MD)
RAUW a temporary.
Definition: Metadata.h:947
Debug location.
DIBasicType * createNullPtrType()
Create C++11 nullptr type.
Definition: DIBuilder.cpp:240
DICompositeType * createEnumerationType(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber, uint64_t SizeInBits, uint32_t AlignInBits, DINodeArray Elements, DIType *UnderlyingType, StringRef UniqueIdentifier="")
Create debugging information entry for an enumeration.
Definition: DIBuilder.cpp:461
const char * Name
DICompositeType * createStructType(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber, uint64_t SizeInBits, uint32_t AlignInBits, DINode::DIFlags Flags, DIType *DerivedFrom, DINodeArray Elements, unsigned RunTimeLang=0, DIType *VTableHolder=nullptr, StringRef UniqueIdentifier="")
Create debugging information entry for a struct.
Definition: DIBuilder.cpp:430
DIType * createArtificialType(DIType *Ty)
Create a new DIType* with "artificial" flag set.
Definition: DIBuilder.cpp:501
DIFile * createFile(StringRef Filename, StringRef Directory, DIFile::ChecksumKind CSKind=DIFile::CSK_None, StringRef Checksum=StringRef())
Create a file descriptor to hold debugging information for a file.
Definition: DIBuilder.cpp:200
static std::enable_if< std::is_base_of< MDNode, T >::value, T * >::type replaceWithUniqued(std::unique_ptr< T, TempMDNodeDeleter > N)
Replace a temporary node with a uniqued one.
Definition: Metadata.h:979
DIDerivedType * createReferenceType(unsigned Tag, DIType *RTy, uint64_t SizeInBits=0, uint32_t AlignInBits=0, Optional< unsigned > DWARFAddressSpace=None)
Create debugging information entry for a c++ style reference or rvalue reference type.
Definition: DIBuilder.cpp:279
void replaceVTableHolder(DICompositeType *&T, DICompositeType *VTableHolder)
Replace the vtable holder in the given composite type.
Definition: DIBuilder.cpp:873
LLVM Basic Block Representation.
Definition: BasicBlock.h:59
This is an important class for using LLVM in a threaded context.
Definition: LLVMContext.h:68
This is an important base class in LLVM.
Definition: Constant.h:42
A pair of DIGlobalVariable and DIExpression.
DIBasicType * createUnspecifiedParameter()
Create unspecified parameter type for a subroutine type.
Definition: DIBuilder.cpp:524
DIBuilder(Module &M, bool AllowUnresolved=true)
Construct a builder for a module.
Definition: DIBuilder.cpp:27
DIExpression * createFragmentExpression(unsigned OffsetInBits, unsigned SizeInBits)
Create a descriptor to describe one part of aggregate variable that is fragmented across multiple Val...
Definition: DIBuilder.cpp:671
void retainType(DIScope *T)
Retain DIScope* in a module even if it is not referenced through debug info anchors.
Definition: DIBuilder.cpp:516
An imported module (C++ using directive or similar).
Base class for scope-like contexts.
DITemplateValueParameter * createTemplateValueParameter(DIScope *Scope, StringRef Name, DIType *Ty, Constant *Val)
Create debugging information for template value parameter.
Definition: DIBuilder.cpp:390
Base class for types.
DIExpression * createConstantValueExpression(uint64_t Val)
Create an expression for a variable that does not have an address, but does have a constant value...
Definition: DIBuilder.h:564
DITemplateValueParameter * createTemplateParameterPack(DIScope *Scope, StringRef Name, DIType *Ty, DINodeArray Val)
Create debugging information for a template parameter pack.
Definition: DIBuilder.cpp:406
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Definition: SmallVector.h:861
const size_t N
DIExpression * createExpression(ArrayRef< uint64_t > Addr=None)
Create a new descriptor for the specified variable which has a complex address expression for its add...
Definition: DIBuilder.cpp:661
DWARF expression.
A (clang) module that has been imported by the compile unit.
DIObjCProperty * createObjCProperty(StringRef Name, DIFile *File, unsigned LineNumber, StringRef GetterName, StringRef SetterName, unsigned PropertyAttributes, DIType *Ty)
Create debugging information entry for Objective-C property.
Definition: DIBuilder.cpp:367
DIBasicType * createBasicType(StringRef Name, uint64_t SizeInBits, unsigned Encoding)
Create debugging information entry for a basic type.
Definition: DIBuilder.cpp:244
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
DITemplateValueParameter * createTemplateTemplateParameter(DIScope *Scope, StringRef Name, DIType *Ty, StringRef Val)
Create debugging information for a template template parameter.
Definition: DIBuilder.cpp:398
Type array for a subprogram.
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata * > MDs)
Definition: Metadata.h:1164
static std::vector< std::string > Flags
Definition: FlagsTest.cpp:8
NodeTy * replaceTemporary(TempMDNode &&N, NodeTy *Replacement)
Replace a temporary node.
Definition: DIBuilder.h:780
DICompositeType * createVectorType(uint64_t Size, uint32_t AlignInBits, DIType *Ty, DINodeArray Subscripts)
Create debugging information entry for a vector type.
Definition: DIBuilder.cpp:484
DIFlags
Debug info flags.
DIDerivedType * createObjCIVar(StringRef Name, DIFile *File, unsigned LineNo, uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits, DINode::DIFlags Flags, DIType *Ty, MDNode *PropertyNode)
Create debugging information entry for Objective-C instance variable.
Definition: DIBuilder.cpp:356
DILexicalBlock * createLexicalBlock(DIScope *Scope, DIFile *File, unsigned Line, unsigned Col)
This creates a descriptor for a lexical block with the specified parent context.
Definition: DIBuilder.cpp:765
DILocalVariable * createAutoVariable(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo, DIType *Ty, bool AlwaysPreserve=false, DINode::DIFlags Flags=DINode::FlagZero, uint32_t AlignInBits=0)
Create a new descriptor for an auto variable.
Definition: DIBuilder.cpp:642
void finalizeSubprogram(DISubprogram *SP)
Finalize a specific subprogram - no new variables may be added to this subprogram afterwards...
Definition: DIBuilder.cpp:42
DIDerivedType * createInheritance(DIType *Ty, DIType *BaseTy, uint64_t BaseOffset, DINode::DIFlags Flags)
Create debugging information entry to establish inheritance relationship between two types...
Definition: DIBuilder.cpp:305
const unsigned Kind
DIImportedEntity * createImportedDeclaration(DIScope *Context, DINode *Decl, DIFile *File, unsigned Line, StringRef Name="")
Create a descriptor for an imported function.
Definition: DIBuilder.cpp:188
DIModule * createModule(DIScope *Scope, StringRef Name, StringRef ConfigurationMacros, StringRef IncludePath, StringRef ISysRoot)
This creates new descriptor for a module with the specified parent scope.
Definition: DIBuilder.cpp:751
LLVM Value Representation.
Definition: Value.h:73
DIBuilder & operator=(const DIBuilder &)=delete
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49
DIDerivedType * createQualifiedType(unsigned Tag, DIType *FromTy)
Create debugging information entry for a qualified type, e.g.
Definition: DIBuilder.cpp:251
DICompileUnit * createCompileUnit(unsigned Lang, DIFile *File, StringRef Producer, bool isOptimized, StringRef Flags, unsigned RV, StringRef SplitName=StringRef(), DICompileUnit::DebugEmissionKind Kind=DICompileUnit::DebugEmissionKind::FullDebug, uint64_t DWOId=0, bool SplitDebugInlining=true, bool DebugInfoForProfiling=false)
A CompileUnit provides an anchor for all debugging information generated during this instance of comp...
Definition: DIBuilder.cpp:126
DILocalVariable * createParameterVariable(DIScope *Scope, StringRef Name, unsigned ArgNo, DIFile *File, unsigned LineNo, DIType *Ty, bool AlwaysPreserve=false, DINode::DIFlags Flags=DINode::FlagZero)
Create a new descriptor for a parameter variable.
Definition: DIBuilder.cpp:652
DIDerivedType * createMemberPointerType(DIType *PointeeTy, DIType *Class, uint64_t SizeInBits, uint32_t AlignInBits=0, DINode::DIFlags Flags=DINode::FlagZero)
Create debugging information entry for a pointer to member.
Definition: DIBuilder.cpp:269
DIDerivedType * createFriend(DIType *Ty, DIType *FriendTy)
Create debugging information entry for a 'friend'.
Definition: DIBuilder.cpp:298
Basic type, like 'int' or 'float'.