LLVM 22.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/SetVector.h"
22#include "llvm/ADT/StringRef.h"
28#include <algorithm>
29#include <cstdint>
30#include <optional>
31
32namespace llvm {
33
34 class BasicBlock;
35 class Constant;
36 class Function;
37 class Instruction;
38 class LLVMContext;
39 class Module;
40 class Value;
42 class DbgRecord;
43
45
46 class DIBuilder {
47 Module &M;
48 LLVMContext &VMContext;
49
50 DICompileUnit *CUNode; ///< The one compile unit created by this DIBuiler.
51
53 /// Track the RetainTypes, since they can be updated later on.
55 SmallVector<DISubprogram *, 4> AllSubprograms;
58 /// Map Macro parent (which can be DIMacroFile or nullptr) to a list of
59 /// Metadata all of type DIMacroNode.
60 /// DIMacroNode's with nullptr parent are DICompileUnit direct children.
62
63 /// Track nodes that may be unresolved.
65 bool AllowUnresolvedNodes;
66
67 /// Each subprogram's preserved local variables, labels and imported
68 /// entities.
69 ///
70 /// Do not use a std::vector. Some versions of libc++ apparently copy
71 /// instead of move on grow operations, and TrackingMDRef is expensive to
72 /// copy.
74 SubprogramTrackedNodes;
75
77 getImportTrackingVector(const DIScope *S) {
79 ? getSubprogramNodesTrackingVector(S)
80 : ImportedModules;
81 }
83 getSubprogramNodesTrackingVector(const DIScope *S) {
84 return SubprogramTrackedNodes[cast<DILocalScope>(S)->getSubprogram()];
85 }
86
87 /// Create a temporary.
88 ///
89 /// Create an \a temporary node and track it in \a UnresolvedNodes.
90 void trackIfUnresolved(MDNode *N);
91
92 /// Internal helper. Track metadata if untracked and insert \p DVR.
93 void insertDbgVariableRecord(DbgVariableRecord *DVR,
94 InsertPosition InsertPt);
95
96 /// Internal helper with common code used by insertDbg{Value,Addr}Intrinsic.
97 Instruction *insertDbgIntrinsic(llvm::Function *Intrinsic, llvm::Value *Val,
98 DILocalVariable *VarInfo,
99 DIExpression *Expr, const DILocation *DL,
100 InsertPosition InsertPt);
101
102 public:
103 /// Construct a builder for a module.
104 ///
105 /// If \c AllowUnresolved, collect unresolved nodes attached to the module
106 /// in order to resolve cycles during \a finalize().
107 ///
108 /// If \p CU is given a value other than nullptr, then set \p CUNode to CU.
109 LLVM_ABI explicit DIBuilder(Module &M, bool AllowUnresolved = true,
110 DICompileUnit *CU = nullptr);
111 DIBuilder(const DIBuilder &) = delete;
112 DIBuilder &operator=(const DIBuilder &) = delete;
113
114 /// Construct any deferred debug info descriptors.
115 LLVM_ABI void finalize();
116
117 /// Finalize a specific subprogram - no new variables may be added to this
118 /// subprogram afterwards.
120
121 /// A CompileUnit provides an anchor for all debugging
122 /// information generated during this instance of compilation.
123 /// \param Lang Source programming language, eg. dwarf::DW_LANG_C99
124 /// \param File File info.
125 /// \param Producer Identify the producer of debugging information
126 /// and code. Usually this is a compiler
127 /// version string.
128 /// \param isOptimized A boolean flag which indicates whether optimization
129 /// is enabled or not.
130 /// \param Flags This string lists command line options. This
131 /// string is directly embedded in debug info
132 /// output which may be used by a tool
133 /// analyzing generated debugging information.
134 /// \param RV This indicates runtime version for languages like
135 /// Objective-C.
136 /// \param SplitName The name of the file that we'll split debug info
137 /// out into.
138 /// \param Kind The kind of debug information to generate.
139 /// \param DWOId The DWOId if this is a split skeleton compile unit.
140 /// \param SplitDebugInlining Whether to emit inline debug info.
141 /// \param DebugInfoForProfiling Whether to emit extra debug info for
142 /// profile collection.
143 /// \param NameTableKind Whether to emit .debug_gnu_pubnames,
144 /// .debug_pubnames, or no pubnames at all.
145 /// \param SysRoot The clang system root (value of -isysroot).
146 /// \param SDK The SDK name. On Darwin, this is the last component
147 /// of the sysroot.
150 StringRef Producer, bool isOptimized, StringRef Flags,
151 unsigned RV, StringRef SplitName = StringRef(),
154 uint64_t DWOId = 0, bool SplitDebugInlining = true,
155 bool DebugInfoForProfiling = false,
158 bool RangesBaseAddress = false, StringRef SysRoot = {},
159 StringRef SDK = {});
160
161 /// Create a file descriptor to hold debugging information for a file.
162 /// \param Filename File name.
163 /// \param Directory Directory.
164 /// \param Checksum Optional checksum kind (e.g. CSK_MD5, CSK_SHA1, etc.)
165 /// and value.
166 /// \param Source Optional source text.
167 LLVM_ABI DIFile *createFile(
168 StringRef Filename, StringRef Directory,
169 std::optional<DIFile::ChecksumInfo<StringRef>> Checksum = std::nullopt,
170 std::optional<StringRef> Source = std::nullopt);
171
172 /// Create debugging information entry for a macro.
173 /// \param Parent Macro parent (could be nullptr).
174 /// \param Line Source line number where the macro is defined.
175 /// \param MacroType DW_MACINFO_define or DW_MACINFO_undef.
176 /// \param Name Macro name.
177 /// \param Value Macro value.
178 LLVM_ABI DIMacro *createMacro(DIMacroFile *Parent, unsigned Line,
179 unsigned MacroType, StringRef Name,
180 StringRef Value = StringRef());
181
182 /// Create debugging information temporary entry for a macro file.
183 /// List of macro node direct children will be calculated by DIBuilder,
184 /// using the \p Parent relationship.
185 /// \param Parent Macro file parent (could be nullptr).
186 /// \param Line Source line number where the macro file is included.
187 /// \param File File descriptor containing the name of the macro file.
188 LLVM_ABI DIMacroFile *createTempMacroFile(DIMacroFile *Parent,
189 unsigned Line, DIFile *File);
190
191 /// Create a single enumerator value.
192 LLVM_ABI DIEnumerator *createEnumerator(StringRef Name,
193 const APSInt &Value);
194 LLVM_ABI DIEnumerator *createEnumerator(StringRef Name, uint64_t Val,
195 bool IsUnsigned = false);
196
197 /// Create a DWARF unspecified type.
198 LLVM_ABI DIBasicType *createUnspecifiedType(StringRef Name);
199
200 /// Create C++11 nullptr type.
201 LLVM_ABI DIBasicType *createNullPtrType();
202
203 /// Create debugging information entry for a basic
204 /// type.
205 /// \param Name Type name.
206 /// \param SizeInBits Size of the type.
207 /// \param Encoding DWARF encoding code, e.g., dwarf::DW_ATE_float.
208 /// \param Flags Optional DWARF attributes, e.g., DW_AT_endianity.
209 /// \param NumExtraInhabitants The number of extra inhabitants of the type.
210 /// An extra inhabitant is a bit pattern that does not represent a valid
211 /// value for instances of a given type. This is used by the Swift language.
212 LLVM_ABI DIBasicType *
213 createBasicType(StringRef Name, uint64_t SizeInBits, unsigned Encoding,
214 DINode::DIFlags Flags = DINode::FlagZero,
215 uint32_t NumExtraInhabitants = 0);
216
217 /// Create debugging information entry for a binary fixed-point type.
218 /// \param Name Type name.
219 /// \param Encoding DWARF encoding code, either
220 /// dwarf::DW_ATE_signed_fixed or DW_ATE_unsigned_fixed.
221 /// \param Flags Optional DWARF attributes, e.g., DW_AT_endianity.
222 /// \param Factor Binary scale factor.
223 LLVM_ABI DIFixedPointType *
224 createBinaryFixedPointType(StringRef Name, uint64_t SizeInBits,
225 uint32_t AlignInBits, unsigned Encoding,
226 DINode::DIFlags Flags, int Factor);
227
228 /// Create debugging information entry for a decimal fixed-point type.
229 /// \param Name Type name.
230 /// \param Encoding DWARF encoding code, either
231 /// dwarf::DW_ATE_signed_fixed or DW_ATE_unsigned_fixed.
232 /// \param Flags Optional DWARF attributes, e.g., DW_AT_endianity.
233 /// \param Factor Decimal scale factor.
234 LLVM_ABI DIFixedPointType *
235 createDecimalFixedPointType(StringRef Name, uint64_t SizeInBits,
236 uint32_t AlignInBits, unsigned Encoding,
237 DINode::DIFlags Flags, int Factor);
238
239 /// Create debugging information entry for an arbitrary rational
240 /// fixed-point type.
241 /// \param Name Type name.
242 /// \param Encoding DWARF encoding code, either
243 /// dwarf::DW_ATE_signed_fixed or DW_ATE_unsigned_fixed.
244 /// \param Flags Optional DWARF attributes, e.g., DW_AT_endianity.
245 /// \param Numerator Numerator of scale factor.
246 /// \param Denominator Denominator of scale factor.
247 LLVM_ABI DIFixedPointType *
248 createRationalFixedPointType(StringRef Name, uint64_t SizeInBits,
249 uint32_t AlignInBits, unsigned Encoding,
250 DINode::DIFlags Flags, APInt Numerator,
251 APInt Denominator);
252
253 /// Create debugging information entry for a string
254 /// type.
255 /// \param Name Type name.
256 /// \param SizeInBits Size of the type.
257 LLVM_ABI DIStringType *createStringType(StringRef Name,
258 uint64_t SizeInBits);
259
260 /// Create debugging information entry for Fortran
261 /// assumed length string type.
262 /// \param Name Type name.
263 /// \param StringLength String length expressed as DIVariable *.
264 /// \param StrLocationExp Optional memory location of the string.
265 LLVM_ABI DIStringType *
266 createStringType(StringRef Name, DIVariable *StringLength,
267 DIExpression *StrLocationExp = nullptr);
268
269 /// Create debugging information entry for Fortran
270 /// assumed length string type.
271 /// \param Name Type name.
272 /// \param StringLengthExp String length expressed in DIExpression form.
273 /// \param StrLocationExp Optional memory location of the string.
274 LLVM_ABI DIStringType *
275 createStringType(StringRef Name, DIExpression *StringLengthExp,
276 DIExpression *StrLocationExp = nullptr);
277
278 /// Create debugging information entry for a qualified
279 /// type, e.g. 'const int'.
280 /// \param Tag Tag identifing type, e.g. dwarf::TAG_volatile_type
281 /// \param FromTy Base Type.
282 LLVM_ABI DIDerivedType *createQualifiedType(unsigned Tag, DIType *FromTy);
283
284 /// Create debugging information entry for a pointer.
285 /// \param PointeeTy Type pointed by this pointer.
286 /// \param SizeInBits Size.
287 /// \param AlignInBits Alignment. (optional)
288 /// \param DWARFAddressSpace DWARF address space. (optional)
289 /// \param Name Pointer type name. (optional)
290 /// \param Annotations Member annotations.
291 LLVM_ABI DIDerivedType *
292 createPointerType(DIType *PointeeTy, uint64_t SizeInBits,
293 uint32_t AlignInBits = 0,
294 std::optional<unsigned> DWARFAddressSpace = std::nullopt,
295 StringRef Name = "", DINodeArray Annotations = nullptr);
296
297 /// Create a __ptrauth qualifier.
298 LLVM_ABI DIDerivedType *
299 createPtrAuthQualifiedType(DIType *FromTy, unsigned Key,
300 bool IsAddressDiscriminated,
301 unsigned ExtraDiscriminator, bool IsaPointer,
302 bool authenticatesNullValues);
303
304 /// Create debugging information entry for a pointer to member.
305 /// \param PointeeTy Type pointed to by this pointer.
306 /// \param SizeInBits Size.
307 /// \param AlignInBits Alignment. (optional)
308 /// \param Class Type for which this pointer points to members of.
309 LLVM_ABI DIDerivedType *
310 createMemberPointerType(DIType *PointeeTy, DIType *Class,
311 uint64_t SizeInBits, uint32_t AlignInBits = 0,
312 DINode::DIFlags Flags = DINode::FlagZero);
313
314 /// Create debugging information entry for a c++
315 /// style reference or rvalue reference type.
316 LLVM_ABI DIDerivedType *createReferenceType(
317 unsigned Tag, DIType *RTy, uint64_t SizeInBits = 0,
318 uint32_t AlignInBits = 0,
319 std::optional<unsigned> DWARFAddressSpace = std::nullopt);
320
321 /// Create debugging information entry for a typedef.
322 /// \param Ty Original type.
323 /// \param Name Typedef name.
324 /// \param File File where this type is defined.
325 /// \param LineNo Line number.
326 /// \param Context The surrounding context for the typedef.
327 /// \param AlignInBits Alignment. (optional)
328 /// \param Flags Flags to describe inheritance attribute, e.g. private
329 /// \param Annotations Annotations. (optional)
330 LLVM_ABI DIDerivedType *
331 createTypedef(DIType *Ty, StringRef Name, DIFile *File, unsigned LineNo,
332 DIScope *Context, uint32_t AlignInBits = 0,
333 DINode::DIFlags Flags = DINode::FlagZero,
334 DINodeArray Annotations = nullptr);
335
336 /// Create debugging information entry for a template alias.
337 /// \param Ty Original type.
338 /// \param Name Alias name.
339 /// \param File File where this type is defined.
340 /// \param LineNo Line number.
341 /// \param Context The surrounding context for the alias.
342 /// \param TParams The template arguments.
343 /// \param AlignInBits Alignment. (optional)
344 /// \param Flags Flags to describe inheritance attribute (optional),
345 /// e.g. private.
346 /// \param Annotations Annotations. (optional)
347 LLVM_ABI DIDerivedType *
348 createTemplateAlias(DIType *Ty, StringRef Name, DIFile *File,
349 unsigned LineNo, DIScope *Context, DINodeArray TParams,
350 uint32_t AlignInBits = 0,
351 DINode::DIFlags Flags = DINode::FlagZero,
352 DINodeArray Annotations = nullptr);
353
354 /// Create debugging information entry for a 'friend'.
355 LLVM_ABI DIDerivedType *createFriend(DIType *Ty, DIType *FriendTy);
356
357 /// Create debugging information entry to establish
358 /// inheritance relationship between two types.
359 /// \param Ty Original type.
360 /// \param BaseTy Base type. Ty is inherits from base.
361 /// \param BaseOffset Base offset.
362 /// \param VBPtrOffset Virtual base pointer offset.
363 /// \param Flags Flags to describe inheritance attribute,
364 /// e.g. private
365 LLVM_ABI DIDerivedType *createInheritance(DIType *Ty, DIType *BaseTy,
366 uint64_t BaseOffset,
367 uint32_t VBPtrOffset,
368 DINode::DIFlags Flags);
369
370 /// Create debugging information entry for a member.
371 /// \param Scope Member scope.
372 /// \param Name Member name.
373 /// \param File File where this member is defined.
374 /// \param LineNo Line number.
375 /// \param SizeInBits Member size.
376 /// \param AlignInBits Member alignment.
377 /// \param OffsetInBits Member offset.
378 /// \param Flags Flags to encode member attribute, e.g. private
379 /// \param Ty Parent type.
380 /// \param Annotations Member annotations.
381 LLVM_ABI DIDerivedType *createMemberType(
382 DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo,
383 Metadata *SizeInBits, uint32_t AlignInBits, Metadata *OffsetInBits,
384 DINode::DIFlags Flags, DIType *Ty, DINodeArray Annotations = nullptr);
385
386 /// Create debugging information entry for a member.
387 /// \param Scope Member scope.
388 /// \param Name Member name.
389 /// \param File File where this member is defined.
390 /// \param LineNo Line number.
391 /// \param SizeInBits Member size.
392 /// \param AlignInBits Member alignment.
393 /// \param OffsetInBits Member offset.
394 /// \param Flags Flags to encode member attribute, e.g. private
395 /// \param Ty Parent type.
396 /// \param Annotations Member annotations.
397 LLVM_ABI DIDerivedType *
398 createMemberType(DIScope *Scope, StringRef Name, DIFile *File,
399 unsigned LineNo, uint64_t SizeInBits, uint32_t AlignInBits,
400 uint64_t OffsetInBits, DINode::DIFlags Flags, DIType *Ty,
401 DINodeArray Annotations = nullptr);
402
403 /// Create debugging information entry for a variant. A variant
404 /// normally should be a member of a variant part.
405 /// \param Scope Member scope.
406 /// \param Name Member name.
407 /// \param File File where this member is defined.
408 /// \param LineNo Line number.
409 /// \param SizeInBits Member size.
410 /// \param AlignInBits Member alignment.
411 /// \param OffsetInBits Member offset.
412 /// \param Flags Flags to encode member attribute, e.g. private
413 /// \param Discriminant The discriminant for this branch; null for
414 /// the default branch. This may be a
415 /// ConstantDataArray if the variant applies
416 /// for multiple discriminants.
417 /// \param Ty Parent type.
418 LLVM_ABI DIDerivedType *createVariantMemberType(
419 DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo,
420 uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits,
421 Constant *Discriminant, DINode::DIFlags Flags, DIType *Ty);
422
423 /// Create debugging information entry for a variant. A variant
424 /// created this way "inlines" multiple members into the enclosing
425 /// variant part.
426 /// \param Scope Scope in which this variant is defined.
427 /// \param Elements Variant elements.
428 /// \param Discriminant The discriminant for this branch; null for
429 /// the default branch. This may be a
430 /// ConstantDataArray if the variant applies
431 /// for multiple discriminants.
432 /// \param Ty Parent type.
433 LLVM_ABI DIDerivedType *createVariantMemberType(DIScope *Scope,
434 DINodeArray Elements,
435 Constant *Discriminant,
436 DIType *Ty);
437
438 /// Create debugging information entry for a bit field member.
439 /// \param Scope Member scope.
440 /// \param Name Member name.
441 /// \param File File where this member is defined.
442 /// \param LineNo Line number.
443 /// \param SizeInBits Member size.
444 /// \param OffsetInBits Member offset.
445 /// \param StorageOffsetInBits Member storage offset.
446 /// \param Flags Flags to encode member attribute.
447 /// \param Ty Parent type.
448 /// \param Annotations Member annotations.
449 LLVM_ABI DIDerivedType *createBitFieldMemberType(
450 DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo,
451 Metadata *SizeInBits, Metadata *OffsetInBits,
452 uint64_t StorageOffsetInBits, DINode::DIFlags Flags, DIType *Ty,
453 DINodeArray Annotations = nullptr);
454
455 /// Create debugging information entry for a bit field member.
456 /// \param Scope Member scope.
457 /// \param Name Member name.
458 /// \param File File where this member is defined.
459 /// \param LineNo Line number.
460 /// \param SizeInBits Member size.
461 /// \param OffsetInBits Member offset.
462 /// \param StorageOffsetInBits Member storage offset.
463 /// \param Flags Flags to encode member attribute.
464 /// \param Ty Parent type.
465 /// \param Annotations Member annotations.
466 LLVM_ABI DIDerivedType *createBitFieldMemberType(
467 DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo,
468 uint64_t SizeInBits, uint64_t OffsetInBits,
469 uint64_t StorageOffsetInBits, DINode::DIFlags Flags, DIType *Ty,
470 DINodeArray Annotations = nullptr);
471
472 /// Create debugging information entry for a
473 /// C++ static data member.
474 /// \param Scope Member scope.
475 /// \param Name Member name.
476 /// \param File File where this member is declared.
477 /// \param LineNo Line number.
478 /// \param Ty Type of the static member.
479 /// \param Flags Flags to encode member attribute, e.g. private.
480 /// \param Val Const initializer of the member.
481 /// \param Tag DWARF tag of the static member.
482 /// \param AlignInBits Member alignment.
483 LLVM_ABI DIDerivedType *createStaticMemberType(DIScope *Scope,
484 StringRef Name, DIFile *File,
485 unsigned LineNo, DIType *Ty,
486 DINode::DIFlags Flags,
487 Constant *Val, unsigned Tag,
488 uint32_t AlignInBits = 0);
489
490 /// Create debugging information entry for Objective-C
491 /// instance variable.
492 /// \param Name Member name.
493 /// \param File File where this member is defined.
494 /// \param LineNo Line number.
495 /// \param SizeInBits Member size.
496 /// \param AlignInBits Member alignment.
497 /// \param OffsetInBits Member offset.
498 /// \param Flags Flags to encode member attribute, e.g. private
499 /// \param Ty Parent type.
500 /// \param PropertyNode Property associated with this ivar.
501 LLVM_ABI DIDerivedType *createObjCIVar(StringRef Name, DIFile *File,
502 unsigned LineNo, uint64_t SizeInBits,
503 uint32_t AlignInBits,
504 uint64_t OffsetInBits,
505 DINode::DIFlags Flags, DIType *Ty,
506 MDNode *PropertyNode);
507
508 /// Create debugging information entry for Objective-C
509 /// property.
510 /// \param Name Property name.
511 /// \param File File where this property is defined.
512 /// \param LineNumber Line number.
513 /// \param GetterName Name of the Objective C property getter selector.
514 /// \param SetterName Name of the Objective C property setter selector.
515 /// \param PropertyAttributes Objective C property attributes.
516 /// \param Ty Type.
517 LLVM_ABI DIObjCProperty *
518 createObjCProperty(StringRef Name, DIFile *File, unsigned LineNumber,
519 StringRef GetterName, StringRef SetterName,
520 unsigned PropertyAttributes, DIType *Ty);
521
522 /// Create debugging information entry for a class.
523 /// \param Scope Scope in which this class is defined.
524 /// \param Name class name.
525 /// \param File File where this member is defined.
526 /// \param LineNumber Line number.
527 /// \param SizeInBits Member size.
528 /// \param AlignInBits Member alignment.
529 /// \param OffsetInBits Member offset.
530 /// \param Flags Flags to encode member attribute, e.g. private
531 /// \param Elements class members.
532 /// \param RunTimeLang Optional parameter, Objective-C runtime version.
533 /// \param VTableHolder Debug info of the base class that contains vtable
534 /// for this type. This is used in
535 /// DW_AT_containing_type. See DWARF documentation
536 /// for more info.
537 /// \param TemplateParms Template type parameters.
538 /// \param UniqueIdentifier A unique identifier for the class.
539 LLVM_ABI DICompositeType *createClassType(
540 DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber,
541 uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits,
542 DINode::DIFlags Flags, DIType *DerivedFrom, DINodeArray Elements,
543 unsigned RunTimeLang = 0, DIType *VTableHolder = nullptr,
544 MDNode *TemplateParms = nullptr, StringRef UniqueIdentifier = "");
545
546 /// Create debugging information entry for a struct.
547 /// \param Scope Scope in which this struct is defined.
548 /// \param Name Struct name.
549 /// \param File File where this member is defined.
550 /// \param LineNumber Line number.
551 /// \param SizeInBits Member size.
552 /// \param AlignInBits Member alignment.
553 /// \param Flags Flags to encode member attribute, e.g. private
554 /// \param Elements Struct elements.
555 /// \param RunTimeLang Optional parameter, Objective-C runtime version.
556 /// \param UniqueIdentifier A unique identifier for the struct.
557 /// \param Specification The type that this type completes. This is used by
558 /// Swift to represent generic types.
559 /// \param NumExtraInhabitants The number of extra inhabitants of the type.
560 /// An extra inhabitant is a bit pattern that does not represent a valid
561 /// value for instances of a given type. This is used by the Swift language.
562 LLVM_ABI DICompositeType *createStructType(
563 DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber,
564 Metadata *SizeInBits, uint32_t AlignInBits, DINode::DIFlags Flags,
565 DIType *DerivedFrom, DINodeArray Elements, unsigned RunTimeLang = 0,
566 DIType *VTableHolder = nullptr, StringRef UniqueIdentifier = "",
567 DIType *Specification = nullptr, uint32_t NumExtraInhabitants = 0);
568
569 /// Create debugging information entry for a struct.
570 /// \param Scope Scope in which this struct is defined.
571 /// \param Name Struct name.
572 /// \param File File where this member is defined.
573 /// \param LineNumber Line number.
574 /// \param SizeInBits Member size.
575 /// \param AlignInBits Member alignment.
576 /// \param Flags Flags to encode member attribute, e.g. private
577 /// \param Elements Struct elements.
578 /// \param RunTimeLang Optional parameter, Objective-C runtime version.
579 /// \param UniqueIdentifier A unique identifier for the struct.
580 /// \param Specification The type that this type completes. This is used by
581 /// Swift to represent generic types.
582 /// \param NumExtraInhabitants The number of extra inhabitants of the type.
583 /// An extra inhabitant is a bit pattern that does not represent a valid
584 /// value for instances of a given type. This is used by the Swift language.
585 LLVM_ABI DICompositeType *createStructType(
586 DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber,
587 uint64_t SizeInBits, uint32_t AlignInBits, DINode::DIFlags Flags,
588 DIType *DerivedFrom, DINodeArray Elements, unsigned RunTimeLang = 0,
589 DIType *VTableHolder = nullptr, StringRef UniqueIdentifier = "",
590 DIType *Specification = nullptr, uint32_t NumExtraInhabitants = 0);
591
592 /// Create debugging information entry for an union.
593 /// \param Scope Scope in which this union is defined.
594 /// \param Name Union name.
595 /// \param File File where this member is defined.
596 /// \param LineNumber Line number.
597 /// \param SizeInBits Member size.
598 /// \param AlignInBits Member alignment.
599 /// \param Flags Flags to encode member attribute, e.g. private
600 /// \param Elements Union elements.
601 /// \param RunTimeLang Optional parameter, Objective-C runtime version.
602 /// \param UniqueIdentifier A unique identifier for the union.
603 LLVM_ABI DICompositeType *
604 createUnionType(DIScope *Scope, StringRef Name, DIFile *File,
605 unsigned LineNumber, uint64_t SizeInBits,
606 uint32_t AlignInBits, DINode::DIFlags Flags,
607 DINodeArray Elements, unsigned RunTimeLang = 0,
608 StringRef UniqueIdentifier = "");
609
610 /// Create debugging information entry for a variant part. A
611 /// variant part normally has a discriminator (though this is not
612 /// required) and a number of variant children.
613 /// \param Scope Scope in which this union is defined.
614 /// \param Name Union name.
615 /// \param File File where this member is defined.
616 /// \param LineNumber Line number.
617 /// \param SizeInBits Member size.
618 /// \param AlignInBits Member alignment.
619 /// \param Flags Flags to encode member attribute, e.g. private
620 /// \param Discriminator Discriminant member
621 /// \param Elements Variant elements.
622 /// \param UniqueIdentifier A unique identifier for the union.
623 LLVM_ABI DICompositeType *
624 createVariantPart(DIScope *Scope, StringRef Name, DIFile *File,
625 unsigned LineNumber, uint64_t SizeInBits,
626 uint32_t AlignInBits, DINode::DIFlags Flags,
627 DIDerivedType *Discriminator, DINodeArray Elements,
628 StringRef UniqueIdentifier = "");
629
630 /// Create debugging information for template
631 /// type parameter.
632 /// \param Scope Scope in which this type is defined.
633 /// \param Name Type parameter name.
634 /// \param Ty Parameter type.
635 /// \param IsDefault Parameter is default or not
636 LLVM_ABI DITemplateTypeParameter *
637 createTemplateTypeParameter(DIScope *Scope, StringRef Name, DIType *Ty,
638 bool IsDefault);
639
640 /// Create debugging information for template
641 /// value parameter.
642 /// \param Scope Scope in which this type is defined.
643 /// \param Name Value parameter name.
644 /// \param Ty Parameter type.
645 /// \param IsDefault Parameter is default or not
646 /// \param Val Constant parameter value.
647 LLVM_ABI DITemplateValueParameter *
648 createTemplateValueParameter(DIScope *Scope, StringRef Name, DIType *Ty,
649 bool IsDefault, Constant *Val);
650
651 /// Create debugging information for a template template parameter.
652 /// \param Scope Scope in which this type is defined.
653 /// \param Name Value parameter name.
654 /// \param Ty Parameter type.
655 /// \param Val The fully qualified name of the template.
656 /// \param IsDefault Parameter is default or not.
657 LLVM_ABI DITemplateValueParameter *
658 createTemplateTemplateParameter(DIScope *Scope, StringRef Name, DIType *Ty,
659 StringRef Val, bool IsDefault = false);
660
661 /// Create debugging information for a template parameter pack.
662 /// \param Scope Scope in which this type is defined.
663 /// \param Name Value parameter name.
664 /// \param Ty Parameter type.
665 /// \param Val An array of types in the pack.
666 LLVM_ABI DITemplateValueParameter *
667 createTemplateParameterPack(DIScope *Scope, StringRef Name, DIType *Ty,
668 DINodeArray Val);
669
670 /// Create debugging information entry for an array.
671 /// \param Size Array size.
672 /// \param AlignInBits Alignment.
673 /// \param Ty Element type.
674 /// \param Subscripts Subscripts.
675 /// \param DataLocation The location of the raw data of a descriptor-based
676 /// Fortran array, either a DIExpression* or
677 /// a DIVariable*.
678 /// \param Associated The associated attribute of a descriptor-based
679 /// Fortran array, either a DIExpression* or
680 /// a DIVariable*.
681 /// \param Allocated The allocated attribute of a descriptor-based
682 /// Fortran array, either a DIExpression* or
683 /// a DIVariable*.
684 /// \param Rank The rank attribute of a descriptor-based
685 /// Fortran array, either a DIExpression* or
686 /// a DIVariable*.
687 LLVM_ABI DICompositeType *createArrayType(
688 uint64_t Size, uint32_t AlignInBits, DIType *Ty, DINodeArray Subscripts,
689 PointerUnion<DIExpression *, DIVariable *> DataLocation = nullptr,
690 PointerUnion<DIExpression *, DIVariable *> Associated = nullptr,
691 PointerUnion<DIExpression *, DIVariable *> Allocated = nullptr,
692 PointerUnion<DIExpression *, DIVariable *> Rank = nullptr);
693
694 /// Create debugging information entry for an array.
695 /// \param Scope Scope in which this enumeration is defined.
696 /// \param Name Union name.
697 /// \param File File where this member is defined.
698 /// \param LineNumber Line number.
699 /// \param Size Array size.
700 /// \param AlignInBits Alignment.
701 /// \param Ty Element type.
702 /// \param Subscripts Subscripts.
703 /// \param DataLocation The location of the raw data of a descriptor-based
704 /// Fortran array, either a DIExpression* or
705 /// a DIVariable*.
706 /// \param Associated The associated attribute of a descriptor-based
707 /// Fortran array, either a DIExpression* or
708 /// a DIVariable*.
709 /// \param Allocated The allocated attribute of a descriptor-based
710 /// Fortran array, either a DIExpression* or
711 /// a DIVariable*.
712 /// \param Rank The rank attribute of a descriptor-based
713 /// Fortran array, either a DIExpression* or
714 /// a DIVariable*.
715 /// \param BitStride The bit size of an element of the array.
716 LLVM_ABI DICompositeType *createArrayType(
717 DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber,
718 uint64_t Size, uint32_t AlignInBits, DIType *Ty, DINodeArray Subscripts,
719 PointerUnion<DIExpression *, DIVariable *> DataLocation = nullptr,
720 PointerUnion<DIExpression *, DIVariable *> Associated = nullptr,
721 PointerUnion<DIExpression *, DIVariable *> Allocated = nullptr,
722 PointerUnion<DIExpression *, DIVariable *> Rank = nullptr,
723 Metadata *BitStride = nullptr);
724
725 /// Create debugging information entry for a vector type.
726 /// \param Size Array size.
727 /// \param AlignInBits Alignment.
728 /// \param Ty Element type.
729 /// \param Subscripts Subscripts.
730 LLVM_ABI DICompositeType *createVectorType(uint64_t Size,
731 uint32_t AlignInBits, DIType *Ty,
732 DINodeArray Subscripts,
733 Metadata *BitStride = nullptr);
734
735 /// Create debugging information entry for an
736 /// enumeration.
737 /// \param Scope Scope in which this enumeration is defined.
738 /// \param Name Union name.
739 /// \param File File where this member is defined.
740 /// \param LineNumber Line number.
741 /// \param SizeInBits Member size.
742 /// \param AlignInBits Member alignment.
743 /// \param Elements Enumeration elements.
744 /// \param UnderlyingType Underlying type of a C++11/ObjC fixed enum.
745 /// \param RunTimeLang Optional parameter, Objective-C runtime version.
746 /// \param UniqueIdentifier A unique identifier for the enum.
747 /// \param IsScoped Boolean flag indicate if this is C++11/ObjC 'enum
748 /// class'.
749 LLVM_ABI DICompositeType *createEnumerationType(
750 DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber,
751 uint64_t SizeInBits, uint32_t AlignInBits, DINodeArray Elements,
752 DIType *UnderlyingType, unsigned RunTimeLang = 0,
753 StringRef UniqueIdentifier = "", bool IsScoped = false,
754 std::optional<uint32_t> EnumKind = std::nullopt);
755 /// Create debugging information entry for a set.
756 /// \param Scope Scope in which this set is defined.
757 /// \param Name Set name.
758 /// \param File File where this set is defined.
759 /// \param LineNo Line number.
760 /// \param SizeInBits Set size.
761 /// \param AlignInBits Set alignment.
762 /// \param Ty Base type of the set.
763 LLVM_ABI DIDerivedType *createSetType(DIScope *Scope, StringRef Name,
764 DIFile *File, unsigned LineNo,
765 uint64_t SizeInBits,
766 uint32_t AlignInBits, DIType *Ty);
767
768 /// Create subroutine type.
769 /// \param ParameterTypes An array of subroutine parameter types. This
770 /// includes return type at 0th index.
771 /// \param Flags E.g.: LValueReference.
772 /// These flags are used to emit dwarf attributes.
773 /// \param CC Calling convention, e.g. dwarf::DW_CC_normal
774 LLVM_ABI DISubroutineType *
775 createSubroutineType(DITypeRefArray ParameterTypes,
776 DINode::DIFlags Flags = DINode::FlagZero,
777 unsigned CC = 0);
778
779 /// Create a distinct clone of \p SP with FlagArtificial set.
780 LLVM_ABI static DISubprogram *createArtificialSubprogram(DISubprogram *SP);
781
782 /// Create a uniqued clone of \p Ty with FlagArtificial set.
783 LLVM_ABI static DIType *createArtificialType(DIType *Ty);
784
785 /// Create a uniqued clone of \p Ty with FlagObjectPointer set.
786 /// If \p Implicit is true, also set FlagArtificial.
787 LLVM_ABI static DIType *createObjectPointerType(DIType *Ty, bool Implicit);
788
789 /// Create a type describing a subrange of another type.
790 /// \param Scope Scope in which this set is defined.
791 /// \param Name Set name.
792 /// \param File File where this set is defined.
793 /// \param LineNo Line number.
794 /// \param SizeInBits Size.
795 /// \param AlignInBits Alignment.
796 /// \param Flags Flags to encode attributes.
797 /// \param Ty Base type.
798 /// \param LowerBound Lower bound.
799 /// \param UpperBound Upper bound.
800 /// \param Stride Stride, if any.
801 /// \param Bias Bias, if any.
802 LLVM_ABI DISubrangeType *
803 createSubrangeType(StringRef Name, DIFile *File, unsigned LineNo,
804 DIScope *Scope, uint64_t SizeInBits,
805 uint32_t AlignInBits, DINode::DIFlags Flags, DIType *Ty,
806 Metadata *LowerBound, Metadata *UpperBound,
807 Metadata *Stride, Metadata *Bias);
808
809 /// Create a permanent forward-declared type.
810 LLVM_ABI DICompositeType *
811 createForwardDecl(unsigned Tag, StringRef Name, DIScope *Scope, DIFile *F,
812 unsigned Line, unsigned RuntimeLang = 0,
813 uint64_t SizeInBits = 0, uint32_t AlignInBits = 0,
814 StringRef UniqueIdentifier = "",
815 std::optional<uint32_t> EnumKind = std::nullopt);
816
817 /// Create a temporary forward-declared type.
819 unsigned Tag, StringRef Name, DIScope *Scope, DIFile *F, unsigned Line,
820 unsigned RuntimeLang = 0, uint64_t SizeInBits = 0,
821 uint32_t AlignInBits = 0, DINode::DIFlags Flags = DINode::FlagFwdDecl,
822 StringRef UniqueIdentifier = "", DINodeArray Annotations = nullptr,
823 std::optional<uint32_t> EnumKind = std::nullopt);
824
825 /// Retain DIScope* in a module even if it is not referenced
826 /// through debug info anchors.
827 LLVM_ABI void retainType(DIScope *T);
828
829 /// Create unspecified parameter type
830 /// for a subroutine type.
832
833 /// Get a DINodeArray, create one if required.
834 LLVM_ABI DINodeArray getOrCreateArray(ArrayRef<Metadata *> Elements);
835
836 /// Get a DIMacroNodeArray, create one if required.
837 LLVM_ABI DIMacroNodeArray
839
840 /// Get a DITypeRefArray, create one if required.
841 LLVM_ABI DITypeRefArray getOrCreateTypeArray(ArrayRef<Metadata *> Elements);
842
843 /// Create a descriptor for a value range. This
844 /// implicitly uniques the values returned.
845 LLVM_ABI DISubrange *getOrCreateSubrange(int64_t Lo, int64_t Count);
846 LLVM_ABI DISubrange *getOrCreateSubrange(int64_t Lo, Metadata *CountNode);
848 Metadata *LowerBound,
849 Metadata *UpperBound,
850 Metadata *Stride);
851
852 LLVM_ABI DIGenericSubrange *
857
858 /// Create a new descriptor for the specified variable.
859 /// \param Context Variable scope.
860 /// \param Name Name of the variable.
861 /// \param LinkageName Mangled name of the variable.
862 /// \param File File where this variable is defined.
863 /// \param LineNo Line number.
864 /// \param Ty Variable Type.
865 /// \param IsLocalToUnit Boolean flag indicate whether this variable is
866 /// externally visible or not.
867 /// \param Expr The location of the global relative to the attached
868 /// GlobalVariable.
869 /// \param Decl Reference to the corresponding declaration.
870 /// \param AlignInBits Variable alignment(or 0 if no alignment attr was
871 /// specified)
872 LLVM_ABI DIGlobalVariableExpression *createGlobalVariableExpression(
873 DIScope *Context, StringRef Name, StringRef LinkageName, DIFile *File,
874 unsigned LineNo, DIType *Ty, bool IsLocalToUnit, bool isDefined = true,
875 DIExpression *Expr = nullptr, MDNode *Decl = nullptr,
876 MDTuple *TemplateParams = nullptr, uint32_t AlignInBits = 0,
877 DINodeArray Annotations = nullptr);
878
879 /// Identical to createGlobalVariable
880 /// except that the resulting DbgNode is temporary and meant to be RAUWed.
882 DIScope *Context, StringRef Name, StringRef LinkageName, DIFile *File,
883 unsigned LineNo, DIType *Ty, bool IsLocalToUnit, MDNode *Decl = nullptr,
884 MDTuple *TemplateParams = nullptr, uint32_t AlignInBits = 0);
885
886 /// Create a new descriptor for an auto variable. This is a local variable
887 /// that is not a subprogram parameter.
888 ///
889 /// \c Scope must be a \a DILocalScope, and thus its scope chain eventually
890 /// leads to a \a DISubprogram.
891 ///
892 /// If \c AlwaysPreserve, this variable will be referenced from its
893 /// containing subprogram, and will survive some optimizations.
894 LLVM_ABI DILocalVariable *
895 createAutoVariable(DIScope *Scope, StringRef Name, DIFile *File,
896 unsigned LineNo, DIType *Ty, bool AlwaysPreserve = false,
897 DINode::DIFlags Flags = DINode::FlagZero,
898 uint32_t AlignInBits = 0);
899
900 /// Create a new descriptor for an label.
901 ///
902 /// \c Scope must be a \a DILocalScope, and thus its scope chain eventually
903 /// leads to a \a DISubprogram.
904 LLVM_ABI DILabel *createLabel(DIScope *Scope, StringRef Name, DIFile *File,
905 unsigned LineNo, unsigned Column,
906 bool IsArtificial,
907 std::optional<unsigned> CoroSuspendIdx,
908 bool AlwaysPreserve = false);
909
910 /// Create a new descriptor for a parameter variable.
911 ///
912 /// \c Scope must be a \a DILocalScope, and thus its scope chain eventually
913 /// leads to a \a DISubprogram.
914 ///
915 /// \c ArgNo is the index (starting from \c 1) of this variable in the
916 /// subprogram parameters. \c ArgNo should not conflict with other
917 /// parameters of the same subprogram.
918 ///
919 /// If \c AlwaysPreserve, this variable will be referenced from its
920 /// containing subprogram, and will survive some optimizations.
921 LLVM_ABI DILocalVariable *
922 createParameterVariable(DIScope *Scope, StringRef Name, unsigned ArgNo,
923 DIFile *File, unsigned LineNo, DIType *Ty,
924 bool AlwaysPreserve = false,
925 DINode::DIFlags Flags = DINode::FlagZero,
926 DINodeArray Annotations = nullptr);
927
928 /// Create a new descriptor for the specified
929 /// variable which has a complex address expression for its address.
930 /// \param Addr An array of complex address operations.
931 LLVM_ABI DIExpression *createExpression(ArrayRef<uint64_t> Addr = {});
932
933 /// Create an expression for a variable that does not have an address, but
934 /// does have a constant value.
936 return DIExpression::get(
937 VMContext, {dwarf::DW_OP_constu, Val, dwarf::DW_OP_stack_value});
938 }
939
940 /// Create a new descriptor for the specified subprogram.
941 /// See comments in DISubprogram* for descriptions of these fields.
942 /// \param Scope Function scope.
943 /// \param Name Function name.
944 /// \param LinkageName Mangled function name.
945 /// \param File File where this variable is defined.
946 /// \param LineNo Line number.
947 /// \param Ty Function type.
948 /// \param ScopeLine Set to the beginning of the scope this starts
949 /// \param Flags e.g. is this function prototyped or not.
950 /// These flags are used to emit dwarf attributes.
951 /// \param SPFlags Additional flags specific to subprograms.
952 /// \param TParams Function template parameters.
953 /// \param ThrownTypes Exception types this function may throw.
954 /// \param Annotations Attribute Annotations.
955 /// \param TargetFuncName The name of the target function if this is
956 /// a trampoline.
957 /// \param UseKeyInstructions Instruct DWARF emission to interpret Key
958 /// Instructions metadata on instructions to determine is_stmt placement.
960 DIScope *Scope, StringRef Name, StringRef LinkageName, DIFile *File,
961 unsigned LineNo, DISubroutineType *Ty, unsigned ScopeLine,
962 DINode::DIFlags Flags = DINode::FlagZero,
963 DISubprogram::DISPFlags SPFlags = DISubprogram::SPFlagZero,
964 DITemplateParameterArray TParams = nullptr,
965 DISubprogram *Decl = nullptr, DITypeArray ThrownTypes = nullptr,
966 DINodeArray Annotations = nullptr, StringRef TargetFuncName = "",
967 bool UseKeyInstructions = false);
968
969 /// Identical to createFunction,
970 /// except that the resulting DbgNode is meant to be RAUWed.
972 DIScope *Scope, StringRef Name, StringRef LinkageName, DIFile *File,
973 unsigned LineNo, DISubroutineType *Ty, unsigned ScopeLine,
974 DINode::DIFlags Flags = DINode::FlagZero,
975 DISubprogram::DISPFlags SPFlags = DISubprogram::SPFlagZero,
976 DITemplateParameterArray TParams = nullptr,
977 DISubprogram *Decl = nullptr, DITypeArray ThrownTypes = nullptr);
978
979 /// Create a new descriptor for the specified C++ method.
980 /// See comments in \a DISubprogram* for descriptions of these fields.
981 /// \param Scope Function scope.
982 /// \param Name Function name.
983 /// \param LinkageName Mangled function name.
984 /// \param File File where this variable is defined.
985 /// \param LineNo Line number.
986 /// \param Ty Function type.
987 /// \param VTableIndex Index no of this method in virtual table, or -1u if
988 /// unrepresentable.
989 /// \param ThisAdjustment
990 /// MS ABI-specific adjustment of 'this' that occurs
991 /// in the prologue.
992 /// \param VTableHolder Type that holds vtable.
993 /// \param Flags e.g. is this function prototyped or not.
994 /// This flags are used to emit dwarf attributes.
995 /// \param SPFlags Additional flags specific to subprograms.
996 /// \param TParams Function template parameters.
997 /// \param ThrownTypes Exception types this function may throw.
998 /// \param UseKeyInstructions Enable Key Instructions debug info.
1000 DIScope *Scope, StringRef Name, StringRef LinkageName, DIFile *File,
1001 unsigned LineNo, DISubroutineType *Ty, unsigned VTableIndex = 0,
1002 int ThisAdjustment = 0, DIType *VTableHolder = nullptr,
1003 DINode::DIFlags Flags = DINode::FlagZero,
1004 DISubprogram::DISPFlags SPFlags = DISubprogram::SPFlagZero,
1005 DITemplateParameterArray TParams = nullptr,
1006 DITypeArray ThrownTypes = nullptr, bool UseKeyInstructions = false);
1007
1008 /// Create common block entry for a Fortran common block.
1009 /// \param Scope Scope of this common block.
1010 /// \param decl Global variable declaration.
1011 /// \param Name The name of this common block.
1012 /// \param File The file this common block is defined.
1013 /// \param LineNo Line number.
1015 DIGlobalVariable *decl,
1016 StringRef Name, DIFile *File,
1017 unsigned LineNo);
1018
1019 /// This creates new descriptor for a namespace with the specified
1020 /// parent scope.
1021 /// \param Scope Namespace scope
1022 /// \param Name Name of this namespace
1023 /// \param ExportSymbols True for C++ inline namespaces.
1025 bool ExportSymbols);
1026
1027 /// This creates new descriptor for a module with the specified
1028 /// parent scope.
1029 /// \param Scope Parent scope
1030 /// \param Name Name of this module
1031 /// \param ConfigurationMacros
1032 /// A space-separated shell-quoted list of -D macro
1033 /// definitions as they would appear on a command line.
1034 /// \param IncludePath The path to the module map file.
1035 /// \param APINotesFile The path to an API notes file for this module.
1036 /// \param File Source file of the module.
1037 /// Used for Fortran modules.
1038 /// \param LineNo Source line number of the module.
1039 /// Used for Fortran modules.
1040 /// \param IsDecl This is a module declaration; default to false;
1041 /// when set to true, only Scope and Name are required
1042 /// as this entry is just a hint for the debugger to find
1043 /// the corresponding definition in the global scope.
1045 StringRef ConfigurationMacros,
1046 StringRef IncludePath,
1047 StringRef APINotesFile = {},
1048 DIFile *File = nullptr, unsigned LineNo = 0,
1049 bool IsDecl = false);
1050
1051 /// This creates a descriptor for a lexical block with a new file
1052 /// attached. This merely extends the existing
1053 /// lexical block as it crosses a file.
1054 /// \param Scope Lexical block.
1055 /// \param File Source file.
1056 /// \param Discriminator DWARF path discriminator value.
1057 LLVM_ABI DILexicalBlockFile *
1058 createLexicalBlockFile(DIScope *Scope, DIFile *File,
1059 unsigned Discriminator = 0);
1060
1061 /// This creates a descriptor for a lexical block with the
1062 /// specified parent context.
1063 /// \param Scope Parent lexical scope.
1064 /// \param File Source file.
1065 /// \param Line Line number.
1066 /// \param Col Column number.
1067 LLVM_ABI DILexicalBlock *createLexicalBlock(DIScope *Scope, DIFile *File,
1068 unsigned Line, unsigned Col);
1069
1070 /// Create a descriptor for an imported module.
1071 /// \param Context The scope this module is imported into
1072 /// \param NS The namespace being imported here.
1073 /// \param File File where the declaration is located.
1074 /// \param Line Line number of the declaration.
1075 /// \param Elements Renamed elements.
1076 LLVM_ABI DIImportedEntity *
1077 createImportedModule(DIScope *Context, DINamespace *NS, DIFile *File,
1078 unsigned Line, DINodeArray Elements = nullptr);
1079
1080 /// Create a descriptor for an imported module.
1081 /// \param Context The scope this module is imported into.
1082 /// \param NS An aliased namespace.
1083 /// \param File File where the declaration is located.
1084 /// \param Line Line number of the declaration.
1085 /// \param Elements Renamed elements.
1086 LLVM_ABI DIImportedEntity *
1087 createImportedModule(DIScope *Context, DIImportedEntity *NS, DIFile *File,
1088 unsigned Line, DINodeArray Elements = nullptr);
1089
1090 /// Create a descriptor for an imported module.
1091 /// \param Context The scope this module is imported into.
1092 /// \param M The module being imported here
1093 /// \param File File where the declaration is located.
1094 /// \param Line Line number of the declaration.
1095 /// \param Elements Renamed elements.
1096 LLVM_ABI DIImportedEntity *
1097 createImportedModule(DIScope *Context, DIModule *M, DIFile *File,
1098 unsigned Line, DINodeArray Elements = nullptr);
1099
1100 /// Create a descriptor for an imported function.
1101 /// \param Context The scope this module is imported into.
1102 /// \param Decl The declaration (or definition) of a function, type, or
1103 /// variable.
1104 /// \param File File where the declaration is located.
1105 /// \param Line Line number of the declaration.
1106 /// \param Elements Renamed elements.
1107 LLVM_ABI DIImportedEntity *
1108 createImportedDeclaration(DIScope *Context, DINode *Decl, DIFile *File,
1109 unsigned Line, StringRef Name = "",
1110 DINodeArray Elements = nullptr);
1111
1112 /// Insert a new llvm.dbg.declare intrinsic call.
1113 /// \param Storage llvm::Value of the variable
1114 /// \param VarInfo Variable's debug info descriptor.
1115 /// \param Expr A complex location expression.
1116 /// \param DL Debug info location.
1117 /// \param InsertAtEnd Location for the new intrinsic.
1119 DILocalVariable *VarInfo,
1120 DIExpression *Expr, const DILocation *DL,
1121 BasicBlock *InsertAtEnd);
1122
1123 /// Insert a new llvm.dbg.assign intrinsic call.
1124 /// \param LinkedInstr Instruction with a DIAssignID to link with the new
1125 /// intrinsic. The intrinsic will be inserted after
1126 /// this instruction.
1127 /// \param Val The value component of this dbg.assign.
1128 /// \param SrcVar Variable's debug info descriptor.
1129 /// \param ValExpr A complex location expression to modify \p Val.
1130 /// \param Addr The address component (store destination).
1131 /// \param AddrExpr A complex location expression to modify \p Addr.
1132 /// NOTE: \p ValExpr carries the FragInfo for the
1133 /// variable.
1134 /// \param DL Debug info location, usually: (line: 0,
1135 /// column: 0, scope: var-decl-scope). See
1136 /// getDebugValueLoc.
1137 LLVM_ABI DbgInstPtr insertDbgAssign(Instruction *LinkedInstr, Value *Val,
1138 DILocalVariable *SrcVar,
1139 DIExpression *ValExpr, Value *Addr,
1140 DIExpression *AddrExpr,
1141 const DILocation *DL);
1142
1143 /// Insert a new llvm.dbg.declare intrinsic call.
1144 /// \param Storage llvm::Value of the variable
1145 /// \param VarInfo Variable's debug info descriptor.
1146 /// \param Expr A complex location expression.
1147 /// \param DL Debug info location.
1148 /// \param InsertPt Location for the new intrinsic.
1150 DILocalVariable *VarInfo,
1151 DIExpression *Expr, const DILocation *DL,
1152 InsertPosition InsertPt);
1153
1154 /// Insert a new llvm.dbg.label intrinsic call.
1155 /// \param LabelInfo Label's debug info descriptor.
1156 /// \param DL Debug info location.
1157 /// \param InsertBefore Location for the new intrinsic.
1158 LLVM_ABI DbgInstPtr insertLabel(DILabel *LabelInfo, const DILocation *DL,
1159 InsertPosition InsertPt);
1160
1161 /// Insert a new llvm.dbg.value intrinsic call.
1162 /// \param Val llvm::Value of the variable
1163 /// \param VarInfo Variable's debug info descriptor.
1164 /// \param Expr A complex location expression.
1165 /// \param DL Debug info location.
1166 /// \param InsertPt Location for the new intrinsic.
1168 DILocalVariable *VarInfo,
1169 DIExpression *Expr,
1170 const DILocation *DL,
1171 InsertPosition InsertPt);
1172
1173 /// Replace the vtable holder in the given type.
1174 ///
1175 /// If this creates a self reference, it may orphan some unresolved cycles
1176 /// in the operands of \c T, so \a DIBuilder needs to track that.
1177 LLVM_ABI void replaceVTableHolder(DICompositeType *&T,
1178 DIType *VTableHolder);
1179
1180 /// Replace arrays on a composite type.
1181 ///
1182 /// If \c T is resolved, but the arrays aren't -- which can happen if \c T
1183 /// has a self-reference -- \a DIBuilder needs to track the array to
1184 /// resolve cycles.
1185 LLVM_ABI void replaceArrays(DICompositeType *&T, DINodeArray Elements,
1186 DINodeArray TParams = DINodeArray());
1187
1188 /// Replace a temporary node.
1189 ///
1190 /// Call \a MDNode::replaceAllUsesWith() on \c N, replacing it with \c
1191 /// Replacement.
1192 ///
1193 /// If \c Replacement is the same as \c N.get(), instead call \a
1194 /// MDNode::replaceWithUniqued(). In this case, the uniqued node could
1195 /// have a different address, so we return the final address.
1196 template <class NodeTy>
1197 NodeTy *replaceTemporary(TempMDNode &&N, NodeTy *Replacement) {
1198 if (N.get() == Replacement)
1199 return cast<NodeTy>(MDNode::replaceWithUniqued(std::move(N)));
1200
1201 N->replaceAllUsesWith(Replacement);
1202 return Replacement;
1203 }
1204 };
1205
1206 // Create wrappers for C Binding types (see CBindingWrapping.h).
1208
1209} // end namespace llvm
1210
1211#endif // LLVM_IR_DIBUILDER_H
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
#define DEFINE_ISA_CONVERSION_FUNCTIONS(ty, ref)
#define LLVM_ABI
Definition Compiler.h:213
dxil translate DXIL Translate Metadata
This file defines the DenseMap class.
This file contains constants used for implementing Dwarf debug support.
#define F(x, y, z)
Definition MD5.cpp:55
This file implements a map that provides insertion order iteration.
#define T
This file implements a set that has insertion order iteration characteristics.
This file defines the SmallVector class.
Annotations lets you mark points and ranges inside source code, for tests:
Definition Annotations.h:53
LLVM Basic Block Representation.
Definition BasicBlock.h:62
This is an important base class in LLVM.
Definition Constant.h:43
static LLVM_ABI DIType * createObjectPointerType(DIType *Ty, bool Implicit)
Create a uniqued clone of Ty with FlagObjectPointer set.
LLVM_ABI DIBasicType * createUnspecifiedParameter()
Create unspecified parameter type for a subroutine type.
LLVM_ABI 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...
LLVM_ABI DITemplateValueParameter * createTemplateTemplateParameter(DIScope *Scope, StringRef Name, DIType *Ty, StringRef Val, bool IsDefault=false)
Create debugging information for a template template parameter.
NodeTy * replaceTemporary(TempMDNode &&N, NodeTy *Replacement)
Replace a temporary node.
Definition DIBuilder.h:1197
LLVM_ABI DIDerivedType * createTypedef(DIType *Ty, StringRef Name, DIFile *File, unsigned LineNo, DIScope *Context, uint32_t AlignInBits=0, DINode::DIFlags Flags=DINode::FlagZero, DINodeArray Annotations=nullptr)
Create debugging information entry for a typedef.
DIBuilder & operator=(const DIBuilder &)=delete
LLVM_ABI void finalize()
Construct any deferred debug info descriptors.
Definition DIBuilder.cpp:62
LLVM_ABI DISubroutineType * createSubroutineType(DITypeRefArray ParameterTypes, DINode::DIFlags Flags=DINode::FlagZero, unsigned CC=0)
Create subroutine type.
LLVM_ABI DIMacro * createMacro(DIMacroFile *Parent, unsigned Line, unsigned MacroType, StringRef Name, StringRef Value=StringRef())
Create debugging information entry for a macro.
LLVM_ABI 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.
LLVM_ABI DICompositeType * createVectorType(uint64_t Size, uint32_t AlignInBits, DIType *Ty, DINodeArray Subscripts, Metadata *BitStride=nullptr)
Create debugging information entry for a vector type.
LLVM_ABI DIDerivedType * createStaticMemberType(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo, DIType *Ty, DINode::DIFlags Flags, Constant *Val, unsigned Tag, uint32_t AlignInBits=0)
Create debugging information entry for a C++ static data member.
LLVM_ABI 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.
LLVM_ABI 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, unsigned RunTimeLang=0, DIType *VTableHolder=nullptr, MDNode *TemplateParms=nullptr, StringRef UniqueIdentifier="")
Create debugging information entry for a class.
LLVM_ABI DILexicalBlockFile * createLexicalBlockFile(DIScope *Scope, DIFile *File, unsigned Discriminator=0)
This creates a descriptor for a lexical block with a new file attached.
LLVM_ABI void finalizeSubprogram(DISubprogram *SP)
Finalize a specific subprogram - no new variables may be added to this subprogram afterwards.
Definition DIBuilder.cpp:54
LLVM_ABI DIDerivedType * createQualifiedType(unsigned Tag, DIType *FromTy)
Create debugging information entry for a qualified type, e.g.
LLVM_ABI 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.
LLVM_ABI 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.
static LLVM_ABI DIType * createArtificialType(DIType *Ty)
Create a uniqued clone of Ty with FlagArtificial set.
LLVM_ABI DIDerivedType * createBitFieldMemberType(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo, Metadata *SizeInBits, Metadata *OffsetInBits, uint64_t StorageOffsetInBits, DINode::DIFlags Flags, DIType *Ty, DINodeArray Annotations=nullptr)
Create debugging information entry for a bit field member.
LLVM_ABI DIFixedPointType * createRationalFixedPointType(StringRef Name, uint64_t SizeInBits, uint32_t AlignInBits, unsigned Encoding, DINode::DIFlags Flags, APInt Numerator, APInt Denominator)
Create debugging information entry for an arbitrary rational fixed-point type.
LLVM_ABI 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, bool UseKeyInstructions=false)
Create a new descriptor for the specified C++ method.
LLVM_ABI DINamespace * createNameSpace(DIScope *Scope, StringRef Name, bool ExportSymbols)
This creates new descriptor for a namespace with the specified parent scope.
LLVM_ABI DIStringType * createStringType(StringRef Name, uint64_t SizeInBits)
Create debugging information entry for a string type.
LLVM_ABI DbgInstPtr insertDbgAssign(Instruction *LinkedInstr, Value *Val, DILocalVariable *SrcVar, DIExpression *ValExpr, Value *Addr, DIExpression *AddrExpr, const DILocation *DL)
Insert a new llvm.dbg.assign intrinsic call.
LLVM_ABI DILexicalBlock * createLexicalBlock(DIScope *Scope, DIFile *File, unsigned Line, unsigned Col)
This creates a descriptor for a lexical block with the specified parent context.
LLVM_ABI 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.
LLVM_ABI DIMacroNodeArray getOrCreateMacroArray(ArrayRef< Metadata * > Elements)
Get a DIMacroNodeArray, create one if required.
LLVM_ABI DIDerivedType * createMemberType(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo, Metadata *SizeInBits, uint32_t AlignInBits, Metadata *OffsetInBits, DINode::DIFlags Flags, DIType *Ty, DINodeArray Annotations=nullptr)
Create debugging information entry for a member.
LLVM_ABI 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.
LLVM_ABI void replaceVTableHolder(DICompositeType *&T, DIType *VTableHolder)
Replace the vtable holder in the given type.
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:935
LLVM_ABI DIBasicType * createNullPtrType()
Create C++11 nullptr type.
LLVM_ABI DICommonBlock * createCommonBlock(DIScope *Scope, DIGlobalVariable *decl, StringRef Name, DIFile *File, unsigned LineNo)
Create common block entry for a Fortran common block.
LLVM_ABI DIDerivedType * createFriend(DIType *Ty, DIType *FriendTy)
Create debugging information entry for a 'friend'.
LLVM_ABI DILabel * createLabel(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo, unsigned Column, bool IsArtificial, std::optional< unsigned > CoroSuspendIdx, bool AlwaysPreserve=false)
Create a new descriptor for an label.
LLVM_ABI void retainType(DIScope *T)
Retain DIScope* in a module even if it is not referenced through debug info anchors.
LLVM_ABI DIDerivedType * createTemplateAlias(DIType *Ty, StringRef Name, DIFile *File, unsigned LineNo, DIScope *Context, DINodeArray TParams, uint32_t AlignInBits=0, DINode::DIFlags Flags=DINode::FlagZero, DINodeArray Annotations=nullptr)
Create debugging information entry for a template alias.
DIBuilder(const DIBuilder &)=delete
LLVM_ABI 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, StringRef TargetFuncName="", bool UseKeyInstructions=false)
Create a new descriptor for the specified subprogram.
LLVM_ABI DIDerivedType * createPointerType(DIType *PointeeTy, uint64_t SizeInBits, uint32_t AlignInBits=0, std::optional< unsigned > DWARFAddressSpace=std::nullopt, StringRef Name="", DINodeArray Annotations=nullptr)
Create debugging information entry for a pointer.
LLVM_ABI DbgInstPtr insertDeclare(llvm::Value *Storage, DILocalVariable *VarInfo, DIExpression *Expr, const DILocation *DL, BasicBlock *InsertAtEnd)
Insert a new llvm.dbg.declare intrinsic call.
LLVM_ABI DbgInstPtr insertDbgValueIntrinsic(llvm::Value *Val, DILocalVariable *VarInfo, DIExpression *Expr, const DILocation *DL, InsertPosition InsertPt)
Insert a new llvm.dbg.value intrinsic call.
LLVM_ABI DITemplateValueParameter * createTemplateParameterPack(DIScope *Scope, StringRef Name, DIType *Ty, DINodeArray Val)
Create debugging information for a template parameter pack.
LLVM_ABI 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.
LLVM_ABI 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, std::optional< uint32_t > EnumKind=std::nullopt)
Create a temporary forward-declared type.
LLVM_ABI DICompositeType * createEnumerationType(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber, uint64_t SizeInBits, uint32_t AlignInBits, DINodeArray Elements, DIType *UnderlyingType, unsigned RunTimeLang=0, StringRef UniqueIdentifier="", bool IsScoped=false, std::optional< uint32_t > EnumKind=std::nullopt)
Create debugging information entry for an enumeration.
LLVM_ABI DIFixedPointType * createDecimalFixedPointType(StringRef Name, uint64_t SizeInBits, uint32_t AlignInBits, unsigned Encoding, DINode::DIFlags Flags, int Factor)
Create debugging information entry for a decimal fixed-point type.
LLVM_ABI DIBasicType * createBasicType(StringRef Name, uint64_t SizeInBits, unsigned Encoding, DINode::DIFlags Flags=DINode::FlagZero, uint32_t NumExtraInhabitants=0)
Create debugging information entry for a basic type.
LLVM_ABI DISubrange * getOrCreateSubrange(int64_t Lo, int64_t Count)
Create a descriptor for a value range.
LLVM_ABI DISubrangeType * createSubrangeType(StringRef Name, DIFile *File, unsigned LineNo, DIScope *Scope, uint64_t SizeInBits, uint32_t AlignInBits, DINode::DIFlags Flags, DIType *Ty, Metadata *LowerBound, Metadata *UpperBound, Metadata *Stride, Metadata *Bias)
Create a type describing a subrange of another type.
LLVM_ABI DIDerivedType * createReferenceType(unsigned Tag, DIType *RTy, uint64_t SizeInBits=0, uint32_t AlignInBits=0, std::optional< unsigned > DWARFAddressSpace=std::nullopt)
Create debugging information entry for a c++ style reference or rvalue reference type.
LLVM_ABI DIMacroFile * createTempMacroFile(DIMacroFile *Parent, unsigned Line, DIFile *File)
Create debugging information temporary entry for a macro file.
LLVM_ABI 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.
LLVM_ABI 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.
LLVM_ABI DICompositeType * createStructType(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber, Metadata *SizeInBits, uint32_t AlignInBits, DINode::DIFlags Flags, DIType *DerivedFrom, DINodeArray Elements, unsigned RunTimeLang=0, DIType *VTableHolder=nullptr, StringRef UniqueIdentifier="", DIType *Specification=nullptr, uint32_t NumExtraInhabitants=0)
Create debugging information entry for a struct.
LLVM_ABI DITypeRefArray getOrCreateTypeArray(ArrayRef< Metadata * > Elements)
Get a DITypeRefArray, create one if required.
LLVM_ABI DINodeArray getOrCreateArray(ArrayRef< Metadata * > Elements)
Get a DINodeArray, create one if required.
LLVM_ABI DICompileUnit * createCompileUnit(DISourceLanguageName 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...
LLVM_ABI DIEnumerator * createEnumerator(StringRef Name, const APSInt &Value)
Create a single enumerator value.
LLVM_ABI DITemplateTypeParameter * createTemplateTypeParameter(DIScope *Scope, StringRef Name, DIType *Ty, bool IsDefault)
Create debugging information for template type parameter.
LLVM_ABI DIBuilder(Module &M, bool AllowUnresolved=true, DICompileUnit *CU=nullptr)
Construct a builder for a module.
Definition DIBuilder.cpp:27
LLVM_ABI DIExpression * createExpression(ArrayRef< uint64_t > Addr={})
Create a new descriptor for the specified variable which has a complex address expression for its add...
LLVM_ABI DIDerivedType * createPtrAuthQualifiedType(DIType *FromTy, unsigned Key, bool IsAddressDiscriminated, unsigned ExtraDiscriminator, bool IsaPointer, bool authenticatesNullValues)
Create a __ptrauth qualifier.
LLVM_ABI 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="", std::optional< uint32_t > EnumKind=std::nullopt)
Create a permanent forward-declared type.
LLVM_ABI 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.
LLVM_ABI DIImportedEntity * createImportedModule(DIScope *Context, DINamespace *NS, DIFile *File, unsigned Line, DINodeArray Elements=nullptr)
Create a descriptor for an imported module.
LLVM_ABI DbgInstPtr insertLabel(DILabel *LabelInfo, const DILocation *DL, InsertPosition InsertPt)
Insert a new llvm.dbg.label intrinsic call.
LLVM_ABI DIImportedEntity * createImportedDeclaration(DIScope *Context, DINode *Decl, DIFile *File, unsigned Line, StringRef Name="", DINodeArray Elements=nullptr)
Create a descriptor for an imported function.
LLVM_ABI 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.
static LLVM_ABI DISubprogram * createArtificialSubprogram(DISubprogram *SP)
Create a distinct clone of SP with FlagArtificial set.
LLVM_ABI DIGenericSubrange * getOrCreateGenericSubrange(DIGenericSubrange::BoundType Count, DIGenericSubrange::BoundType LowerBound, DIGenericSubrange::BoundType UpperBound, DIGenericSubrange::BoundType Stride)
LLVM_ABI DIBasicType * createUnspecifiedType(StringRef Name)
Create a DWARF unspecified type.
LLVM_ABI DIObjCProperty * createObjCProperty(StringRef Name, DIFile *File, unsigned LineNumber, StringRef GetterName, StringRef SetterName, unsigned PropertyAttributes, DIType *Ty)
Create debugging information entry for Objective-C property.
LLVM_ABI DITemplateValueParameter * createTemplateValueParameter(DIScope *Scope, StringRef Name, DIType *Ty, bool IsDefault, Constant *Val)
Create debugging information for template value parameter.
LLVM_ABI 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.
LLVM_ABI DIFile * createFile(StringRef Filename, StringRef Directory, std::optional< DIFile::ChecksumInfo< StringRef > > Checksum=std::nullopt, std::optional< StringRef > Source=std::nullopt)
Create a file descriptor to hold debugging information for a file.
LLVM_ABI void replaceArrays(DICompositeType *&T, DINodeArray Elements, DINodeArray TParams=DINodeArray())
Replace arrays on a composite type.
LLVM_ABI DIFixedPointType * createBinaryFixedPointType(StringRef Name, uint64_t SizeInBits, uint32_t AlignInBits, unsigned Encoding, DINode::DIFlags Flags, int Factor)
Create debugging information entry for a binary fixed-point type.
LLVM_ABI 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.
Debug common block.
DWARF expression.
PointerUnion< DIVariable *, DIExpression * > BoundType
Represents a module in the programming language, for example, a Clang module, or a Fortran module.
Debug lexical block.
DIFlags
Debug info flags.
Base class for scope-like contexts.
Wrapper structure that holds a language name and its version.
Subprogram description. Uses SubclassData1.
DISPFlags
Debug info subprogram flags.
Type array for a subprogram.
Base class for types.
This represents the llvm.dbg.assign instruction.
Base class for non-instruction debug metadata records that have positions within IR.
Record of a variable value-assignment, aka a non instruction representation of the dbg....
This is an important class for using LLVM in a threaded context.
Definition LLVMContext.h:68
Metadata node.
Definition Metadata.h:1078
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata * > MDs)
Definition Metadata.h:1569
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:1317
This class implements a map that also provides access to all stored values in a deterministic order.
Definition MapVector.h:36
A Module instance is used to store all the information related to an LLVM module.
Definition Module.h:67
A discriminated union of two or more pointer types, with the discriminator in the low bit of the poin...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
Definition StringRef.h:55
LLVM Value Representation.
Definition Value.h:75
struct LLVMOpaqueDIBuilder * LLVMDIBuilderRef
Represents an LLVM debug info builder.
Definition Types.h:117
This namespace contains an enum with a value for every intrinsic/builtin function known by LLVM.
This is an optimization pass for GlobalISel generic memory operations.
bool isa_and_nonnull(const Y &Val)
Definition Casting.h:677
FunctionAddr VTableAddr Count
Definition InstrProf.h:139
LLVM_ATTRIBUTE_VISIBILITY_DEFAULT AnalysisKey InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key
ArrayRef(const T &OneElt) -> ArrayRef< T >
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
Definition Casting.h:560
PointerUnion< Instruction *, DbgRecord * > DbgInstPtr
Definition DIBuilder.h:44
#define N