LLVM  14.0.0git
DIBuilder.h
Go to the documentation of this file.
1 //===- DIBuilder.h - Debug Information Builder ------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file defines a DIBuilder that is useful for creating debugging
10 // information entries in LLVM IR form.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_IR_DIBUILDER_H
15 #define LLVM_IR_DIBUILDER_H
16 
17 #include "llvm/ADT/ArrayRef.h"
18 #include "llvm/ADT/DenseMap.h"
19 #include "llvm/ADT/MapVector.h"
20 #include "llvm/ADT/Optional.h"
21 #include "llvm/ADT/SetVector.h"
22 #include "llvm/ADT/SmallVector.h"
23 #include "llvm/ADT/StringRef.h"
24 #include "llvm/IR/DebugInfo.h"
26 #include "llvm/IR/TrackingMDRef.h"
27 #include "llvm/Support/Casting.h"
28 #include <algorithm>
29 #include <cstdint>
30 
31 namespace llvm {
32 
33  class BasicBlock;
34  class Constant;
35  class Function;
36  class Instruction;
37  class LLVMContext;
38  class Module;
39  class Value;
40 
41  class DIBuilder {
42  Module &M;
43  LLVMContext &VMContext;
44 
45  DICompileUnit *CUNode; ///< The one compile unit created by this DIBuiler.
46  Function *DeclareFn; ///< llvm.dbg.declare
47  Function *ValueFn; ///< llvm.dbg.value
48  Function *LabelFn; ///< llvm.dbg.label
49  Function *AddrFn; ///< llvm.dbg.addr
50 
51  SmallVector<Metadata *, 4> AllEnumTypes;
52  /// Track the RetainTypes, since they can be updated later on.
53  SmallVector<TrackingMDNodeRef, 4> AllRetainTypes;
54  SmallVector<Metadata *, 4> AllSubprograms;
56  SmallVector<TrackingMDNodeRef, 4> AllImportedModules;
57  /// Map Macro parent (which can be DIMacroFile or nullptr) to a list of
58  /// Metadata all of type DIMacroNode.
59  /// DIMacroNode's with nullptr parent are DICompileUnit direct children.
61 
62  /// Track nodes that may be unresolved.
63  SmallVector<TrackingMDNodeRef, 4> UnresolvedNodes;
64  bool AllowUnresolvedNodes;
65 
66  /// Each subprogram's preserved local variables.
67  ///
68  /// Do not use a std::vector. Some versions of libc++ apparently copy
69  /// instead of move on grow operations, and TrackingMDRef is expensive to
70  /// copy.
72 
73  /// Each subprogram's preserved labels.
75 
76  /// Create a temporary.
77  ///
78  /// Create an \a temporary node and track it in \a UnresolvedNodes.
79  void trackIfUnresolved(MDNode *N);
80 
81  /// Internal helper for insertDeclare.
82  Instruction *insertDeclare(llvm::Value *Storage, DILocalVariable *VarInfo,
83  DIExpression *Expr, const DILocation *DL,
84  BasicBlock *InsertBB, Instruction *InsertBefore);
85 
86  /// Internal helper for insertLabel.
87  Instruction *insertLabel(DILabel *LabelInfo, const DILocation *DL,
88  BasicBlock *InsertBB, Instruction *InsertBefore);
89 
90  /// Internal helper with common code used by insertDbg{Value,Addr}Intrinsic.
91  Instruction *insertDbgIntrinsic(llvm::Function *Intrinsic, llvm::Value *Val,
92  DILocalVariable *VarInfo,
93  DIExpression *Expr, const DILocation *DL,
94  BasicBlock *InsertBB,
95  Instruction *InsertBefore);
96 
97  /// Internal helper for insertDbgValueIntrinsic.
98  Instruction *
99  insertDbgValueIntrinsic(llvm::Value *Val, DILocalVariable *VarInfo,
100  DIExpression *Expr, const DILocation *DL,
101  BasicBlock *InsertBB, Instruction *InsertBefore);
102 
103  /// Internal helper for insertDbgAddrIntrinsic.
104  Instruction *
105  insertDbgAddrIntrinsic(llvm::Value *Val, DILocalVariable *VarInfo,
106  DIExpression *Expr, const DILocation *DL,
107  BasicBlock *InsertBB, Instruction *InsertBefore);
108 
109  public:
110  /// Construct a builder for a module.
111  ///
112  /// If \c AllowUnresolved, collect unresolved nodes attached to the module
113  /// in order to resolve cycles during \a finalize().
114  ///
115  /// If \p CU is given a value other than nullptr, then set \p CUNode to CU.
116  explicit DIBuilder(Module &M, bool AllowUnresolved = true,
117  DICompileUnit *CU = nullptr);
118  DIBuilder(const DIBuilder &) = delete;
119  DIBuilder &operator=(const DIBuilder &) = delete;
120 
121  /// Construct any deferred debug info descriptors.
122  void finalize();
123 
124  /// Finalize a specific subprogram - no new variables may be added to this
125  /// subprogram afterwards.
127 
128  /// A CompileUnit provides an anchor for all debugging
129  /// information generated during this instance of compilation.
130  /// \param Lang Source programming language, eg. dwarf::DW_LANG_C99
131  /// \param File File info.
132  /// \param Producer Identify the producer of debugging information
133  /// and code. Usually this is a compiler
134  /// version string.
135  /// \param isOptimized A boolean flag which indicates whether optimization
136  /// is enabled or not.
137  /// \param Flags This string lists command line options. This
138  /// string is directly embedded in debug info
139  /// output which may be used by a tool
140  /// analyzing generated debugging information.
141  /// \param RV This indicates runtime version for languages like
142  /// Objective-C.
143  /// \param SplitName The name of the file that we'll split debug info
144  /// out into.
145  /// \param Kind The kind of debug information to generate.
146  /// \param DWOId The DWOId if this is a split skeleton compile unit.
147  /// \param SplitDebugInlining Whether to emit inline debug info.
148  /// \param DebugInfoForProfiling Whether to emit extra debug info for
149  /// profile collection.
150  /// \param NameTableKind Whether to emit .debug_gnu_pubnames,
151  /// .debug_pubnames, or no pubnames at all.
152  /// \param SysRoot The clang system root (value of -isysroot).
153  /// \param SDK The SDK name. On Darwin, this is the last component
154  /// of the sysroot.
155  DICompileUnit *
156  createCompileUnit(unsigned Lang, DIFile *File, StringRef Producer,
157  bool isOptimized, StringRef Flags, unsigned RV,
158  StringRef SplitName = StringRef(),
160  DICompileUnit::DebugEmissionKind::FullDebug,
161  uint64_t DWOId = 0, bool SplitDebugInlining = true,
162  bool DebugInfoForProfiling = false,
165  bool RangesBaseAddress = false, StringRef SysRoot = {},
166  StringRef SDK = {});
167 
168  /// Create a file descriptor to hold debugging information for a file.
169  /// \param Filename File name.
170  /// \param Directory Directory.
171  /// \param Checksum Optional checksum kind (e.g. CSK_MD5, CSK_SHA1, etc.)
172  /// and value.
173  /// \param Source Optional source text.
174  DIFile *
175  createFile(StringRef Filename, StringRef Directory,
178 
179  /// Create debugging information entry for a macro.
180  /// \param Parent Macro parent (could be nullptr).
181  /// \param Line Source line number where the macro is defined.
182  /// \param MacroType DW_MACINFO_define or DW_MACINFO_undef.
183  /// \param Name Macro name.
184  /// \param Value Macro value.
185  DIMacro *createMacro(DIMacroFile *Parent, unsigned Line, unsigned MacroType,
187 
188  /// Create debugging information temporary entry for a macro file.
189  /// List of macro node direct children will be calculated by DIBuilder,
190  /// using the \p Parent relationship.
191  /// \param Parent Macro file parent (could be nullptr).
192  /// \param Line Source line number where the macro file is included.
193  /// \param File File descriptor containing the name of the macro file.
194  DIMacroFile *createTempMacroFile(DIMacroFile *Parent, unsigned Line,
195  DIFile *File);
196 
197  /// Create a single enumerator value.
200  bool IsUnsigned = false);
201 
202  /// Create a DWARF unspecified type.
204 
205  /// Create C++11 nullptr type.
207 
208  /// Create debugging information entry for a basic
209  /// type.
210  /// \param Name Type name.
211  /// \param SizeInBits Size of the type.
212  /// \param Encoding DWARF encoding code, e.g., dwarf::DW_ATE_float.
213  /// \param Flags Optional DWARF attributes, e.g., DW_AT_endianity.
215  unsigned Encoding,
216  DINode::DIFlags Flags = DINode::FlagZero);
217 
218  /// Create debugging information entry for a string
219  /// type.
220  /// \param Name Type name.
221  /// \param SizeInBits Size of the type.
223 
224  /// Create debugging information entry for a qualified
225  /// type, e.g. 'const int'.
226  /// \param Tag Tag identifing type, e.g. dwarf::TAG_volatile_type
227  /// \param FromTy Base Type.
228  DIDerivedType *createQualifiedType(unsigned Tag, DIType *FromTy);
229 
230  /// Create debugging information entry for a pointer.
231  /// \param PointeeTy Type pointed by this pointer.
232  /// \param SizeInBits Size.
233  /// \param AlignInBits Alignment. (optional)
234  /// \param DWARFAddressSpace DWARF address space. (optional)
235  /// \param Name Pointer type name. (optional)
236  /// \param Annotations Member annotations.
237  DIDerivedType *
238  createPointerType(DIType *PointeeTy, uint64_t SizeInBits,
239  uint32_t AlignInBits = 0,
240  Optional<unsigned> DWARFAddressSpace = None,
241  StringRef Name = "", DINodeArray Annotations = nullptr);
242 
243  /// Create debugging information entry for a pointer to member.
244  /// \param PointeeTy Type pointed to by this pointer.
245  /// \param SizeInBits Size.
246  /// \param AlignInBits Alignment. (optional)
247  /// \param Class Type for which this pointer points to members of.
248  DIDerivedType *
249  createMemberPointerType(DIType *PointeeTy, DIType *Class,
250  uint64_t SizeInBits, uint32_t AlignInBits = 0,
251  DINode::DIFlags Flags = DINode::FlagZero);
252 
253  /// Create debugging information entry for a c++
254  /// style reference or rvalue reference type.
255  DIDerivedType *createReferenceType(unsigned Tag, DIType *RTy,
256  uint64_t SizeInBits = 0,
257  uint32_t AlignInBits = 0,
258  Optional<unsigned> DWARFAddressSpace =
259  None);
260 
261  /// Create debugging information entry for a typedef.
262  /// \param Ty Original type.
263  /// \param Name Typedef name.
264  /// \param File File where this type is defined.
265  /// \param LineNo Line number.
266  /// \param Context The surrounding context for the typedef.
267  /// \param AlignInBits Alignment. (optional)
268  /// \param Annotations Annotations. (optional)
270  unsigned LineNo, DIScope *Context,
271  uint32_t AlignInBits = 0,
272  DINodeArray Annotations = nullptr);
273 
274  /// Create debugging information entry for a 'friend'.
275  DIDerivedType *createFriend(DIType *Ty, DIType *FriendTy);
276 
277  /// Create debugging information entry to establish
278  /// inheritance relationship between two types.
279  /// \param Ty Original type.
280  /// \param BaseTy Base type. Ty is inherits from base.
281  /// \param BaseOffset Base offset.
282  /// \param VBPtrOffset Virtual base pointer offset.
283  /// \param Flags Flags to describe inheritance attribute,
284  /// e.g. private
286  uint64_t BaseOffset, uint32_t VBPtrOffset,
287  DINode::DIFlags Flags);
288 
289  /// Create debugging information entry for a member.
290  /// \param Scope Member scope.
291  /// \param Name Member name.
292  /// \param File File where this member is defined.
293  /// \param LineNo Line number.
294  /// \param SizeInBits Member size.
295  /// \param AlignInBits Member alignment.
296  /// \param OffsetInBits Member offset.
297  /// \param Flags Flags to encode member attribute, e.g. private
298  /// \param Ty Parent type.
299  /// \param Annotations Member annotations.
301  DIFile *File, unsigned LineNo,
302  uint64_t SizeInBits, uint32_t AlignInBits,
303  uint64_t OffsetInBits,
304  DINode::DIFlags Flags, DIType *Ty,
305  DINodeArray Annotations = nullptr);
306 
307  /// Create debugging information entry for a variant. A variant
308  /// normally should be a member of a variant part.
309  /// \param Scope Member scope.
310  /// \param Name Member name.
311  /// \param File File where this member is defined.
312  /// \param LineNo Line number.
313  /// \param SizeInBits Member size.
314  /// \param AlignInBits Member alignment.
315  /// \param OffsetInBits Member offset.
316  /// \param Flags Flags to encode member attribute, e.g. private
317  /// \param Discriminant The discriminant for this branch; null for
318  /// the default branch
319  /// \param Ty Parent type.
321  DIFile *File, unsigned LineNo,
322  uint64_t SizeInBits,
323  uint32_t AlignInBits,
324  uint64_t OffsetInBits,
325  Constant *Discriminant,
326  DINode::DIFlags Flags, DIType *Ty);
327 
328  /// Create debugging information entry for a bit field member.
329  /// \param Scope Member scope.
330  /// \param Name Member name.
331  /// \param File File where this member is defined.
332  /// \param LineNo Line number.
333  /// \param SizeInBits Member size.
334  /// \param OffsetInBits Member offset.
335  /// \param StorageOffsetInBits Member storage offset.
336  /// \param Flags Flags to encode member attribute.
337  /// \param Ty Parent type.
338  /// \param Annotations Member annotations.
340  DIFile *File, unsigned LineNo,
341  uint64_t SizeInBits,
342  uint64_t OffsetInBits,
343  uint64_t StorageOffsetInBits,
344  DINode::DIFlags Flags, DIType *Ty,
345  DINodeArray Annotations = nullptr);
346 
347  /// Create debugging information entry for a
348  /// C++ static data member.
349  /// \param Scope Member scope.
350  /// \param Name Member name.
351  /// \param File File where this member is declared.
352  /// \param LineNo Line number.
353  /// \param Ty Type of the static member.
354  /// \param Flags Flags to encode member attribute, e.g. private.
355  /// \param Val Const initializer of the member.
356  /// \param AlignInBits Member alignment.
358  DIFile *File, unsigned LineNo,
359  DIType *Ty, DINode::DIFlags Flags,
360  Constant *Val,
361  uint32_t AlignInBits = 0);
362 
363  /// Create debugging information entry for Objective-C
364  /// instance variable.
365  /// \param Name Member name.
366  /// \param File File where this member is defined.
367  /// \param LineNo Line number.
368  /// \param SizeInBits Member size.
369  /// \param AlignInBits Member alignment.
370  /// \param OffsetInBits Member offset.
371  /// \param Flags Flags to encode member attribute, e.g. private
372  /// \param Ty Parent type.
373  /// \param PropertyNode Property associated with this ivar.
375  uint64_t SizeInBits, uint32_t AlignInBits,
376  uint64_t OffsetInBits, DINode::DIFlags Flags,
377  DIType *Ty, MDNode *PropertyNode);
378 
379  /// Create debugging information entry for Objective-C
380  /// property.
381  /// \param Name Property name.
382  /// \param File File where this property is defined.
383  /// \param LineNumber Line number.
384  /// \param GetterName Name of the Objective C property getter selector.
385  /// \param SetterName Name of the Objective C property setter selector.
386  /// \param PropertyAttributes Objective C property attributes.
387  /// \param Ty Type.
389  unsigned LineNumber,
390  StringRef GetterName,
391  StringRef SetterName,
392  unsigned PropertyAttributes, DIType *Ty);
393 
394  /// Create debugging information entry for a class.
395  /// \param Scope Scope in which this class is defined.
396  /// \param Name class name.
397  /// \param File File where this member is defined.
398  /// \param LineNumber Line number.
399  /// \param SizeInBits Member size.
400  /// \param AlignInBits Member alignment.
401  /// \param OffsetInBits Member offset.
402  /// \param Flags Flags to encode member attribute, e.g. private
403  /// \param Elements class members.
404  /// \param VTableHolder Debug info of the base class that contains vtable
405  /// for this type. This is used in
406  /// DW_AT_containing_type. See DWARF documentation
407  /// for more info.
408  /// \param TemplateParms Template type parameters.
409  /// \param UniqueIdentifier A unique identifier for the class.
411  DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber,
412  uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits,
413  DINode::DIFlags Flags, DIType *DerivedFrom, DINodeArray Elements,
414  DIType *VTableHolder = nullptr, MDNode *TemplateParms = nullptr,
415  StringRef UniqueIdentifier = "");
416 
417  /// Create debugging information entry for a struct.
418  /// \param Scope Scope in which this struct is defined.
419  /// \param Name Struct name.
420  /// \param File File where this member is defined.
421  /// \param LineNumber Line number.
422  /// \param SizeInBits Member size.
423  /// \param AlignInBits Member alignment.
424  /// \param Flags Flags to encode member attribute, e.g. private
425  /// \param Elements Struct elements.
426  /// \param RunTimeLang Optional parameter, Objective-C runtime version.
427  /// \param UniqueIdentifier A unique identifier for the struct.
429  DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber,
430  uint64_t SizeInBits, uint32_t AlignInBits, DINode::DIFlags Flags,
431  DIType *DerivedFrom, DINodeArray Elements, unsigned RunTimeLang = 0,
432  DIType *VTableHolder = nullptr, StringRef UniqueIdentifier = "");
433 
434  /// Create debugging information entry for an union.
435  /// \param Scope Scope in which this union is defined.
436  /// \param Name Union name.
437  /// \param File File where this member is defined.
438  /// \param LineNumber Line number.
439  /// \param SizeInBits Member size.
440  /// \param AlignInBits Member alignment.
441  /// \param Flags Flags to encode member attribute, e.g. private
442  /// \param Elements Union elements.
443  /// \param RunTimeLang Optional parameter, Objective-C runtime version.
444  /// \param UniqueIdentifier A unique identifier for the union.
446  DIFile *File, unsigned LineNumber,
447  uint64_t SizeInBits, uint32_t AlignInBits,
448  DINode::DIFlags Flags,
449  DINodeArray Elements,
450  unsigned RunTimeLang = 0,
451  StringRef UniqueIdentifier = "");
452 
453  /// Create debugging information entry for a variant part. A
454  /// variant part normally has a discriminator (though this is not
455  /// required) and a number of variant children.
456  /// \param Scope Scope in which this union is defined.
457  /// \param Name Union name.
458  /// \param File File where this member is defined.
459  /// \param LineNumber Line number.
460  /// \param SizeInBits Member size.
461  /// \param AlignInBits Member alignment.
462  /// \param Flags Flags to encode member attribute, e.g. private
463  /// \param Discriminator Discriminant member
464  /// \param Elements Variant elements.
465  /// \param UniqueIdentifier A unique identifier for the union.
467  DIFile *File, unsigned LineNumber,
468  uint64_t SizeInBits, uint32_t AlignInBits,
469  DINode::DIFlags Flags,
470  DIDerivedType *Discriminator,
471  DINodeArray Elements,
472  StringRef UniqueIdentifier = "");
473 
474  /// Create debugging information for template
475  /// type parameter.
476  /// \param Scope Scope in which this type is defined.
477  /// \param Name Type parameter name.
478  /// \param Ty Parameter type.
479  /// \param IsDefault Parameter is default or not
481  StringRef Name,
482  DIType *Ty,
483  bool IsDefault);
484 
485  /// Create debugging information for template
486  /// value parameter.
487  /// \param Scope Scope in which this type is defined.
488  /// \param Name Value parameter name.
489  /// \param Ty Parameter type.
490  /// \param IsDefault Parameter is default or not
491  /// \param Val Constant parameter value.
494  bool IsDefault, Constant *Val);
495 
496  /// Create debugging information for a template template parameter.
497  /// \param Scope Scope in which this type is defined.
498  /// \param Name Value parameter name.
499  /// \param Ty Parameter type.
500  /// \param Val The fully qualified name of the template.
502  StringRef Name,
503  DIType *Ty,
504  StringRef Val);
505 
506  /// Create debugging information for a template parameter pack.
507  /// \param Scope Scope in which this type is defined.
508  /// \param Name Value parameter name.
509  /// \param Ty Parameter type.
510  /// \param Val An array of types in the pack.
512  StringRef Name,
513  DIType *Ty,
514  DINodeArray Val);
515 
516  /// Create debugging information entry for an array.
517  /// \param Size Array size.
518  /// \param AlignInBits Alignment.
519  /// \param Ty Element type.
520  /// \param Subscripts Subscripts.
521  /// \param DataLocation The location of the raw data of a descriptor-based
522  /// Fortran array, either a DIExpression* or
523  /// a DIVariable*.
524  /// \param Associated The associated attribute of a descriptor-based
525  /// Fortran array, either a DIExpression* or
526  /// a DIVariable*.
527  /// \param Allocated The allocated attribute of a descriptor-based
528  /// Fortran array, either a DIExpression* or
529  /// a DIVariable*.
530  /// \param Rank The rank attribute of a descriptor-based
531  /// Fortran array, either a DIExpression* or
532  /// a DIVariable*.
534  uint64_t Size, uint32_t AlignInBits, DIType *Ty, DINodeArray Subscripts,
535  PointerUnion<DIExpression *, DIVariable *> DataLocation = nullptr,
536  PointerUnion<DIExpression *, DIVariable *> Associated = nullptr,
537  PointerUnion<DIExpression *, DIVariable *> Allocated = nullptr,
539 
540  /// Create debugging information entry for a vector type.
541  /// \param Size Array size.
542  /// \param AlignInBits Alignment.
543  /// \param Ty Element type.
544  /// \param Subscripts Subscripts.
546  DIType *Ty, DINodeArray Subscripts);
547 
548  /// Create debugging information entry for an
549  /// enumeration.
550  /// \param Scope Scope in which this enumeration is defined.
551  /// \param Name Union name.
552  /// \param File File where this member is defined.
553  /// \param LineNumber Line number.
554  /// \param SizeInBits Member size.
555  /// \param AlignInBits Member alignment.
556  /// \param Elements Enumeration elements.
557  /// \param UnderlyingType Underlying type of a C++11/ObjC fixed enum.
558  /// \param UniqueIdentifier A unique identifier for the enum.
559  /// \param IsScoped Boolean flag indicate if this is C++11/ObjC 'enum class'.
561  DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber,
562  uint64_t SizeInBits, uint32_t AlignInBits, DINodeArray Elements,
563  DIType *UnderlyingType, StringRef UniqueIdentifier = "", bool IsScoped = false);
564 
565  /// Create debugging information entry for a set.
566  /// \param Scope Scope in which this set is defined.
567  /// \param Name Set name.
568  /// \param File File where this set is defined.
569  /// \param LineNo Line number.
570  /// \param SizeInBits Set size.
571  /// \param AlignInBits Set alignment.
572  /// \param Ty Base type of the set.
574  unsigned LineNo, uint64_t SizeInBits,
575  uint32_t AlignInBits, DIType *Ty);
576 
577  /// Create subroutine type.
578  /// \param ParameterTypes An array of subroutine parameter types. This
579  /// includes return type at 0th index.
580  /// \param Flags E.g.: LValueReference.
581  /// These flags are used to emit dwarf attributes.
582  /// \param CC Calling convention, e.g. dwarf::DW_CC_normal
584  createSubroutineType(DITypeRefArray ParameterTypes,
585  DINode::DIFlags Flags = DINode::FlagZero,
586  unsigned CC = 0);
587 
588  /// Create a distinct clone of \p SP with FlagArtificial set.
590 
591  /// Create a uniqued clone of \p Ty with FlagArtificial set.
592  static DIType *createArtificialType(DIType *Ty);
593 
594  /// Create a uniqued clone of \p Ty with FlagObjectPointer and
595  /// FlagArtificial set.
597 
598  /// Create a permanent forward-declared type.
600  DIScope *Scope, DIFile *F, unsigned Line,
601  unsigned RuntimeLang = 0,
602  uint64_t SizeInBits = 0,
603  uint32_t AlignInBits = 0,
604  StringRef UniqueIdentifier = "");
605 
606  /// Create a temporary forward-declared type.
608  unsigned Tag, StringRef Name, DIScope *Scope, DIFile *F, unsigned Line,
609  unsigned RuntimeLang = 0, uint64_t SizeInBits = 0,
610  uint32_t AlignInBits = 0, DINode::DIFlags Flags = DINode::FlagFwdDecl,
611  StringRef UniqueIdentifier = "", DINodeArray Annotations = nullptr);
612 
613  /// Retain DIScope* in a module even if it is not referenced
614  /// through debug info anchors.
615  void retainType(DIScope *T);
616 
617  /// Create unspecified parameter type
618  /// for a subroutine type.
620 
621  /// Get a DINodeArray, create one if required.
622  DINodeArray getOrCreateArray(ArrayRef<Metadata *> Elements);
623 
624  /// Get a DIMacroNodeArray, create one if required.
625  DIMacroNodeArray getOrCreateMacroArray(ArrayRef<Metadata *> Elements);
626 
627  /// Get a DITypeRefArray, create one if required.
629 
630  /// Create a descriptor for a value range. This
631  /// implicitly uniques the values returned.
632  DISubrange *getOrCreateSubrange(int64_t Lo, int64_t Count);
633  DISubrange *getOrCreateSubrange(int64_t Lo, Metadata *CountNode);
634  DISubrange *getOrCreateSubrange(Metadata *Count, Metadata *LowerBound,
635  Metadata *UpperBound, Metadata *Stride);
636 
639  DIGenericSubrange::BoundType LowerBound,
640  DIGenericSubrange::BoundType UpperBound,
642 
643  /// Create a new descriptor for the specified variable.
644  /// \param Context Variable scope.
645  /// \param Name Name of the variable.
646  /// \param LinkageName Mangled name of the variable.
647  /// \param File File where this variable is defined.
648  /// \param LineNo Line number.
649  /// \param Ty Variable Type.
650  /// \param IsLocalToUnit Boolean flag indicate whether this variable is
651  /// externally visible or not.
652  /// \param Expr The location of the global relative to the attached
653  /// GlobalVariable.
654  /// \param Decl Reference to the corresponding declaration.
655  /// \param AlignInBits Variable alignment(or 0 if no alignment attr was
656  /// specified)
659  unsigned LineNo, DIType *Ty, bool IsLocalToUnit, bool isDefined = true,
660  DIExpression *Expr = nullptr, MDNode *Decl = nullptr,
661  MDTuple *TemplateParams = nullptr, uint32_t AlignInBits = 0,
662  DINodeArray Annotations = nullptr);
663 
664  /// Identical to createGlobalVariable
665  /// except that the resulting DbgNode is temporary and meant to be RAUWed.
668  unsigned LineNo, DIType *Ty, bool IsLocalToUnit, MDNode *Decl = nullptr,
669  MDTuple *TemplateParams= nullptr, uint32_t AlignInBits = 0);
670 
671  /// Create a new descriptor for an auto variable. This is a local variable
672  /// that is not a subprogram parameter.
673  ///
674  /// \c Scope must be a \a DILocalScope, and thus its scope chain eventually
675  /// leads to a \a DISubprogram.
676  ///
677  /// If \c AlwaysPreserve, this variable will be referenced from its
678  /// containing subprogram, and will survive some optimizations.
681  unsigned LineNo, DIType *Ty, bool AlwaysPreserve = false,
682  DINode::DIFlags Flags = DINode::FlagZero,
683  uint32_t AlignInBits = 0);
684 
685  /// Create a new descriptor for an label.
686  ///
687  /// \c Scope must be a \a DILocalScope, and thus its scope chain eventually
688  /// leads to a \a DISubprogram.
689  DILabel *
690  createLabel(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo,
691  bool AlwaysPreserve = false);
692 
693  /// Create a new descriptor for a parameter variable.
694  ///
695  /// \c Scope must be a \a DILocalScope, and thus its scope chain eventually
696  /// leads to a \a DISubprogram.
697  ///
698  /// \c ArgNo is the index (starting from \c 1) of this variable in the
699  /// subprogram parameters. \c ArgNo should not conflict with other
700  /// parameters of the same subprogram.
701  ///
702  /// If \c AlwaysPreserve, this variable will be referenced from its
703  /// containing subprogram, and will survive some optimizations.
706  DIFile *File, unsigned LineNo, DIType *Ty,
707  bool AlwaysPreserve = false,
708  DINode::DIFlags Flags = DINode::FlagZero,
709  DINodeArray Annotations = nullptr);
710 
711  /// Create a new descriptor for the specified
712  /// variable which has a complex address expression for its address.
713  /// \param Addr An array of complex address operations.
715 
716  /// Create an expression for a variable that does not have an address, but
717  /// does have a constant value.
719  return DIExpression::get(
720  VMContext, {dwarf::DW_OP_constu, Val, dwarf::DW_OP_stack_value});
721  }
722 
723  /// Create a new descriptor for the specified subprogram.
724  /// See comments in DISubprogram* for descriptions of these fields.
725  /// \param Scope Function scope.
726  /// \param Name Function name.
727  /// \param LinkageName Mangled function name.
728  /// \param File File where this variable is defined.
729  /// \param LineNo Line number.
730  /// \param Ty Function type.
731  /// \param ScopeLine Set to the beginning of the scope this starts
732  /// \param Flags e.g. is this function prototyped or not.
733  /// These flags are used to emit dwarf attributes.
734  /// \param SPFlags Additional flags specific to subprograms.
735  /// \param TParams Function template parameters.
736  /// \param ThrownTypes Exception types this function may throw.
737  /// \param Annotations Attribute Annotations.
738  DISubprogram *
740  DIFile *File, unsigned LineNo, DISubroutineType *Ty,
741  unsigned ScopeLine, DINode::DIFlags Flags = DINode::FlagZero,
742  DISubprogram::DISPFlags SPFlags = DISubprogram::SPFlagZero,
743  DITemplateParameterArray TParams = nullptr,
744  DISubprogram *Decl = nullptr,
745  DITypeArray ThrownTypes = nullptr,
746  DINodeArray Annotations = nullptr);
747 
748  /// Identical to createFunction,
749  /// except that the resulting DbgNode is meant to be RAUWed.
751  DIScope *Scope, StringRef Name, StringRef LinkageName, DIFile *File,
752  unsigned LineNo, DISubroutineType *Ty, unsigned ScopeLine,
753  DINode::DIFlags Flags = DINode::FlagZero,
754  DISubprogram::DISPFlags SPFlags = DISubprogram::SPFlagZero,
755  DITemplateParameterArray TParams = nullptr,
756  DISubprogram *Decl = nullptr, DITypeArray ThrownTypes = nullptr);
757 
758  /// Create a new descriptor for the specified C++ method.
759  /// See comments in \a DISubprogram* for descriptions of these fields.
760  /// \param Scope Function scope.
761  /// \param Name Function name.
762  /// \param LinkageName Mangled function name.
763  /// \param File File where this variable is defined.
764  /// \param LineNo Line number.
765  /// \param Ty Function type.
766  /// \param VTableIndex Index no of this method in virtual table, or -1u if
767  /// unrepresentable.
768  /// \param ThisAdjustment
769  /// MS ABI-specific adjustment of 'this' that occurs
770  /// in the prologue.
771  /// \param VTableHolder Type that holds vtable.
772  /// \param Flags e.g. is this function prototyped or not.
773  /// This flags are used to emit dwarf attributes.
774  /// \param SPFlags Additional flags specific to subprograms.
775  /// \param TParams Function template parameters.
776  /// \param ThrownTypes Exception types this function may throw.
777  DISubprogram *
779  DIFile *File, unsigned LineNo, DISubroutineType *Ty,
780  unsigned VTableIndex = 0, int ThisAdjustment = 0,
781  DIType *VTableHolder = nullptr,
782  DINode::DIFlags Flags = DINode::FlagZero,
783  DISubprogram::DISPFlags SPFlags = DISubprogram::SPFlagZero,
784  DITemplateParameterArray TParams = nullptr,
785  DITypeArray ThrownTypes = nullptr);
786 
787  /// Create common block entry for a Fortran common block.
788  /// \param Scope Scope of this common block.
789  /// \param decl Global variable declaration.
790  /// \param Name The name of this common block.
791  /// \param File The file this common block is defined.
792  /// \param LineNo Line number.
795  unsigned LineNo);
796 
797  /// This creates new descriptor for a namespace with the specified
798  /// parent scope.
799  /// \param Scope Namespace scope
800  /// \param Name Name of this namespace
801  /// \param ExportSymbols True for C++ inline namespaces.
803  bool ExportSymbols);
804 
805  /// This creates new descriptor for a module with the specified
806  /// parent scope.
807  /// \param Scope Parent scope
808  /// \param Name Name of this module
809  /// \param ConfigurationMacros
810  /// A space-separated shell-quoted list of -D macro
811  /// definitions as they would appear on a command line.
812  /// \param IncludePath The path to the module map file.
813  /// \param APINotesFile The path to an API notes file for this module.
814  /// \param File Source file of the module.
815  /// Used for Fortran modules.
816  /// \param LineNo Source line number of the module.
817  /// Used for Fortran modules.
818  /// \param IsDecl This is a module declaration; default to false;
819  /// when set to true, only Scope and Name are required
820  /// as this entry is just a hint for the debugger to find
821  /// the corresponding definition in the global scope.
823  StringRef ConfigurationMacros, StringRef IncludePath,
824  StringRef APINotesFile = {}, DIFile *File = nullptr,
825  unsigned LineNo = 0, bool IsDecl = false);
826 
827  /// This creates a descriptor for a lexical block with a new file
828  /// attached. This merely extends the existing
829  /// lexical block as it crosses a file.
830  /// \param Scope Lexical block.
831  /// \param File Source file.
832  /// \param Discriminator DWARF path discriminator value.
833  DILexicalBlockFile *createLexicalBlockFile(DIScope *Scope, DIFile *File,
834  unsigned Discriminator = 0);
835 
836  /// This creates a descriptor for a lexical block with the
837  /// specified parent context.
838  /// \param Scope Parent lexical scope.
839  /// \param File Source file.
840  /// \param Line Line number.
841  /// \param Col Column number.
842  DILexicalBlock *createLexicalBlock(DIScope *Scope, DIFile *File,
843  unsigned Line, unsigned Col);
844 
845  /// Create a descriptor for an imported module.
846  /// \param Context The scope this module is imported into
847  /// \param NS The namespace being imported here.
848  /// \param File File where the declaration is located.
849  /// \param Line Line number of the declaration.
850  /// \param Elements Renamed elements.
851  DIImportedEntity *createImportedModule(DIScope *Context, DINamespace *NS,
852  DIFile *File, unsigned Line,
853  DINodeArray Elements = nullptr);
854 
855  /// Create a descriptor for an imported module.
856  /// \param Context The scope this module is imported into.
857  /// \param NS An aliased namespace.
858  /// \param File File where the declaration is located.
859  /// \param Line Line number of the declaration.
860  /// \param Elements Renamed elements.
861  DIImportedEntity *createImportedModule(DIScope *Context,
862  DIImportedEntity *NS, DIFile *File,
863  unsigned Line,
864  DINodeArray Elements = nullptr);
865 
866  /// Create a descriptor for an imported module.
867  /// \param Context The scope this module is imported into.
868  /// \param M The module being imported here
869  /// \param File File where the declaration is located.
870  /// \param Line Line number of the declaration.
871  /// \param Elements Renamed elements.
872  DIImportedEntity *createImportedModule(DIScope *Context, DIModule *M,
873  DIFile *File, unsigned Line,
874  DINodeArray Elements = nullptr);
875 
876  /// Create a descriptor for an imported function.
877  /// \param Context The scope this module is imported into.
878  /// \param Decl The declaration (or definition) of a function, type, or
879  /// variable.
880  /// \param File File where the declaration is located.
881  /// \param Line Line number of the declaration.
882  /// \param Elements Renamed elements.
883  DIImportedEntity *createImportedDeclaration(DIScope *Context, DINode *Decl,
884  DIFile *File, unsigned Line,
885  StringRef Name = "",
886  DINodeArray Elements = nullptr);
887 
888  /// Insert a new llvm.dbg.declare intrinsic call.
889  /// \param Storage llvm::Value of the variable
890  /// \param VarInfo Variable's debug info descriptor.
891  /// \param Expr A complex location expression.
892  /// \param DL Debug info location.
893  /// \param InsertAtEnd Location for the new intrinsic.
894  Instruction *insertDeclare(llvm::Value *Storage, DILocalVariable *VarInfo,
895  DIExpression *Expr, const DILocation *DL,
896  BasicBlock *InsertAtEnd);
897 
898  /// Insert a new llvm.dbg.declare intrinsic call.
899  /// \param Storage llvm::Value of the variable
900  /// \param VarInfo Variable's debug info descriptor.
901  /// \param Expr A complex location expression.
902  /// \param DL Debug info location.
903  /// \param InsertBefore Location for the new intrinsic.
904  Instruction *insertDeclare(llvm::Value *Storage, DILocalVariable *VarInfo,
905  DIExpression *Expr, const DILocation *DL,
906  Instruction *InsertBefore);
907 
908  /// Insert a new llvm.dbg.label intrinsic call.
909  /// \param LabelInfo Label's debug info descriptor.
910  /// \param DL Debug info location.
911  /// \param InsertBefore Location for the new intrinsic.
912  Instruction *insertLabel(DILabel *LabelInfo, const DILocation *DL,
913  Instruction *InsertBefore);
914 
915  /// Insert a new llvm.dbg.label intrinsic call.
916  /// \param LabelInfo Label's debug info descriptor.
917  /// \param DL Debug info location.
918  /// \param InsertAtEnd Location for the new intrinsic.
919  Instruction *insertLabel(DILabel *LabelInfo, const DILocation *DL,
920  BasicBlock *InsertAtEnd);
921 
922  /// Insert a new llvm.dbg.value intrinsic call.
923  /// \param Val llvm::Value of the variable
924  /// \param VarInfo Variable's debug info descriptor.
925  /// \param Expr A complex location expression.
926  /// \param DL Debug info location.
927  /// \param InsertAtEnd Location for the new intrinsic.
928  Instruction *insertDbgValueIntrinsic(llvm::Value *Val,
929  DILocalVariable *VarInfo,
930  DIExpression *Expr,
931  const DILocation *DL,
932  BasicBlock *InsertAtEnd);
933 
934  /// Insert a new llvm.dbg.value intrinsic call.
935  /// \param Val llvm::Value of the variable
936  /// \param VarInfo Variable's debug info descriptor.
937  /// \param Expr A complex location expression.
938  /// \param DL Debug info location.
939  /// \param InsertBefore Location for the new intrinsic.
940  Instruction *insertDbgValueIntrinsic(llvm::Value *Val,
941  DILocalVariable *VarInfo,
942  DIExpression *Expr,
943  const DILocation *DL,
944  Instruction *InsertBefore);
945 
946  /// Insert a new llvm.dbg.addr intrinsic call.
947  /// \param Addr llvm::Value of the address
948  /// \param VarInfo Variable's debug info descriptor.
949  /// \param Expr A complex location expression.
950  /// \param DL Debug info location.
951  /// \param InsertAtEnd Location for the new intrinsic.
952  Instruction *insertDbgAddrIntrinsic(llvm::Value *Addr,
953  DILocalVariable *VarInfo,
954  DIExpression *Expr,
955  const DILocation *DL,
956  BasicBlock *InsertAtEnd);
957 
958  /// Insert a new llvm.dbg.addr intrinsic call.
959  /// \param Addr llvm::Value of the address.
960  /// \param VarInfo Variable's debug info descriptor.
961  /// \param Expr A complex location expression.
962  /// \param DL Debug info location.
963  /// \param InsertBefore Location for the new intrinsic.
964  Instruction *insertDbgAddrIntrinsic(llvm::Value *Addr,
965  DILocalVariable *VarInfo,
966  DIExpression *Expr,
967  const DILocation *DL,
968  Instruction *InsertBefore);
969 
970  /// Replace the vtable holder in the given type.
971  ///
972  /// If this creates a self reference, it may orphan some unresolved cycles
973  /// in the operands of \c T, so \a DIBuilder needs to track that.
974  void replaceVTableHolder(DICompositeType *&T,
975  DIType *VTableHolder);
976 
977  /// Replace arrays on a composite type.
978  ///
979  /// If \c T is resolved, but the arrays aren't -- which can happen if \c T
980  /// has a self-reference -- \a DIBuilder needs to track the array to
981  /// resolve cycles.
982  void replaceArrays(DICompositeType *&T, DINodeArray Elements,
983  DINodeArray TParams = DINodeArray());
984 
985  /// Replace a temporary node.
986  ///
987  /// Call \a MDNode::replaceAllUsesWith() on \c N, replacing it with \c
988  /// Replacement.
989  ///
990  /// If \c Replacement is the same as \c N.get(), instead call \a
991  /// MDNode::replaceWithUniqued(). In this case, the uniqued node could
992  /// have a different address, so we return the final address.
993  template <class NodeTy>
994  NodeTy *replaceTemporary(TempMDNode &&N, NodeTy *Replacement) {
995  if (N.get() == Replacement)
996  return cast<NodeTy>(MDNode::replaceWithUniqued(std::move(N)));
997 
998  N->replaceAllUsesWith(Replacement);
999  return Replacement;
1000  }
1001  };
1002 
1003  // Create wrappers for C Binding types (see CBindingWrapping.h).
1005 
1006 } // end namespace llvm
1007 
1008 #endif // LLVM_IR_DIBUILDER_H
llvm::DIBuilder::createModule
DIModule * createModule(DIScope *Scope, StringRef Name, StringRef ConfigurationMacros, StringRef IncludePath, StringRef APINotesFile={}, DIFile *File=nullptr, unsigned LineNo=0, bool IsDecl=false)
This creates new descriptor for a module with the specified parent scope.
Definition: DIBuilder.cpp:908
llvm::Check::Size
@ Size
Definition: FileCheck.h:73
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AllocatorList.h:22
llvm::DIType
Base class for types.
Definition: DebugInfoMetadata.h:665
M
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
Definition: README.txt:252
llvm::DIBuilder::getOrCreateTypeArray
DITypeRefArray getOrCreateTypeArray(ArrayRef< Metadata * > Elements)
Get a DITypeRefArray, create one if required.
Definition: DIBuilder.cpp:672
llvm::DIBuilder::finalize
void finalize()
Construct any deferred debug info descriptors.
Definition: DIBuilder.cpp:82
Optional.h
llvm::DIBuilder::replaceVTableHolder
void replaceVTableHolder(DICompositeType *&T, DIType *VTableHolder)
Replace the vtable holder in the given type.
Definition: DIBuilder.cpp:1102
llvm::DIBuilder
Definition: DIBuilder.h:41
DebugInfoMetadata.h
llvm::DIGenericSubrange
Definition: DebugInfoMetadata.h:362
llvm::Function
Definition: Function.h:62
llvm::DIBuilder::finalizeSubprogram
void finalizeSubprogram(DISubprogram *SP)
Finalize a specific subprogram - no new variables may be added to this subprogram afterwards.
Definition: DIBuilder.cpp:62
StringRef.h
llvm::DIBuilder::createBitFieldMemberType
DIDerivedType * createBitFieldMemberType(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo, uint64_t SizeInBits, uint64_t OffsetInBits, uint64_t StorageOffsetInBits, DINode::DIFlags Flags, DIType *Ty, DINodeArray Annotations=nullptr)
Create debugging information entry for a bit field member.
Definition: DIBuilder.cpp:390
llvm::lltok::NameTableKind
@ NameTableKind
Definition: LLToken.h:487
llvm::SmallVector
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1176
llvm::DIBuilder::createPointerType
DIDerivedType * createPointerType(DIType *PointeeTy, uint64_t SizeInBits, uint32_t AlignInBits=0, Optional< unsigned > DWARFAddressSpace=None, StringRef Name="", DINodeArray Annotations=nullptr)
Create debugging information entry for a pointer.
Definition: DIBuilder.cpp:304
llvm::DIStringType
String type, Fortran CHARACTER(n)
Definition: DebugInfoMetadata.h:839
llvm::DIFile::ChecksumInfo
A single checksum, represented by a Kind and a Value (a string).
Definition: DebugInfoMetadata.h:551
llvm::MipsISD::Lo
@ Lo
Definition: MipsISelLowering.h:79
llvm::DIBuilder::createTempGlobalVariableFwdDecl
DIGlobalVariable * createTempGlobalVariableFwdDecl(DIScope *Context, StringRef Name, StringRef LinkageName, DIFile *File, unsigned LineNo, DIType *Ty, bool IsLocalToUnit, MDNode *Decl=nullptr, MDTuple *TemplateParams=nullptr, uint32_t AlignInBits=0)
Identical to createGlobalVariable except that the resulting DbgNode is temporary and meant to be RAUW...
Definition: DIBuilder.cpp:742
MapVector.h
llvm::DILocation
Debug location.
Definition: DebugInfoMetadata.h:1580
DenseMap.h
llvm::DIBuilder::createTempFunctionFwdDecl
DISubprogram * createTempFunctionFwdDecl(DIScope *Scope, StringRef Name, StringRef LinkageName, DIFile *File, unsigned LineNo, DISubroutineType *Ty, unsigned ScopeLine, DINode::DIFlags Flags=DINode::FlagZero, DISubprogram::DISPFlags SPFlags=DISubprogram::SPFlagZero, 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:851
llvm::Optional
Definition: APInt.h:33
T
#define T
Definition: Mips16ISelLowering.cpp:341
llvm::MapVector
This class implements a map that also provides access to all stored values in a deterministic order.
Definition: MapVector.h:36
llvm::DIBuilder::createMemberType
DIDerivedType * createMemberType(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo, uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits, DINode::DIFlags Flags, DIType *Ty, DINodeArray Annotations=nullptr)
Create debugging information entry for a member.
Definition: DIBuilder.cpp:364
llvm::DIBuilder::createSubroutineType
DISubroutineType * createSubroutineType(DITypeRefArray ParameterTypes, DINode::DIFlags Flags=DINode::FlagZero, unsigned CC=0)
Create subroutine type.
Definition: DIBuilder.cpp:531
llvm::DIExpression
DWARF expression.
Definition: DebugInfoMetadata.h:2596
llvm::DIBuilder::createQualifiedType
DIDerivedType * createQualifiedType(unsigned Tag, DIType *FromTy)
Create debugging information entry for a qualified type, e.g.
Definition: DIBuilder.cpp:298
llvm::DIBuilder::DIBuilder
DIBuilder(Module &M, bool AllowUnresolved=true, DICompileUnit *CU=nullptr)
Construct a builder for a module.
Definition: DIBuilder.cpp:34
llvm::DINameKind::LinkageName
@ LinkageName
llvm::DIBuilder::createStringType
DIStringType * createStringType(StringRef Name, uint64_t SizeInBits)
Create debugging information entry for a string type.
Definition: DIBuilder.cpp:292
llvm::DIBuilder::createObjCProperty
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:428
llvm::DICompileUnit::DebugEmissionKind
DebugEmissionKind
Definition: DebugInfoMetadata.h:1342
llvm::DIBuilder::createReplaceableCompositeType
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="", DINodeArray Annotations=nullptr)
Create a temporary forward-declared type.
Definition: DIBuilder.cpp:647
llvm::DINamespace
Definition: DebugInfoMetadata.h:2286
llvm::DIBuilder::createFile
DIFile * createFile(StringRef Filename, StringRef Directory, Optional< DIFile::ChecksumInfo< StringRef >> Checksum=None, Optional< StringRef > Source=None)
Create a file descriptor to hold debugging information for a file.
Definition: DIBuilder.cpp:232
llvm::MDNode::get
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata * > MDs)
Definition: Metadata.h:1233
F
#define F(x, y, z)
Definition: MD5.cpp:55
llvm::DIBuilder::createTemplateParameterPack
DITemplateValueParameter * createTemplateParameterPack(DIScope *Scope, StringRef Name, DIType *Ty, DINodeArray Val)
Create debugging information for a template parameter pack.
Definition: DIBuilder.cpp:468
Context
ManagedStatic< detail::RecordContext > Context
Definition: Record.cpp:96
llvm::BasicBlock
LLVM Basic Block Representation.
Definition: BasicBlock.h:58
llvm::Annotations
Annotations lets you mark points and ranges inside source code, for tests:
Definition: Annotations.h:48
llvm::DIBuilder::createAutoVariable
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:782
llvm::DITypeRefArray
Definition: DebugInfoMetadata.h:67
llvm::DIBuilder::createSetType
DIDerivedType * createSetType(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo, uint64_t SizeInBits, uint32_t AlignInBits, DIType *Ty)
Create debugging information entry for a set.
Definition: DIBuilder.cpp:551
llvm::DIBuilder::createArtificialType
static DIType * createArtificialType(DIType *Ty)
Create a uniqued clone of Ty with FlagArtificial set.
Definition: DIBuilder.cpp:607
llvm::DIObjCProperty
Definition: DebugInfoMetadata.h:3260
DEFINE_ISA_CONVERSION_FUNCTIONS
#define DEFINE_ISA_CONVERSION_FUNCTIONS(ty, ref)
Definition: CBindingWrapping.h:28
llvm::DIBuilder::replaceTemporary
NodeTy * replaceTemporary(TempMDNode &&N, NodeTy *Replacement)
Replace a temporary node.
Definition: DIBuilder.h:994
llvm::DIBuilder::createStaticMemberType
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:405
llvm::ISD::Constant
@ Constant
Definition: ISDOpcodes.h:76
llvm::DILocalVariable
Local variable.
Definition: DebugInfoMetadata.h:3104
llvm::DIMacro
Definition: DebugInfoMetadata.h:3498
llvm::DIBuilder::createMacro
DIMacro * createMacro(DIMacroFile *Parent, unsigned Line, unsigned MacroType, StringRef Name, StringRef Value=StringRef())
Create debugging information entry for a macro.
Definition: DIBuilder.cpp:238
llvm::DIBuilder::createTempMacroFile
DIMacroFile * createTempMacroFile(DIMacroFile *Parent, unsigned Line, DIFile *File)
Create debugging information temporary entry for a macro file.
Definition: DIBuilder.cpp:250
llvm::DIBuilder::createCommonBlock
DICommonBlock * createCommonBlock(DIScope *Scope, DIGlobalVariable *decl, StringRef Name, DIFile *File, unsigned LineNo)
Create common block entry for a Fortran common block.
Definition: DIBuilder.cpp:889
llvm::DIBuilder::retainType
void retainType(DIScope *T)
Retain DIScope* in a module even if it is not referenced through debug info anchors.
Definition: DIBuilder.cpp:622
llvm::DISubprogram::DISPFlags
DISPFlags
Debug info subprogram flags.
Definition: DebugInfoMetadata.h:1841
llvm::MDTuple
Tuple of metadata.
Definition: Metadata.h:1174
llvm::DIBuilder::createEnumerator
DIEnumerator * createEnumerator(StringRef Name, const APSInt &Value)
Create a single enumerator value.
Definition: DIBuilder.cpp:270
llvm::DISubrange
Array subrange.
Definition: DebugInfoMetadata.h:298
llvm::DIBuilder::createFriend
DIDerivedType * createFriend(DIType *Ty, DIType *FriendTy)
Create debugging information entry for a 'friend'.
Definition: DIBuilder.cpp:345
llvm::DITemplateTypeParameter
Definition: DebugInfoMetadata.h:2436
llvm::DIBuilder::createFunction
DISubprogram * createFunction(DIScope *Scope, StringRef Name, StringRef LinkageName, DIFile *File, unsigned LineNo, DISubroutineType *Ty, unsigned ScopeLine, DINode::DIFlags Flags=DINode::FlagZero, DISubprogram::DISPFlags SPFlags=DISubprogram::SPFlagZero, DITemplateParameterArray TParams=nullptr, DISubprogram *Decl=nullptr, DITypeArray ThrownTypes=nullptr, DINodeArray Annotations=nullptr)
Create a new descriptor for the specified subprogram.
Definition: DIBuilder.cpp:831
llvm::Instruction
Definition: Instruction.h:45
llvm::APSInt
An arbitrary precision integer that knows its signedness.
Definition: APSInt.h:22
llvm::DIBuilder::createUnionType
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:505
llvm::DIBuilder::createTypedef
DIDerivedType * createTypedef(DIType *Ty, StringRef Name, DIFile *File, unsigned LineNo, DIScope *Context, uint32_t AlignInBits=0, DINodeArray Annotations=nullptr)
Create debugging information entry for a typedef.
Definition: DIBuilder.cpp:335
llvm::DIBuilder::createVariantPart
DICompositeType * createVariantPart(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber, uint64_t SizeInBits, uint32_t AlignInBits, DINode::DIFlags Flags, DIDerivedType *Discriminator, DINodeArray Elements, StringRef UniqueIdentifier="")
Create debugging information entry for a variant part.
Definition: DIBuilder.cpp:518
llvm::Metadata
Root of the metadata hierarchy.
Definition: Metadata.h:62
llvm::DIBuilder::replaceArrays
void replaceArrays(DICompositeType *&T, DINodeArray Elements, DINodeArray TParams=DINodeArray())
Replace arrays on a composite type.
Definition: DIBuilder.cpp:1121
llvm::None
const NoneType None
Definition: None.h:23
llvm::lltok::Kind
Kind
Definition: LLToken.h:18
llvm::DIBuilder::createObjectPointerType
static DIType * createObjectPointerType(DIType *Ty)
Create a uniqued clone of Ty with FlagObjectPointer and FlagArtificial set.
Definition: DIBuilder.cpp:614
llvm::DICommonBlock
Definition: DebugInfoMetadata.h:3042
llvm::DIBuilder::createReferenceType
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:326
llvm::Constant
This is an important base class in LLVM.
Definition: Constant.h:41
llvm::DIEnumerator
Enumeration value.
Definition: DebugInfoMetadata.h:412
llvm::DIBuilder::createMethod
DISubprogram * createMethod(DIScope *Scope, StringRef Name, StringRef LinkageName, DIFile *File, unsigned LineNo, DISubroutineType *Ty, unsigned VTableIndex=0, int ThisAdjustment=0, DIType *VTableHolder=nullptr, DINode::DIFlags Flags=DINode::FlagZero, DISubprogram::DISPFlags SPFlags=DISubprogram::SPFlagZero, DITemplateParameterArray TParams=nullptr, DITypeArray ThrownTypes=nullptr)
Create a new descriptor for the specified C++ method.
Definition: DIBuilder.cpp:866
uint64_t
llvm::DIBuilder::createForwardDecl
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:633
llvm::DIBuilder::createArrayType
DICompositeType * createArrayType(uint64_t Size, uint32_t AlignInBits, DIType *Ty, DINodeArray Subscripts, PointerUnion< DIExpression *, DIVariable * > DataLocation=nullptr, PointerUnion< DIExpression *, DIVariable * > Associated=nullptr, PointerUnion< DIExpression *, DIVariable * > Allocated=nullptr, PointerUnion< DIExpression *, DIVariable * > Rank=nullptr)
Create debugging information entry for an array.
Definition: DIBuilder.cpp:564
Addr
uint64_t Addr
Definition: ELFObjHandler.cpp:79
llvm::DIBuilder::createEnumerationType
DICompositeType * createEnumerationType(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber, uint64_t SizeInBits, uint32_t AlignInBits, DINodeArray Elements, DIType *UnderlyingType, StringRef UniqueIdentifier="", bool IsScoped=false)
Create debugging information entry for an enumeration.
Definition: DIBuilder.cpp:537
llvm::DIBuilder::createClassType
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:475
llvm::DIBuilder::createExpression
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:820
llvm::DIGlobalVariable
Global variables.
Definition: DebugInfoMetadata.h:2957
move
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
Definition: README.txt:546
llvm::MDNode::replaceWithUniqued
static std::enable_if_t< std::is_base_of< MDNode, T >::value, T * > replaceWithUniqued(std::unique_ptr< T, TempMDNodeDeleter > N)
Replace a temporary node with a uniqued one.
Definition: Metadata.h:1027
llvm::LLVMContext
This is an important class for using LLVM in a threaded context.
Definition: LLVMContext.h:68
llvm::DIBuilder::createTemplateTemplateParameter
DITemplateValueParameter * createTemplateTemplateParameter(DIScope *Scope, StringRef Name, DIType *Ty, StringRef Val)
Create debugging information for a template template parameter.
Definition: DIBuilder.cpp:460
llvm::DenseMap
Definition: DenseMap.h:714
DebugInfo.h
llvm::DIBuilder::createMemberPointerType
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:315
llvm::DICompileUnit
Compile unit.
Definition: DebugInfoMetadata.h:1337
ArrayRef.h
llvm::DIMacroFile
Definition: DebugInfoMetadata.h:3549
llvm::DIBuilder::createArtificialSubprogram
static DISubprogram * createArtificialSubprogram(DISubprogram *SP)
Create a distinct clone of SP with FlagArtificial set.
Definition: DIBuilder.cpp:596
llvm::ISD::BasicBlock
@ BasicBlock
Various leaf nodes.
Definition: ISDOpcodes.h:71
llvm::DIBuilder::createLabel
DILabel * createLabel(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo, bool AlwaysPreserve=false)
Create a new descriptor for an label.
Definition: DIBuilder.cpp:802
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:65
llvm::MDNode
Metadata node.
Definition: Metadata.h:906
llvm::DIBuilder::createImportedDeclaration
DIImportedEntity * createImportedDeclaration(DIScope *Context, DINode *Decl, DIFile *File, unsigned Line, StringRef Name="", DINodeArray Elements=nullptr)
Create a descriptor for an imported function.
Definition: DIBuilder.cpp:222
llvm::DIBasicType
Basic type, like 'int' or 'float'.
Definition: DebugInfoMetadata.h:771
llvm::DISubroutineType
Type array for a subprogram.
Definition: DebugInfoMetadata.h:1283
llvm::DICompositeType
Composite types.
Definition: DebugInfoMetadata.h:1060
llvm::DIBuilder::createImportedModule
DIImportedEntity * createImportedModule(DIScope *Context, DINamespace *NS, DIFile *File, unsigned Line, DINodeArray Elements=nullptr)
Create a descriptor for an imported module.
Definition: DIBuilder.cpp:195
llvm::Sched::Source
@ Source
Definition: TargetLowering.h:99
llvm::ArrayRef
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: APInt.h:32
llvm::DIBuilder::createLexicalBlockFile
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:917
llvm::DICompileUnit::DebugNameTableKind
DebugNameTableKind
Definition: DebugInfoMetadata.h:1350
llvm::DIBuilder::createVariantMemberType
DIDerivedType * createVariantMemberType(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo, uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits, Constant *Discriminant, DINode::DIFlags Flags, DIType *Ty)
Create debugging information entry for a variant.
Definition: DIBuilder.cpp:380
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
uint32_t
DL
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Definition: AArch64SLSHardening.cpp:76
Module
Machine Check Debug Module
Definition: MachineCheckDebugify.cpp:122
llvm::DIBuilder::operator=
DIBuilder & operator=(const DIBuilder &)=delete
llvm::DIBuilder::getOrCreateGenericSubrange
DIGenericSubrange * getOrCreateGenericSubrange(DIGenericSubrange::BoundType Count, DIGenericSubrange::BoundType LowerBound, DIGenericSubrange::BoundType UpperBound, DIGenericSubrange::BoundType Stride)
Definition: DIBuilder.cpp:702
llvm::DIBuilder::createLexicalBlock
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:923
llvm::PointerUnion
A discriminated union of two or more pointer types, with the discriminator in the low bit of the poin...
Definition: PointerUnion.h:107
llvm::DIBuilder::createTemplateTypeParameter
DITemplateTypeParameter * createTemplateTypeParameter(DIScope *Scope, StringRef Name, DIType *Ty, bool IsDefault)
Create debugging information for template type parameter.
Definition: DIBuilder.cpp:436
llvm::DIBuilder::createInheritance
DIDerivedType * createInheritance(DIType *Ty, DIType *BaseTy, uint64_t BaseOffset, uint32_t VBPtrOffset, DINode::DIFlags Flags)
Create debugging information entry to establish inheritance relationship between two types.
Definition: DIBuilder.cpp:352
llvm::DIBuilder::createCompileUnit
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, DICompileUnit::DebugNameTableKind NameTableKind=DICompileUnit::DebugNameTableKind::Default, bool RangesBaseAddress=false, StringRef SysRoot={}, StringRef SDK={})
A CompileUnit provides an anchor for all debugging information generated during this instance of comp...
Definition: DIBuilder.cpp:152
llvm::DIBuilder::createNameSpace
DINamespace * createNameSpace(DIScope *Scope, StringRef Name, bool ExportSymbols)
This creates new descriptor for a namespace with the specified parent scope.
Definition: DIBuilder.cpp:896
llvm::DIBuilder::createStructType
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:492
llvm::GraphProgram::Name
Name
Definition: GraphWriter.h:50
llvm::DIBuilder::createUnspecifiedType
DIBasicType * createUnspecifiedType(StringRef Name)
Create a DWARF unspecified type.
Definition: DIBuilder.cpp:275
llvm::DIScope
Base class for scope-like contexts.
Definition: DebugInfoMetadata.h:476
llvm::DIBuilder::createObjCIVar
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:417
Casting.h
TrackingMDRef.h
llvm::DIBuilder::createVectorType
DICompositeType * createVectorType(uint64_t Size, uint32_t AlignInBits, DIType *Ty, DINodeArray Subscripts)
Create debugging information entry for a vector type.
Definition: DIBuilder.cpp:586
llvm::TargetStackID::Value
Value
Definition: TargetFrameLowering.h:27
llvm::DIBuilder::getOrCreateArray
DINodeArray getOrCreateArray(ArrayRef< Metadata * > Elements)
Get a DINodeArray, create one if required.
Definition: DIBuilder.cpp:663
llvm::DIBuilder::createParameterVariable
DILocalVariable * createParameterVariable(DIScope *Scope, StringRef Name, unsigned ArgNo, DIFile *File, unsigned LineNo, DIType *Ty, bool AlwaysPreserve=false, DINode::DIFlags Flags=DINode::FlagZero, DINodeArray Annotations=nullptr)
Create a new descriptor for a parameter variable.
Definition: DIBuilder.cpp:792
llvm::DICompileUnit::DebugNameTableKind::Default
@ Default
llvm::DIBuilder::createGlobalVariableExpression
DIGlobalVariableExpression * createGlobalVariableExpression(DIScope *Context, StringRef Name, StringRef LinkageName, DIFile *File, unsigned LineNo, DIType *Ty, bool IsLocalToUnit, bool isDefined=true, DIExpression *Expr=nullptr, MDNode *Decl=nullptr, MDTuple *TemplateParams=nullptr, uint32_t AlignInBits=0, DINodeArray Annotations=nullptr)
Create a new descriptor for the specified variable.
Definition: DIBuilder.cpp:723
llvm::DIDerivedType
Derived types.
Definition: DebugInfoMetadata.h:919
llvm::DIGlobalVariableExpression
A pair of DIGlobalVariable and DIExpression.
Definition: DebugInfoMetadata.h:3408
llvm::DIBuilder::createTemplateValueParameter
DITemplateValueParameter * createTemplateValueParameter(DIScope *Scope, StringRef Name, DIType *Ty, bool IsDefault, Constant *Val)
Create debugging information for template value parameter.
Definition: DIBuilder.cpp:451
llvm::DITemplateValueParameter
Definition: DebugInfoMetadata.h:2478
LLVMDIBuilderRef
struct LLVMOpaqueDIBuilder * LLVMDIBuilderRef
Represents an LLVM debug info builder.
Definition: Types.h:117
llvm::DIBuilder::createNullPtrType
DIBasicType * createNullPtrType()
Create C++11 nullptr type.
Definition: DIBuilder.cpp:280
llvm::DIBuilder::getOrCreateSubrange
DISubrange * getOrCreateSubrange(int64_t Lo, int64_t Count)
Create a descriptor for a value range.
Definition: DIBuilder.cpp:683
llvm::DIBuilder::getOrCreateMacroArray
DIMacroNodeArray getOrCreateMacroArray(ArrayRef< Metadata * > Elements)
Get a DIMacroNodeArray, create one if required.
Definition: DIBuilder.cpp:668
SmallVector.h
llvm::DINode::DIFlags
DIFlags
Debug info flags.
Definition: DebugInfoMetadata.h:166
N
#define N
llvm::DISubprogram
Subprogram description.
Definition: DebugInfoMetadata.h:1826
llvm::DIModule
Represents a module in the programming language, for example, a Clang module, or a Fortran module.
Definition: DebugInfoMetadata.h:2338
llvm::DILabel
Label.
Definition: DebugInfoMetadata.h:3194
llvm::DIBuilder::createBasicType
DIBasicType * createBasicType(StringRef Name, uint64_t SizeInBits, unsigned Encoding, DINode::DIFlags Flags=DINode::FlagZero)
Create debugging information entry for a basic type.
Definition: DIBuilder.cpp:284
CU
Definition: AArch64AsmBackend.cpp:504
llvm::Value
LLVM Value Representation.
Definition: Value.h:74
File
Instrumentation for Order File
Definition: InstrOrderFile.cpp:205
llvm::DIBuilder::createUnspecifiedParameter
DIBasicType * createUnspecifiedParameter()
Create unspecified parameter type for a subroutine type.
Definition: DIBuilder.cpp:630
llvm::codeview::PublicSymFlags::Function
@ Function
llvm::DIBuilder::createConstantValueExpression
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:718
SetVector.h
llvm::DIFile
File.
Definition: DebugInfoMetadata.h:530