LLVM 22.0.0git
Public Member Functions | Static Public Member Functions | List of all members
llvm::DIBuilder Class Reference

#include "llvm/IR/DIBuilder.h"

Public Member Functions

LLVM_ABI DIBuilder (Module &M, bool AllowUnresolved=true, DICompileUnit *CU=nullptr)
 Construct a builder for a module.
 
 DIBuilder (const DIBuilder &)=delete
 
DIBuilderoperator= (const DIBuilder &)=delete
 
LLVM_ABI void finalize ()
 Construct any deferred debug info descriptors.
 
LLVM_ABI void finalizeSubprogram (DISubprogram *SP)
 Finalize a specific subprogram - no new variables may be added to this subprogram afterwards.
 
LLVM_ABI DICompileUnitcreateCompileUnit (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 compilation.
 
LLVM_ABI DIFilecreateFile (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 DIMacrocreateMacro (DIMacroFile *Parent, unsigned Line, unsigned MacroType, StringRef Name, StringRef Value=StringRef())
 Create debugging information entry for a macro.
 
LLVM_ABI DIMacroFilecreateTempMacroFile (DIMacroFile *Parent, unsigned Line, DIFile *File)
 Create debugging information temporary entry for a macro file.
 
LLVM_ABI DIEnumeratorcreateEnumerator (StringRef Name, const APSInt &Value)
 Create a single enumerator value.
 
LLVM_ABI DIEnumeratorcreateEnumerator (StringRef Name, uint64_t Val, bool IsUnsigned=false)
 
LLVM_ABI DIBasicTypecreateUnspecifiedType (StringRef Name)
 Create a DWARF unspecified type.
 
LLVM_ABI DIBasicTypecreateNullPtrType ()
 Create C++11 nullptr type.
 
LLVM_ABI DIBasicTypecreateBasicType (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 DIFixedPointTypecreateBinaryFixedPointType (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 DIFixedPointTypecreateDecimalFixedPointType (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 DIFixedPointTypecreateRationalFixedPointType (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 DIStringTypecreateStringType (StringRef Name, uint64_t SizeInBits)
 Create debugging information entry for a string type.
 
LLVM_ABI DIStringTypecreateStringType (StringRef Name, DIVariable *StringLength, DIExpression *StrLocationExp=nullptr)
 Create debugging information entry for Fortran assumed length string type.
 
LLVM_ABI DIStringTypecreateStringType (StringRef Name, DIExpression *StringLengthExp, DIExpression *StrLocationExp=nullptr)
 Create debugging information entry for Fortran assumed length string type.
 
LLVM_ABI DIDerivedTypecreateQualifiedType (unsigned Tag, DIType *FromTy)
 Create debugging information entry for a qualified type, e.g.
 
LLVM_ABI DIDerivedTypecreatePointerType (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 DIDerivedTypecreatePtrAuthQualifiedType (DIType *FromTy, unsigned Key, bool IsAddressDiscriminated, unsigned ExtraDiscriminator, bool IsaPointer, bool authenticatesNullValues)
 Create a __ptrauth qualifier.
 
LLVM_ABI DIDerivedTypecreateMemberPointerType (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 DIDerivedTypecreateReferenceType (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 DIDerivedTypecreateTypedef (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.
 
LLVM_ABI DIDerivedTypecreateTemplateAlias (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.
 
LLVM_ABI DIDerivedTypecreateFriend (DIType *Ty, DIType *FriendTy)
 Create debugging information entry for a 'friend'.
 
LLVM_ABI DIDerivedTypecreateInheritance (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 DIDerivedTypecreateMemberType (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 DIDerivedTypecreateMemberType (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.
 
LLVM_ABI DIDerivedTypecreateVariantMemberType (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 DIDerivedTypecreateVariantMemberType (DIScope *Scope, DINodeArray Elements, Constant *Discriminant, DIType *Ty)
 Create debugging information entry for a variant.
 
LLVM_ABI DIDerivedTypecreateBitFieldMemberType (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 DIDerivedTypecreateBitFieldMemberType (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.
 
LLVM_ABI DIDerivedTypecreateStaticMemberType (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 DIDerivedTypecreateObjCIVar (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.
 
LLVM_ABI DIObjCPropertycreateObjCProperty (StringRef Name, DIFile *File, unsigned LineNumber, StringRef GetterName, StringRef SetterName, unsigned PropertyAttributes, DIType *Ty)
 Create debugging information entry for Objective-C property.
 
LLVM_ABI DICompositeTypecreateClassType (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 DICompositeTypecreateStructType (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 DICompositeTypecreateStructType (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.
 
LLVM_ABI DICompositeTypecreateUnionType (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 DICompositeTypecreateVariantPart (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 DITemplateTypeParametercreateTemplateTypeParameter (DIScope *Scope, StringRef Name, DIType *Ty, bool IsDefault)
 Create debugging information for template type parameter.
 
LLVM_ABI DITemplateValueParametercreateTemplateValueParameter (DIScope *Scope, StringRef Name, DIType *Ty, bool IsDefault, Constant *Val)
 Create debugging information for template value parameter.
 
LLVM_ABI DITemplateValueParametercreateTemplateTemplateParameter (DIScope *Scope, StringRef Name, DIType *Ty, StringRef Val, bool IsDefault=false)
 Create debugging information for a template template parameter.
 
LLVM_ABI DITemplateValueParametercreateTemplateParameterPack (DIScope *Scope, StringRef Name, DIType *Ty, DINodeArray Val)
 Create debugging information for a template parameter pack.
 
LLVM_ABI DICompositeTypecreateArrayType (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 DICompositeTypecreateArrayType (DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber, 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, Metadata *BitStride=nullptr)
 Create debugging information entry for an array.
 
LLVM_ABI DICompositeTypecreateVectorType (uint64_t Size, uint32_t AlignInBits, DIType *Ty, DINodeArray Subscripts)
 Create debugging information entry for a vector type.
 
LLVM_ABI DICompositeTypecreateEnumerationType (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 DIDerivedTypecreateSetType (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 DISubroutineTypecreateSubroutineType (DITypeRefArray ParameterTypes, DINode::DIFlags Flags=DINode::FlagZero, unsigned CC=0)
 Create subroutine type.
 
LLVM_ABI DISubrangeTypecreateSubrangeType (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 DICompositeTypecreateForwardDecl (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 DICompositeTypecreateReplaceableCompositeType (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 void retainType (DIScope *T)
 Retain DIScope* in a module even if it is not referenced through debug info anchors.
 
LLVM_ABI DIBasicTypecreateUnspecifiedParameter ()
 Create unspecified parameter type for a subroutine type.
 
LLVM_ABI DINodeArray getOrCreateArray (ArrayRef< Metadata * > Elements)
 Get a DINodeArray, create one if required.
 
LLVM_ABI DIMacroNodeArray getOrCreateMacroArray (ArrayRef< Metadata * > Elements)
 Get a DIMacroNodeArray, create one if required.
 
LLVM_ABI DITypeRefArray getOrCreateTypeArray (ArrayRef< Metadata * > Elements)
 Get a DITypeRefArray, create one if required.
 
LLVM_ABI DISubrangegetOrCreateSubrange (int64_t Lo, int64_t Count)
 Create a descriptor for a value range.
 
LLVM_ABI DISubrangegetOrCreateSubrange (int64_t Lo, Metadata *CountNode)
 
LLVM_ABI DISubrangegetOrCreateSubrange (Metadata *Count, Metadata *LowerBound, Metadata *UpperBound, Metadata *Stride)
 
LLVM_ABI DIGenericSubrangegetOrCreateGenericSubrange (DIGenericSubrange::BoundType Count, DIGenericSubrange::BoundType LowerBound, DIGenericSubrange::BoundType UpperBound, DIGenericSubrange::BoundType Stride)
 
LLVM_ABI DIGlobalVariableExpressioncreateGlobalVariableExpression (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 DIGlobalVariablecreateTempGlobalVariableFwdDecl (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 RAUWed.
 
LLVM_ABI DILocalVariablecreateAutoVariable (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.
 
LLVM_ABI DILabelcreateLabel (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 DILocalVariablecreateParameterVariable (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 DIExpressioncreateExpression (ArrayRef< uint64_t > Addr={})
 Create a new descriptor for the specified variable which has a complex address expression for its address.
 
DIExpressioncreateConstantValueExpression (uint64_t Val)
 Create an expression for a variable that does not have an address, but does have a constant value.
 
LLVM_ABI DISubprogramcreateFunction (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 DISubprogramcreateTempFunctionFwdDecl (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 DISubprogramcreateMethod (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 DICommonBlockcreateCommonBlock (DIScope *Scope, DIGlobalVariable *decl, StringRef Name, DIFile *File, unsigned LineNo)
 Create common block entry for a Fortran common block.
 
LLVM_ABI DINamespacecreateNameSpace (DIScope *Scope, StringRef Name, bool ExportSymbols)
 This creates new descriptor for a namespace with the specified parent scope.
 
LLVM_ABI DIModulecreateModule (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.
 
LLVM_ABI DILexicalBlockFilecreateLexicalBlockFile (DIScope *Scope, DIFile *File, unsigned Discriminator=0)
 This creates a descriptor for a lexical block with a new file attached.
 
LLVM_ABI DILexicalBlockcreateLexicalBlock (DIScope *Scope, DIFile *File, unsigned Line, unsigned Col)
 This creates a descriptor for a lexical block with the specified parent context.
 
LLVM_ABI DIImportedEntitycreateImportedModule (DIScope *Context, DINamespace *NS, DIFile *File, unsigned Line, DINodeArray Elements=nullptr)
 Create a descriptor for an imported module.
 
LLVM_ABI DIImportedEntitycreateImportedModule (DIScope *Context, DIImportedEntity *NS, DIFile *File, unsigned Line, DINodeArray Elements=nullptr)
 Create a descriptor for an imported module.
 
LLVM_ABI DIImportedEntitycreateImportedModule (DIScope *Context, DIModule *M, DIFile *File, unsigned Line, DINodeArray Elements=nullptr)
 Create a descriptor for an imported module.
 
LLVM_ABI DIImportedEntitycreateImportedDeclaration (DIScope *Context, DINode *Decl, DIFile *File, unsigned Line, StringRef Name="", DINodeArray Elements=nullptr)
 Create a descriptor for an imported function.
 
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 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 DbgInstPtr insertDeclare (llvm::Value *Storage, DILocalVariable *VarInfo, DIExpression *Expr, const DILocation *DL, InsertPosition InsertPt)
 Insert a new llvm.dbg.declare intrinsic call.
 
LLVM_ABI DbgInstPtr insertLabel (DILabel *LabelInfo, const DILocation *DL, InsertPosition InsertPt)
 Insert a new llvm.dbg.label 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 void replaceVTableHolder (DICompositeType *&T, DIType *VTableHolder)
 Replace the vtable holder in the given type.
 
LLVM_ABI void replaceArrays (DICompositeType *&T, DINodeArray Elements, DINodeArray TParams=DINodeArray())
 Replace arrays on a composite type.
 
template<class NodeTy >
NodeTy * replaceTemporary (TempMDNode &&N, NodeTy *Replacement)
 Replace a temporary node.
 

Static Public Member Functions

static LLVM_ABI DISubprogramcreateArtificialSubprogram (DISubprogram *SP)
 Create a distinct clone of SP with FlagArtificial set.
 
static LLVM_ABI DITypecreateArtificialType (DIType *Ty)
 Create a uniqued clone of Ty with FlagArtificial set.
 
static LLVM_ABI DITypecreateObjectPointerType (DIType *Ty, bool Implicit)
 Create a uniqued clone of Ty with FlagObjectPointer set.
 

Detailed Description

Definition at line 46 of file DIBuilder.h.

Constructor & Destructor Documentation

◆ DIBuilder() [1/2]

DIBuilder::DIBuilder ( Module M,
bool  AllowUnresolved = true,
DICompileUnit CU = nullptr 
)
explicit

Construct a builder for a module.

If AllowUnresolved, collect unresolved nodes attached to the module in order to resolve cycles during finalize().

If CU is given a value other than nullptr, then set CUNode to CU.

Definition at line 27 of file DIBuilder.cpp.

References llvm::from_range, llvm::DICompileUnit::getEnumTypes(), llvm::DICompileUnit::getGlobalVariables(), llvm::DICompileUnit::getImportedEntities(), llvm::DICompileUnit::getMacros(), and llvm::DICompileUnit::getRetainedTypes().

◆ DIBuilder() [2/2]

llvm::DIBuilder::DIBuilder ( const DIBuilder )
delete

Member Function Documentation

◆ createArrayType() [1/2]

DICompositeType * DIBuilder::createArrayType ( DIScope Scope,
StringRef  Name,
DIFile File,
unsigned  LineNumber,
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,
Metadata BitStride = nullptr 
)

Create debugging information entry for an array.

Parameters
ScopeScope in which this enumeration is defined.
NameUnion name.
FileFile where this member is defined.
LineNumberLine number.
SizeArray size.
AlignInBitsAlignment.
TyElement type.
SubscriptsSubscripts.
DataLocationThe location of the raw data of a descriptor-based Fortran array, either a DIExpression* or a DIVariable*.
AssociatedThe associated attribute of a descriptor-based Fortran array, either a DIExpression* or a DIVariable*.
AllocatedThe allocated attribute of a descriptor-based Fortran array, either a DIExpression* or a DIVariable*.
RankThe rank attribute of a descriptor-based Fortran array, either a DIExpression* or a DIVariable*.
BitStrideThe bit size of an element of the array.

Definition at line 696 of file DIBuilder.cpp.

References DL, llvm::MDNode::get(), getNonCompileUnitScope(), Name, and Size.

◆ createArrayType() [2/2]

DICompositeType * DIBuilder::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.

Parameters
SizeArray size.
AlignInBitsAlignment.
TyElement type.
SubscriptsSubscripts.
DataLocationThe location of the raw data of a descriptor-based Fortran array, either a DIExpression* or a DIVariable*.
AssociatedThe associated attribute of a descriptor-based Fortran array, either a DIExpression* or a DIVariable*.
AllocatedThe allocated attribute of a descriptor-based Fortran array, either a DIExpression* or a DIVariable*.
RankThe rank attribute of a descriptor-based Fortran array, either a DIExpression* or a DIVariable*.

Definition at line 686 of file DIBuilder.cpp.

References createArrayType(), DL, and Size.

Referenced by createArrayType(), and solveDIType().

◆ createArtificialSubprogram()

DISubprogram * DIBuilder::createArtificialSubprogram ( DISubprogram SP)
static

Create a distinct clone of SP with FlagArtificial set.

Definition at line 731 of file DIBuilder.cpp.

References llvm::MDNode::replaceWithDistinct().

◆ createArtificialType()

DIType * DIBuilder::createArtificialType ( DIType Ty)
static

Create a uniqued clone of Ty with FlagArtificial set.

Definition at line 742 of file DIBuilder.cpp.

References createTypeWithFlags(), and llvm::DIType::isArtificial().

◆ createAutoVariable()

DILocalVariable * DIBuilder::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.

This is a local variable that is not a subprogram parameter.

Scope must be a DILocalScope, and thus its scope chain eventually leads to a DISubprogram.

If AlwaysPreserve, this variable will be referenced from its containing subprogram, and will survive some optimizations.

Definition at line 924 of file DIBuilder.cpp.

References assert(), createLocalVariable(), and Name.

Referenced by buildFrameDebugInfo(), and fixupDebugInfoPostExtraction().

◆ createBasicType()

DIBasicType * DIBuilder::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.

Parameters
NameType name.
SizeInBitsSize of the type.
EncodingDWARF encoding code, e.g., dwarf::DW_ATE_float.
FlagsOptional DWARF attributes, e.g., DW_AT_endianity.
NumExtraInhabitantsThe number of extra inhabitants of the type. An extra inhabitant is a bit pattern that does not represent a valid value for instances of a given type. This is used by the Swift language.

Definition at line 265 of file DIBuilder.cpp.

References assert(), llvm::MDNode::get(), and Name.

Referenced by buildFrameDebugInfo(), and solveDIType().

◆ createBinaryFixedPointType()

DIFixedPointType * DIBuilder::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.

Parameters
NameType name.
EncodingDWARF encoding code, either dwarf::DW_ATE_signed_fixed or DW_ATE_unsigned_fixed.
FlagsOptional DWARF attributes, e.g., DW_AT_endianity.
FactorBinary scale factor.

Definition at line 275 of file DIBuilder.cpp.

References llvm::DIFixedPointType::FixedPointBinary, llvm::MDNode::get(), and Name.

◆ createBitFieldMemberType() [1/2]

DIDerivedType * DIBuilder::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.

Parameters
ScopeMember scope.
NameMember name.
FileFile where this member is defined.
LineNoLine number.
SizeInBitsMember size.
OffsetInBitsMember offset.
StorageOffsetInBitsMember storage offset.
FlagsFlags to encode member attribute.
TyParent type.
AnnotationsMember annotations.

Definition at line 474 of file DIBuilder.cpp.

References llvm::ConstantAsMetadata::get(), llvm::IntegerType::get(), llvm::MDNode::get(), getNonCompileUnitScope(), and Name.

◆ createBitFieldMemberType() [2/2]

DIDerivedType * DIBuilder::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.

Parameters
ScopeMember scope.
NameMember name.
FileFile where this member is defined.
LineNoLine number.
SizeInBitsMember size.
OffsetInBitsMember offset.
StorageOffsetInBitsMember storage offset.
FlagsFlags to encode member attribute.
TyParent type.
AnnotationsMember annotations.

Definition at line 488 of file DIBuilder.cpp.

References llvm::ConstantAsMetadata::get(), llvm::IntegerType::get(), llvm::MDNode::get(), getNonCompileUnitScope(), and Name.

◆ createClassType()

DICompositeType * DIBuilder::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.

Parameters
ScopeScope in which this class is defined.
Nameclass name.
FileFile where this member is defined.
LineNumberLine number.
SizeInBitsMember size.
AlignInBitsMember alignment.
OffsetInBitsMember offset.
FlagsFlags to encode member attribute, e.g. private
Elementsclass members.
RunTimeLangOptional parameter, Objective-C runtime version.
VTableHolderDebug info of the base class that contains vtable for this type. This is used in DW_AT_containing_type. See DWARF documentation for more info.
TemplateParmsTemplate type parameters.
UniqueIdentifierA unique identifier for the class.

Definition at line 574 of file DIBuilder.cpp.

References assert(), Context, llvm::MDNode::get(), getNonCompileUnitScope(), and Name.

◆ createCommonBlock()

DICommonBlock * DIBuilder::createCommonBlock ( DIScope Scope,
DIGlobalVariable decl,
StringRef  Name,
DIFile File,
unsigned  LineNo 
)

Create common block entry for a Fortran common block.

Parameters
ScopeScope of this common block.
declGlobal variable declaration.
NameThe name of this common block.
FileThe file this common block is defined.
LineNoLine number.

Definition at line 1033 of file DIBuilder.cpp.

References llvm::MDNode::get(), and Name.

◆ createCompileUnit()

DICompileUnit * DIBuilder::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 compilation.

Parameters
LangSource programming language, eg. dwarf::DW_LANG_C99
FileFile info.
ProducerIdentify the producer of debugging information and code. Usually this is a compiler version string.
isOptimizedA boolean flag which indicates whether optimization is enabled or not.
FlagsThis string lists command line options. This string is directly embedded in debug info output which may be used by a tool analyzing generated debugging information.
RVThis indicates runtime version for languages like Objective-C.
SplitNameThe name of the file that we'll split debug info out into.
KindThe kind of debug information to generate.
DWOIdThe DWOId if this is a split skeleton compile unit.
SplitDebugInliningWhether to emit inline debug info.
DebugInfoForProfilingWhether to emit extra debug info for profile collection.
NameTableKindWhether to emit .debug_gnu_pubnames, .debug_pubnames, or no pubnames at all.
SysRootThe clang system root (value of -isysroot).
SDKThe SDK name. On Darwin, this is the last component of the sysroot.

Definition at line 133 of file DIBuilder.cpp.

References llvm::NamedMDNode::addOperand(), assert(), llvm::dwarf::DW_LANG_lo_user, llvm::MDNode::getDistinct(), and llvm::Module::getOrInsertNamedMetadata().

◆ createConstantValueExpression()

DIExpression * llvm::DIBuilder::createConstantValueExpression ( uint64_t  Val)
inline

Create an expression for a variable that does not have an address, but does have a constant value.

Definition at line 934 of file DIBuilder.h.

References llvm::MDNode::get().

Referenced by llvm::getExpressionForConstant().

◆ createDecimalFixedPointType()

DIFixedPointType * DIBuilder::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.

Parameters
NameType name.
EncodingDWARF encoding code, either dwarf::DW_ATE_signed_fixed or DW_ATE_unsigned_fixed.
FlagsOptional DWARF attributes, e.g., DW_AT_endianity.
FactorDecimal scale factor.

Definition at line 285 of file DIBuilder.cpp.

References llvm::DIFixedPointType::FixedPointDecimal, llvm::MDNode::get(), and Name.

◆ createEnumerationType()

DICompositeType * DIBuilder::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.

Parameters
ScopeScope in which this enumeration is defined.
NameUnion name.
FileFile where this member is defined.
LineNumberLine number.
SizeInBitsMember size.
AlignInBitsMember alignment.
ElementsEnumeration elements.
UnderlyingTypeUnderlying type of a C++11/ObjC fixed enum.
RunTimeLangOptional parameter, Objective-C runtime version.
UniqueIdentifierA unique identifier for the enum.
IsScopedBoolean flag indicate if this is C++11/ObjC 'enum class'.

Definition at line 658 of file DIBuilder.cpp.

References llvm::MDNode::get(), getNonCompileUnitScope(), and Name.

◆ createEnumerator() [1/2]

DIEnumerator * DIBuilder::createEnumerator ( StringRef  Name,
const APSInt Value 
)

Create a single enumerator value.

Definition at line 251 of file DIBuilder.cpp.

References assert(), llvm::MDNode::get(), and Name.

◆ createEnumerator() [2/2]

DIEnumerator * DIBuilder::createEnumerator ( StringRef  Name,
uint64_t  Val,
bool  IsUnsigned = false 
)

Definition at line 244 of file DIBuilder.cpp.

References assert(), llvm::MDNode::get(), and Name.

◆ createExpression()

DIExpression * DIBuilder::createExpression ( ArrayRef< uint64_t Addr = {})

Create a new descriptor for the specified variable which has a complex address expression for its address.

Parameters
AddrAn array of complex address operations.

Definition at line 966 of file DIBuilder.cpp.

References Addr, and llvm::MDNode::get().

Referenced by buildFrameDebugInfo(), createGlobalVariableExpression(), and fixupDebugInfoPostExtraction().

◆ createFile()

DIFile * DIBuilder::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.

Parameters
FilenameFile name.
DirectoryDirectory.
ChecksumOptional checksum kind (e.g. CSK_MD5, CSK_SHA1, etc.) and value.
SourceOptional source text.

Definition at line 213 of file DIBuilder.cpp.

References llvm::MDNode::get().

◆ createForwardDecl()

DICompositeType * DIBuilder::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.

Definition at line 771 of file DIBuilder.cpp.

References F, llvm::MDNode::get(), getNonCompileUnitScope(), Name, and RetTy.

◆ createFriend()

DIDerivedType * DIBuilder::createFriend ( DIType Ty,
DIType FriendTy 
)

Create debugging information entry for a 'friend'.

Definition at line 401 of file DIBuilder.cpp.

References assert(), and llvm::MDNode::get().

◆ createFunction()

DISubprogram * DIBuilder::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.

See comments in DISubprogram* for descriptions of these fields.

Parameters
ScopeFunction scope.
NameFunction name.
LinkageNameMangled function name.
FileFile where this variable is defined.
LineNoLine number.
TyFunction type.
ScopeLineSet to the beginning of the scope this starts
Flagse.g. is this function prototyped or not. These flags are used to emit dwarf attributes.
SPFlagsAdditional flags specific to subprograms.
TParamsFunction template parameters.
ThrownTypesException types this function may throw.
AnnotationsAttribute Annotations.
TargetFuncNameThe name of the target function if this is a trampoline.
UseKeyInstructionsInstruct DWARF emission to interpret Key Instructions metadata on instructions to determine is_stmt placement.

Definition at line 977 of file DIBuilder.cpp.

References Context, getNonCompileUnitScope(), getSubprogram(), llvm::LinkageName, and Name.

Referenced by createBPFUnreachable(), and fixupDebugInfoPostExtraction().

◆ createGlobalVariableExpression()

DIGlobalVariableExpression * DIBuilder::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.

Parameters
ContextVariable scope.
NameName of the variable.
LinkageNameMangled name of the variable.
FileFile where this variable is defined.
LineNoLine number.
TyVariable Type.
IsLocalToUnitBoolean flag indicate whether this variable is externally visible or not.
ExprThe location of the global relative to the attached GlobalVariable.
DeclReference to the corresponding declaration.
AlignInBitsVariable alignment(or 0 if no alignment attr was specified)

Definition at line 871 of file DIBuilder.cpp.

References checkGlobalVariableScope(), Context, createExpression(), F, llvm::MDNode::get(), llvm::MDNode::getDistinct(), llvm::LinkageName, N, and Name.

◆ createImportedDeclaration()

DIImportedEntity * DIBuilder::createImportedDeclaration ( DIScope Context,
DINode Decl,
DIFile File,
unsigned  Line,
StringRef  Name = "",
DINodeArray  Elements = nullptr 
)

Create a descriptor for an imported function.

Parameters
ContextThe scope this module is imported into.
DeclThe declaration (or definition) of a function, type, or variable.
FileFile where the declaration is located.
LineLine number of the declaration.
ElementsRenamed elements.

Definition at line 203 of file DIBuilder.cpp.

References Context, and Name.

◆ createImportedModule() [1/3]

DIImportedEntity * DIBuilder::createImportedModule ( DIScope Context,
DIImportedEntity NS,
DIFile File,
unsigned  Line,
DINodeArray  Elements = nullptr 
)

Create a descriptor for an imported module.

Parameters
ContextThe scope this module is imported into.
NSAn aliased namespace.
FileFile where the declaration is located.
LineLine number of the declaration.
ElementsRenamed elements.

Definition at line 185 of file DIBuilder.cpp.

References Context.

◆ createImportedModule() [2/3]

DIImportedEntity * DIBuilder::createImportedModule ( DIScope Context,
DIModule M,
DIFile File,
unsigned  Line,
DINodeArray  Elements = nullptr 
)

Create a descriptor for an imported module.

Parameters
ContextThe scope this module is imported into.
MThe module being imported here
FileFile where the declaration is located.
LineLine number of the declaration.
ElementsRenamed elements.

Definition at line 194 of file DIBuilder.cpp.

References Context.

◆ createImportedModule() [3/3]

DIImportedEntity * DIBuilder::createImportedModule ( DIScope Context,
DINamespace NS,
DIFile File,
unsigned  Line,
DINodeArray  Elements = nullptr 
)

Create a descriptor for an imported module.

Parameters
ContextThe scope this module is imported into
NSThe namespace being imported here.
FileFile where the declaration is located.
LineLine number of the declaration.
ElementsRenamed elements.

Definition at line 176 of file DIBuilder.cpp.

References Context.

◆ createInheritance()

DIDerivedType * DIBuilder::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.

Parameters
TyOriginal type.
BaseTyBase type. Ty is inherits from base.
BaseOffsetBase offset.
VBPtrOffsetVirtual base pointer offset.
FlagsFlags to describe inheritance attribute, e.g. private

Definition at line 409 of file DIBuilder.cpp.

References assert(), llvm::ConstantAsMetadata::get(), llvm::IntegerType::get(), and llvm::MDNode::get().

◆ createLabel()

DILabel * DIBuilder::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.

Scope must be a DILocalScope, and thus its scope chain eventually leads to a DISubprogram.

The optimizer may remove labels. If there is an interest to preserve label info in such situation then append it to the list of retained nodes of the DISubprogram.

Definition at line 948 of file DIBuilder.cpp.

References Context, llvm::MDNode::get(), and Name.

◆ createLexicalBlock()

DILexicalBlock * DIBuilder::createLexicalBlock ( DIScope Scope,
DIFile File,
unsigned  Line,
unsigned  Col 
)

This creates a descriptor for a lexical block with the specified parent context.

Parameters
ScopeParent lexical scope.
FileSource file.
LineLine number.
ColColumn number.

Definition at line 1067 of file DIBuilder.cpp.

References llvm::MDNode::getDistinct(), and getNonCompileUnitScope().

◆ createLexicalBlockFile()

DILexicalBlockFile * DIBuilder::createLexicalBlockFile ( DIScope Scope,
DIFile File,
unsigned  Discriminator = 0 
)

This creates a descriptor for a lexical block with a new file attached.

This merely extends the existing lexical block as it crosses a file.

Parameters
ScopeLexical block.
FileSource file.
DiscriminatorDWARF path discriminator value.

Definition at line 1061 of file DIBuilder.cpp.

References llvm::MDNode::get().

◆ createMacro()

DIMacro * DIBuilder::createMacro ( DIMacroFile Parent,
unsigned  Line,
unsigned  MacroType,
StringRef  Name,
StringRef  Value = StringRef() 
)

Create debugging information entry for a macro.

Parameters
ParentMacro parent (could be nullptr).
LineSource line number where the macro is defined.
MacroTypeDW_MACINFO_define or DW_MACINFO_undef.
NameMacro name.
ValueMacro value.

Definition at line 219 of file DIBuilder.cpp.

References assert(), llvm::dwarf::DW_MACINFO_define, llvm::dwarf::DW_MACINFO_undef, llvm::MDNode::get(), and Name.

◆ createMemberPointerType()

DIDerivedType * DIBuilder::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.

Parameters
PointeeTyType pointed to by this pointer.
SizeInBitsSize.
AlignInBitsAlignment. (optional)
ClassType for which this pointer points to members of.

Definition at line 358 of file DIBuilder.cpp.

References llvm::sampleprof::Base, and llvm::MDNode::get().

◆ createMemberType() [1/2]

DIDerivedType * DIBuilder::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.

Parameters
ScopeMember scope.
NameMember name.
FileFile where this member is defined.
LineNoLine number.
SizeInBitsMember size.
AlignInBitsMember alignment.
OffsetInBitsMember offset.
FlagsFlags to encode member attribute, e.g. private
TyParent type.
AnnotationsMember annotations.

Definition at line 431 of file DIBuilder.cpp.

References llvm::MDNode::get(), getNonCompileUnitScope(), and Name.

Referenced by buildFrameDebugInfo(), and solveDIType().

◆ createMemberType() [2/2]

DIDerivedType * DIBuilder::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.

Parameters
ScopeMember scope.
NameMember name.
FileFile where this member is defined.
LineNoLine number.
SizeInBitsMember size.
AlignInBitsMember alignment.
OffsetInBitsMember offset.
FlagsFlags to encode member attribute, e.g. private
TyParent type.
AnnotationsMember annotations.

Definition at line 421 of file DIBuilder.cpp.

References llvm::MDNode::get(), getNonCompileUnitScope(), and Name.

◆ createMethod()

DISubprogram * DIBuilder::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.

See comments in DISubprogram* for descriptions of these fields.

Parameters
ScopeFunction scope.
NameFunction name.
LinkageNameMangled function name.
FileFile where this variable is defined.
LineNoLine number.
TyFunction type.
VTableIndexIndex no of this method in virtual table, or -1u if unrepresentable.
ThisAdjustmentMS ABI-specific adjustment of 'this' that occurs in the prologue.
VTableHolderType that holds vtable.
Flagse.g. is this function prototyped or not. This flags are used to emit dwarf attributes.
SPFlagsAdditional flags specific to subprograms.
TParamsFunction template parameters.
ThrownTypesException types this function may throw.
UseKeyInstructionsEnable Key Instructions debug info.

Definition at line 1011 of file DIBuilder.cpp.

References assert(), Context, F, getNonCompileUnitScope(), getSubprogram(), llvm::LinkageName, and Name.

◆ createModule()

DIModule * DIBuilder::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.

Parameters
ScopeParent scope
NameName of this module
ConfigurationMacrosA space-separated shell-quoted list of -D macro definitions as they would appear on a command line.
IncludePathThe path to the module map file.
APINotesFileThe path to an API notes file for this module.
FileSource file of the module. Used for Fortran modules.
LineNoSource line number of the module. Used for Fortran modules.
IsDeclThis is a module declaration; default to false; when set to true, only Scope and Name are required as this entry is just a hint for the debugger to find the corresponding definition in the global scope.

Definition at line 1052 of file DIBuilder.cpp.

References llvm::MDNode::get(), getNonCompileUnitScope(), and Name.

◆ createNameSpace()

DINamespace * DIBuilder::createNameSpace ( DIScope Scope,
StringRef  Name,
bool  ExportSymbols 
)

This creates new descriptor for a namespace with the specified parent scope.

Parameters
ScopeNamespace scope
NameName of this namespace
ExportSymbolsTrue for C++ inline namespaces.

Definition at line 1040 of file DIBuilder.cpp.

References llvm::MDNode::get(), getNonCompileUnitScope(), and Name.

◆ createNullPtrType()

DIBasicType * DIBuilder::createNullPtrType ( )

Create C++11 nullptr type.

Definition at line 261 of file DIBuilder.cpp.

References createUnspecifiedType().

◆ createObjCIVar()

DIDerivedType * DIBuilder::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.

Parameters
NameMember name.
FileFile where this member is defined.
LineNoLine number.
SizeInBitsMember size.
AlignInBitsMember alignment.
OffsetInBitsMember offset.
FlagsFlags to encode member attribute, e.g. private
TyParent type.
PropertyNodeProperty associated with this ivar.

Definition at line 515 of file DIBuilder.cpp.

References llvm::MDNode::get(), getNonCompileUnitScope(), and Name.

◆ createObjCProperty()

DIObjCProperty * DIBuilder::createObjCProperty ( StringRef  Name,
DIFile File,
unsigned  LineNumber,
StringRef  GetterName,
StringRef  SetterName,
unsigned  PropertyAttributes,
DIType Ty 
)

Create debugging information entry for Objective-C property.

Parameters
NameProperty name.
FileFile where this property is defined.
LineNumberLine number.
GetterNameName of the Objective C property getter selector.
SetterNameName of the Objective C property setter selector.
PropertyAttributesObjective C property attributes.
TyType.

Definition at line 526 of file DIBuilder.cpp.

References llvm::MDNode::get(), and Name.

◆ createObjectPointerType()

DIType * DIBuilder::createObjectPointerType ( DIType Ty,
bool  Implicit 
)
static

Create a uniqued clone of Ty with FlagObjectPointer set.

If Implicit is true, also set FlagArtificial.

Definition at line 749 of file DIBuilder.cpp.

References createTypeWithFlags(), and llvm::DIType::isObjectPointer().

◆ createParameterVariable()

DILocalVariable * DIBuilder::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.

Scope must be a DILocalScope, and thus its scope chain eventually leads to a DISubprogram.

ArgNo is the index (starting from 1) of this variable in the subprogram parameters. ArgNo should not conflict with other parameters of the same subprogram.

If AlwaysPreserve, this variable will be referenced from its containing subprogram, and will survive some optimizations.

Definition at line 936 of file DIBuilder.cpp.

References assert(), createLocalVariable(), and Name.

◆ createPointerType()

DIDerivedType * DIBuilder::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.

Parameters
PointeeTyType pointed by this pointer.
SizeInBitsSize.
AlignInBitsAlignment. (optional)
DWARFAddressSpaceDWARF address space. (optional)
NamePointer type name. (optional)
AnnotationsMember annotations.

Definition at line 347 of file DIBuilder.cpp.

References llvm::MDNode::get(), and Name.

Referenced by buildFrameDebugInfo(), and solveDIType().

◆ createPtrAuthQualifiedType()

DIDerivedType * DIBuilder::createPtrAuthQualifiedType ( DIType FromTy,
unsigned  Key,
bool  IsAddressDiscriminated,
unsigned  ExtraDiscriminator,
bool  IsaPointer,
bool  authenticatesNullValues 
)

Create a __ptrauth qualifier.

Definition at line 333 of file DIBuilder.cpp.

References llvm::MDNode::get().

◆ createQualifiedType()

DIDerivedType * DIBuilder::createQualifiedType ( unsigned  Tag,
DIType FromTy 
)

Create debugging information entry for a qualified type, e.g.

'const int'.

Parameters
TagTag identifing type, e.g. dwarf::TAG_volatile_type
FromTyBase Type.

Definition at line 327 of file DIBuilder.cpp.

References llvm::MDNode::get().

◆ createRationalFixedPointType()

DIFixedPointType * DIBuilder::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.

Parameters
NameType name.
EncodingDWARF encoding code, either dwarf::DW_ATE_signed_fixed or DW_ATE_unsigned_fixed.
FlagsOptional DWARF attributes, e.g., DW_AT_endianity.
NumeratorNumerator of scale factor.
DenominatorDenominator of scale factor.

Definition at line 295 of file DIBuilder.cpp.

References llvm::DIFixedPointType::FixedPointRational, llvm::MDNode::get(), and Name.

◆ createReferenceType()

DIDerivedType * DIBuilder::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.

Definition at line 370 of file DIBuilder.cpp.

References assert(), and llvm::MDNode::get().

◆ createReplaceableCompositeType()

DICompositeType * DIBuilder::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.

Definition at line 785 of file DIBuilder.cpp.

References F, getNonCompileUnitScope(), llvm::MDNode::getTemporary(), Name, and RetTy.

◆ createSetType()

DIDerivedType * DIBuilder::createSetType ( DIScope Scope,
StringRef  Name,
DIFile File,
unsigned  LineNo,
uint64_t  SizeInBits,
uint32_t  AlignInBits,
DIType Ty 
)

Create debugging information entry for a set.

Parameters
ScopeScope in which this set is defined.
NameSet name.
FileFile where this set is defined.
LineNoLine number.
SizeInBitsSet size.
AlignInBitsSet alignment.
TyBase type of the set.

Definition at line 673 of file DIBuilder.cpp.

References llvm::MDNode::get(), getNonCompileUnitScope(), and Name.

◆ createStaticMemberType()

DIDerivedType * DIBuilder::createStaticMemberType ( DIScope Scope,
StringRef  Name,
DIFile File,
unsigned  LineNo,
DIType Ty,
DINode::DIFlags  Flags,
llvm::Constant Val,
unsigned  Tag,
uint32_t  AlignInBits = 0 
)

Create debugging information entry for a C++ static data member.

Parameters
ScopeMember scope.
NameMember name.
FileFile where this member is declared.
LineNoLine number.
TyType of the static member.
FlagsFlags to encode member attribute, e.g. private.
ValConst initializer of the member.
TagDWARF tag of the static member.
AlignInBitsMember alignment.

Definition at line 503 of file DIBuilder.cpp.

References llvm::MDNode::get(), getConstantOrNull(), getNonCompileUnitScope(), and Name.

◆ createStringType() [1/3]

DIStringType * DIBuilder::createStringType ( StringRef  Name,
DIExpression StringLengthExp,
DIExpression StrLocationExp = nullptr 
)

Create debugging information entry for Fortran assumed length string type.

Parameters
NameType name.
StringLengthExpString length expressed in DIExpression form.
StrLocationExpOptional memory location of the string.

Definition at line 319 of file DIBuilder.cpp.

References assert(), llvm::MDNode::get(), and Name.

◆ createStringType() [2/3]

DIStringType * DIBuilder::createStringType ( StringRef  Name,
DIVariable StringLength,
DIExpression StrLocationExp = nullptr 
)

Create debugging information entry for Fortran assumed length string type.

Parameters
NameType name.
StringLengthString length expressed as DIVariable *.
StrLocationExpOptional memory location of the string.

Definition at line 311 of file DIBuilder.cpp.

References assert(), llvm::MDNode::get(), and Name.

◆ createStringType() [3/3]

DIStringType * DIBuilder::createStringType ( StringRef  Name,
uint64_t  SizeInBits 
)

Create debugging information entry for a string type.

Parameters
NameType name.
SizeInBitsSize of the type.

Definition at line 305 of file DIBuilder.cpp.

References assert(), llvm::MDNode::get(), and Name.

◆ createStructType() [1/2]

DICompositeType * DIBuilder::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.

Parameters
ScopeScope in which this struct is defined.
NameStruct name.
FileFile where this member is defined.
LineNumberLine number.
SizeInBitsMember size.
AlignInBitsMember alignment.
FlagsFlags to encode member attribute, e.g. private
ElementsStruct elements.
RunTimeLangOptional parameter, Objective-C runtime version.
UniqueIdentifierA unique identifier for the struct.
SpecificationThe type that this type completes. This is used by Swift to represent generic types.
NumExtraInhabitantsThe number of extra inhabitants of the type. An extra inhabitant is a bit pattern that does not represent a valid value for instances of a given type. This is used by the Swift language.

Definition at line 592 of file DIBuilder.cpp.

References Context, llvm::MDNode::get(), getNonCompileUnitScope(), and Name.

Referenced by buildFrameDebugInfo(), and solveDIType().

◆ createStructType() [2/2]

DICompositeType * DIBuilder::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.

Parameters
ScopeScope in which this struct is defined.
NameStruct name.
FileFile where this member is defined.
LineNumberLine number.
SizeInBitsMember size.
AlignInBitsMember alignment.
FlagsFlags to encode member attribute, e.g. private
ElementsStruct elements.
RunTimeLangOptional parameter, Objective-C runtime version.
UniqueIdentifierA unique identifier for the struct.
SpecificationThe type that this type completes. This is used by Swift to represent generic types.
NumExtraInhabitantsThe number of extra inhabitants of the type. An extra inhabitant is a bit pattern that does not represent a valid value for instances of a given type. This is used by the Swift language.

Definition at line 608 of file DIBuilder.cpp.

References Context, llvm::MDNode::get(), getNonCompileUnitScope(), and Name.

◆ createSubrangeType()

DISubrangeType * DIBuilder::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.

Parameters
ScopeScope in which this set is defined.
NameSet name.
FileFile where this set is defined.
LineNoLine number.
SizeInBitsSize.
AlignInBitsAlignment.
FlagsFlags to encode attributes.
TyBase type.
LowerBoundLower bound.
UpperBoundUpper bound.
StrideStride, if any.
BiasBias, if any.

Definition at line 852 of file DIBuilder.cpp.

References llvm::MDNode::get(), and Name.

◆ createSubroutineType()

DISubroutineType * DIBuilder::createSubroutineType ( DITypeRefArray  ParameterTypes,
DINode::DIFlags  Flags = DINode::FlagZero,
unsigned  CC = 0 
)

Create subroutine type.

Parameters
ParameterTypesAn array of subroutine parameter types. This includes return type at 0th index.
FlagsE.g.: LValueReference. These flags are used to emit dwarf attributes.
CCCalling convention, e.g. dwarf::DW_CC_normal

Definition at line 652 of file DIBuilder.cpp.

References llvm::MDNode::get().

Referenced by createBPFUnreachable(), and fixupDebugInfoPostExtraction().

◆ createTempFunctionFwdDecl()

DISubprogram * DIBuilder::createTempFunctionFwdDecl ( DIScope Scope,
StringRef  Name,
StringRef  LinkageName,
DIFile File,
unsigned  LineNo,
DISubroutineType Ty,
unsigned  ScopeLine,
DINode::DIFlags  Flags = DINode::FlagZero,
DISubprogram::DISPFlags  SPFlags = DISubprogram::SPFlagZero,
DITemplateParameterArray  TParams = nullptr,
DISubprogram Decl = nullptr,
DITypeArray  ThrownTypes = nullptr 
)

Identical to createFunction, except that the resulting DbgNode is meant to be RAUWed.

Definition at line 996 of file DIBuilder.cpp.

References Context, getNonCompileUnitScope(), llvm::MDNode::getTemporary(), llvm::LinkageName, and Name.

◆ createTempGlobalVariableFwdDecl()

DIGlobalVariable * DIBuilder::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 RAUWed.

Definition at line 890 of file DIBuilder.cpp.

References checkGlobalVariableScope(), Context, F, llvm::MDNode::getTemporary(), llvm::LinkageName, and Name.

◆ createTemplateAlias()

DIDerivedType * DIBuilder::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.

Parameters
TyOriginal type.
NameAlias name.
FileFile where this type is defined.
LineNoLine number.
ContextThe surrounding context for the alias.
TParamsThe template arguments.
AlignInBitsAlignment. (optional)
FlagsFlags to describe inheritance attribute (optional), e.g. private.
AnnotationsAnnotations. (optional)

Definition at line 391 of file DIBuilder.cpp.

References Context, llvm::MDNode::get(), getNonCompileUnitScope(), and Name.

◆ createTemplateParameterPack()

DITemplateValueParameter * DIBuilder::createTemplateParameterPack ( DIScope Scope,
StringRef  Name,
DIType Ty,
DINodeArray  Val 
)

Create debugging information for a template parameter pack.

Parameters
ScopeScope in which this type is defined.
NameValue parameter name.
TyParameter type.
ValAn array of types in the pack.

Definition at line 567 of file DIBuilder.cpp.

References Context, createTemplateValueParameterHelper(), llvm::MDNode::get(), and Name.

◆ createTemplateTemplateParameter()

DITemplateValueParameter * DIBuilder::createTemplateTemplateParameter ( DIScope Scope,
StringRef  Name,
DIType Ty,
StringRef  Val,
bool  IsDefault = false 
)

Create debugging information for a template template parameter.

Parameters
ScopeScope in which this type is defined.
NameValue parameter name.
TyParameter type.
ValThe fully qualified name of the template.
IsDefaultParameter is default or not.

Definition at line 558 of file DIBuilder.cpp.

References Context, createTemplateValueParameterHelper(), llvm::MDString::get(), and Name.

◆ createTemplateTypeParameter()

DITemplateTypeParameter * DIBuilder::createTemplateTypeParameter ( DIScope Scope,
StringRef  Name,
DIType Ty,
bool  IsDefault 
)

Create debugging information for template type parameter.

Parameters
ScopeScope in which this type is defined.
NameType parameter name.
TyParameter type.
IsDefaultParameter is default or not

Definition at line 534 of file DIBuilder.cpp.

References assert(), Context, llvm::MDNode::get(), and Name.

◆ createTemplateValueParameter()

DITemplateValueParameter * DIBuilder::createTemplateValueParameter ( DIScope Scope,
StringRef  Name,
DIType Ty,
bool  IsDefault,
Constant Val 
)

Create debugging information for template value parameter.

Parameters
ScopeScope in which this type is defined.
NameValue parameter name.
TyParameter type.
IsDefaultParameter is default or not
ValConstant parameter value.

Definition at line 549 of file DIBuilder.cpp.

References Context, createTemplateValueParameterHelper(), getConstantOrNull(), and Name.

◆ createTempMacroFile()

DIMacroFile * DIBuilder::createTempMacroFile ( DIMacroFile Parent,
unsigned  Line,
DIFile File 
)

Create debugging information temporary entry for a macro file.

List of macro node direct children will be calculated by DIBuilder, using the Parent relationship.

Parameters
ParentMacro file parent (could be nullptr).
LineSource line number where the macro file is included.
FileFile descriptor containing the name of the macro file.

Definition at line 231 of file DIBuilder.cpp.

References llvm::dwarf::DW_MACINFO_start_file, and llvm::MDNode::getTemporary().

◆ createTypedef()

DIDerivedType * DIBuilder::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.

Parameters
TyOriginal type.
NameTypedef name.
FileFile where this type is defined.
LineNoLine number.
ContextThe surrounding context for the typedef.
AlignInBitsAlignment. (optional)
FlagsFlags to describe inheritance attribute, e.g. private
AnnotationsAnnotations. (optional)

Definition at line 379 of file DIBuilder.cpp.

References Context, llvm::MDNode::get(), getNonCompileUnitScope(), and Name.

◆ createUnionType()

DICompositeType * DIBuilder::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.

Parameters
ScopeScope in which this union is defined.
NameUnion name.
FileFile where this member is defined.
LineNumberLine number.
SizeInBitsMember size.
AlignInBitsMember alignment.
FlagsFlags to encode member attribute, e.g. private
ElementsUnion elements.
RunTimeLangOptional parameter, Objective-C runtime version.
UniqueIdentifierA unique identifier for the union.

Definition at line 624 of file DIBuilder.cpp.

References llvm::MDNode::get(), getNonCompileUnitScope(), and Name.

◆ createUnspecifiedParameter()

DIBasicType * DIBuilder::createUnspecifiedParameter ( )

Create unspecified parameter type for a subroutine type.

Definition at line 769 of file DIBuilder.cpp.

◆ createUnspecifiedType()

DIBasicType * DIBuilder::createUnspecifiedType ( StringRef  Name)

Create a DWARF unspecified type.

Definition at line 256 of file DIBuilder.cpp.

References assert(), llvm::MDNode::get(), and Name.

Referenced by createNullPtrType().

◆ createVariantMemberType() [1/2]

DIDerivedType * DIBuilder::createVariantMemberType ( DIScope Scope,
DINodeArray  Elements,
Constant Discriminant,
DIType Ty 
)

Create debugging information entry for a variant.

A variant created this way "inlines" multiple members into the enclosing variant part.

Parameters
ScopeScope in which this variant is defined.
ElementsVariant elements.
DiscriminantThe discriminant for this branch; null for the default branch. This may be a ConstantDataArray if the variant applies for multiple discriminants.
TyParent type.

Definition at line 460 of file DIBuilder.cpp.

References createVariantMemberType(), llvm::MDNode::get(), and getNonCompileUnitScope().

◆ createVariantMemberType() [2/2]

DIDerivedType * DIBuilder::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.

A variant normally should be a member of a variant part.

Parameters
ScopeMember scope.
NameMember name.
FileFile where this member is defined.
LineNoLine number.
SizeInBitsMember size.
AlignInBitsMember alignment.
OffsetInBitsMember offset.
FlagsFlags to encode member attribute, e.g. private
DiscriminantThe discriminant for this branch; null for the default branch. This may be a ConstantDataArray if the variant applies for multiple discriminants.
TyParent type.

Definition at line 447 of file DIBuilder.cpp.

References assert(), llvm::MDNode::get(), getConstantOrNull(), getNonCompileUnitScope(), and Name.

Referenced by createVariantMemberType().

◆ createVariantPart()

DICompositeType * DIBuilder::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.

A variant part normally has a discriminator (though this is not required) and a number of variant children.

Parameters
ScopeScope in which this union is defined.
NameUnion name.
FileFile where this member is defined.
LineNumberLine number.
SizeInBitsMember size.
AlignInBitsMember alignment.
FlagsFlags to encode member attribute, e.g. private
DiscriminatorDiscriminant member
ElementsVariant elements.
UniqueIdentifierA unique identifier for the union.

Definition at line 638 of file DIBuilder.cpp.

References llvm::MDNode::get(), getNonCompileUnitScope(), and Name.

◆ createVectorType()

DICompositeType * DIBuilder::createVectorType ( uint64_t  Size,
uint32_t  AlignInBits,
DIType Ty,
DINodeArray  Subscripts 
)

Create debugging information entry for a vector type.

Parameters
SizeArray size.
AlignInBitsAlignment.
TyElement type.
SubscriptsSubscripts.

Definition at line 720 of file DIBuilder.cpp.

References llvm::MDNode::get(), and Size.

◆ finalize()

void DIBuilder::finalize ( )

◆ finalizeSubprogram()

void DIBuilder::finalizeSubprogram ( DISubprogram SP)

Finalize a specific subprogram - no new variables may be added to this subprogram afterwards.

Definition at line 54 of file DIBuilder.cpp.

References llvm::MDTuple::get().

Referenced by finalize(), and fixupDebugInfoPostExtraction().

◆ getOrCreateArray()

DINodeArray DIBuilder::getOrCreateArray ( ArrayRef< Metadata * >  Elements)

Get a DINodeArray, create one if required.

Definition at line 801 of file DIBuilder.cpp.

References llvm::MDTuple::get().

Referenced by buildFrameDebugInfo(), and solveDIType().

◆ getOrCreateGenericSubrange()

DIGenericSubrange * DIBuilder::getOrCreateGenericSubrange ( DIGenericSubrange::BoundType  Count,
DIGenericSubrange::BoundType  LowerBound,
DIGenericSubrange::BoundType  UpperBound,
DIGenericSubrange::BoundType  Stride 
)

Definition at line 840 of file DIBuilder.cpp.

References llvm::MDNode::get().

◆ getOrCreateMacroArray()

DIMacroNodeArray DIBuilder::getOrCreateMacroArray ( ArrayRef< Metadata * >  Elements)

Get a DIMacroNodeArray, create one if required.

Definition at line 806 of file DIBuilder.cpp.

References llvm::MDTuple::get().

Referenced by finalize().

◆ getOrCreateSubrange() [1/3]

DISubrange * DIBuilder::getOrCreateSubrange ( int64_t  Lo,
int64_t  Count 
)

Create a descriptor for a value range.

This implicitly uniques the values returned.

Definition at line 821 of file DIBuilder.cpp.

References llvm::ConstantAsMetadata::get(), llvm::MDNode::get(), llvm::Type::getInt64Ty(), llvm::ConstantInt::getSigned(), and llvm::Lo.

Referenced by solveDIType().

◆ getOrCreateSubrange() [2/3]

DISubrange * DIBuilder::getOrCreateSubrange ( int64_t  Lo,
Metadata CountNode 
)

◆ getOrCreateSubrange() [3/3]

DISubrange * DIBuilder::getOrCreateSubrange ( Metadata Count,
Metadata LowerBound,
Metadata UpperBound,
Metadata Stride 
)

Definition at line 835 of file DIBuilder.cpp.

References llvm::MDNode::get().

◆ getOrCreateTypeArray()

DITypeRefArray DIBuilder::getOrCreateTypeArray ( ArrayRef< Metadata * >  Elements)

Get a DITypeRefArray, create one if required.

Definition at line 810 of file DIBuilder.cpp.

References llvm::MDNode::get(), and llvm::SmallVectorTemplateBase< T, bool >::push_back().

Referenced by createBPFUnreachable(), and fixupDebugInfoPostExtraction().

◆ insertDbgAssign()

DbgInstPtr DIBuilder::insertDbgAssign ( Instruction LinkedInstr,
Value Val,
DILocalVariable SrcVar,
DIExpression ValExpr,
Value Addr,
DIExpression AddrExpr,
const DILocation DL 
)

Insert a new llvm.dbg.assign intrinsic call.

Parameters
LinkedInstrInstruction with a DIAssignID to link with the new intrinsic. The intrinsic will be inserted after this instruction.
ValThe value component of this dbg.assign.
SrcVarVariable's debug info descriptor.
ValExprA complex location expression to modify Val.
AddrThe address component (store destination).
AddrExprA complex location expression to modify Addr. NOTE: ValExpr carries the FragInfo for the variable.
DLDebug info location, usually: (line: 0, column: 0, scope: var-decl-scope). See getDebugValueLoc.

Definition at line 1086 of file DIBuilder.cpp.

References Addr, assert(), llvm::DbgVariableRecord::createDVRAssign(), DL, llvm::ilist_node_impl< OptionsT >::getIterator(), and llvm::Instruction::getMetadata().

Referenced by migrateDebugInfo().

◆ insertDbgValueIntrinsic()

DbgInstPtr DIBuilder::insertDbgValueIntrinsic ( llvm::Value Val,
DILocalVariable VarInfo,
DIExpression Expr,
const DILocation DL,
InsertPosition  InsertPt 
)

Insert a new llvm.dbg.value intrinsic call.

Parameters
Valllvm::Value of the variable
VarInfoVariable's debug info descriptor.
ExprA complex location expression.
DLDebug info location.
InsertPtLocation for the new intrinsic.

Definition at line 1117 of file DIBuilder.cpp.

References llvm::DbgVariableRecord::createDbgVariableRecord(), and DL.

Referenced by fixupDebugInfoPostExtraction().

◆ insertDeclare() [1/2]

DbgInstPtr DIBuilder::insertDeclare ( llvm::Value Storage,
DILocalVariable VarInfo,
DIExpression Expr,
const DILocation DL,
BasicBlock InsertAtEnd 
)

Insert a new llvm.dbg.declare intrinsic call.

Parameters
Storagellvm::Value of the variable
VarInfoVariable's debug info descriptor.
ExprA complex location expression.
DLDebug info location.
InsertAtEndLocation for the new intrinsic.

Definition at line 1075 of file DIBuilder.cpp.

References DL, llvm::BasicBlock::end(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::BasicBlock::getTerminator(), and insertDeclare().

Referenced by fixupDebugInfoPostExtraction(), and insertDeclare().

◆ insertDeclare() [2/2]

DbgInstPtr DIBuilder::insertDeclare ( llvm::Value Storage,
DILocalVariable VarInfo,
DIExpression Expr,
const DILocation DL,
InsertPosition  InsertPt 
)

Insert a new llvm.dbg.declare intrinsic call.

Parameters
Storagellvm::Value of the variable
VarInfoVariable's debug info descriptor.
ExprA complex location expression.
DLDebug info location.
InsertPtLocation for the new intrinsic.

Definition at line 1128 of file DIBuilder.cpp.

References assert(), llvm::DbgVariableRecord::createDVRDeclare(), DL, llvm::DILocalVariable::getScope(), and llvm::DILocalScope::getSubprogram().

◆ insertLabel()

DbgInstPtr DIBuilder::insertLabel ( DILabel LabelInfo,
const DILocation DL,
InsertPosition  InsertPt 
)

Insert a new llvm.dbg.label intrinsic call.

Parameters
LabelInfoLabel's debug info descriptor.
DLDebug info location.
InsertBeforeLocation for the new intrinsic.

Definition at line 1180 of file DIBuilder.cpp.

References assert(), DL, llvm::InsertPosition::getBasicBlock(), llvm::DILabel::getScope(), llvm::DILocalScope::getSubprogram(), llvm::BasicBlock::insertDbgRecordBefore(), and llvm::InsertPosition::isValid().

◆ operator=()

DIBuilder & llvm::DIBuilder::operator= ( const DIBuilder )
delete

◆ replaceArrays()

void DIBuilder::replaceArrays ( DICompositeType *&  T,
DINodeArray  Elements,
DINodeArray  TParams = DINodeArray() 
)

Replace arrays on a composite type.

If T is resolved, but the arrays aren't – which can happen if T has a self-reference – DIBuilder needs to track the array to resolve cycles.

Definition at line 1216 of file DIBuilder.cpp.

References N.

Referenced by buildFrameDebugInfo(), and solveDIType().

◆ replaceTemporary()

template<class NodeTy >
NodeTy * llvm::DIBuilder::replaceTemporary ( TempMDNode &&  N,
NodeTy *  Replacement 
)
inline

Replace a temporary node.

Call MDNode::replaceAllUsesWith() on N, replacing it with Replacement.

If Replacement is the same as N.get(), instead call MDNode::replaceWithUniqued(). In this case, the uniqued node could have a different address, so we return the final address.

Definition at line 1196 of file DIBuilder.h.

References N, and llvm::MDNode::replaceWithUniqued().

Referenced by finalize().

◆ replaceVTableHolder()

void DIBuilder::replaceVTableHolder ( DICompositeType *&  T,
DIType VTableHolder 
)

Replace the vtable holder in the given type.

If this creates a self reference, it may orphan some unresolved cycles in the operands of T, so DIBuilder needs to track that.

Definition at line 1197 of file DIBuilder.cpp.

References N.

◆ retainType()

void DIBuilder::retainType ( DIScope T)

Retain DIScope* in a module even if it is not referenced through debug info anchors.

Definition at line 761 of file DIBuilder.cpp.

References assert().


The documentation for this class was generated from the following files: