LLVM  6.0.0svn
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)
 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, bool GnuPubnames=false)
 A CompileUnit provides an anchor for all debugging information generated during this instance of compilation. More...
 
DIFilecreateFile (StringRef Filename, StringRef Directory, DIFile::ChecksumKind CSKind=DIFile::CSK_None, StringRef Checksum=StringRef())
 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)
 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)
 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, 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...
 
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...
 
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="")
 Create debugging information entry for an enumeration. More...
 
DISubroutineTypecreateSubroutineType (DITypeRefArray ParameterTypes, DINode::DIFlags Flags=DINode::FlagZero, unsigned CC=0)
 Create subroutine type. More...
 
DITypecreateArtificialType (DIType *Ty)
 Create a new DIType* with "artificial" flag set. More...
 
DITypecreateObjectPointerType (DIType *Ty)
 Create a new DIType* with the "object pointer" flag set. 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...
 
DIGlobalVariableExpressioncreateGlobalVariableExpression (DIScope *Context, StringRef Name, StringRef LinkageName, DIFile *File, unsigned LineNo, DIType *Ty, bool isLocalToUnit, DIExpression *Expr=nullptr, MDNode *Decl=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, 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...
 
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, bool isLocalToUnit, bool isDefinition, unsigned ScopeLine, DINode::DIFlags Flags=DINode::FlagZero, bool isOptimized=false, 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, bool isLocalToUnit, bool isDefinition, unsigned ScopeLine, DINode::DIFlags Flags=DINode::FlagZero, bool isOptimized=false, 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, bool isLocalToUnit, bool isDefinition, unsigned Virtuality=0, unsigned VTableIndex=0, int ThisAdjustment=0, DIType *VTableHolder=nullptr, DINode::DIFlags Flags=DINode::FlagZero, bool isOptimized=false, 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...
 
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, DICompositeType *VTableHolder)
 Replace the vtable holder in the given composite 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...
 

Detailed Description

Definition at line 42 of file DIBuilder.h.

Constructor & Destructor Documentation

◆ DIBuilder() [1/2]

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

Construct a builder for a module.

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

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

References llvm::MDNode::get().

◆ createArtificialType()

DIType * DIBuilder::createArtificialType ( DIType Ty)

Create a new DIType* with "artificial" flag set.

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

References createLocalVariable().

◆ createBasicType()

DIBasicType * DIBuilder::createBasicType ( StringRef  Name,
uint64_t  SizeInBits,
unsigned  Encoding 
)

Create debugging information entry for a basic type.

Parameters
NameType name.
SizeInBitsSize of the type.
EncodingDWARF encoding code, e.g. dwarf::DW_ATE_float.

Definition at line 250 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 336 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 419 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,
bool  GnuPubnames = 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.
GnuPubnamesWhether to emit .debug_gnu_pubnames section instead of .debug_pubnames.

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

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.

Definition at line 467 of file DIBuilder.cpp.

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

◆ createEnumerator()

DIEnumerator * DIBuilder::createEnumerator ( StringRef  Name,
int64_t  Val 
)

Create a single enumerator value.

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

References llvm::MDNode::get().

Referenced by llvm::ConvertDebugDeclareToDebugValue(), createExpression(), createGlobalVariableExpression(), and replaceOneDbgValueForAlloca().

◆ createExpression() [2/2]

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

◆ createFile()

DIFile * DIBuilder::createFile ( StringRef  Filename,
StringRef  Directory,
DIFile::ChecksumKind  CSKind = DIFile::CSK_None,
StringRef  Checksum = StringRef() 
)

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

Parameters
FilenameFile name.
DirectoryDirectory.
CSKindChecksum kind (e.g. CSK_None, CSK_MD5, CSK_SHA1, etc.).
ChecksumChecksum data.

Definition at line 206 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 533 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 304 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,
bool  isLocalToUnit,
bool  isDefinition,
unsigned  ScopeLine,
DINode::DIFlags  Flags = DINode::FlagZero,
bool  isOptimized = false,
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.
isLocalToUnitTrue if this function is not externally visible.
isDefinitionTrue if this is a function definition.
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.
isOptimizedTrue if optimization is ON.
TParamsFunction template parameters.
ThrownTypesException types this function may throw.

Definition at line 686 of file DIBuilder.cpp.

References getNonCompileUnitScope(), getSubprogram(), llvm::MDTuple::getTemporary(), llvm::None, and llvm::release.

Referenced by createConstantValueExpression().

◆ createGlobalVariableExpression()

DIGlobalVariableExpression * DIBuilder::createGlobalVariableExpression ( DIScope Context,
StringRef  Name,
StringRef  LinkageName,
DIFile File,
unsigned  LineNo,
DIType Ty,
bool  isLocalToUnit,
DIExpression Expr = nullptr,
MDNode Decl = 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 594 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 194 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 171 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 179 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 187 of file DIBuilder.cpp.

References createImportedModule().

◆ createInheritance()

DIDerivedType * DIBuilder::createInheritance ( DIType Ty,
DIType BaseTy,
uint64_t  BaseOffset,
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.
FlagsFlags to describe inheritance attribute, e.g. private

Definition at line 311 of file DIBuilder.cpp.

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

◆ 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 767 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 761 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 211 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 275 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 319 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,
bool  isLocalToUnit,
bool  isDefinition,
unsigned  Virtuality = 0,
unsigned  VTableIndex = 0,
int  ThisAdjustment = 0,
DIType VTableHolder = nullptr,
DINode::DIFlags  Flags = DINode::FlagZero,
bool  isOptimized = false,
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.
isLocalToUnitTrue if this function is not externally visible..
isDefinitionTrue if this is a function definition.
VirtualityAttributes describing virtualness. e.g. pure virtual function.
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.
isOptimizedTrue if optimization is ON.
TParamsFunction template parameters.
ThrownTypesException types this function may throw.

Definition at line 719 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 753 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 741 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 246 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 362 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 373 of file DIBuilder.cpp.

References llvm::MDNode::get().

◆ createObjectPointerType()

DIType * DIBuilder::createObjectPointerType ( DIType Ty)

Create a new DIType* with the "object pointer" flag set.

Definition at line 514 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 660 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 262 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 257 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 285 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 547 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 350 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 436 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 461 of file DIBuilder.cpp.

References llvm::MDNode::get().

◆ createTempFunctionFwdDecl()

DISubprogram * DIBuilder::createTempFunctionFwdDecl ( DIScope Scope,
StringRef  Name,
StringRef  LinkageName,
DIFile File,
unsigned  LineNo,
DISubroutineType Ty,
bool  isLocalToUnit,
bool  isDefinition,
unsigned  ScopeLine,
DINode::DIFlags  Flags = DINode::FlagZero,
bool  isOptimized = false,
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 705 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,
uint32_t  AlignInBits = 0 
)

Identical to createGlobalVariable except that the resulting DbgNode is temporary and meant to be RAUWed.

Definition at line 611 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 412 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 404 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 381 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 396 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 223 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 296 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 449 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 530 of file DIBuilder.cpp.

◆ createUnspecifiedType()

DIBasicType * DIBuilder::createUnspecifiedType ( StringRef  Name)

Create a DWARF unspecified type.

Definition at line 241 of file DIBuilder.cpp.

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

Referenced by createNullPtrType().

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

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

Referenced by finalize().

◆ getOrCreateArray()

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

Get a DINodeArray, create one if required.

Definition at line 561 of file DIBuilder.cpp.

References llvm::MDTuple::get().

Referenced by finalizeSubprogram().

◆ getOrCreateMacroArray()

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

Get a DIMacroNodeArray, create one if required.

Definition at line 566 of file DIBuilder.cpp.

References llvm::MDTuple::get().

Referenced by finalize().

◆ getOrCreateSubrange()

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

References llvm::MDNode::get().

◆ getOrCreateTypeArray()

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

◆ 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 801 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 791 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 782 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 775 of file DIBuilder.cpp.

References llvm::Instruction::getParent().

◆ 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 896 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 784 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,
DICompositeType VTableHolder 
)

Replace the vtable holder in the given composite 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 876 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 522 of file DIBuilder.cpp.

References assert().


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