1//===- DIBuilder.h - Debug Information Builder ------------------*- C++ -*-===// 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 7//===----------------------------------------------------------------------===// 9// This file defines a DIBuilder that is useful for creating debugging 10// information entries in LLVM IR form. 12//===----------------------------------------------------------------------===// 14#ifndef LLVM_IR_DIBUILDER_H 15#define LLVM_IR_DIBUILDER_H 40classDbgAssignIntrinsic;
49DICompileUnit *CUNode;
///< The one compile unit created by this DIBuiler. 50Function *DeclareFn;
///< llvm.dbg.declare 53Function *AssignFn;
///< llvm.dbg.assign 56 /// Track the RetainTypes, since they can be updated later on. 61 /// Map Macro parent (which can be DIMacroFile or nullptr) to a list of 62 /// Metadata all of type DIMacroNode. 63 /// DIMacroNode's with nullptr parent are DICompileUnit direct children. 66 /// Track nodes that may be unresolved. 68bool AllowUnresolvedNodes;
70 /// Each subprogram's preserved local variables, labels and imported 73 /// Do not use a std::vector. Some versions of libc++ apparently copy 74 /// instead of move on grow operations, and TrackingMDRef is expensive to 77 SubprogramTrackedNodes;
80 getImportTrackingVector(
constDIScope *S) {
81return isa_and_nonnull<DILocalScope>(S)
82 ? getSubprogramNodesTrackingVector(S)
86 getSubprogramNodesTrackingVector(
constDIScope *S) {
87return SubprogramTrackedNodes[cast<DILocalScope>(S)->getSubprogram()];
90 /// Create a temporary. 92 /// Create an \a temporary node and track it in \a UnresolvedNodes. 93void trackIfUnresolved(
MDNode *
N);
95 /// Internal helper for insertDeclare. 100 /// Internal helper for insertLabel. 104 /// Internal helper. Track metadata if untracked and insert \p DVR. 107bool InsertAtHead =
false);
109 /// Internal helper with common code used by insertDbg{Value,Addr}Intrinsic. 116 /// Internal helper for insertDbgValueIntrinsic. 124 /// Construct a builder for a module. 126 /// If \c AllowUnresolved, collect unresolved nodes attached to the module 127 /// in order to resolve cycles during \a finalize(). 129 /// If \p CU is given a value other than nullptr, then set \p CUNode to CU. 135 /// Construct any deferred debug info descriptors. 138 /// Finalize a specific subprogram - no new variables may be added to this 139 /// subprogram afterwards. 142 /// A CompileUnit provides an anchor for all debugging 143 /// information generated during this instance of compilation. 144 /// \param Lang Source programming language, eg. dwarf::DW_LANG_C99 145 /// \param File File info. 146 /// \param Producer Identify the producer of debugging information 147 /// and code. Usually this is a compiler 149 /// \param isOptimized A boolean flag which indicates whether optimization 150 /// is enabled or not. 151 /// \param Flags This string lists command line options. This 152 /// string is directly embedded in debug info 153 /// output which may be used by a tool 154 /// analyzing generated debugging information. 155 /// \param RV This indicates runtime version for languages like 157 /// \param SplitName The name of the file that we'll split debug info 159 /// \param Kind The kind of debug information to generate. 160 /// \param DWOId The DWOId if this is a split skeleton compile unit. 161 /// \param SplitDebugInlining Whether to emit inline debug info. 162 /// \param DebugInfoForProfiling Whether to emit extra debug info for 163 /// profile collection. 164 /// \param NameTableKind Whether to emit .debug_gnu_pubnames, 165 /// .debug_pubnames, or no pubnames at all. 166 /// \param SysRoot The clang system root (value of -isysroot). 167 /// \param SDK The SDK name. On Darwin, this is the last component 171bool isOptimized,
StringRef Flags,
unsigned RV,
175uint64_t DWOId = 0,
bool SplitDebugInlining =
true,
176bool DebugInfoForProfiling =
false,
179bool RangesBaseAddress =
false,
StringRef SysRoot = {},
182 /// Create a file descriptor to hold debugging information for a file. 183 /// \param Filename File name. 184 /// \param Directory Directory. 185 /// \param Checksum Optional checksum kind (e.g. CSK_MD5, CSK_SHA1, etc.) 187 /// \param Source Optional source text. 189 StringRef Filename, StringRef Directory,
190 std::optional<DIFile::ChecksumInfo<StringRef>> Checksum = std::nullopt,
191 std::optional<StringRef> Source = std::nullopt);
193 /// Create debugging information entry for a macro. 194 /// \param Parent Macro parent (could be nullptr). 195 /// \param Line Source line number where the macro is defined. 196 /// \param MacroType DW_MACINFO_define or DW_MACINFO_undef. 197 /// \param Name Macro name. 198 /// \param Value Macro value. 199 DIMacro *
createMacro(DIMacroFile *Parent,
unsigned Line,
unsigned MacroType,
200 StringRef
Name, StringRef Value = StringRef());
202 /// Create debugging information temporary entry for a macro file. 203 /// List of macro node direct children will be calculated by DIBuilder, 204 /// using the \p Parent relationship. 205 /// \param Parent Macro file parent (could be nullptr). 206 /// \param Line Source line number where the macro file is included. 207 /// \param File File descriptor containing the name of the macro file. 211 /// Create a single enumerator value. 214bool IsUnsigned =
false);
216 /// Create a DWARF unspecified type. 219 /// Create C++11 nullptr type. 222 /// Create debugging information entry for a basic 224 /// \param Name Type name. 225 /// \param SizeInBits Size of the type. 226 /// \param Encoding DWARF encoding code, e.g., dwarf::DW_ATE_float. 227 /// \param Flags Optional DWARF attributes, e.g., DW_AT_endianity. 228 /// \param NumExtraInhabitants The number of extra inhabitants of the type. 229 /// An extra inhabitant is a bit pattern that does not represent a valid 230 /// value for instances of a given type. This is used by the Swift language. 236 /// Create debugging information entry for a string 238 /// \param Name Type name. 239 /// \param SizeInBits Size of the type. 242 /// Create debugging information entry for Fortran 243 /// assumed length string type. 244 /// \param Name Type name. 245 /// \param StringLength String length expressed as DIVariable *. 246 /// \param StrLocationExp Optional memory location of the string. 248 DIExpression *StrLocationExp =
nullptr);
250 /// Create debugging information entry for Fortran 251 /// assumed length string type. 252 /// \param Name Type name. 253 /// \param StringLengthExp String length expressed in DIExpression form. 254 /// \param StrLocationExp Optional memory location of the string. 256 DIExpression *StringLengthExp,
257 DIExpression *StrLocationExp =
nullptr);
259 /// Create debugging information entry for a qualified 260 /// type, e.g. 'const int'. 261 /// \param Tag Tag identifing type, e.g. dwarf::TAG_volatile_type 262 /// \param FromTy Base Type. 265 /// Create debugging information entry for a pointer. 266 /// \param PointeeTy Type pointed by this pointer. 267 /// \param SizeInBits Size. 268 /// \param AlignInBits Alignment. (optional) 269 /// \param DWARFAddressSpace DWARF address space. (optional) 270 /// \param Name Pointer type name. (optional) 271 /// \param Annotations Member annotations. 275 std::optional<unsigned> DWARFAddressSpace = std::nullopt,
276 StringRef
Name =
"", DINodeArray Annotations =
nullptr);
278 /// Create a __ptrauth qualifier. 280bool IsAddressDiscriminated,
281unsigned ExtraDiscriminator,
283bool authenticatesNullValues);
285 /// Create debugging information entry for a pointer to member. 286 /// \param PointeeTy Type pointed to by this pointer. 287 /// \param SizeInBits Size. 288 /// \param AlignInBits Alignment. (optional) 289 /// \param Class Type for which this pointer points to members of. 295 /// Create debugging information entry for a c++ 296 /// style reference or rvalue reference type. 300 std::optional<unsigned> DWARFAddressSpace = std::nullopt);
302 /// Create debugging information entry for a typedef. 303 /// \param Ty Original type. 304 /// \param Name Typedef name. 305 /// \param File File where this type is defined. 306 /// \param LineNo Line number. 307 /// \param Context The surrounding context for the typedef. 308 /// \param AlignInBits Alignment. (optional) 309 /// \param Flags Flags to describe inheritance attribute, e.g. private 310 /// \param Annotations Annotations. (optional) 312unsigned LineNo, DIScope *Context,
315 DINodeArray Annotations =
nullptr);
317 /// Create debugging information entry for a template alias. 318 /// \param Ty Original type. 319 /// \param Name Alias name. 320 /// \param File File where this type is defined. 321 /// \param LineNo Line number. 322 /// \param Context The surrounding context for the alias. 323 /// \param TParams The template arguments. 324 /// \param AlignInBits Alignment. (optional) 325 /// \param Flags Flags to describe inheritance attribute (optional), 327 /// \param Annotations Annotations. (optional) 329unsigned LineNo, DIScope *Context,
333 DINodeArray Annotations =
nullptr);
335 /// Create debugging information entry for a 'friend'. 336 DIDerivedType *
createFriend(DIType *Ty, DIType *FriendTy);
338 /// Create debugging information entry to establish 339 /// inheritance relationship between two types. 340 /// \param Ty Original type. 341 /// \param BaseTy Base type. Ty is inherits from base. 342 /// \param BaseOffset Base offset. 343 /// \param VBPtrOffset Virtual base pointer offset. 344 /// \param Flags Flags to describe inheritance attribute, 350 /// Create debugging information entry for a member. 351 /// \param Scope Member scope. 352 /// \param Name Member name. 353 /// \param File File where this member is defined. 354 /// \param LineNo Line number. 355 /// \param SizeInBits Member size. 356 /// \param AlignInBits Member alignment. 357 /// \param OffsetInBits Member offset. 358 /// \param Flags Flags to encode member attribute, e.g. private 359 /// \param Ty Parent type. 360 /// \param Annotations Member annotations. 362 DIFile *File,
unsigned LineNo,
366 DINodeArray Annotations =
nullptr);
368 /// Create debugging information entry for a variant. A variant 369 /// normally should be a member of a variant part. 370 /// \param Scope Member scope. 371 /// \param Name Member name. 372 /// \param File File where this member is defined. 373 /// \param LineNo Line number. 374 /// \param SizeInBits Member size. 375 /// \param AlignInBits Member alignment. 376 /// \param OffsetInBits Member offset. 377 /// \param Flags Flags to encode member attribute, e.g. private 378 /// \param Discriminant The discriminant for this branch; null for 379 /// the default branch 380 /// \param Ty Parent type. 382 DIFile *File,
unsigned LineNo,
386 Constant *Discriminant,
389 /// Create debugging information entry for a bit field member. 390 /// \param Scope Member scope. 391 /// \param Name Member name. 392 /// \param File File where this member is defined. 393 /// \param LineNo Line number. 394 /// \param SizeInBits Member size. 395 /// \param OffsetInBits Member offset. 396 /// \param StorageOffsetInBits Member storage offset. 397 /// \param Flags Flags to encode member attribute. 398 /// \param Ty Parent type. 399 /// \param Annotations Member annotations. 401 DIFile *File,
unsigned LineNo,
406 DINodeArray Annotations =
nullptr);
408 /// Create debugging information entry for a 409 /// C++ static data member. 410 /// \param Scope Member scope. 411 /// \param Name Member name. 412 /// \param File File where this member is declared. 413 /// \param LineNo Line number. 414 /// \param Ty Type of the static member. 415 /// \param Flags Flags to encode member attribute, e.g. private. 416 /// \param Val Const initializer of the member. 417 /// \param Tag DWARF tag of the static member. 418 /// \param AlignInBits Member alignment. 420 DIFile *File,
unsigned LineNo,
422 Constant *Val,
unsignedTag,
425 /// Create debugging information entry for Objective-C 426 /// instance variable. 427 /// \param Name Member name. 428 /// \param File File where this member is defined. 429 /// \param LineNo Line number. 430 /// \param SizeInBits Member size. 431 /// \param AlignInBits Member alignment. 432 /// \param OffsetInBits Member offset. 433 /// \param Flags Flags to encode member attribute, e.g. private 434 /// \param Ty Parent type. 435 /// \param PropertyNode Property associated with this ivar. 439 DIType *Ty, MDNode *PropertyNode);
441 /// Create debugging information entry for Objective-C 443 /// \param Name Property name. 444 /// \param File File where this property is defined. 445 /// \param LineNumber Line number. 446 /// \param GetterName Name of the Objective C property getter selector. 447 /// \param SetterName Name of the Objective C property setter selector. 448 /// \param PropertyAttributes Objective C property attributes. 452 StringRef GetterName,
453 StringRef SetterName,
454unsigned PropertyAttributes, DIType *Ty);
456 /// Create debugging information entry for a class. 457 /// \param Scope Scope in which this class is defined. 458 /// \param Name class name. 459 /// \param File File where this member is defined. 460 /// \param LineNumber Line number. 461 /// \param SizeInBits Member size. 462 /// \param AlignInBits Member alignment. 463 /// \param OffsetInBits Member offset. 464 /// \param Flags Flags to encode member attribute, e.g. private 465 /// \param Elements class members. 466 /// \param RunTimeLang Optional parameter, Objective-C runtime version. 467 /// \param VTableHolder Debug info of the base class that contains vtable 468 /// for this type. This is used in 469 /// DW_AT_containing_type. See DWARF documentation 471 /// \param TemplateParms Template type parameters. 472 /// \param UniqueIdentifier A unique identifier for the class. 474 DIScope *Scope, StringRef
Name, DIFile *File,
unsigned LineNumber,
477unsigned RunTimeLang = 0, DIType *VTableHolder =
nullptr,
478 MDNode *TemplateParms =
nullptr, StringRef UniqueIdentifier =
"");
480 /// Create debugging information entry for a struct. 481 /// \param Scope Scope in which this struct is defined. 482 /// \param Name Struct name. 483 /// \param File File where this member is defined. 484 /// \param LineNumber Line number. 485 /// \param SizeInBits Member size. 486 /// \param AlignInBits Member alignment. 487 /// \param Flags Flags to encode member attribute, e.g. private 488 /// \param Elements Struct elements. 489 /// \param RunTimeLang Optional parameter, Objective-C runtime version. 490 /// \param UniqueIdentifier A unique identifier for the struct. 491 /// \param Specification The type that this type completes. This is used by 492 /// Swift to represent generic types. 493 /// \param NumExtraInhabitants The number of extra inhabitants of the type. 494 /// An extra inhabitant is a bit pattern that does not represent a valid 495 /// value for instances of a given type. This is used by the Swift language. 497 DIScope *Scope, StringRef
Name, DIFile *File,
unsigned LineNumber,
499 DIType *DerivedFrom, DINodeArray Elements,
unsigned RunTimeLang = 0,
500 DIType *VTableHolder =
nullptr, StringRef UniqueIdentifier =
"",
501 DIType *Specification =
nullptr,
uint32_t NumExtraInhabitants = 0);
503 /// Create debugging information entry for an union. 504 /// \param Scope Scope in which this union is defined. 505 /// \param Name Union name. 506 /// \param File File where this member is defined. 507 /// \param LineNumber Line number. 508 /// \param SizeInBits Member size. 509 /// \param AlignInBits Member alignment. 510 /// \param Flags Flags to encode member attribute, e.g. private 511 /// \param Elements Union elements. 512 /// \param RunTimeLang Optional parameter, Objective-C runtime version. 513 /// \param UniqueIdentifier A unique identifier for the union. 515 DIFile *File,
unsigned LineNumber,
518 DINodeArray Elements,
519unsigned RunTimeLang = 0,
520 StringRef UniqueIdentifier =
"");
522 /// Create debugging information entry for a variant part. A 523 /// variant part normally has a discriminator (though this is not 524 /// required) and a number of variant children. 525 /// \param Scope Scope in which this union is defined. 526 /// \param Name Union name. 527 /// \param File File where this member is defined. 528 /// \param LineNumber Line number. 529 /// \param SizeInBits Member size. 530 /// \param AlignInBits Member alignment. 531 /// \param Flags Flags to encode member attribute, e.g. private 532 /// \param Discriminator Discriminant member 533 /// \param Elements Variant elements. 534 /// \param UniqueIdentifier A unique identifier for the union. 536 DIFile *File,
unsigned LineNumber,
539 DIDerivedType *Discriminator,
540 DINodeArray Elements,
541 StringRef UniqueIdentifier =
"");
543 /// Create debugging information for template 545 /// \param Scope Scope in which this type is defined. 546 /// \param Name Type parameter name. 547 /// \param Ty Parameter type. 548 /// \param IsDefault Parameter is default or not 554 /// Create debugging information for template 556 /// \param Scope Scope in which this type is defined. 557 /// \param Name Value parameter name. 558 /// \param Ty Parameter type. 559 /// \param IsDefault Parameter is default or not 560 /// \param Val Constant parameter value. 561 DITemplateValueParameter *
563bool IsDefault, Constant *Val);
565 /// Create debugging information for a template template parameter. 566 /// \param Scope Scope in which this type is defined. 567 /// \param Name Value parameter name. 568 /// \param Ty Parameter type. 569 /// \param Val The fully qualified name of the template. 570 /// \param IsDefault Parameter is default or not. 571 DITemplateValueParameter *
573 StringRef Val,
bool IsDefault =
false);
575 /// Create debugging information for a template parameter pack. 576 /// \param Scope Scope in which this type is defined. 577 /// \param Name Value parameter name. 578 /// \param Ty Parameter type. 579 /// \param Val An array of types in the pack. 585 /// Create debugging information entry for an array. 586 /// \param Size Array size. 587 /// \param AlignInBits Alignment. 588 /// \param Ty Element type. 589 /// \param Subscripts Subscripts. 590 /// \param DataLocation The location of the raw data of a descriptor-based 591 /// Fortran array, either a DIExpression* or 593 /// \param Associated The associated attribute of a descriptor-based 594 /// Fortran array, either a DIExpression* or 596 /// \param Allocated The allocated attribute of a descriptor-based 597 /// Fortran array, either a DIExpression* or 599 /// \param Rank The rank attribute of a descriptor-based 600 /// Fortran array, either a DIExpression* or 604 PointerUnion<DIExpression *, DIVariable *> DataLocation =
nullptr,
605 PointerUnion<DIExpression *, DIVariable *> Associated =
nullptr,
606 PointerUnion<DIExpression *, DIVariable *> Allocated =
nullptr,
607 PointerUnion<DIExpression *, DIVariable *> Rank =
nullptr);
609 /// Create debugging information entry for a vector type. 610 /// \param Size Array size. 611 /// \param AlignInBits Alignment. 612 /// \param Ty Element type. 613 /// \param Subscripts Subscripts. 615 DIType *Ty, DINodeArray Subscripts);
617 /// Create debugging information entry for an 619 /// \param Scope Scope in which this enumeration is defined. 620 /// \param Name Union name. 621 /// \param File File where this member is defined. 622 /// \param LineNumber Line number. 623 /// \param SizeInBits Member size. 624 /// \param AlignInBits Member alignment. 625 /// \param Elements Enumeration elements. 626 /// \param UnderlyingType Underlying type of a C++11/ObjC fixed enum. 627 /// \param RunTimeLang Optional parameter, Objective-C runtime version. 628 /// \param UniqueIdentifier A unique identifier for the enum. 629 /// \param IsScoped Boolean flag indicate if this is C++11/ObjC 'enum 632 DIScope *Scope, StringRef
Name, DIFile *File,
unsigned LineNumber,
634 DIType *UnderlyingType,
unsigned RunTimeLang = 0,
635 StringRef UniqueIdentifier =
"",
bool IsScoped =
false);
636 /// Create debugging information entry for a set. 637 /// \param Scope Scope in which this set is defined. 638 /// \param Name Set name. 639 /// \param File File where this set is defined. 640 /// \param LineNo Line number. 641 /// \param SizeInBits Set size. 642 /// \param AlignInBits Set alignment. 643 /// \param Ty Base type of the set. 648 /// Create subroutine type. 649 /// \param ParameterTypes An array of subroutine parameter types. This 650 /// includes return type at 0th index. 651 /// \param Flags E.g.: LValueReference. 652 /// These flags are used to emit dwarf attributes. 653 /// \param CC Calling convention, e.g. dwarf::DW_CC_normal 659 /// Create a distinct clone of \p SP with FlagArtificial set. 662 /// Create a uniqued clone of \p Ty with FlagArtificial set. 665 /// Create a uniqued clone of \p Ty with FlagObjectPointer set. 666 /// If \p Implicit is true, also set FlagArtificial. 669 /// Create a permanent forward-declared type. 671 DIScope *Scope, DIFile *
F,
unsigned Line,
672unsigned RuntimeLang = 0,
675 StringRef UniqueIdentifier =
"");
677 /// Create a temporary forward-declared type. 679unsignedTag, StringRef
Name, DIScope *Scope, DIFile *
F,
unsigned Line,
680unsigned RuntimeLang = 0,
uint64_t SizeInBits = 0,
682 StringRef UniqueIdentifier =
"", DINodeArray Annotations =
nullptr);
684 /// Retain DIScope* in a module even if it is not referenced 685 /// through debug info anchors. 688 /// Create unspecified parameter type 689 /// for a subroutine type. 692 /// Get a DINodeArray, create one if required. 695 /// Get a DIMacroNodeArray, create one if required. 698 /// Get a DITypeRefArray, create one if required. 701 /// Create a descriptor for a value range. This 702 /// implicitly uniques the values returned. 706 Metadata *UpperBound, Metadata *Stride);
714 /// Create a new descriptor for the specified variable. 715 /// \param Context Variable scope. 716 /// \param Name Name of the variable. 717 /// \param LinkageName Mangled name of the variable. 718 /// \param File File where this variable is defined. 719 /// \param LineNo Line number. 720 /// \param Ty Variable Type. 721 /// \param IsLocalToUnit Boolean flag indicate whether this variable is 722 /// externally visible or not. 723 /// \param Expr The location of the global relative to the attached 725 /// \param Decl Reference to the corresponding declaration. 726 /// \param AlignInBits Variable alignment(or 0 if no alignment attr was 730unsigned LineNo, DIType *Ty,
bool IsLocalToUnit,
bool isDefined =
true,
731 DIExpression *Expr =
nullptr, MDNode *Decl =
nullptr,
732 MDTuple *TemplateParams =
nullptr,
uint32_t AlignInBits = 0,
733 DINodeArray Annotations =
nullptr);
735 /// Identical to createGlobalVariable 736 /// except that the resulting DbgNode is temporary and meant to be RAUWed. 739unsigned LineNo, DIType *Ty,
bool IsLocalToUnit, MDNode *Decl =
nullptr,
740 MDTuple *TemplateParams =
nullptr,
uint32_t AlignInBits = 0);
742 /// Create a new descriptor for an auto variable. This is a local variable 743 /// that is not a subprogram parameter. 745 /// \c Scope must be a \a DILocalScope, and thus its scope chain eventually 746 /// leads to a \a DISubprogram. 748 /// If \c AlwaysPreserve, this variable will be referenced from its 749 /// containing subprogram, and will survive some optimizations. 752unsigned LineNo, DIType *Ty,
bool AlwaysPreserve =
false,
756 /// Create a new descriptor for an label. 758 /// \c Scope must be a \a DILocalScope, and thus its scope chain eventually 759 /// leads to a \a DISubprogram. 761createLabel(DIScope *Scope, StringRef
Name, DIFile *File,
unsigned LineNo,
762bool AlwaysPreserve =
false);
764 /// Create a new descriptor for a parameter variable. 766 /// \c Scope must be a \a DILocalScope, and thus its scope chain eventually 767 /// leads to a \a DISubprogram. 769 /// \c ArgNo is the index (starting from \c 1) of this variable in the 770 /// subprogram parameters. \c ArgNo should not conflict with other 771 /// parameters of the same subprogram. 773 /// If \c AlwaysPreserve, this variable will be referenced from its 774 /// containing subprogram, and will survive some optimizations. 777 DIFile *File,
unsigned LineNo, DIType *Ty,
778bool AlwaysPreserve =
false,
780 DINodeArray Annotations =
nullptr);
782 /// Create a new descriptor for the specified 783 /// variable which has a complex address expression for its address. 784 /// \param Addr An array of complex address operations. 787 /// Create an expression for a variable that does not have an address, but 788 /// does have a constant value. 791 VMContext, {dwarf::DW_OP_constu, Val, dwarf::DW_OP_stack_value});
794 /// Create a new descriptor for the specified subprogram. 795 /// See comments in DISubprogram* for descriptions of these fields. 796 /// \param Scope Function scope. 797 /// \param Name Function name. 798 /// \param LinkageName Mangled function name. 799 /// \param File File where this variable is defined. 800 /// \param LineNo Line number. 801 /// \param Ty Function type. 802 /// \param ScopeLine Set to the beginning of the scope this starts 803 /// \param Flags e.g. is this function prototyped or not. 804 /// These flags are used to emit dwarf attributes. 805 /// \param SPFlags Additional flags specific to subprograms. 806 /// \param TParams Function template parameters. 807 /// \param ThrownTypes Exception types this function may throw. 808 /// \param Annotations Attribute Annotations. 809 /// \param TargetFuncName The name of the target function if this is 816 DITemplateParameterArray TParams =
nullptr,
818 DITypeArray ThrownTypes =
nullptr,
822 /// Identical to createFunction, 823 /// except that the resulting DbgNode is meant to be RAUWed. 829 DITemplateParameterArray TParams =
nullptr,
830DISubprogram *Decl =
nullptr, DITypeArray ThrownTypes =
nullptr);
832 /// Create a new descriptor for the specified C++ method. 833 /// See comments in \a DISubprogram* for descriptions of these fields. 834 /// \param Scope Function scope. 835 /// \param Name Function name. 836 /// \param LinkageName Mangled function name. 837 /// \param File File where this variable is defined. 838 /// \param LineNo Line number. 839 /// \param Ty Function type. 840 /// \param VTableIndex Index no of this method in virtual table, or -1u if 842 /// \param ThisAdjustment 843 /// MS ABI-specific adjustment of 'this' that occurs 845 /// \param VTableHolder Type that holds vtable. 846 /// \param Flags e.g. is this function prototyped or not. 847 /// This flags are used to emit dwarf attributes. 848 /// \param SPFlags Additional flags specific to subprograms. 849 /// \param TParams Function template parameters. 850 /// \param ThrownTypes Exception types this function may throw. 854unsigned VTableIndex = 0,
int ThisAdjustment = 0,
855DIType *VTableHolder =
nullptr,
858 DITemplateParameterArray TParams =
nullptr,
859 DITypeArray ThrownTypes =
nullptr);
861 /// Create common block entry for a Fortran common block. 862 /// \param Scope Scope of this common block. 863 /// \param decl Global variable declaration. 864 /// \param Name The name of this common block. 865 /// \param File The file this common block is defined. 866 /// \param LineNo Line number. 871 /// This creates new descriptor for a namespace with the specified 873 /// \param Scope Namespace scope 874 /// \param Name Name of this namespace 875 /// \param ExportSymbols True for C++ inline namespaces. 879 /// This creates new descriptor for a module with the specified 881 /// \param Scope Parent scope 882 /// \param Name Name of this module 883 /// \param ConfigurationMacros 884 /// A space-separated shell-quoted list of -D macro 885 /// definitions as they would appear on a command line. 886 /// \param IncludePath The path to the module map file. 887 /// \param APINotesFile The path to an API notes file for this module. 888 /// \param File Source file of the module. 889 /// Used for Fortran modules. 890 /// \param LineNo Source line number of the module. 891 /// Used for Fortran modules. 892 /// \param IsDecl This is a module declaration; default to false; 893 /// when set to true, only Scope and Name are required 894 /// as this entry is just a hint for the debugger to find 895 /// the corresponding definition in the global scope. 898StringRef APINotesFile = {}, DIFile *File =
nullptr,
899unsigned LineNo = 0,
bool IsDecl =
false);
901 /// This creates a descriptor for a lexical block with a new file 902 /// attached. This merely extends the existing 903 /// lexical block as it crosses a file. 904 /// \param Scope Lexical block. 905 /// \param File Source file. 906 /// \param Discriminator DWARF path discriminator value. 908unsigned Discriminator = 0);
910 /// This creates a descriptor for a lexical block with the 911 /// specified parent context. 912 /// \param Scope Parent lexical scope. 913 /// \param File Source file. 914 /// \param Line Line number. 915 /// \param Col Column number. 917unsigned Line,
unsigned Col);
919 /// Create a descriptor for an imported module. 920 /// \param Context The scope this module is imported into 921 /// \param NS The namespace being imported here. 922 /// \param File File where the declaration is located. 923 /// \param Line Line number of the declaration. 924 /// \param Elements Renamed elements. 926 DIFile *File,
unsigned Line,
927 DINodeArray Elements =
nullptr);
929 /// Create a descriptor for an imported module. 930 /// \param Context The scope this module is imported into. 931 /// \param NS An aliased namespace. 932 /// \param File File where the declaration is located. 933 /// \param Line Line number of the declaration. 934 /// \param Elements Renamed elements. 936 DIImportedEntity *NS, DIFile *File,
938 DINodeArray Elements =
nullptr);
940 /// Create a descriptor for an imported module. 941 /// \param Context The scope this module is imported into. 942 /// \param M The module being imported here 943 /// \param File File where the declaration is located. 944 /// \param Line Line number of the declaration. 945 /// \param Elements Renamed elements. 947 DIFile *File,
unsigned Line,
948 DINodeArray Elements =
nullptr);
950 /// Create a descriptor for an imported function. 951 /// \param Context The scope this module is imported into. 952 /// \param Decl The declaration (or definition) of a function, type, or 954 /// \param File File where the declaration is located. 955 /// \param Line Line number of the declaration. 956 /// \param Elements Renamed elements. 958 DIFile *File,
unsigned Line,
960 DINodeArray Elements =
nullptr);
962 /// Insert a new llvm.dbg.declare intrinsic call. 963 /// \param Storage llvm::Value of the variable 964 /// \param VarInfo Variable's debug info descriptor. 965 /// \param Expr A complex location expression. 966 /// \param DL Debug info location. 967 /// \param InsertAtEnd Location for the new intrinsic. 969 DIExpression *Expr,
const DILocation *
DL,
970 BasicBlock *InsertAtEnd);
972 /// Insert a new llvm.dbg.assign intrinsic call. 973 /// \param LinkedInstr Instruction with a DIAssignID to link with the new 974 /// intrinsic. The intrinsic will be inserted after 975 /// this instruction. 976 /// \param Val The value component of this dbg.assign. 977 /// \param SrcVar Variable's debug info descriptor. 978 /// \param ValExpr A complex location expression to modify \p Val. 979 /// \param Addr The address component (store destination). 980 /// \param AddrExpr A complex location expression to modify \p Addr. 981 /// NOTE: \p ValExpr carries the FragInfo for the 983 /// \param DL Debug info location, usually: (line: 0, 984 /// column: 0, scope: var-decl-scope). See 985 /// getDebugValueLoc. 987 DILocalVariable *SrcVar, DIExpression *ValExpr,
988 Value *
Addr, DIExpression *AddrExpr,
989const DILocation *
DL);
991 /// Insert a new llvm.dbg.declare intrinsic call. 992 /// \param Storage llvm::Value of the variable 993 /// \param VarInfo Variable's debug info descriptor. 994 /// \param Expr A complex location expression. 995 /// \param DL Debug info location. 996 /// \param InsertBefore Location for the new intrinsic. 998 DIExpression *Expr,
const DILocation *
DL,
999 Instruction *InsertBefore);
1001 /// Insert a new llvm.dbg.label intrinsic call. 1002 /// \param LabelInfo Label's debug info descriptor. 1003 /// \param DL Debug info location. 1004 /// \param InsertBefore Location for the new intrinsic. 1005DbgInstPtr insertLabel(DILabel *LabelInfo,
const DILocation *
DL,
1006 Instruction *InsertBefore);
1008 /// Insert a new llvm.dbg.label intrinsic call. 1009 /// \param LabelInfo Label's debug info descriptor. 1010 /// \param DL Debug info location. 1011 /// \param InsertAtEnd Location for the new intrinsic. 1012DbgInstPtr insertLabel(DILabel *LabelInfo,
const DILocation *
DL,
1013 BasicBlock *InsertAtEnd);
1015 /// Insert a new llvm.dbg.value intrinsic call. 1016 /// \param Val llvm::Value of the variable 1017 /// \param VarInfo Variable's debug info descriptor. 1018 /// \param Expr A complex location expression. 1019 /// \param DL Debug info location. 1020 /// \param InsertAtEnd Location for the new intrinsic. 1022 DILocalVariable *VarInfo,
1023 DIExpression *Expr,
const DILocation *
DL,
1024 BasicBlock *InsertAtEnd);
1026 /// Insert a new llvm.dbg.value intrinsic call. 1027 /// \param Val llvm::Value of the variable 1028 /// \param VarInfo Variable's debug info descriptor. 1029 /// \param Expr A complex location expression. 1030 /// \param DL Debug info location. 1031 /// \param InsertBefore Location for the new intrinsic. 1033 DILocalVariable *VarInfo,
1034 DIExpression *Expr,
const DILocation *
DL,
1035 Instruction *InsertBefore);
1037 /// Replace the vtable holder in the given type. 1039 /// If this creates a self reference, it may orphan some unresolved cycles 1040 /// in the operands of \c T, so \a DIBuilder needs to track that. 1042 DIType *VTableHolder);
1044 /// Replace arrays on a composite type. 1046 /// If \c T is resolved, but the arrays aren't -- which can happen if \c T 1047 /// has a self-reference -- \a DIBuilder needs to track the array to 1050 DINodeArray TParams = DINodeArray());
1052 /// Replace a temporary node. 1054 /// Call \a MDNode::replaceAllUsesWith() on \c N, replacing it with \c 1057 /// If \c Replacement is the same as \c N.get(), instead call \a 1058 /// MDNode::replaceWithUniqued(). In this case, the uniqued node could 1059 /// have a different address, so we return the final address. 1060template <
class NodeTy>
1062if (
N.get() == Replacement)
1065N->replaceAllUsesWith(Replacement);
1070// Create wrappers for C Binding types (see CBindingWrapping.h). 1073}
// end namespace llvm 1075#endif// LLVM_IR_DIBUILDER_H MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
#define DEFINE_ISA_CONVERSION_FUNCTIONS(ty, ref)
This file defines the DenseMap class.
This file contains constants used for implementing Dwarf debug support.
Machine Check Debug Module
This file implements a map that provides insertion order iteration.
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:
LLVM Basic Block Representation.
static DIType * createObjectPointerType(DIType *Ty, bool Implicit)
Create a uniqued clone of Ty with FlagObjectPointer set.
DIBasicType * createUnspecifiedParameter()
Create unspecified parameter type for a subroutine type.
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...
DITemplateValueParameter * createTemplateTemplateParameter(DIScope *Scope, StringRef Name, DIType *Ty, StringRef Val, bool IsDefault=false)
Create debugging information for a template template parameter.
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.
NodeTy * replaceTemporary(TempMDNode &&N, NodeTy *Replacement)
Replace a temporary node.
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
void finalize()
Construct any deferred debug info descriptors.
DISubroutineType * createSubroutineType(DITypeRefArray ParameterTypes, DINode::DIFlags Flags=DINode::FlagZero, unsigned CC=0)
Create subroutine type.
DIMacro * createMacro(DIMacroFile *Parent, unsigned Line, unsigned MacroType, StringRef Name, StringRef Value=StringRef())
Create debugging information entry for a macro.
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.
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.
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.
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.
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)
Create debugging information entry for an enumeration.
DILexicalBlockFile * createLexicalBlockFile(DIScope *Scope, DIFile *File, unsigned Discriminator=0)
This creates a descriptor for a lexical block with a new file attached.
void finalizeSubprogram(DISubprogram *SP)
Finalize a specific subprogram - no new variables may be added to this subprogram afterwards.
DIDerivedType * createQualifiedType(unsigned Tag, DIType *FromTy)
Create debugging information entry for a qualified type, e.g.
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...
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.
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 DIType * createArtificialType(DIType *Ty)
Create a uniqued clone of Ty with FlagArtificial set.
DICompositeType * createVectorType(uint64_t Size, uint32_t AlignInBits, DIType *Ty, DINodeArray Subscripts)
Create debugging information entry for a vector type.
DILabel * createLabel(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo, bool AlwaysPreserve=false)
Create a new descriptor for an label.
DINamespace * createNameSpace(DIScope *Scope, StringRef Name, bool ExportSymbols)
This creates new descriptor for a namespace with the specified parent scope.
DIStringType * createStringType(StringRef Name, uint64_t SizeInBits)
Create debugging information entry for a string type.
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="")
Create a new descriptor for the specified subprogram.
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.
DILexicalBlock * createLexicalBlock(DIScope *Scope, DIFile *File, unsigned Line, unsigned Col)
This creates a descriptor for a lexical block with the specified parent context.
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.
DIMacroNodeArray getOrCreateMacroArray(ArrayRef< Metadata * > Elements)
Get a DIMacroNodeArray, create one if required.
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.
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.
DIBasicType * createNullPtrType()
Create C++11 nullptr type.
DICommonBlock * createCommonBlock(DIScope *Scope, DIGlobalVariable *decl, StringRef Name, DIFile *File, unsigned LineNo)
Create common block entry for a Fortran common block.
DIDerivedType * createFriend(DIType *Ty, DIType *FriendTy)
Create debugging information entry for a 'friend'.
void retainType(DIScope *T)
Retain DIScope* in a module even if it is not referenced through debug info anchors.
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
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.
DITemplateValueParameter * createTemplateParameterPack(DIScope *Scope, StringRef Name, DIType *Ty, DINodeArray Val)
Create debugging information for a template parameter pack.
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.
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.
DISubrange * getOrCreateSubrange(int64_t Lo, int64_t Count)
Create a descriptor for a value range.
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.
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.
DIMacroFile * createTempMacroFile(DIMacroFile *Parent, unsigned Line, DIFile *File)
Create debugging information temporary entry for a macro file.
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.
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.
DITypeRefArray getOrCreateTypeArray(ArrayRef< Metadata * > Elements)
Get a DITypeRefArray, create one if required.
DINodeArray getOrCreateArray(ArrayRef< Metadata * > Elements)
Get a DINodeArray, create one if required.
DIEnumerator * createEnumerator(StringRef Name, const APSInt &Value)
Create a single enumerator value.
DITemplateTypeParameter * createTemplateTypeParameter(DIScope *Scope, StringRef Name, DIType *Ty, bool IsDefault)
Create debugging information for template type parameter.
DIExpression * createExpression(ArrayRef< uint64_t > Addr={})
Create a new descriptor for the specified variable which has a complex address expression for its add...
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.
DIDerivedType * createPtrAuthQualifiedType(DIType *FromTy, unsigned Key, bool IsAddressDiscriminated, unsigned ExtraDiscriminator, bool IsaPointer, bool authenticatesNullValues)
Create a __ptrauth qualifier.
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.
DIImportedEntity * createImportedModule(DIScope *Context, DINamespace *NS, DIFile *File, unsigned Line, DINodeArray Elements=nullptr)
Create a descriptor for an imported module.
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.
DIImportedEntity * createImportedDeclaration(DIScope *Context, DINode *Decl, DIFile *File, unsigned Line, StringRef Name="", DINodeArray Elements=nullptr)
Create a descriptor for an imported function.
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 DISubprogram * createArtificialSubprogram(DISubprogram *SP)
Create a distinct clone of SP with FlagArtificial set.
DIGenericSubrange * getOrCreateGenericSubrange(DIGenericSubrange::BoundType Count, DIGenericSubrange::BoundType LowerBound, DIGenericSubrange::BoundType UpperBound, DIGenericSubrange::BoundType Stride)
DIBasicType * createUnspecifiedType(StringRef Name)
Create a DWARF unspecified type.
DIObjCProperty * createObjCProperty(StringRef Name, DIFile *File, unsigned LineNumber, StringRef GetterName, StringRef SetterName, unsigned PropertyAttributes, DIType *Ty)
Create debugging information entry for Objective-C property.
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.
DITemplateValueParameter * createTemplateValueParameter(DIScope *Scope, StringRef Name, DIType *Ty, bool IsDefault, Constant *Val)
Create debugging information for template value parameter.
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.
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.
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="", DIType *Specification=nullptr, uint32_t NumExtraInhabitants=0)
Create debugging information entry for a struct.
void replaceArrays(DICompositeType *&T, DINodeArray Elements, DINodeArray TParams=DINodeArray())
Replace arrays on a composite type.
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.
PointerUnion< DIVariable *, DIExpression * > BoundType
Represents a module in the programming language, for example, a Clang module, or a Fortran module.
Base class for scope-like contexts.
DISPFlags
Debug info subprogram flags.
Type array for a subprogram.
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.
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata * > MDs)
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.
This class implements a map that also provides access to all stored values in a deterministic order.
A Module instance is used to store all the information related to an LLVM module.
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.
LLVM Value Representation.
struct LLVMOpaqueDIBuilder * LLVMDIBuilderRef
Represents an LLVM debug info builder.
@ BasicBlock
Various leaf nodes.
This is an optimization pass for GlobalISel generic memory operations.
PointerUnion< Instruction *, DbgRecord * > DbgInstPtr