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 
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  /// Each subprogram's preserved labels.
74 
75  /// Create a temporary.
76  ///
77  /// Create an \a temporary node and track it in \a UnresolvedNodes.
78  void trackIfUnresolved(MDNode *N);
79 
80  /// Internal helper for insertDeclare.
81  Instruction *insertDeclare(llvm::Value *Storage, DILocalVariable *VarInfo,
82  DIExpression *Expr, const DILocation *DL,
83  BasicBlock *InsertBB, Instruction *InsertBefore);
84 
85  /// Internal helper for insertLabel.
86  Instruction *insertLabel(DILabel *LabelInfo, const DILocation *DL,
87  BasicBlock *InsertBB, Instruction *InsertBefore);
88 
89  /// Internal helper for insertDbgValueIntrinsic.
90  Instruction *
91  insertDbgValueIntrinsic(llvm::Value *Val, DILocalVariable *VarInfo,
92  DIExpression *Expr, const DILocation *DL,
93  BasicBlock *InsertBB, Instruction *InsertBefore);
94 
95  public:
96  /// Construct a builder for a module.
97  ///
98  /// If \c AllowUnresolved, collect unresolved nodes attached to the module
99  /// in order to resolve cycles during \a finalize().
100  ///
101  /// If \p CU is given a value other than nullptr, then set \p CUNode to CU.
102  explicit DIBuilder(Module &M, bool AllowUnresolved = true,
103  DICompileUnit *CU = nullptr);
104  DIBuilder(const DIBuilder &) = delete;
105  DIBuilder &operator=(const DIBuilder &) = delete;
106 
107  /// Construct any deferred debug info descriptors.
108  void finalize();
109 
110  /// Finalize a specific subprogram - no new variables may be added to this
111  /// subprogram afterwards.
113 
114  /// A CompileUnit provides an anchor for all debugging
115  /// information generated during this instance of compilation.
116  /// \param Lang Source programming language, eg. dwarf::DW_LANG_C99
117  /// \param File File info.
118  /// \param Producer Identify the producer of debugging information
119  /// and code. Usually this is a compiler
120  /// version string.
121  /// \param isOptimized A boolean flag which indicates whether optimization
122  /// is enabled or not.
123  /// \param Flags This string lists command line options. This
124  /// string is directly embedded in debug info
125  /// output which may be used by a tool
126  /// analyzing generated debugging information.
127  /// \param RV This indicates runtime version for languages like
128  /// Objective-C.
129  /// \param SplitName The name of the file that we'll split debug info
130  /// out into.
131  /// \param Kind The kind of debug information to generate.
132  /// \param DWOId The DWOId if this is a split skeleton compile unit.
133  /// \param SplitDebugInlining Whether to emit inline debug info.
134  /// \param DebugInfoForProfiling Whether to emit extra debug info for
135  /// profile collection.
136  /// \param NameTableKind Whether to emit .debug_gnu_pubnames,
137  /// .debug_pubnames, or no pubnames at all.
138  /// \param SysRoot The clang system root (value of -isysroot).
139  /// \param SDK The SDK name. On Darwin, this is the last component
140  /// of the sysroot.
141  DICompileUnit *
142  createCompileUnit(unsigned Lang, DIFile *File, StringRef Producer,
143  bool isOptimized, StringRef Flags, unsigned RV,
144  StringRef SplitName = StringRef(),
146  DICompileUnit::DebugEmissionKind::FullDebug,
147  uint64_t DWOId = 0, bool SplitDebugInlining = true,
148  bool DebugInfoForProfiling = false,
151  bool RangesBaseAddress = false, StringRef SysRoot = {},
152  StringRef SDK = {});
153 
154  /// Create a file descriptor to hold debugging information for a file.
155  /// \param Filename File name.
156  /// \param Directory Directory.
157  /// \param Checksum Optional checksum kind (e.g. CSK_MD5, CSK_SHA1, etc.)
158  /// and value.
159  /// \param Source Optional source text.
160  DIFile *
161  createFile(StringRef Filename, StringRef Directory,
164 
165  /// Create debugging information entry for a macro.
166  /// \param Parent Macro parent (could be nullptr).
167  /// \param Line Source line number where the macro is defined.
168  /// \param MacroType DW_MACINFO_define or DW_MACINFO_undef.
169  /// \param Name Macro name.
170  /// \param Value Macro value.
171  DIMacro *createMacro(DIMacroFile *Parent, unsigned Line, unsigned MacroType,
173 
174  /// Create debugging information temporary entry for a macro file.
175  /// List of macro node direct children will be calculated by DIBuilder,
176  /// using the \p Parent relationship.
177  /// \param Parent Macro file parent (could be nullptr).
178  /// \param Line Source line number where the macro file is included.
179  /// \param File File descriptor containing the name of the macro file.
180  DIMacroFile *createTempMacroFile(DIMacroFile *Parent, unsigned Line,
181  DIFile *File);
182 
183  /// Create a single enumerator value.
186  bool IsUnsigned = false);
187 
188  /// Create a DWARF unspecified type.
190 
191  /// Create C++11 nullptr type.
193 
194  /// Create debugging information entry for a basic
195  /// type.
196  /// \param Name Type name.
197  /// \param SizeInBits Size of the type.
198  /// \param Encoding DWARF encoding code, e.g., dwarf::DW_ATE_float.
199  /// \param Flags Optional DWARF attributes, e.g., DW_AT_endianity.
201  unsigned Encoding,
202  DINode::DIFlags Flags = DINode::FlagZero);
203 
204  /// Create debugging information entry for a string
205  /// type.
206  /// \param Name Type name.
207  /// \param SizeInBits Size of the type.
209 
210  /// Create debugging information entry for a qualified
211  /// type, e.g. 'const int'.
212  /// \param Tag Tag identifing type, e.g. dwarf::TAG_volatile_type
213  /// \param FromTy Base Type.
214  DIDerivedType *createQualifiedType(unsigned Tag, DIType *FromTy);
215 
216  /// Create debugging information entry for a pointer.
217  /// \param PointeeTy Type pointed by this pointer.
218  /// \param SizeInBits Size.
219  /// \param AlignInBits Alignment. (optional)
220  /// \param DWARFAddressSpace DWARF address space. (optional)
221  /// \param Name Pointer type name. (optional)
222  DIDerivedType *createPointerType(DIType *PointeeTy, uint64_t SizeInBits,
223  uint32_t AlignInBits = 0,
224  Optional<unsigned> DWARFAddressSpace =
225  None,
226  StringRef Name = "");
227 
228  /// Create debugging information entry for a pointer to member.
229  /// \param PointeeTy Type pointed to by this pointer.
230  /// \param SizeInBits Size.
231  /// \param AlignInBits Alignment. (optional)
232  /// \param Class Type for which this pointer points to members of.
233  DIDerivedType *
234  createMemberPointerType(DIType *PointeeTy, DIType *Class,
235  uint64_t SizeInBits, uint32_t AlignInBits = 0,
236  DINode::DIFlags Flags = DINode::FlagZero);
237 
238  /// Create debugging information entry for a c++
239  /// style reference or rvalue reference type.
240  DIDerivedType *createReferenceType(unsigned Tag, DIType *RTy,
241  uint64_t SizeInBits = 0,
242  uint32_t AlignInBits = 0,
243  Optional<unsigned> DWARFAddressSpace =
244  None);
245 
246  /// Create debugging information entry for a typedef.
247  /// \param Ty Original type.
248  /// \param Name Typedef name.
249  /// \param File File where this type is defined.
250  /// \param LineNo Line number.
251  /// \param Context The surrounding context for the typedef.
252  /// \param AlignInBits Alignment. (optional)
253  /// \param Annotations Annotations. (optional)
255  unsigned LineNo, DIScope *Context,
256  uint32_t AlignInBits = 0,
257  DINodeArray Annotations = nullptr);
258 
259  /// Create debugging information entry for a 'friend'.
260  DIDerivedType *createFriend(DIType *Ty, DIType *FriendTy);
261 
262  /// Create debugging information entry to establish
263  /// inheritance relationship between two types.
264  /// \param Ty Original type.
265  /// \param BaseTy Base type. Ty is inherits from base.
266  /// \param BaseOffset Base offset.
267  /// \param VBPtrOffset Virtual base pointer offset.
268  /// \param Flags Flags to describe inheritance attribute,
269  /// e.g. private
271  uint64_t BaseOffset, uint32_t VBPtrOffset,
272  DINode::DIFlags Flags);
273 
274  /// Create debugging information entry for a member.
275  /// \param Scope Member scope.
276  /// \param Name Member name.
277  /// \param File File where this member is defined.
278  /// \param LineNo Line number.
279  /// \param SizeInBits Member size.
280  /// \param AlignInBits Member alignment.
281  /// \param OffsetInBits Member offset.
282  /// \param Flags Flags to encode member attribute, e.g. private
283  /// \param Ty Parent type.
284  /// \param Annotations Member annotations.
286  DIFile *File, unsigned LineNo,
287  uint64_t SizeInBits, uint32_t AlignInBits,
288  uint64_t OffsetInBits,
289  DINode::DIFlags Flags, DIType *Ty,
290  DINodeArray Annotations = nullptr);
291 
292  /// Create debugging information entry for a variant. A variant
293  /// normally should be a member of a variant part.
294  /// \param Scope Member scope.
295  /// \param Name Member name.
296  /// \param File File where this member is defined.
297  /// \param LineNo Line number.
298  /// \param SizeInBits Member size.
299  /// \param AlignInBits Member alignment.
300  /// \param OffsetInBits Member offset.
301  /// \param Flags Flags to encode member attribute, e.g. private
302  /// \param Discriminant The discriminant for this branch; null for
303  /// the default branch
304  /// \param Ty Parent type.
306  DIFile *File, unsigned LineNo,
307  uint64_t SizeInBits,
308  uint32_t AlignInBits,
309  uint64_t OffsetInBits,
310  Constant *Discriminant,
311  DINode::DIFlags Flags, DIType *Ty);
312 
313  /// Create debugging information entry for a bit field member.
314  /// \param Scope Member scope.
315  /// \param Name Member name.
316  /// \param File File where this member is defined.
317  /// \param LineNo Line number.
318  /// \param SizeInBits Member size.
319  /// \param OffsetInBits Member offset.
320  /// \param StorageOffsetInBits Member storage offset.
321  /// \param Flags Flags to encode member attribute.
322  /// \param Ty Parent type.
323  /// \param Annotations Member annotations.
325  DIFile *File, unsigned LineNo,
326  uint64_t SizeInBits,
327  uint64_t OffsetInBits,
328  uint64_t StorageOffsetInBits,
329  DINode::DIFlags Flags, DIType *Ty,
330  DINodeArray Annotations = nullptr);
331 
332  /// Create debugging information entry for a
333  /// C++ static data member.
334  /// \param Scope Member scope.
335  /// \param Name Member name.
336  /// \param File File where this member is declared.
337  /// \param LineNo Line number.
338  /// \param Ty Type of the static member.
339  /// \param Flags Flags to encode member attribute, e.g. private.
340  /// \param Val Const initializer of the member.
341  /// \param AlignInBits Member alignment.
343  DIFile *File, unsigned LineNo,
344  DIType *Ty, DINode::DIFlags Flags,
345  Constant *Val,
346  uint32_t AlignInBits = 0);
347 
348  /// Create debugging information entry for Objective-C
349  /// instance variable.
350  /// \param Name Member name.
351  /// \param File File where this member is defined.
352  /// \param LineNo Line number.
353  /// \param SizeInBits Member size.
354  /// \param AlignInBits Member alignment.
355  /// \param OffsetInBits Member offset.
356  /// \param Flags Flags to encode member attribute, e.g. private
357  /// \param Ty Parent type.
358  /// \param PropertyNode Property associated with this ivar.
360  uint64_t SizeInBits, uint32_t AlignInBits,
361  uint64_t OffsetInBits, DINode::DIFlags Flags,
362  DIType *Ty, MDNode *PropertyNode);
363 
364  /// Create debugging information entry for Objective-C
365  /// property.
366  /// \param Name Property name.
367  /// \param File File where this property is defined.
368  /// \param LineNumber Line number.
369  /// \param GetterName Name of the Objective C property getter selector.
370  /// \param SetterName Name of the Objective C property setter selector.
371  /// \param PropertyAttributes Objective C property attributes.
372  /// \param Ty Type.
374  unsigned LineNumber,
375  StringRef GetterName,
376  StringRef SetterName,
377  unsigned PropertyAttributes, DIType *Ty);
378 
379  /// Create debugging information entry for a class.
380  /// \param Scope Scope in which this class is defined.
381  /// \param Name class name.
382  /// \param File File where this member is defined.
383  /// \param LineNumber Line number.
384  /// \param SizeInBits Member size.
385  /// \param AlignInBits Member alignment.
386  /// \param OffsetInBits Member offset.
387  /// \param Flags Flags to encode member attribute, e.g. private
388  /// \param Elements class members.
389  /// \param VTableHolder Debug info of the base class that contains vtable
390  /// for this type. This is used in
391  /// DW_AT_containing_type. See DWARF documentation
392  /// for more info.
393  /// \param TemplateParms Template type parameters.
394  /// \param UniqueIdentifier A unique identifier for the class.
396  DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber,
397  uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits,
398  DINode::DIFlags Flags, DIType *DerivedFrom, DINodeArray Elements,
399  DIType *VTableHolder = nullptr, MDNode *TemplateParms = nullptr,
400  StringRef UniqueIdentifier = "");
401 
402  /// Create debugging information entry for a struct.
403  /// \param Scope Scope in which this struct is defined.
404  /// \param Name Struct name.
405  /// \param File File where this member is defined.
406  /// \param LineNumber Line number.
407  /// \param SizeInBits Member size.
408  /// \param AlignInBits Member alignment.
409  /// \param Flags Flags to encode member attribute, e.g. private
410  /// \param Elements Struct elements.
411  /// \param RunTimeLang Optional parameter, Objective-C runtime version.
412  /// \param UniqueIdentifier A unique identifier for the struct.
414  DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber,
415  uint64_t SizeInBits, uint32_t AlignInBits, DINode::DIFlags Flags,
416  DIType *DerivedFrom, DINodeArray Elements, unsigned RunTimeLang = 0,
417  DIType *VTableHolder = nullptr, StringRef UniqueIdentifier = "");
418 
419  /// Create debugging information entry for an union.
420  /// \param Scope Scope in which this union is defined.
421  /// \param Name Union name.
422  /// \param File File where this member is defined.
423  /// \param LineNumber Line number.
424  /// \param SizeInBits Member size.
425  /// \param AlignInBits Member alignment.
426  /// \param Flags Flags to encode member attribute, e.g. private
427  /// \param Elements Union elements.
428  /// \param RunTimeLang Optional parameter, Objective-C runtime version.
429  /// \param UniqueIdentifier A unique identifier for the union.
431  DIFile *File, unsigned LineNumber,
432  uint64_t SizeInBits, uint32_t AlignInBits,
433  DINode::DIFlags Flags,
434  DINodeArray Elements,
435  unsigned RunTimeLang = 0,
436  StringRef UniqueIdentifier = "");
437 
438  /// Create debugging information entry for a variant part. A
439  /// variant part normally has a discriminator (though this is not
440  /// required) and a number of variant children.
441  /// \param Scope Scope in which this union is defined.
442  /// \param Name Union name.
443  /// \param File File where this member is defined.
444  /// \param LineNumber Line number.
445  /// \param SizeInBits Member size.
446  /// \param AlignInBits Member alignment.
447  /// \param Flags Flags to encode member attribute, e.g. private
448  /// \param Discriminator Discriminant member
449  /// \param Elements Variant elements.
450  /// \param UniqueIdentifier A unique identifier for the union.
452  DIFile *File, unsigned LineNumber,
453  uint64_t SizeInBits, uint32_t AlignInBits,
454  DINode::DIFlags Flags,
455  DIDerivedType *Discriminator,
456  DINodeArray Elements,
457  StringRef UniqueIdentifier = "");
458 
459  /// Create debugging information for template
460  /// type parameter.
461  /// \param Scope Scope in which this type is defined.
462  /// \param Name Type parameter name.
463  /// \param Ty Parameter type.
464  /// \param IsDefault Parameter is default or not
466  StringRef Name,
467  DIType *Ty,
468  bool IsDefault);
469 
470  /// Create debugging information for template
471  /// value parameter.
472  /// \param Scope Scope in which this type is defined.
473  /// \param Name Value parameter name.
474  /// \param Ty Parameter type.
475  /// \param IsDefault Parameter is default or not
476  /// \param Val Constant parameter value.
479  bool IsDefault, Constant *Val);
480 
481  /// Create debugging information for a template template parameter.
482  /// \param Scope Scope in which this type is defined.
483  /// \param Name Value parameter name.
484  /// \param Ty Parameter type.
485  /// \param Val The fully qualified name of the template.
487  StringRef Name,
488  DIType *Ty,
489  StringRef Val);
490 
491  /// Create debugging information for a template parameter pack.
492  /// \param Scope Scope in which this type is defined.
493  /// \param Name Value parameter name.
494  /// \param Ty Parameter type.
495  /// \param Val An array of types in the pack.
497  StringRef Name,
498  DIType *Ty,
499  DINodeArray Val);
500 
501  /// Create debugging information entry for an array.
502  /// \param Size Array size.
503  /// \param AlignInBits Alignment.
504  /// \param Ty Element type.
505  /// \param Subscripts Subscripts.
506  /// \param DataLocation The location of the raw data of a descriptor-based
507  /// Fortran array, either a DIExpression* or
508  /// a DIVariable*.
509  /// \param Associated The associated attribute of a descriptor-based
510  /// Fortran array, either a DIExpression* or
511  /// a DIVariable*.
512  /// \param Allocated The allocated attribute of a descriptor-based
513  /// Fortran array, either a DIExpression* or
514  /// a DIVariable*.
515  /// \param Rank The rank attribute of a descriptor-based
516  /// Fortran array, either a DIExpression* or
517  /// a DIVariable*.
519  uint64_t Size, uint32_t AlignInBits, DIType *Ty, DINodeArray Subscripts,
520  PointerUnion<DIExpression *, DIVariable *> DataLocation = nullptr,
521  PointerUnion<DIExpression *, DIVariable *> Associated = nullptr,
522  PointerUnion<DIExpression *, DIVariable *> Allocated = nullptr,
524 
525  /// Create debugging information entry for a vector type.
526  /// \param Size Array size.
527  /// \param AlignInBits Alignment.
528  /// \param Ty Element type.
529  /// \param Subscripts Subscripts.
531  DIType *Ty, DINodeArray Subscripts);
532 
533  /// Create debugging information entry for an
534  /// enumeration.
535  /// \param Scope Scope in which this enumeration is defined.
536  /// \param Name Union name.
537  /// \param File File where this member is defined.
538  /// \param LineNumber Line number.
539  /// \param SizeInBits Member size.
540  /// \param AlignInBits Member alignment.
541  /// \param Elements Enumeration elements.
542  /// \param UnderlyingType Underlying type of a C++11/ObjC fixed enum.
543  /// \param UniqueIdentifier A unique identifier for the enum.
544  /// \param IsScoped Boolean flag indicate if this is C++11/ObjC 'enum class'.
546  DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber,
547  uint64_t SizeInBits, uint32_t AlignInBits, DINodeArray Elements,
548  DIType *UnderlyingType, StringRef UniqueIdentifier = "", bool IsScoped = false);
549 
550  /// Create debugging information entry for a set.
551  /// \param Scope Scope in which this set is defined.
552  /// \param Name Set name.
553  /// \param File File where this set is defined.
554  /// \param LineNo Line number.
555  /// \param SizeInBits Set size.
556  /// \param AlignInBits Set alignment.
557  /// \param Ty Base type of the set.
559  unsigned LineNo, uint64_t SizeInBits,
560  uint32_t AlignInBits, DIType *Ty);
561 
562  /// Create subroutine type.
563  /// \param ParameterTypes An array of subroutine parameter types. This
564  /// includes return type at 0th index.
565  /// \param Flags E.g.: LValueReference.
566  /// These flags are used to emit dwarf attributes.
567  /// \param CC Calling convention, e.g. dwarf::DW_CC_normal
569  createSubroutineType(DITypeRefArray ParameterTypes,
570  DINode::DIFlags Flags = DINode::FlagZero,
571  unsigned CC = 0);
572 
573  /// Create a distinct clone of \p SP with FlagArtificial set.
575 
576  /// Create a uniqued clone of \p Ty with FlagArtificial set.
577  static DIType *createArtificialType(DIType *Ty);
578 
579  /// Create a uniqued clone of \p Ty with FlagObjectPointer and
580  /// FlagArtificial set.
582 
583  /// Create a permanent forward-declared type.
585  DIScope *Scope, DIFile *F, unsigned Line,
586  unsigned RuntimeLang = 0,
587  uint64_t SizeInBits = 0,
588  uint32_t AlignInBits = 0,
589  StringRef UniqueIdentifier = "");
590 
591  /// Create a temporary forward-declared type.
593  unsigned Tag, StringRef Name, DIScope *Scope, DIFile *F, unsigned Line,
594  unsigned RuntimeLang = 0, uint64_t SizeInBits = 0,
595  uint32_t AlignInBits = 0, DINode::DIFlags Flags = DINode::FlagFwdDecl,
596  StringRef UniqueIdentifier = "", DINodeArray Annotations = nullptr);
597 
598  /// Retain DIScope* in a module even if it is not referenced
599  /// through debug info anchors.
600  void retainType(DIScope *T);
601 
602  /// Create unspecified parameter type
603  /// for a subroutine type.
605 
606  /// Get a DINodeArray, create one if required.
607  DINodeArray getOrCreateArray(ArrayRef<Metadata *> Elements);
608 
609  /// Get a DIMacroNodeArray, create one if required.
610  DIMacroNodeArray getOrCreateMacroArray(ArrayRef<Metadata *> Elements);
611 
612  /// Get a DITypeRefArray, create one if required.
614 
615  /// Create a descriptor for a value range. This
616  /// implicitly uniques the values returned.
617  DISubrange *getOrCreateSubrange(int64_t Lo, int64_t Count);
618  DISubrange *getOrCreateSubrange(int64_t Lo, Metadata *CountNode);
619  DISubrange *getOrCreateSubrange(Metadata *Count, Metadata *LowerBound,
620  Metadata *UpperBound, Metadata *Stride);
621 
624  DIGenericSubrange::BoundType LowerBound,
625  DIGenericSubrange::BoundType UpperBound,
627 
628  /// Create a new descriptor for the specified variable.
629  /// \param Context Variable scope.
630  /// \param Name Name of the variable.
631  /// \param LinkageName Mangled name of the variable.
632  /// \param File File where this variable is defined.
633  /// \param LineNo Line number.
634  /// \param Ty Variable Type.
635  /// \param IsLocalToUnit Boolean flag indicate whether this variable is
636  /// externally visible or not.
637  /// \param Expr The location of the global relative to the attached
638  /// GlobalVariable.
639  /// \param Decl Reference to the corresponding declaration.
640  /// \param AlignInBits Variable alignment(or 0 if no alignment attr was
641  /// specified)
644  unsigned LineNo, DIType *Ty, bool IsLocalToUnit, bool isDefined = true,
645  DIExpression *Expr = nullptr, MDNode *Decl = nullptr,
646  MDTuple *TemplateParams = nullptr, uint32_t AlignInBits = 0,
647  DINodeArray Annotations = nullptr);
648 
649  /// Identical to createGlobalVariable
650  /// except that the resulting DbgNode is temporary and meant to be RAUWed.
653  unsigned LineNo, DIType *Ty, bool IsLocalToUnit, MDNode *Decl = nullptr,
654  MDTuple *TemplateParams= nullptr, uint32_t AlignInBits = 0);
655 
656  /// Create a new descriptor for an auto variable. This is a local variable
657  /// that is not a subprogram parameter.
658  ///
659  /// \c Scope must be a \a DILocalScope, and thus its scope chain eventually
660  /// leads to a \a DISubprogram.
661  ///
662  /// If \c AlwaysPreserve, this variable will be referenced from its
663  /// containing subprogram, and will survive some optimizations.
666  unsigned LineNo, DIType *Ty, bool AlwaysPreserve = false,
667  DINode::DIFlags Flags = DINode::FlagZero,
668  uint32_t AlignInBits = 0);
669 
670  /// Create a new descriptor for an label.
671  ///
672  /// \c Scope must be a \a DILocalScope, and thus its scope chain eventually
673  /// leads to a \a DISubprogram.
674  DILabel *
675  createLabel(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo,
676  bool AlwaysPreserve = false);
677 
678  /// Create a new descriptor for a parameter variable.
679  ///
680  /// \c Scope must be a \a DILocalScope, and thus its scope chain eventually
681  /// leads to a \a DISubprogram.
682  ///
683  /// \c ArgNo is the index (starting from \c 1) of this variable in the
684  /// subprogram parameters. \c ArgNo should not conflict with other
685  /// parameters of the same subprogram.
686  ///
687  /// If \c AlwaysPreserve, this variable will be referenced from its
688  /// containing subprogram, and will survive some optimizations.
691  DIFile *File, unsigned LineNo, DIType *Ty,
692  bool AlwaysPreserve = false,
693  DINode::DIFlags Flags = DINode::FlagZero,
694  DINodeArray Annotations = nullptr);
695 
696  /// Create a new descriptor for the specified
697  /// variable which has a complex address expression for its address.
698  /// \param Addr An array of complex address operations.
701 
702  /// Create an expression for a variable that does not have an address, but
703  /// does have a constant value.
705  return DIExpression::get(
706  VMContext, {dwarf::DW_OP_constu, Val, dwarf::DW_OP_stack_value});
707  }
708 
709  /// Create a new descriptor for the specified subprogram.
710  /// See comments in DISubprogram* for descriptions of these fields.
711  /// \param Scope Function scope.
712  /// \param Name Function name.
713  /// \param LinkageName Mangled function name.
714  /// \param File File where this variable is defined.
715  /// \param LineNo Line number.
716  /// \param Ty Function type.
717  /// \param ScopeLine Set to the beginning of the scope this starts
718  /// \param Flags e.g. is this function prototyped or not.
719  /// These flags are used to emit dwarf attributes.
720  /// \param SPFlags Additional flags specific to subprograms.
721  /// \param TParams Function template parameters.
722  /// \param ThrownTypes Exception types this function may throw.
723  /// \param Annotations Attribute Annotations.
724  DISubprogram *
726  DIFile *File, unsigned LineNo, DISubroutineType *Ty,
727  unsigned ScopeLine, DINode::DIFlags Flags = DINode::FlagZero,
728  DISubprogram::DISPFlags SPFlags = DISubprogram::SPFlagZero,
729  DITemplateParameterArray TParams = nullptr,
730  DISubprogram *Decl = nullptr,
731  DITypeArray ThrownTypes = nullptr,
732  DINodeArray Annotations = nullptr);
733 
734  /// Identical to createFunction,
735  /// except that the resulting DbgNode is meant to be RAUWed.
737  DIScope *Scope, StringRef Name, StringRef LinkageName, DIFile *File,
738  unsigned LineNo, DISubroutineType *Ty, unsigned ScopeLine,
739  DINode::DIFlags Flags = DINode::FlagZero,
740  DISubprogram::DISPFlags SPFlags = DISubprogram::SPFlagZero,
741  DITemplateParameterArray TParams = nullptr,
742  DISubprogram *Decl = nullptr, DITypeArray ThrownTypes = nullptr);
743 
744  /// Create a new descriptor for the specified C++ method.
745  /// See comments in \a DISubprogram* for descriptions of these fields.
746  /// \param Scope Function scope.
747  /// \param Name Function name.
748  /// \param LinkageName Mangled function name.
749  /// \param File File where this variable is defined.
750  /// \param LineNo Line number.
751  /// \param Ty Function type.
752  /// \param VTableIndex Index no of this method in virtual table, or -1u if
753  /// unrepresentable.
754  /// \param ThisAdjustment
755  /// MS ABI-specific adjustment of 'this' that occurs
756  /// in the prologue.
757  /// \param VTableHolder Type that holds vtable.
758  /// \param Flags e.g. is this function prototyped or not.
759  /// This flags are used to emit dwarf attributes.
760  /// \param SPFlags Additional flags specific to subprograms.
761  /// \param TParams Function template parameters.
762  /// \param ThrownTypes Exception types this function may throw.
763  DISubprogram *
765  DIFile *File, unsigned LineNo, DISubroutineType *Ty,
766  unsigned VTableIndex = 0, int ThisAdjustment = 0,
767  DIType *VTableHolder = nullptr,
768  DINode::DIFlags Flags = DINode::FlagZero,
769  DISubprogram::DISPFlags SPFlags = DISubprogram::SPFlagZero,
770  DITemplateParameterArray TParams = nullptr,
771  DITypeArray ThrownTypes = nullptr);
772 
773  /// Create common block entry for a Fortran common block.
774  /// \param Scope Scope of this common block.
775  /// \param decl Global variable declaration.
776  /// \param Name The name of this common block.
777  /// \param File The file this common block is defined.
778  /// \param LineNo Line number.
781  unsigned LineNo);
782 
783  /// This creates new descriptor for a namespace with the specified
784  /// parent scope.
785  /// \param Scope Namespace scope
786  /// \param Name Name of this namespace
787  /// \param ExportSymbols True for C++ inline namespaces.
789  bool ExportSymbols);
790 
791  /// This creates new descriptor for a module with the specified
792  /// parent scope.
793  /// \param Scope Parent scope
794  /// \param Name Name of this module
795  /// \param ConfigurationMacros
796  /// A space-separated shell-quoted list of -D macro
797  /// definitions as they would appear on a command line.
798  /// \param IncludePath The path to the module map file.
799  /// \param APINotesFile The path to an API notes file for this module.
800  /// \param File Source file of the module.
801  /// Used for Fortran modules.
802  /// \param LineNo Source line number of the module.
803  /// Used for Fortran modules.
804  /// \param IsDecl This is a module declaration; default to false;
805  /// when set to true, only Scope and Name are required
806  /// as this entry is just a hint for the debugger to find
807  /// the corresponding definition in the global scope.
809  StringRef ConfigurationMacros, StringRef IncludePath,
810  StringRef APINotesFile = {}, DIFile *File = nullptr,
811  unsigned LineNo = 0, bool IsDecl = false);
812 
813  /// This creates a descriptor for a lexical block with a new file
814  /// attached. This merely extends the existing
815  /// lexical block as it crosses a file.
816  /// \param Scope Lexical block.
817  /// \param File Source file.
818  /// \param Discriminator DWARF path discriminator value.
819  DILexicalBlockFile *createLexicalBlockFile(DIScope *Scope, DIFile *File,
820  unsigned Discriminator = 0);
821 
822  /// This creates a descriptor for a lexical block with the
823  /// specified parent context.
824  /// \param Scope Parent lexical scope.
825  /// \param File Source file.
826  /// \param Line Line number.
827  /// \param Col Column number.
828  DILexicalBlock *createLexicalBlock(DIScope *Scope, DIFile *File,
829  unsigned Line, unsigned Col);
830 
831  /// Create a descriptor for an imported module.
832  /// \param Context The scope this module is imported into
833  /// \param NS The namespace being imported here.
834  /// \param File File where the declaration is located.
835  /// \param Line Line number of the declaration.
836  /// \param Elements Renamed elements.
837  DIImportedEntity *createImportedModule(DIScope *Context, DINamespace *NS,
838  DIFile *File, unsigned Line,
839  DINodeArray Elements = nullptr);
840 
841  /// Create a descriptor for an imported module.
842  /// \param Context The scope this module is imported into.
843  /// \param NS An aliased namespace.
844  /// \param File File where the declaration is located.
845  /// \param Line Line number of the declaration.
846  /// \param Elements Renamed elements.
847  DIImportedEntity *createImportedModule(DIScope *Context,
848  DIImportedEntity *NS, DIFile *File,
849  unsigned Line,
850  DINodeArray Elements = nullptr);
851 
852  /// Create a descriptor for an imported module.
853  /// \param Context The scope this module is imported into.
854  /// \param M The module being imported here
855  /// \param File File where the declaration is located.
856  /// \param Line Line number of the declaration.
857  /// \param Elements Renamed elements.
858  DIImportedEntity *createImportedModule(DIScope *Context, DIModule *M,
859  DIFile *File, unsigned Line,
860  DINodeArray Elements = nullptr);
861 
862  /// Create a descriptor for an imported function.
863  /// \param Context The scope this module is imported into.
864  /// \param Decl The declaration (or definition) of a function, type, or
865  /// variable.
866  /// \param File File where the declaration is located.
867  /// \param Line Line number of the declaration.
868  /// \param Elements Renamed elements.
869  DIImportedEntity *createImportedDeclaration(DIScope *Context, DINode *Decl,
870  DIFile *File, unsigned Line,
871  StringRef Name = "",
872  DINodeArray Elements = nullptr);
873 
874  /// Insert a new llvm.dbg.declare intrinsic call.
875  /// \param Storage llvm::Value of the variable
876  /// \param VarInfo Variable's debug info descriptor.
877  /// \param Expr A complex location expression.
878  /// \param DL Debug info location.
879  /// \param InsertAtEnd Location for the new intrinsic.
880  Instruction *insertDeclare(llvm::Value *Storage, DILocalVariable *VarInfo,
881  DIExpression *Expr, const DILocation *DL,
882  BasicBlock *InsertAtEnd);
883 
884  /// Insert a new llvm.dbg.declare intrinsic call.
885  /// \param Storage llvm::Value of the variable
886  /// \param VarInfo Variable's debug info descriptor.
887  /// \param Expr A complex location expression.
888  /// \param DL Debug info location.
889  /// \param InsertBefore Location for the new intrinsic.
890  Instruction *insertDeclare(llvm::Value *Storage, DILocalVariable *VarInfo,
891  DIExpression *Expr, const DILocation *DL,
892  Instruction *InsertBefore);
893 
894  /// Insert a new llvm.dbg.label intrinsic call.
895  /// \param LabelInfo Label's debug info descriptor.
896  /// \param DL Debug info location.
897  /// \param InsertBefore Location for the new intrinsic.
898  Instruction *insertLabel(DILabel *LabelInfo, const DILocation *DL,
899  Instruction *InsertBefore);
900 
901  /// Insert a new llvm.dbg.label intrinsic call.
902  /// \param LabelInfo Label's debug info descriptor.
903  /// \param DL Debug info location.
904  /// \param InsertAtEnd Location for the new intrinsic.
905  Instruction *insertLabel(DILabel *LabelInfo, const DILocation *DL,
906  BasicBlock *InsertAtEnd);
907 
908  /// Insert a new llvm.dbg.value intrinsic call.
909  /// \param Val llvm::Value of the variable
910  /// \param VarInfo Variable's debug info descriptor.
911  /// \param Expr A complex location expression.
912  /// \param DL Debug info location.
913  /// \param InsertAtEnd Location for the new intrinsic.
914  Instruction *insertDbgValueIntrinsic(llvm::Value *Val,
915  DILocalVariable *VarInfo,
916  DIExpression *Expr,
917  const DILocation *DL,
918  BasicBlock *InsertAtEnd);
919 
920  /// Insert a new llvm.dbg.value intrinsic call.
921  /// \param Val llvm::Value of the variable
922  /// \param VarInfo Variable's debug info descriptor.
923  /// \param Expr A complex location expression.
924  /// \param DL Debug info location.
925  /// \param InsertBefore Location for the new intrinsic.
926  Instruction *insertDbgValueIntrinsic(llvm::Value *Val,
927  DILocalVariable *VarInfo,
928  DIExpression *Expr,
929  const DILocation *DL,
930  Instruction *InsertBefore);
931 
932  /// Replace the vtable holder in the given type.
933  ///
934  /// If this creates a self reference, it may orphan some unresolved cycles
935  /// in the operands of \c T, so \a DIBuilder needs to track that.
936  void replaceVTableHolder(DICompositeType *&T,
937  DIType *VTableHolder);
938 
939  /// Replace arrays on a composite type.
940  ///
941  /// If \c T is resolved, but the arrays aren't -- which can happen if \c T
942  /// has a self-reference -- \a DIBuilder needs to track the array to
943  /// resolve cycles.
944  void replaceArrays(DICompositeType *&T, DINodeArray Elements,
945  DINodeArray TParams = DINodeArray());
946 
947  /// Replace a temporary node.
948  ///
949  /// Call \a MDNode::replaceAllUsesWith() on \c N, replacing it with \c
950  /// Replacement.
951  ///
952  /// If \c Replacement is the same as \c N.get(), instead call \a
953  /// MDNode::replaceWithUniqued(). In this case, the uniqued node could
954  /// have a different address, so we return the final address.
955  template <class NodeTy>
956  NodeTy *replaceTemporary(TempMDNode &&N, NodeTy *Replacement) {
957  if (N.get() == Replacement)
958  return cast<NodeTy>(MDNode::replaceWithUniqued(std::move(N)));
959 
960  N->replaceAllUsesWith(Replacement);
961  return Replacement;
962  }
963  };
964 
965  // Create wrappers for C Binding types (see CBindingWrapping.h).
967 
968 } // end namespace llvm
969 
970 #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:904
llvm::Check::Size
@ Size
Definition: FileCheck.h:73
llvm
This file implements support for optimizing divisions by a constant.
Definition: AllocatorList.h:23
llvm::DIType
Base class for types.
Definition: DebugInfoMetadata.h:662
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:659
llvm::DIBuilder::finalize
void finalize()
Construct any deferred debug info descriptors.
Definition: DIBuilder.cpp:69
Optional.h
llvm::DIBuilder::replaceVTableHolder
void replaceVTableHolder(DICompositeType *&T, DIType *VTableHolder)
Replace the vtable holder in the given type.
Definition: DIBuilder.cpp:1058
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:49
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:380
llvm::lltok::NameTableKind
@ NameTableKind
Definition: LLToken.h:485
llvm::SmallVector
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1168
llvm::DIStringType
String type, Fortran CHARACTER(n)
Definition: DebugInfoMetadata.h:837
llvm::DIFile::ChecksumInfo
A single checksum, represented by a Kind and a Value (a string).
Definition: DebugInfoMetadata.h:552
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:729
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:847
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:37
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:354
llvm::DIBuilder::createSubroutineType
DISubroutineType * createSubroutineType(DITypeRefArray ParameterTypes, DINode::DIFlags Flags=DINode::FlagZero, unsigned CC=0)
Create subroutine type.
Definition: DIBuilder.cpp:519
llvm::DIExpression
DWARF expression.
Definition: DebugInfoMetadata.h:2586
llvm::DIBuilder::createQualifiedType
DIDerivedType * createQualifiedType(unsigned Tag, DIType *FromTy)
Create debugging information entry for a qualified type, e.g.
Definition: DIBuilder.cpp:285
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:279
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:418
llvm::DICompileUnit::DebugEmissionKind
DebugEmissionKind
Definition: DebugInfoMetadata.h:1340
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:634
llvm::DINamespace
Definition: DebugInfoMetadata.h:2276
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:219
llvm::MDNode::get
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata * > MDs)
Definition: Metadata.h:1233
F
#define F(x, y, z)
Definition: MD5.cpp:56
llvm::DIBuilder::createTemplateParameterPack
DITemplateValueParameter * createTemplateParameterPack(DIScope *Scope, StringRef Name, DIType *Ty, DINodeArray Val)
Create debugging information for a template parameter pack.
Definition: DIBuilder.cpp:458
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:46
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:770
Context
LLVMContext & Context
Definition: NVVMIntrRange.cpp:66
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:539
llvm::DIBuilder::createArtificialType
static DIType * createArtificialType(DIType *Ty)
Create a uniqued clone of Ty with FlagArtificial set.
Definition: DIBuilder.cpp:594
llvm::DIObjCProperty
Definition: DebugInfoMetadata.h:3253
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:956
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:395
llvm::ISD::Constant
@ Constant
Definition: ISDOpcodes.h:76
llvm::DILocalVariable
Local variable.
Definition: DebugInfoMetadata.h:3097
llvm::DIMacro
Definition: DebugInfoMetadata.h:3491
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:225
llvm::DIBuilder::createTempMacroFile
DIMacroFile * createTempMacroFile(DIMacroFile *Parent, unsigned Line, DIFile *File)
Create debugging information temporary entry for a macro file.
Definition: DIBuilder.cpp:237
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:885
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:609
llvm::DISubprogram::DISPFlags
DISPFlags
Debug info subprogram flags.
Definition: DebugInfoMetadata.h:1835
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:257
llvm::DISubrange
Array subrange.
Definition: DebugInfoMetadata.h:296
llvm::DIBuilder::createFriend
DIDerivedType * createFriend(DIType *Ty, DIType *FriendTy)
Create debugging information entry for a 'friend'.
Definition: DIBuilder.cpp:335
llvm::DITemplateTypeParameter
Definition: DebugInfoMetadata.h:2426
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:827
llvm::Instruction
Definition: Instruction.h:45
llvm::DIBuilder::createPointerType
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:290
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:495
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:324
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:507
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:1078
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:601
llvm::DICommonBlock
Definition: DebugInfoMetadata.h:3035
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:313
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:862
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:620
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:551
Addr
uint64_t Addr
Definition: ELFObjHandler.cpp:80
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:525
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:465
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:810
llvm::DIGlobalVariable
Global variables.
Definition: DebugInfoMetadata.h:2946
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:450
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:303
llvm::DICompileUnit
Compile unit.
Definition: DebugInfoMetadata.h:1335
ArrayRef.h
llvm::DIMacroFile
Definition: DebugInfoMetadata.h:3540
llvm::DIBuilder::createArtificialSubprogram
static DISubprogram * createArtificialSubprogram(DISubprogram *SP)
Create a distinct clone of SP with FlagArtificial set.
Definition: DIBuilder.cpp:583
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:790
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:67
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:209
llvm::DIBasicType
Basic type, like 'int' or 'float'.
Definition: DebugInfoMetadata.h:769
llvm::DISubroutineType
Type array for a subprogram.
Definition: DebugInfoMetadata.h:1281
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:182
llvm::ReplayInlineScope::Function
@ Function
llvm::Sched::Source
@ Source
Definition: TargetLowering.h:100
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:913
llvm::DICompileUnit::DebugNameTableKind
DebugNameTableKind
Definition: DebugInfoMetadata.h:1348
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:370
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:689
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:919
llvm::PointerUnion
A discriminated union of two or more pointer types, with the discriminator in the low bit of the poin...
Definition: PointerUnion.h:120
llvm::DIBuilder::createTemplateTypeParameter
DITemplateTypeParameter * createTemplateTypeParameter(DIScope *Scope, StringRef Name, DIType *Ty, bool IsDefault)
Create debugging information for template type parameter.
Definition: DIBuilder.cpp:426
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:342
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:139
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:892
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:482
llvm::GraphProgram::Name
Name
Definition: GraphWriter.h:52
llvm::DIBuilder::createUnspecifiedType
DIBasicType * createUnspecifiedType(StringRef Name)
Create a DWARF unspecified type.
Definition: DIBuilder.cpp:262
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:407
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:573
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:650
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:780
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:710
llvm::DIDerivedType
Derived types.
Definition: DebugInfoMetadata.h:917
llvm::DIGlobalVariableExpression
A pair of DIGlobalVariable and DIExpression.
Definition: DebugInfoMetadata.h:3401
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:441
llvm::DITemplateValueParameter
Definition: DebugInfoMetadata.h:2468
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:267
llvm::DIBuilder::getOrCreateSubrange
DISubrange * getOrCreateSubrange(int64_t Lo, int64_t Count)
Create a descriptor for a value range.
Definition: DIBuilder.cpp:670
llvm::DIBuilder::getOrCreateMacroArray
DIMacroNodeArray getOrCreateMacroArray(ArrayRef< Metadata * > Elements)
Get a DIMacroNodeArray, create one if required.
Definition: DIBuilder.cpp:655
SmallVector.h
llvm::DINode::DIFlags
DIFlags
Debug info flags.
Definition: DebugInfoMetadata.h:166
N
#define N
llvm::DISubprogram
Subprogram description.
Definition: DebugInfoMetadata.h:1820
llvm::DIModule
Represents a module in the programming language, for example, a Clang module, or a Fortran module.
Definition: DebugInfoMetadata.h:2328
llvm::DILabel
Label.
Definition: DebugInfoMetadata.h:3185
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:271
CU
Definition: AArch64AsmBackend.cpp:501
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:617
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:704
SetVector.h
llvm::DIFile
File.
Definition: DebugInfoMetadata.h:530