LLVM  mainline
Public Types | Public Member Functions
llvm::DIBuilder Class Reference

#include <DIBuilder.h>

List of all members.

Public Types

enum  DebugEmissionKind { FullDebug = 1, LineTablesOnly }

Public Member Functions

 DIBuilder (Module &M, bool AllowUnresolved=true)
 Construct a builder for a module.
void finalize ()
 finalize - Construct any deferred debug info descriptors.
DICompileUnitcreateCompileUnit (unsigned Lang, StringRef File, StringRef Dir, StringRef Producer, bool isOptimized, StringRef Flags, unsigned RV, StringRef SplitName=StringRef(), DebugEmissionKind Kind=FullDebug, uint64_t DWOId=0, bool EmitDebugInfo=true)
 createCompileUnit - A CompileUnit provides an anchor for all debugging information generated during this instance of compilation.
DIFilecreateFile (StringRef Filename, StringRef Directory)
 createFile - Create a file descriptor to hold debugging information for a file.
DIEnumeratorcreateEnumerator (StringRef Name, int64_t Val)
 createEnumerator - Create a single enumerator value.
DIBasicTypecreateUnspecifiedType (StringRef Name)
 Create a DWARF unspecified type.
DIBasicTypecreateNullPtrType ()
 Create C++11 nullptr type.
DIBasicTypecreateBasicType (StringRef Name, uint64_t SizeInBits, uint64_t AlignInBits, unsigned Encoding)
 createBasicType - Create debugging information entry for a basic type.
DIDerivedTypecreateQualifiedType (unsigned Tag, DIType *FromTy)
 createQualifiedType - Create debugging information entry for a qualified type, e.g.
DIDerivedTypecreatePointerType (DIType *PointeeTy, uint64_t SizeInBits, uint64_t AlignInBits=0, StringRef Name="")
 createPointerType - Create debugging information entry for a pointer.
DIDerivedTypecreateMemberPointerType (DIType *PointeeTy, DIType *Class, uint64_t SizeInBits, uint64_t AlignInBits=0)
 Create debugging information entry for a pointer to member.
DIDerivedTypecreateReferenceType (unsigned Tag, DIType *RTy)
 createReferenceType - Create debugging information entry for a c++ style reference or rvalue reference type.
DIDerivedTypecreateTypedef (DIType *Ty, StringRef Name, DIFile *File, unsigned LineNo, DIScope *Context)
 createTypedef - Create debugging information entry for a typedef.
DIDerivedTypecreateFriend (DIType *Ty, DIType *FriendTy)
 createFriend - Create debugging information entry for a 'friend'.
DIDerivedTypecreateInheritance (DIType *Ty, DIType *BaseTy, uint64_t BaseOffset, unsigned Flags)
 createInheritance - Create debugging information entry to establish inheritance relationship between two types.
DIDerivedTypecreateMemberType (DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo, uint64_t SizeInBits, uint64_t AlignInBits, uint64_t OffsetInBits, unsigned Flags, DIType *Ty)
 createMemberType - Create debugging information entry for a member.
DIDerivedTypecreateStaticMemberType (DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo, DIType *Ty, unsigned Flags, llvm::Constant *Val)
 createStaticMemberType - Create debugging information entry for a C++ static data member.
DIDerivedTypecreateObjCIVar (StringRef Name, DIFile *File, unsigned LineNo, uint64_t SizeInBits, uint64_t AlignInBits, uint64_t OffsetInBits, unsigned Flags, DIType *Ty, MDNode *PropertyNode)
 createObjCIVar - Create debugging information entry for Objective-C instance variable.
DIObjCPropertycreateObjCProperty (StringRef Name, DIFile *File, unsigned LineNumber, StringRef GetterName, StringRef SetterName, unsigned PropertyAttributes, DIType *Ty)
 createObjCProperty - Create debugging information entry for Objective-C property.
DICompositeTypecreateClassType (DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber, uint64_t SizeInBits, uint64_t AlignInBits, uint64_t OffsetInBits, unsigned Flags, DIType *DerivedFrom, DINodeArray Elements, DIType *VTableHolder=nullptr, MDNode *TemplateParms=nullptr, StringRef UniqueIdentifier="")
 createClassType - Create debugging information entry for a class.
DICompositeTypecreateStructType (DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber, uint64_t SizeInBits, uint64_t AlignInBits, unsigned Flags, DIType *DerivedFrom, DINodeArray Elements, unsigned RunTimeLang=0, DIType *VTableHolder=nullptr, StringRef UniqueIdentifier="")
 createStructType - Create debugging information entry for a struct.
DICompositeTypecreateUnionType (DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber, uint64_t SizeInBits, uint64_t AlignInBits, unsigned Flags, DINodeArray Elements, unsigned RunTimeLang=0, StringRef UniqueIdentifier="")
 createUnionType - Create debugging information entry for an union.
DITemplateTypeParametercreateTemplateTypeParameter (DIScope *Scope, StringRef Name, DIType *Ty)
 createTemplateTypeParameter - Create debugging information for template type parameter.
DITemplateValueParametercreateTemplateValueParameter (DIScope *Scope, StringRef Name, DIType *Ty, Constant *Val)
 createTemplateValueParameter - Create debugging information for template value parameter.
DITemplateValueParametercreateTemplateTemplateParameter (DIScope *Scope, StringRef Name, DIType *Ty, StringRef Val)
 Create debugging information for a template template parameter.
DITemplateValueParametercreateTemplateParameterPack (DIScope *Scope, StringRef Name, DIType *Ty, DINodeArray Val)
 Create debugging information for a template parameter pack.
DICompositeTypecreateArrayType (uint64_t Size, uint64_t AlignInBits, DIType *Ty, DINodeArray Subscripts)
 createArrayType - Create debugging information entry for an array.
DICompositeTypecreateVectorType (uint64_t Size, uint64_t AlignInBits, DIType *Ty, DINodeArray Subscripts)
 createVectorType - Create debugging information entry for a vector type.
DICompositeTypecreateEnumerationType (DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber, uint64_t SizeInBits, uint64_t AlignInBits, DINodeArray Elements, DIType *UnderlyingType, StringRef UniqueIdentifier="")
 createEnumerationType - Create debugging information entry for an enumeration.
DISubroutineTypecreateSubroutineType (DIFile *File, DITypeRefArray ParameterTypes, unsigned Flags=0)
 createSubroutineType - Create subroutine type.
DITypecreateArtificialType (DIType *Ty)
 createArtificialType - Create a new DIType* with "artificial" flag set.
DITypecreateObjectPointerType (DIType *Ty)
 createObjectPointerType - Create a new DIType* with the "object pointer" flag set.
DICompositeTypecreateForwardDecl (unsigned Tag, StringRef Name, DIScope *Scope, DIFile *F, unsigned Line, unsigned RuntimeLang=0, uint64_t SizeInBits=0, uint64_t AlignInBits=0, StringRef UniqueIdentifier="")
 Create a permanent forward-declared type.
DICompositeTypecreateReplaceableCompositeType (unsigned Tag, StringRef Name, DIScope *Scope, DIFile *F, unsigned Line, unsigned RuntimeLang=0, uint64_t SizeInBits=0, uint64_t AlignInBits=0, unsigned Flags=DINode::FlagFwdDecl, StringRef UniqueIdentifier="")
 Create a temporary forward-declared type.
void retainType (DIType *T)
 retainType - Retain DIType* in a module even if it is not referenced through debug info anchors.
DIBasicTypecreateUnspecifiedParameter ()
 createUnspecifiedParameter - Create unspecified parameter type for a subroutine type.
DINodeArray getOrCreateArray (ArrayRef< Metadata * > Elements)
 getOrCreateArray - Get a DINodeArray, create one if required.
DITypeRefArray getOrCreateTypeArray (ArrayRef< Metadata * > Elements)
 getOrCreateTypeArray - Get a DITypeRefArray, create one if required.
DISubrangegetOrCreateSubrange (int64_t Lo, int64_t Count)
 getOrCreateSubrange - Create a descriptor for a value range.
DIGlobalVariablecreateGlobalVariable (DIScope *Context, StringRef Name, StringRef LinkageName, DIFile *File, unsigned LineNo, DIType *Ty, bool isLocalToUnit, llvm::Constant *Val, MDNode *Decl=nullptr)
 createGlobalVariable - Create a new descriptor for the specified variable.
DIGlobalVariablecreateTempGlobalVariableFwdDecl (DIScope *Context, StringRef Name, StringRef LinkageName, DIFile *File, unsigned LineNo, DIType *Ty, bool isLocalToUnit, llvm::Constant *Val, MDNode *Decl=nullptr)
 createTempGlobalVariableFwdDecl - Identical to createGlobalVariable except that the resulting DbgNode is temporary and meant to be RAUWed.
DILocalVariablecreateLocalVariable (unsigned Tag, DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo, DIType *Ty, bool AlwaysPreserve=false, unsigned Flags=0, unsigned ArgNo=0)
 createLocalVariable - Create a new descriptor for the specified local variable.
DIExpressioncreateExpression (ArrayRef< uint64_t > Addr=None)
 createExpression - Create a new descriptor for the specified variable which has a complex address expression for its address.
DIExpressioncreateExpression (ArrayRef< int64_t > Addr)
DIExpressioncreateBitPieceExpression (unsigned OffsetInBits, unsigned SizeInBits)
 createBitPieceExpression - Create a descriptor to describe one part of aggregate variable that is fragmented across multiple Values.
DISubprogramcreateFunction (DIScope *Scope, StringRef Name, StringRef LinkageName, DIFile *File, unsigned LineNo, DISubroutineType *Ty, bool isLocalToUnit, bool isDefinition, unsigned ScopeLine, unsigned Flags=0, bool isOptimized=false, Function *Fn=nullptr, MDNode *TParam=nullptr, MDNode *Decl=nullptr)
 createFunction - Create a new descriptor for the specified subprogram.
DISubprogramcreateTempFunctionFwdDecl (DIScope *Scope, StringRef Name, StringRef LinkageName, DIFile *File, unsigned LineNo, DISubroutineType *Ty, bool isLocalToUnit, bool isDefinition, unsigned ScopeLine, unsigned Flags=0, bool isOptimized=false, Function *Fn=nullptr, MDNode *TParam=nullptr, MDNode *Decl=nullptr)
 createTempFunctionFwdDecl - Identical to createFunction, except that the resulting DbgNode is meant to be RAUWed.
DISubprogramcreateFunction (DIScopeRef Scope, StringRef Name, StringRef LinkageName, DIFile *File, unsigned LineNo, DISubroutineType *Ty, bool isLocalToUnit, bool isDefinition, unsigned ScopeLine, unsigned Flags=0, bool isOptimized=false, Function *Fn=nullptr, MDNode *TParam=nullptr, MDNode *Decl=nullptr)
 FIXME: this is added for dragonegg.
DISubprogramcreateMethod (DIScope *Scope, StringRef Name, StringRef LinkageName, DIFile *File, unsigned LineNo, DISubroutineType *Ty, bool isLocalToUnit, bool isDefinition, unsigned Virtuality=0, unsigned VTableIndex=0, DIType *VTableHolder=nullptr, unsigned Flags=0, bool isOptimized=false, Function *Fn=nullptr, MDNode *TParam=nullptr)
 createMethod - Create a new descriptor for the specified C++ method.
DINamespacecreateNameSpace (DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo)
 createNameSpace - This creates new descriptor for a namespace with the specified parent scope.
DILexicalBlockFilecreateLexicalBlockFile (DIScope *Scope, DIFile *File, unsigned Discriminator=0)
 createLexicalBlockFile - This creates a descriptor for a lexical block with a new file attached.
DILexicalBlockcreateLexicalBlock (DIScope *Scope, DIFile *File, unsigned Line, unsigned Col)
 createLexicalBlock - This creates a descriptor for a lexical block with the specified parent context.
DIImportedEntitycreateImportedModule (DIScope *Context, DINamespace *NS, unsigned Line)
 Create a descriptor for an imported module.
DIImportedEntitycreateImportedModule (DIScope *Context, DIImportedEntity *NS, unsigned Line)
 Create a descriptor for an imported module.
DIImportedEntitycreateImportedDeclaration (DIScope *Context, DINode *Decl, unsigned Line, StringRef Name="")
 Create a descriptor for an imported function.
InstructioninsertDeclare (llvm::Value *Storage, DILocalVariable *VarInfo, DIExpression *Expr, const DILocation *DL, BasicBlock *InsertAtEnd)
 insertDeclare - Insert a new llvm.dbg.declare intrinsic call.
InstructioninsertDeclare (llvm::Value *Storage, DILocalVariable *VarInfo, DIExpression *Expr, const DILocation *DL, Instruction *InsertBefore)
 insertDeclare - Insert a new llvm.dbg.declare intrinsic call.
InstructioninsertDbgValueIntrinsic (llvm::Value *Val, uint64_t Offset, DILocalVariable *VarInfo, DIExpression *Expr, const DILocation *DL, BasicBlock *InsertAtEnd)
 insertDbgValueIntrinsic - Insert a new llvm.dbg.value intrinsic call.
InstructioninsertDbgValueIntrinsic (llvm::Value *Val, uint64_t Offset, DILocalVariable *VarInfo, DIExpression *Expr, const DILocation *DL, Instruction *InsertBefore)
 insertDbgValueIntrinsic - Insert a new llvm.dbg.value intrinsic call.
void replaceVTableHolder (DICompositeType *&T, DICompositeType *VTableHolder)
 Replace the vtable holder in the given composite type.
void replaceArrays (DICompositeType *&T, DINodeArray Elements, DINodeArray TParems=DINodeArray())
 Replace arrays on a composite type.
template<class NodeTy >
NodeTy * replaceTemporary (TempMDNode &&N, NodeTy *Replacement)
 Replace a temporary node.

Detailed Description

Definition at line 35 of file DIBuilder.h.


Member Enumeration Documentation

Enumerator:
FullDebug 
LineTablesOnly 

Definition at line 76 of file DIBuilder.h.


Constructor & Destructor Documentation

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


Member Function Documentation

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

createArrayType - Create debugging information entry for an array.

Parameters:
SizeArray size.
AlignInBitsAlignment.
TyElement type.
SubscriptsSubscripts.

Definition at line 446 of file DIBuilder.cpp.

References llvm::TypedDINodeRef< T >::get(), and llvm::MDNode::get().

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

Definition at line 474 of file DIBuilder.cpp.

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

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

createBasicType - Create debugging information entry for a basic type.

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

Definition at line 218 of file DIBuilder.cpp.

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

DIExpression * DIBuilder::createBitPieceExpression ( unsigned  OffsetInBits,
unsigned  SizeInBits 
)

createBitPieceExpression - Create a descriptor to describe one part of aggregate variable that is fragmented across multiple Values.

Parameters:
OffsetInBitsOffset of the piece in bits.
SizeInBitsSize of the piece in bits.

Definition at line 618 of file DIBuilder.cpp.

References llvm::MDNode::get().

DICompositeType * DIBuilder::createClassType ( DIScope Scope,
StringRef  Name,
DIFile File,
unsigned  LineNumber,
uint64_t  SizeInBits,
uint64_t  AlignInBits,
uint64_t  OffsetInBits,
unsigned  Flags,
DIType DerivedFrom,
DINodeArray  Elements,
DIType VTableHolder = nullptr,
MDNode TemplateParms = nullptr,
StringRef  UniqueIdentifier = "" 
)

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

References llvm::StringRef::empty(), llvm::TypedDINodeRef< T >::get(), llvm::MDNode::get(), getNonCompileUnitScope(), and retainType().

DICompileUnit * DIBuilder::createCompileUnit ( unsigned  Lang,
StringRef  File,
StringRef  Dir,
StringRef  Producer,
bool  isOptimized,
StringRef  Flags,
unsigned  RV,
StringRef  SplitName = StringRef(),
DebugEmissionKind  Kind = FullDebug,
uint64_t  DWOId = 0,
bool  EmitDebugInfo = true 
)

createCompileUnit - 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 name
DirDirectory
ProducerIdentify the producer of debugging information and code. Usually this is a compiler version string.
isOptimizedA boolean flag which indicates whether optimization is ON 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.
EmitDebugInfoA boolean flag which indicates whether debug information should be written to the final output or not. When this is false, debug information annotations will be present in the IL but they are not written to the final assembly or object file. This supports tracking source location information in the back end without actually changing the output (e.g., when using optimization remarks).

Definition at line 125 of file DIBuilder.cpp.

References llvm::NamedMDNode::addOperand(), llvm::StringRef::empty(), llvm::MDNode::get(), llvm::Module::getOrInsertNamedMetadata(), llvm::MDTuple::getTemporary(), and llvm::None.

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

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

References llvm::StringRef::empty(), llvm::TypedDINodeRef< T >::get(), llvm::MDNode::get(), getNonCompileUnitScope(), llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), and retainType().

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

createEnumerator - Create a single enumerator value.

Definition at line 204 of file DIBuilder.cpp.

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

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

References llvm::MDNode::get().

Referenced by createExpression(), and llvm::replaceDbgDeclareForAlloca().

DIFile * DIBuilder::createFile ( StringRef  Filename,
StringRef  Directory 
)

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

Definition at line 200 of file DIBuilder.cpp.

References llvm::MDNode::get().

DICompositeType * DIBuilder::createForwardDecl ( unsigned  Tag,
StringRef  Name,
DIScope Scope,
DIFile F,
unsigned  Line,
unsigned  RuntimeLang = 0,
uint64_t  SizeInBits = 0,
uint64_t  AlignInBits = 0,
StringRef  UniqueIdentifier = "" 
)

Create a permanent forward-declared type.

Definition at line 497 of file DIBuilder.cpp.

References llvm::StringRef::empty(), llvm::TypedDINodeRef< T >::get(), llvm::MDNode::get(), getNonCompileUnitScope(), and retainType().

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

createFriend - Create debugging information entry for a 'friend'.

Definition at line 266 of file DIBuilder.cpp.

References llvm::TypedDINodeRef< T >::get(), and llvm::MDNode::get().

DISubprogram * DIBuilder::createFunction ( DIScope Scope,
StringRef  Name,
StringRef  LinkageName,
DIFile File,
unsigned  LineNo,
DISubroutineType Ty,
bool  isLocalToUnit,
bool  isDefinition,
unsigned  ScopeLine,
unsigned  Flags = 0,
bool  isOptimized = false,
Function Fn = nullptr,
MDNode TParam = nullptr,
MDNode Decl = nullptr 
)

createFunction - 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.
Fnllvm::Function pointer.
TParamFunction template parameters.

Definition at line 639 of file DIBuilder.cpp.

References llvm::TypedDINodeRef< T >::get(), llvm::MDNode::get(), getNonCompileUnitScope(), llvm::DINode::getTag(), llvm::MDTuple::getTemporary(), llvm::None, and llvm::SmallVectorTemplateBase< T, isPodLike >::push_back().

Referenced by createFunction().

DISubprogram * DIBuilder::createFunction ( DIScopeRef  Scope,
StringRef  Name,
StringRef  LinkageName,
DIFile File,
unsigned  LineNo,
DISubroutineType Ty,
bool  isLocalToUnit,
bool  isDefinition,
unsigned  ScopeLine,
unsigned  Flags = 0,
bool  isOptimized = false,
Function Fn = nullptr,
MDNode TParam = nullptr,
MDNode Decl = nullptr 
)

FIXME: this is added for dragonegg.

Once we update dragonegg to call resolve function, this will be removed.

Definition at line 624 of file DIBuilder.cpp.

References createFunction(), llvm::ARMBuildAttrs::File, llvm::LinkageName, Name, and llvm::TypedDINodeRef< T >::resolve().

DIGlobalVariable * DIBuilder::createGlobalVariable ( DIScope Context,
StringRef  Name,
StringRef  LinkageName,
DIFile File,
unsigned  LineNo,
DIType Ty,
bool  isLocalToUnit,
llvm::Constant Val,
MDNode Decl = nullptr 
)

createGlobalVariable - 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.
Valllvm::Value of the variable.
DeclReference to the corresponding declaration.

Definition at line 558 of file DIBuilder.cpp.

References checkGlobalVariableScope(), llvm::TypedDINodeRef< T >::get(), llvm::MDNode::get(), and llvm::SmallVectorTemplateBase< T, isPodLike >::push_back().

DIImportedEntity * DIBuilder::createImportedDeclaration ( DIScope Context,
DINode Decl,
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
LineLine number

Definition at line 189 of file DIBuilder.cpp.

References createImportedModule(), and llvm::TypedDINodeRef< T >::get().

Create a descriptor for an imported module.

Parameters:
ContextThe scope this module is imported into
NSThe namespace being imported here
LineLine number

Definition at line 175 of file DIBuilder.cpp.

Referenced by createImportedDeclaration(), and createImportedModule().

Create a descriptor for an imported module.

Parameters:
ContextThe scope this module is imported into
NSAn aliased namespace
LineLine number

Definition at line 182 of file DIBuilder.cpp.

References createImportedModule().

DIDerivedType * DIBuilder::createInheritance ( DIType Ty,
DIType BaseTy,
uint64_t  BaseOffset,
unsigned  Flags 
)

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

References llvm::TypedDINodeRef< T >::get(), and llvm::MDNode::get().

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

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

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

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

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

References llvm::MDNode::get().

DILocalVariable * DIBuilder::createLocalVariable ( unsigned  Tag,
DIScope Scope,
StringRef  Name,
DIFile File,
unsigned  LineNo,
DIType Ty,
bool  AlwaysPreserve = false,
unsigned  Flags = 0,
unsigned  ArgNo = 0 
)

createLocalVariable - Create a new descriptor for the specified local variable.

Parameters:
TagDwarf TAG. Usually DW_TAG_auto_variable or DW_TAG_arg_variable.
ScopeVariable scope.
NameVariable name.
FileFile where this variable is defined.
LineNoLine number.
TyVariable Type
AlwaysPreserveBoolean. Set to true if debug info for this variable should be preserved in optimized build.
FlagsFlags, e.g. artificial variable.
ArgNoIf this variable is an argument then this argument's number. 1 indicates 1st argument.

Definition at line 585 of file DIBuilder.cpp.

References llvm::TypedDINodeRef< T >::get(), llvm::MDNode::get(), llvm::getDISubprogram(), and getNonCompileUnitScope().

DIDerivedType * DIBuilder::createMemberPointerType ( DIType PointeeTy,
DIType Class,
uint64_t  SizeInBits,
uint64_t  AlignInBits = 0 
)

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

References llvm::TypedDINodeRef< T >::get(), and llvm::MDNode::get().

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

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

References llvm::TypedDINodeRef< T >::get(), llvm::MDNode::get(), and getNonCompileUnitScope().

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,
DIType VTableHolder = nullptr,
unsigned  Flags = 0,
bool  isOptimized = false,
Function Fn = nullptr,
MDNode TParam = nullptr 
)

createMethod - 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.
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.
Fnllvm::Function pointer.
TParamFunction template parameters.

Definition at line 676 of file DIBuilder.cpp.

References llvm::TypedDINodeRef< T >::get(), llvm::MDNode::get(), getNonCompileUnitScope(), llvm::DINode::getTag(), llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), and llvm::SP.

DINamespace * DIBuilder::createNameSpace ( DIScope Scope,
StringRef  Name,
DIFile File,
unsigned  LineNo 
)

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

Parameters:
ScopeNamespace scope
NameName of this namespace
FileSource file
LineNoLine number

Definition at line 699 of file DIBuilder.cpp.

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

Create C++11 nullptr type.

Definition at line 214 of file DIBuilder.cpp.

References createUnspecifiedType().

DIDerivedType * DIBuilder::createObjCIVar ( StringRef  Name,
DIFile File,
unsigned  LineNo,
uint64_t  SizeInBits,
uint64_t  AlignInBits,
uint64_t  OffsetInBits,
unsigned  Flags,
DIType Ty,
MDNode PropertyNode 
)

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

References llvm::TypedDINodeRef< T >::get(), llvm::MDNode::get(), and getNonCompileUnitScope().

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

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

References llvm::MDNode::get().

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

Definition at line 481 of file DIBuilder.cpp.

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

DIDerivedType * DIBuilder::createPointerType ( DIType PointeeTy,
uint64_t  SizeInBits,
uint64_t  AlignInBits = 0,
StringRef  Name = "" 
)

createPointerType - Create debugging information entry for a pointer.

Parameters:
PointeeTyType pointed by this pointer.
SizeInBitsSize.
AlignInBitsAlignment. (optional)
NamePointer type name. (optional)

Definition at line 231 of file DIBuilder.cpp.

References llvm::TypedDINodeRef< T >::get(), and llvm::MDNode::get().

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

References llvm::TypedDINodeRef< T >::get(), and llvm::MDNode::get().

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

Definition at line 251 of file DIBuilder.cpp.

References llvm::TypedDINodeRef< T >::get(), and llvm::MDNode::get().

DICompositeType * DIBuilder::createReplaceableCompositeType ( unsigned  Tag,
StringRef  Name,
DIScope Scope,
DIFile F,
unsigned  Line,
unsigned  RuntimeLang = 0,
uint64_t  SizeInBits = 0,
uint64_t  AlignInBits = 0,
unsigned  Flags = DINode::FlagFwdDecl,
StringRef  UniqueIdentifier = "" 
)

Create a temporary forward-declared type.

Definition at line 514 of file DIBuilder.cpp.

References llvm::StringRef::empty(), llvm::TypedDINodeRef< T >::get(), getNonCompileUnitScope(), llvm::MDNode::getTemporary(), and retainType().

DIDerivedType * DIBuilder::createStaticMemberType ( DIScope Scope,
StringRef  Name,
DIFile File,
unsigned  LineNo,
DIType Ty,
unsigned  Flags,
llvm::Constant Val 
)

createStaticMemberType - 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.

Definition at line 301 of file DIBuilder.cpp.

References llvm::TypedDINodeRef< T >::get(), llvm::MDNode::get(), getConstantOrNull(), and getNonCompileUnitScope().

DICompositeType * DIBuilder::createStructType ( DIScope Scope,
StringRef  Name,
DIFile File,
unsigned  LineNumber,
uint64_t  SizeInBits,
uint64_t  AlignInBits,
unsigned  Flags,
DIType DerivedFrom,
DINodeArray  Elements,
unsigned  RunTimeLang = 0,
DIType VTableHolder = nullptr,
StringRef  UniqueIdentifier = "" 
)

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

References llvm::StringRef::empty(), llvm::TypedDINodeRef< T >::get(), llvm::MDNode::get(), getNonCompileUnitScope(), and retainType().

DISubroutineType * DIBuilder::createSubroutineType ( DIFile File,
DITypeRefArray  ParameterTypes,
unsigned  Flags = 0 
)

createSubroutineType - Create subroutine type.

Parameters:
FileFile in which this subroutine is defined.
ParameterTypesAn array of subroutine parameter types. This includes return type at 0th index.
FlagsE.g.: LValueReference. These flags are used to emit dwarf attributes.

Definition at line 424 of file DIBuilder.cpp.

References llvm::MDNode::get().

DISubprogram * DIBuilder::createTempFunctionFwdDecl ( DIScope Scope,
StringRef  Name,
StringRef  LinkageName,
DIFile File,
unsigned  LineNo,
DISubroutineType Ty,
bool  isLocalToUnit,
bool  isDefinition,
unsigned  ScopeLine,
unsigned  Flags = 0,
bool  isOptimized = false,
Function Fn = nullptr,
MDNode TParam = nullptr,
MDNode Decl = nullptr 
)

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

Definition at line 661 of file DIBuilder.cpp.

References llvm::TypedDINodeRef< T >::get(), getNonCompileUnitScope(), and llvm::MDNode::getTemporary().

DIGlobalVariable * DIBuilder::createTempGlobalVariableFwdDecl ( DIScope Context,
StringRef  Name,
StringRef  LinkageName,
DIFile File,
unsigned  LineNo,
DIType Ty,
bool  isLocalToUnit,
llvm::Constant Val,
MDNode Decl = nullptr 
)

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

Definition at line 572 of file DIBuilder.cpp.

References checkGlobalVariableScope(), llvm::TypedDINodeRef< T >::get(), and llvm::MDNode::getTemporary().

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

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

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

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

createTemplateTypeParameter - Create debugging information for template type parameter.

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

Definition at line 334 of file DIBuilder.cpp.

References llvm::TypedDINodeRef< T >::get(), and llvm::MDNode::get().

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

References createTemplateValueParameterHelper(), and getConstantOrNull().

DIDerivedType * DIBuilder::createTypedef ( DIType Ty,
StringRef  Name,
DIFile File,
unsigned  LineNo,
DIScope Context 
)

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

References llvm::TypedDINodeRef< T >::get(), llvm::MDNode::get(), and getNonCompileUnitScope().

DICompositeType * DIBuilder::createUnionType ( DIScope Scope,
StringRef  Name,
DIFile File,
unsigned  LineNumber,
uint64_t  SizeInBits,
uint64_t  AlignInBits,
unsigned  Flags,
DINodeArray  Elements,
unsigned  RunTimeLang = 0,
StringRef  UniqueIdentifier = "" 
)

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

References llvm::StringRef::empty(), llvm::TypedDINodeRef< T >::get(), llvm::MDNode::get(), getNonCompileUnitScope(), and retainType().

createUnspecifiedParameter - Create unspecified parameter type for a subroutine type.

Definition at line 494 of file DIBuilder.cpp.

Create a DWARF unspecified type.

Definition at line 209 of file DIBuilder.cpp.

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

Referenced by createNullPtrType().

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

createVectorType - Create debugging information entry for a vector type.

Parameters:
SizeArray size.
AlignInBitsAlignment.
TyElement type.
SubscriptsSubscripts.

Definition at line 456 of file DIBuilder.cpp.

References llvm::TypedDINodeRef< T >::get(), and llvm::MDNode::get().

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

getOrCreateArray - Get a DINodeArray, create one if required.

Definition at line 530 of file DIBuilder.cpp.

References llvm::MDTuple::get().

Referenced by finalize().

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

getOrCreateSubrange - Create a descriptor for a value range.

This implicitly uniques the values returned.

Definition at line 545 of file DIBuilder.cpp.

References llvm::MDNode::get().

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

insertDbgValueIntrinsic - Insert a new llvm.dbg.value intrinsic call.

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

Definition at line 795 of file DIBuilder.cpp.

References llvm::CallInst::Create(), llvm::ConstantInt::get(), llvm::MetadataAsValue::get(), getDbgIntrinsicValueImpl(), llvm::Intrinsic::getDeclaration(), llvm::Type::getInt64Ty(), llvm::DILocalVariable::getScope(), llvm::DILocalScope::getSubprogram(), and withDebugLoc().

Referenced by llvm::ConvertDebugDeclareToDebugValue().

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

insertDbgValueIntrinsic - Insert a new llvm.dbg.value intrinsic call.

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

Definition at line 772 of file DIBuilder.cpp.

References llvm::CallInst::Create(), llvm::ConstantInt::get(), llvm::MetadataAsValue::get(), getDbgIntrinsicValueImpl(), llvm::Intrinsic::getDeclaration(), llvm::Type::getInt64Ty(), llvm::DILocalVariable::getScope(), llvm::DILocalScope::getSubprogram(), and withDebugLoc().

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

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

References llvm::CallInst::Create(), llvm::DL, llvm::MetadataAsValue::get(), getDbgIntrinsicValueImpl(), llvm::Intrinsic::getDeclaration(), llvm::DILocalVariable::getScope(), llvm::DILocalScope::getSubprogram(), llvm::BasicBlock::getTerminator(), and withDebugLoc().

Referenced by llvm::replaceDbgDeclareForAlloca().

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

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

References llvm::CallInst::Create(), llvm::MetadataAsValue::get(), getDbgIntrinsicValueImpl(), llvm::Intrinsic::getDeclaration(), llvm::DILocalVariable::getScope(), llvm::DILocalScope::getSubprogram(), and withDebugLoc().

void DIBuilder::replaceArrays ( DICompositeType *&  T,
DINodeArray  Elements,
DINodeArray  TParems = 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 839 of file DIBuilder.cpp.

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

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

References llvm::MDNode::get(), llvm::MDNode::replaceAllUsesWith(), and llvm::MDNode::replaceWithUniqued().

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

References llvm::TypedDINodeRef< T >::get(), llvm::TypedTrackingMDRef< T >::get(), llvm::MDNode::isResolved(), llvm::MDNode::operands(), and llvm::DICompositeTypeBase::replaceVTableHolder().

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

Definition at line 489 of file DIBuilder.cpp.

References llvm::SmallVectorImpl< T >::emplace_back().

Referenced by createClassType(), createEnumerationType(), createForwardDecl(), createReplaceableCompositeType(), createStructType(), and createUnionType().


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