LLVM  8.0.0svn
Public Member Functions | Static Public Member Functions | List of all members
llvm::DIBuilder Class Reference

#include "llvm/IR/DIBuilder.h"

Public Member Functions

 DIBuilder (Module &M, bool AllowUnresolved=true, DICompileUnit *CU=nullptr)
 Construct a builder for a module. More...
 
 DIBuilder (const DIBuilder &)=delete
 
DIBuilderoperator= (const DIBuilder &)=delete
 
void finalize ()
 Construct any deferred debug info descriptors. More...
 
void finalizeSubprogram (DISubprogram *SP)
 Finalize a specific subprogram - no new variables may be added to this subprogram afterwards. More...
 
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)
 A CompileUnit provides an anchor for all debugging information generated during this instance of compilation. More...
 
DIFilecreateFile (StringRef Filename, StringRef Directory, Optional< DIFile::ChecksumInfo< StringRef >> Checksum=None, Optional< StringRef > Source=None)
 Create a file descriptor to hold debugging information for a file. More...
 
DIMacrocreateMacro (DIMacroFile *Parent, unsigned Line, unsigned MacroType, StringRef Name, StringRef Value=StringRef())
 Create debugging information entry for a macro. More...
 
DIMacroFilecreateTempMacroFile (DIMacroFile *Parent, unsigned Line, DIFile *File)
 Create debugging information temporary entry for a macro file. More...
 
DIEnumeratorcreateEnumerator (StringRef Name, int64_t Val, bool IsUnsigned=false)
 Create a single enumerator value. More...
 
DIBasicTypecreateUnspecifiedType (StringRef Name)
 Create a DWARF unspecified type. More...
 
DIBasicTypecreateNullPtrType ()
 Create C++11 nullptr type. More...
 
DIBasicTypecreateBasicType (StringRef Name, uint64_t SizeInBits, unsigned Encoding, DINode::DIFlags Flags=DINode::FlagZero)
 Create debugging information entry for a basic type. More...
 
DIDerivedTypecreateQualifiedType (unsigned Tag, DIType *FromTy)
 Create debugging information entry for a qualified type, e.g. More...
 
DIDerivedTypecreatePointerType (DIType *PointeeTy, uint64_t SizeInBits, uint32_t AlignInBits=0, Optional< unsigned > DWARFAddressSpace=None, StringRef Name="")
 Create debugging information entry for a pointer. More...
 
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. More...
 
DIDerivedTypecreateReferenceType (unsigned Tag, DIType *RTy, uint64_t SizeInBits=0, uint32_t AlignInBits=0, Optional< unsigned > DWARFAddressSpace=None)
 Create debugging information entry for a c++ style reference or rvalue reference type. More...
 
DIDerivedTypecreateTypedef (DIType *Ty, StringRef Name, DIFile *File, unsigned LineNo, DIScope *Context)
 Create debugging information entry for a typedef. More...
 
DIDerivedTypecreateFriend (DIType *Ty, DIType *FriendTy)
 Create debugging information entry for a 'friend'. More...
 
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. More...
 
DIDerivedTypecreateMemberType (DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo, uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits, DINode::DIFlags Flags, DIType *Ty)
 Create debugging information entry for a member. More...
 
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. More...
 
DIDerivedTypecreateBitFieldMemberType (DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo, uint64_t SizeInBits, uint64_t OffsetInBits, uint64_t StorageOffsetInBits, DINode::DIFlags Flags, DIType *Ty)
 Create debugging information entry for a bit field member. More...
 
DIDerivedTypecreateStaticMemberType (DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo, DIType *Ty, DINode::DIFlags Flags, Constant *Val, uint32_t AlignInBits=0)
 Create debugging information entry for a C++ static data member. More...
 
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. More...
 
DIObjCPropertycreateObjCProperty (StringRef Name, DIFile *File, unsigned LineNumber, StringRef GetterName, StringRef SetterName, unsigned PropertyAttributes, DIType *Ty)
 Create debugging information entry for Objective-C property. More...
 
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, DIType *VTableHolder=nullptr, MDNode *TemplateParms=nullptr, StringRef UniqueIdentifier="")
 Create debugging information entry for a class. More...
 
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="")
 Create debugging information entry for a struct. More...
 
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. More...
 
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. More...
 
DITemplateTypeParametercreateTemplateTypeParameter (DIScope *Scope, StringRef Name, DIType *Ty)
 Create debugging information for template type parameter. More...
 
DITemplateValueParametercreateTemplateValueParameter (DIScope *Scope, StringRef Name, DIType *Ty, Constant *Val)
 Create debugging information for template value parameter. More...
 
DITemplateValueParametercreateTemplateTemplateParameter (DIScope *Scope, StringRef Name, DIType *Ty, StringRef Val)
 Create debugging information for a template template parameter. More...
 
DITemplateValueParametercreateTemplateParameterPack (DIScope *Scope, StringRef Name, DIType *Ty, DINodeArray Val)
 Create debugging information for a template parameter pack. More...
 
DICompositeTypecreateArrayType (uint64_t Size, uint32_t AlignInBits, DIType *Ty, DINodeArray Subscripts)
 Create debugging information entry for an array. More...
 
DICompositeTypecreateVectorType (uint64_t Size, uint32_t AlignInBits, DIType *Ty, DINodeArray Subscripts)
 Create debugging information entry for a vector type. More...
 
DICompositeTypecreateEnumerationType (DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber, uint64_t SizeInBits, uint32_t AlignInBits, DINodeArray Elements, DIType *UnderlyingType, StringRef UniqueIdentifier="", bool IsFixed=false)
 Create debugging information entry for an enumeration. More...
 
DISubroutineTypecreateSubroutineType (DITypeRefArray ParameterTypes, DINode::DIFlags Flags=DINode::FlagZero, unsigned CC=0)
 Create subroutine type. More...
 
DICompositeTypecreateForwardDecl (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. More...
 
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="")
 Create a temporary forward-declared type. More...
 
void retainType (DIScope *T)
 Retain DIScope* in a module even if it is not referenced through debug info anchors. More...
 
DIBasicTypecreateUnspecifiedParameter ()
 Create unspecified parameter type for a subroutine type. More...
 
DINodeArray getOrCreateArray (ArrayRef< Metadata *> Elements)
 Get a DINodeArray, create one if required. More...
 
DIMacroNodeArray getOrCreateMacroArray (ArrayRef< Metadata *> Elements)
 Get a DIMacroNodeArray, create one if required. More...
 
DITypeRefArray getOrCreateTypeArray (ArrayRef< Metadata *> Elements)
 Get a DITypeRefArray, create one if required. More...
 
DISubrangegetOrCreateSubrange (int64_t Lo, int64_t Count)
 Create a descriptor for a value range. More...
 
DISubrangegetOrCreateSubrange (int64_t Lo, Metadata *CountNode)
 
DIGlobalVariableExpressioncreateGlobalVariableExpression (DIScope *Context, StringRef Name, StringRef LinkageName, DIFile *File, unsigned LineNo, DIType *Ty, bool isLocalToUnit, DIExpression *Expr=nullptr, MDNode *Decl=nullptr, MDTuple *templateParams=nullptr, uint32_t AlignInBits=0)
 Create a new descriptor for the specified variable. More...
 
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. More...
 
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. More...
 
DILabelcreateLabel (DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo, bool AlwaysPreserve=false)
 Create a new descriptor for an label. More...
 
DILocalVariablecreateParameterVariable (DIScope *Scope, StringRef Name, unsigned ArgNo, DIFile *File, unsigned LineNo, DIType *Ty, bool AlwaysPreserve=false, DINode::DIFlags Flags=DINode::FlagZero)
 Create a new descriptor for a parameter variable. More...
 
DIExpressioncreateExpression (ArrayRef< uint64_t > Addr=None)
 Create a new descriptor for the specified variable which has a complex address expression for its address. More...
 
DIExpressioncreateExpression (ArrayRef< int64_t > Addr)
 
DIExpressioncreateConstantValueExpression (uint64_t Val)
 Create an expression for a variable that does not have an address, but does have a constant value. More...
 
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)
 Create a new descriptor for the specified subprogram. More...
 
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. More...
 
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)
 Create a new descriptor for the specified C++ method. More...
 
DINamespacecreateNameSpace (DIScope *Scope, StringRef Name, bool ExportSymbols)
 This creates new descriptor for a namespace with the specified parent scope. More...
 
DIModulecreateModule (DIScope *Scope, StringRef Name, StringRef ConfigurationMacros, StringRef IncludePath, StringRef ISysRoot)
 This creates new descriptor for a module with the specified parent scope. More...
 
DILexicalBlockFilecreateLexicalBlockFile (DIScope *Scope, DIFile *File, unsigned Discriminator=0)
 This creates a descriptor for a lexical block with a new file attached. More...
 
DILexicalBlockcreateLexicalBlock (DIScope *Scope, DIFile *File, unsigned Line, unsigned Col)
 This creates a descriptor for a lexical block with the specified parent context. More...
 
DIImportedEntitycreateImportedModule (DIScope *Context, DINamespace *NS, DIFile *File, unsigned Line)
 Create a descriptor for an imported module. More...
 
DIImportedEntitycreateImportedModule (DIScope *Context, DIImportedEntity *NS, DIFile *File, unsigned Line)
 Create a descriptor for an imported module. More...
 
DIImportedEntitycreateImportedModule (DIScope *Context, DIModule *M, DIFile *File, unsigned Line)
 Create a descriptor for an imported module. More...
 
DIImportedEntitycreateImportedDeclaration (DIScope *Context, DINode *Decl, DIFile *File, unsigned Line, StringRef Name="")
 Create a descriptor for an imported function. More...
 
InstructioninsertDeclare (llvm::Value *Storage, DILocalVariable *VarInfo, DIExpression *Expr, const DILocation *DL, BasicBlock *InsertAtEnd)
 Insert a new llvm.dbg.declare intrinsic call. More...
 
InstructioninsertDeclare (llvm::Value *Storage, DILocalVariable *VarInfo, DIExpression *Expr, const DILocation *DL, Instruction *InsertBefore)
 Insert a new llvm.dbg.declare intrinsic call. More...
 
InstructioninsertLabel (DILabel *LabelInfo, const DILocation *DL, Instruction *InsertBefore)
 Insert a new llvm.dbg.label intrinsic call. More...
 
InstructioninsertLabel (DILabel *LabelInfo, const DILocation *DL, BasicBlock *InsertAtEnd)
 Insert a new llvm.dbg.label intrinsic call. More...
 
InstructioninsertDbgValueIntrinsic (llvm::Value *Val, DILocalVariable *VarInfo, DIExpression *Expr, const DILocation *DL, BasicBlock *InsertAtEnd)
 Insert a new llvm.dbg.value intrinsic call. More...
 
InstructioninsertDbgValueIntrinsic (llvm::Value *Val, DILocalVariable *VarInfo, DIExpression *Expr, const DILocation *DL, Instruction *InsertBefore)
 Insert a new llvm.dbg.value intrinsic call. More...
 
void replaceVTableHolder (DICompositeType *&T, DIType *VTableHolder)
 Replace the vtable holder in the given type. More...
 
void replaceArrays (DICompositeType *&T, DINodeArray Elements, DINodeArray TParams=DINodeArray())
 Replace arrays on a composite type. More...
 
template<class NodeTy >
NodeTy * replaceTemporary (TempMDNode &&N, NodeTy *Replacement)
 Replace a temporary node. More...
 

Static Public Member Functions

static DISubprogramcreateArtificialSubprogram (DISubprogram *SP)
 Create a distinct clone of SP with FlagArtificial set. More...
 
static DITypecreateArtificialType (DIType *Ty)
 Create a uniqued clone of Ty with FlagArtificial set. More...
 
static DITypecreateObjectPointerType (DIType *Ty)
 Create a uniqued clone of Ty with FlagObjectPointer and FlagArtificial set. More...
 

Detailed Description

Definition at line 42 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 34 of file DIBuilder.cpp.

References assert(), llvm::MDNode::isResolved(), and N.

◆ DIBuilder() [2/2]

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

Member Function Documentation

◆ createArrayType()

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

Create debugging information entry for an array.

Parameters
SizeArray size.
AlignInBitsAlignment.
TyElement type.
SubscriptsSubscripts.

Definition at line 518 of file DIBuilder.cpp.

References llvm::MDNode::get().

◆ createArtificialSubprogram()

DISubprogram * DIBuilder::createArtificialSubprogram ( DISubprogram SP)
static

Create a distinct clone of SP with FlagArtificial set.

Definition at line 538 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 549 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 696 of file DIBuilder.cpp.

References createLocalVariable().

◆ createBasicType()

DIBasicType * DIBuilder::createBasicType ( StringRef  Name,
uint64_t  SizeInBits,
unsigned  Encoding,
DINode::DIFlags  Flags = DINode::FlagZero 
)

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.

Definition at line 260 of file DIBuilder.cpp.

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

◆ createBitFieldMemberType()

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 
)

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.

Definition at line 361 of file DIBuilder.cpp.

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

◆ 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,
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.
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 444 of file DIBuilder.cpp.

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

◆ 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 
)

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.

Definition at line 138 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 643 of file DIBuilder.h.

References createFunction(), createImportedDeclaration(), createImportedModule(), createLexicalBlock(), createLexicalBlockFile(), createMethod(), createModule(), createNameSpace(), createTempFunctionFwdDecl(), llvm::MDNode::get(), replaceArrays(), and replaceVTableHolder().

◆ createEnumerationType()

DICompositeType * DIBuilder::createEnumerationType ( DIScope Scope,
StringRef  Name,
DIFile File,
unsigned  LineNumber,
uint64_t  SizeInBits,
uint32_t  AlignInBits,
DINodeArray  Elements,
DIType UnderlyingType,
StringRef  UniqueIdentifier = "",
bool  IsFixed = false 
)

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.
UniqueIdentifierA unique identifier for the enum.
IsFixedBoolean flag indicate if this is C++11/ObjC fixed enum.

Definition at line 504 of file DIBuilder.cpp.

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

◆ createEnumerator()

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

Create a single enumerator value.

Definition at line 245 of file DIBuilder.cpp.

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

◆ createExpression() [1/2]

DIExpression * DIBuilder::createExpression ( ArrayRef< uint64_t >  Addr = None)

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 735 of file DIBuilder.cpp.

References llvm::MDNode::get().

Referenced by createExpression(), createGlobalVariableExpression(), and replaceOneDbgValueForAlloca().

◆ createExpression() [2/2]

DIExpression * DIBuilder::createExpression ( ArrayRef< int64_t >  Addr)

◆ createFile()

DIFile * DIBuilder::createFile ( StringRef  Filename,
StringRef  Directory,
Optional< DIFile::ChecksumInfo< StringRef >>  Checksum = None,
Optional< StringRef Source = None 
)

Create a file descriptor to hold debugging information for a file.

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

Definition at line 214 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 = "" 
)

Create a permanent forward-declared type.

Definition at line 575 of file DIBuilder.cpp.

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

◆ createFriend()

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

Create debugging information entry for a 'friend'.

Definition at line 315 of file DIBuilder.cpp.

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

◆ 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 
)

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.

Definition at line 752 of file DIBuilder.cpp.

Referenced by createConstantValueExpression(), and INITIALIZE_PASS().

◆ createGlobalVariableExpression()

DIGlobalVariableExpression * DIBuilder::createGlobalVariableExpression ( DIScope Context,
StringRef  Name,
StringRef  LinkageName,
DIFile File,
unsigned  LineNo,
DIType Ty,
bool  isLocalToUnit,
DIExpression Expr = nullptr,
MDNode Decl = nullptr,
MDTuple templateParams = nullptr,
uint32_t  AlignInBits = 0 
)

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 640 of file DIBuilder.cpp.

References checkGlobalVariableScope(), createExpression(), llvm::MDNode::get(), llvm::MDNode::getDistinct(), and N.

◆ createImportedDeclaration()

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

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.

Definition at line 202 of file DIBuilder.cpp.

References createImportedModule().

Referenced by createConstantValueExpression().

◆ createImportedModule() [1/3]

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

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.

Definition at line 179 of file DIBuilder.cpp.

References createImportedModule().

Referenced by createConstantValueExpression().

◆ createImportedModule() [2/3]

DIImportedEntity * DIBuilder::createImportedModule ( DIScope Context,
DIImportedEntity NS,
DIFile File,
unsigned  Line 
)

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.

Definition at line 187 of file DIBuilder.cpp.

References createImportedModule().

◆ createImportedModule() [3/3]

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

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.

Definition at line 195 of file DIBuilder.cpp.

References createImportedModule().

◆ 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 322 of file DIBuilder.cpp.

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

◆ createLabel()

DILabel * DIBuilder::createLabel ( DIScope Scope,
StringRef  Name,
DIFile File,
unsigned  LineNo,
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 715 of file DIBuilder.cpp.

References Context, and getNonCompileUnitScope().

◆ 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 835 of file DIBuilder.cpp.

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

Referenced by createConstantValueExpression().

◆ 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 829 of file DIBuilder.cpp.

References llvm::MDNode::get().

Referenced by createConstantValueExpression().

◆ 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 220 of file DIBuilder.cpp.

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

◆ 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 286 of file DIBuilder.cpp.

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

◆ createMemberType()

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 
)

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.

Definition at line 334 of file DIBuilder.cpp.

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

◆ 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 
)

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.

Definition at line 786 of file DIBuilder.cpp.

References assert(), getNonCompileUnitScope(), and getSubprogram().

Referenced by createConstantValueExpression().

◆ createModule()

DIModule * DIBuilder::createModule ( DIScope Scope,
StringRef  Name,
StringRef  ConfigurationMacros,
StringRef  IncludePath,
StringRef  ISysRoot 
)

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.
ISysRootThe clang system root (value of -isysroot).

Definition at line 821 of file DIBuilder.cpp.

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

Referenced by createConstantValueExpression().

◆ 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 809 of file DIBuilder.cpp.

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

Referenced by createConstantValueExpression().

◆ createNullPtrType()

DIBasicType * DIBuilder::createNullPtrType ( )

Create C++11 nullptr type.

Definition at line 256 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 387 of file DIBuilder.cpp.

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

◆ 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 398 of file DIBuilder.cpp.

References llvm::MDNode::get().

◆ createObjectPointerType()

DIType * DIBuilder::createObjectPointerType ( DIType Ty)
static

Create a uniqued clone of Ty with FlagObjectPointer and FlagArtificial set.

Definition at line 556 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 
)

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 706 of file DIBuilder.cpp.

References assert(), and createLocalVariable().

◆ createPointerType()

DIDerivedType * DIBuilder::createPointerType ( DIType PointeeTy,
uint64_t  SizeInBits,
uint32_t  AlignInBits = 0,
Optional< unsigned DWARFAddressSpace = None,
StringRef  Name = "" 
)

Create debugging information entry for a pointer.

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

Definition at line 273 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 268 of file DIBuilder.cpp.

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

◆ createReferenceType()

DIDerivedType * DIBuilder::createReferenceType ( unsigned  Tag,
DIType RTy,
uint64_t  SizeInBits = 0,
uint32_t  AlignInBits = 0,
Optional< unsigned DWARFAddressSpace = None 
)

Create debugging information entry for a c++ style reference or rvalue reference type.

Definition at line 296 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 = "" 
)

Create a temporary forward-declared type.

Definition at line 589 of file DIBuilder.cpp.

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

◆ createStaticMemberType()

DIDerivedType * DIBuilder::createStaticMemberType ( DIScope Scope,
StringRef  Name,
DIFile File,
unsigned  LineNo,
DIType Ty,
DINode::DIFlags  Flags,
llvm::Constant Val,
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.
AlignInBitsMember alignment.

Definition at line 375 of file DIBuilder.cpp.

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

◆ createStructType()

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 = "" 
)

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.

Definition at line 461 of file DIBuilder.cpp.

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

◆ 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 498 of file DIBuilder.cpp.

References llvm::MDNode::get().

Referenced by INITIALIZE_PASS().

◆ 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 771 of file DIBuilder.cpp.

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

Referenced by createConstantValueExpression().

◆ 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 657 of file DIBuilder.cpp.

References checkGlobalVariableScope(), and llvm::MDNode::getTemporary().

◆ 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 437 of file DIBuilder.cpp.

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

◆ createTemplateTemplateParameter()

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

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.

Definition at line 429 of file DIBuilder.cpp.

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

◆ createTemplateTypeParameter()

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

Create debugging information for template type parameter.

Parameters
ScopeScope in which this type is defined.
NameType parameter name.
TyParameter type.

Definition at line 406 of file DIBuilder.cpp.

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

◆ createTemplateValueParameter()

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

Create debugging information for template value parameter.

Parameters
ScopeScope in which this type is defined.
NameValue parameter name.
TyParameter type.
ValConstant parameter value.

Definition at line 421 of file DIBuilder.cpp.

References createTemplateValueParameterHelper(), and getConstantOrNull().

◆ 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 232 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 
)

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.

Definition at line 307 of file DIBuilder.cpp.

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

◆ 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 474 of file DIBuilder.cpp.

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

◆ createUnspecifiedParameter()

DIBasicType * DIBuilder::createUnspecifiedParameter ( )

Create unspecified parameter type for a subroutine type.

Definition at line 572 of file DIBuilder.cpp.

◆ createUnspecifiedType()

DIBasicType * DIBuilder::createUnspecifiedType ( StringRef  Name)

Create a DWARF unspecified type.

Definition at line 251 of file DIBuilder.cpp.

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

Referenced by createNullPtrType().

◆ createVariantMemberType()

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
TyParent type.

Definition at line 351 of file DIBuilder.cpp.

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

◆ 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 486 of file DIBuilder.cpp.

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

◆ 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 528 of file DIBuilder.cpp.

References llvm::MDNode::get().

◆ 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 49 of file DIBuilder.cpp.

References llvm::SmallVectorImpl< T >::append(), llvm::MDNode::get(), llvm::MDNode::isTemporary(), and llvm::AArch64CC::PL.

Referenced by finalize(), and INITIALIZE_PASS().

◆ getOrCreateArray()

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

Get a DINodeArray, create one if required.

Definition at line 603 of file DIBuilder.cpp.

References llvm::MDTuple::get().

◆ getOrCreateMacroArray()

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

Get a DIMacroNodeArray, create one if required.

Definition at line 608 of file DIBuilder.cpp.

References llvm::MDTuple::get().

Referenced by finalize().

◆ getOrCreateSubrange() [1/2]

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 623 of file DIBuilder.cpp.

References llvm::MDNode::get().

◆ getOrCreateSubrange() [2/2]

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

Definition at line 627 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 612 of file DIBuilder.cpp.

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

Referenced by INITIALIZE_PASS().

◆ insertDbgValueIntrinsic() [1/2]

Instruction * DIBuilder::insertDbgValueIntrinsic ( llvm::Value Val,
DILocalVariable VarInfo,
DIExpression Expr,
const DILocation DL,
BasicBlock InsertAtEnd 
)

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.
InsertAtEndLocation for the new intrinsic.

Definition at line 881 of file DIBuilder.cpp.

◆ insertDbgValueIntrinsic() [2/2]

Instruction * DIBuilder::insertDbgValueIntrinsic ( llvm::Value Val,
DILocalVariable VarInfo,
DIExpression Expr,
const DILocation DL,
Instruction InsertBefore 
)

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.
InsertBeforeLocation for the new intrinsic.

Definition at line 871 of file DIBuilder.cpp.

References llvm::Instruction::getParent().

◆ insertDeclare() [1/2]

Instruction * 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 850 of file DIBuilder.cpp.

References llvm::BasicBlock::getTerminator().

◆ insertDeclare() [2/2]

Instruction * DIBuilder::insertDeclare ( llvm::Value Storage,
DILocalVariable VarInfo,
DIExpression Expr,
const DILocation DL,
Instruction InsertBefore 
)

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.
InsertBeforeLocation for the new intrinsic.

Definition at line 843 of file DIBuilder.cpp.

References llvm::Instruction::getParent().

◆ insertLabel() [1/2]

Instruction * DIBuilder::insertLabel ( DILabel LabelInfo,
const DILocation DL,
Instruction InsertBefore 
)

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 859 of file DIBuilder.cpp.

References llvm::Instruction::getParent().

◆ insertLabel() [2/2]

Instruction * DIBuilder::insertLabel ( DILabel LabelInfo,
const DILocation DL,
BasicBlock InsertAtEnd 
)

Insert a new llvm.dbg.label intrinsic call.

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

Definition at line 866 of file DIBuilder.cpp.

◆ 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 994 of file DIBuilder.cpp.

References llvm::TypedTrackingMDRef< T >::get(), llvm::MDNode::isResolved(), N, llvm::DICompositeType::replaceElements(), and llvm::DICompositeType::replaceTemplateParams().

Referenced by createConstantValueExpression().

◆ 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 867 of file DIBuilder.h.

References DEFINE_ISA_CONVERSION_FUNCTIONS, llvm::MDNode::get(), llvm::MDNode::replaceAllUsesWith(), 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 974 of file DIBuilder.cpp.

References llvm::TypedTrackingMDRef< T >::get(), llvm::MDNode::isResolved(), N, llvm::RISCVFenceField::O, llvm::MDNode::operands(), and llvm::DICompositeType::replaceVTableHolder().

Referenced by createConstantValueExpression().

◆ retainType()

void DIBuilder::retainType ( DIScope T)

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

Definition at line 564 of file DIBuilder.cpp.

References assert().


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