LLVM API Documentation

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)
void finalize ()
 finalize - Construct any deferred debug info descriptors.
DICompileUnit createCompileUnit (unsigned Lang, StringRef File, StringRef Dir, StringRef Producer, bool isOptimized, StringRef Flags, unsigned RV, StringRef SplitName=StringRef(), DebugEmissionKind Kind=FullDebug, bool EmitDebugInfo=true)
DIFile createFile (StringRef Filename, StringRef Directory)
DIEnumerator createEnumerator (StringRef Name, int64_t Val)
 createEnumerator - Create a single enumerator value.
DIBasicType createUnspecifiedType (StringRef Name)
 Create a DWARF unspecified type.
DIBasicType createNullPtrType ()
 Create C++11 nullptr type.
DIBasicType createBasicType (StringRef Name, uint64_t SizeInBits, uint64_t AlignInBits, unsigned Encoding)
DIDerivedType createQualifiedType (unsigned Tag, DIType FromTy)
DIDerivedType createPointerType (DIType PointeeTy, uint64_t SizeInBits, uint64_t AlignInBits=0, StringRef Name=StringRef())
DIDerivedType createMemberPointerType (DIType PointeeTy, DIType Class)
 Create debugging information entry for a pointer to member.
DIDerivedType createReferenceType (unsigned Tag, DIType RTy)
DIDerivedType createTypedef (DIType Ty, StringRef Name, DIFile File, unsigned LineNo, DIDescriptor Context)
DIDerivedType createFriend (DIType Ty, DIType FriendTy)
 createFriend - Create debugging information entry for a 'friend'.
DIDerivedType createInheritance (DIType Ty, DIType BaseTy, uint64_t BaseOffset, unsigned Flags)
DIDerivedType createMemberType (DIDescriptor Scope, StringRef Name, DIFile File, unsigned LineNo, uint64_t SizeInBits, uint64_t AlignInBits, uint64_t OffsetInBits, unsigned Flags, DIType Ty)
DIDerivedType createStaticMemberType (DIDescriptor Scope, StringRef Name, DIFile File, unsigned LineNo, DIType Ty, unsigned Flags, llvm::Value *Val)
DIDerivedType createObjCIVar (StringRef Name, DIFile File, unsigned LineNo, uint64_t SizeInBits, uint64_t AlignInBits, uint64_t OffsetInBits, unsigned Flags, DIType Ty, MDNode *PropertyNode)
DIObjCProperty createObjCProperty (StringRef Name, DIFile File, unsigned LineNumber, StringRef GetterName, StringRef SetterName, unsigned PropertyAttributes, DIType Ty)
DICompositeType createClassType (DIDescriptor Scope, StringRef Name, DIFile File, unsigned LineNumber, uint64_t SizeInBits, uint64_t AlignInBits, uint64_t OffsetInBits, unsigned Flags, DIType DerivedFrom, DIArray Elements, DIType VTableHolder=DIType(), MDNode *TemplateParms=nullptr, StringRef UniqueIdentifier=StringRef())
DICompositeType createStructType (DIDescriptor Scope, StringRef Name, DIFile File, unsigned LineNumber, uint64_t SizeInBits, uint64_t AlignInBits, unsigned Flags, DIType DerivedFrom, DIArray Elements, unsigned RunTimeLang=0, DIType VTableHolder=DIType(), StringRef UniqueIdentifier=StringRef())
DICompositeType createUnionType (DIDescriptor Scope, StringRef Name, DIFile File, unsigned LineNumber, uint64_t SizeInBits, uint64_t AlignInBits, unsigned Flags, DIArray Elements, unsigned RunTimeLang=0, StringRef UniqueIdentifier=StringRef())
DITemplateTypeParameter createTemplateTypeParameter (DIDescriptor Scope, StringRef Name, DIType Ty, MDNode *File=nullptr, unsigned LineNo=0, unsigned ColumnNo=0)
DITemplateValueParameter createTemplateValueParameter (DIDescriptor Scope, StringRef Name, DIType Ty, Value *Val, MDNode *File=nullptr, unsigned LineNo=0, unsigned ColumnNo=0)
DITemplateValueParameter createTemplateTemplateParameter (DIDescriptor Scope, StringRef Name, DIType Ty, StringRef Val, MDNode *File=nullptr, unsigned LineNo=0, unsigned ColumnNo=0)
 Create debugging information for a template template parameter.
DITemplateValueParameter createTemplateParameterPack (DIDescriptor Scope, StringRef Name, DIType Ty, DIArray Val, MDNode *File=nullptr, unsigned LineNo=0, unsigned ColumnNo=0)
 Create debugging information for a template parameter pack.
DICompositeType createArrayType (uint64_t Size, uint64_t AlignInBits, DIType Ty, DIArray Subscripts)
DICompositeType createVectorType (uint64_t Size, uint64_t AlignInBits, DIType Ty, DIArray Subscripts)
DICompositeType createEnumerationType (DIDescriptor Scope, StringRef Name, DIFile File, unsigned LineNumber, uint64_t SizeInBits, uint64_t AlignInBits, DIArray Elements, DIType UnderlyingType, StringRef UniqueIdentifier=StringRef())
DISubroutineType createSubroutineType (DIFile File, DITypeArray ParameterTypes, unsigned Flags=0)
DIType createArtificialType (DIType Ty)
 createArtificialType - Create a new DIType with "artificial" flag set.
DIType createObjectPointerType (DIType Ty)
DICompositeType createForwardDecl (unsigned Tag, StringRef Name, DIDescriptor Scope, DIFile F, unsigned Line, unsigned RuntimeLang=0, uint64_t SizeInBits=0, uint64_t AlignInBits=0, StringRef UniqueIdentifier=StringRef())
 Create a permanent forward-declared type.
DICompositeType createReplaceableForwardDecl (unsigned Tag, StringRef Name, DIDescriptor Scope, DIFile F, unsigned Line, unsigned RuntimeLang=0, uint64_t SizeInBits=0, uint64_t AlignInBits=0, StringRef UniqueIdentifier=StringRef())
 Create a temporary forward-declared type.
void retainType (DIType T)
DIBasicType createUnspecifiedParameter ()
DIArray getOrCreateArray (ArrayRef< Value * > Elements)
 getOrCreateArray - Get a DIArray, create one if required.
DITypeArray getOrCreateTypeArray (ArrayRef< Value * > Elements)
 getOrCreateTypeArray - Get a DITypeArray, create one if required.
DISubrange getOrCreateSubrange (int64_t Lo, int64_t Count)
DIGlobalVariable createGlobalVariable (DIDescriptor Context, StringRef Name, StringRef LinkageName, DIFile File, unsigned LineNo, DITypeRef Ty, bool isLocalToUnit, llvm::Value *Val, MDNode *Decl=nullptr)
DIGlobalVariable createTempGlobalVariableFwdDecl (DIDescriptor Context, StringRef Name, StringRef LinkageName, DIFile File, unsigned LineNo, DITypeRef Ty, bool isLocalToUnit, llvm::Value *Val, MDNode *Decl=nullptr)
DIVariable createLocalVariable (unsigned Tag, DIDescriptor Scope, StringRef Name, DIFile File, unsigned LineNo, DITypeRef Ty, bool AlwaysPreserve=false, unsigned Flags=0, unsigned ArgNo=0)
DIExpression createExpression (ArrayRef< int64_t > Addr=None)
DIExpression createPieceExpression (unsigned OffsetInBytes, unsigned SizeInBytes)
DISubprogram createFunction (DIDescriptor Scope, StringRef Name, StringRef LinkageName, DIFile File, unsigned LineNo, DICompositeType Ty, bool isLocalToUnit, bool isDefinition, unsigned ScopeLine, unsigned Flags=0, bool isOptimized=false, Function *Fn=nullptr, MDNode *TParam=nullptr, MDNode *Decl=nullptr)
DISubprogram createTempFunctionFwdDecl (DIDescriptor Scope, StringRef Name, StringRef LinkageName, DIFile File, unsigned LineNo, DICompositeType Ty, bool isLocalToUnit, bool isDefinition, unsigned ScopeLine, unsigned Flags=0, bool isOptimized=false, Function *Fn=nullptr, MDNode *TParam=nullptr, MDNode *Decl=nullptr)
DISubprogram createFunction (DIScopeRef Scope, StringRef Name, StringRef LinkageName, DIFile File, unsigned LineNo, DICompositeType Ty, bool isLocalToUnit, bool isDefinition, unsigned ScopeLine, unsigned Flags=0, bool isOptimized=false, Function *Fn=nullptr, MDNode *TParam=nullptr, MDNode *Decl=nullptr)
DISubprogram createMethod (DIDescriptor Scope, StringRef Name, StringRef LinkageName, DIFile File, unsigned LineNo, DICompositeType Ty, bool isLocalToUnit, bool isDefinition, unsigned Virtuality=0, unsigned VTableIndex=0, DIType VTableHolder=DIType(), unsigned Flags=0, bool isOptimized=false, Function *Fn=nullptr, MDNode *TParam=nullptr)
DINameSpace createNameSpace (DIDescriptor Scope, StringRef Name, DIFile File, unsigned LineNo)
DILexicalBlockFile createLexicalBlockFile (DIDescriptor Scope, DIFile File, unsigned Discriminator=0)
DILexicalBlock createLexicalBlock (DIDescriptor Scope, DIFile File, unsigned Line, unsigned Col)
DIImportedEntity createImportedModule (DIScope Context, DINameSpace NS, unsigned Line)
 Create a descriptor for an imported module.
DIImportedEntity createImportedModule (DIScope Context, DIImportedEntity NS, unsigned Line)
 Create a descriptor for an imported module.
DIImportedEntity createImportedDeclaration (DIScope Context, DIScope Decl, unsigned Line, StringRef Name=StringRef())
 Create a descriptor for an imported function.
DIImportedEntity createImportedDeclaration (DIScope Context, DIImportedEntity NS, unsigned Line, StringRef Name=StringRef())
InstructioninsertDeclare (llvm::Value *Storage, DIVariable VarInfo, DIExpression Expr, BasicBlock *InsertAtEnd)
InstructioninsertDeclare (llvm::Value *Storage, DIVariable VarInfo, DIExpression Expr, Instruction *InsertBefore)
InstructioninsertDbgValueIntrinsic (llvm::Value *Val, uint64_t Offset, DIVariable VarInfo, DIExpression Expr, BasicBlock *InsertAtEnd)
InstructioninsertDbgValueIntrinsic (llvm::Value *Val, uint64_t Offset, DIVariable VarInfo, DIExpression Expr, Instruction *InsertBefore)

Detailed Description

Definition at line 54 of file DIBuilder.h.


Member Enumeration Documentation

Enumerator:
FullDebug 
LineTablesOnly 

Definition at line 88 of file DIBuilder.h.


Constructor & Destructor Documentation

DIBuilder::DIBuilder ( Module M) [explicit]

Definition at line 32 of file DIBuilder.cpp.


Member Function Documentation

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

createArrayType - Create debugging information entry for an array.

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

Definition at line 714 of file DIBuilder.cpp.

References llvm::dwarf::DW_TAG_array_type, llvm::MDString::get(), llvm::ConstantInt::get(), llvm::MDNode::get(), llvm::Type::getInt32Ty(), llvm::Type::getInt64Ty(), llvm::DIScope::getRef(), and GetTagConstant().

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

References llvm::dwarf::DW_TAG_base_type, llvm::StringRef::empty(), llvm::MDString::get(), llvm::ConstantInt::get(), llvm::MDNode::get(), llvm::Type::getInt32Ty(), llvm::Type::getInt64Ty(), and GetTagConstant().

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

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

References llvm::dwarf::DW_TAG_class_type, llvm::StringRef::empty(), llvm::MDString::get(), llvm::ConstantInt::get(), llvm::MDNode::get(), llvm::DIFile::getFileNode(), llvm::Type::getInt32Ty(), llvm::Type::getInt64Ty(), getNonCompileUnitScope(), llvm::DIScope::getRef(), GetTagConstant(), llvm::DIDescriptor::isCompositeType(), llvm::DIDescriptor::isScope(), llvm::DIDescriptor::isType(), 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,
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.
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 96 of file DIBuilder.cpp.

References llvm::NamedMDNode::addOperand(), createFilePathPair(), llvm::dwarf::DW_LANG_C89, llvm::dwarf::DW_LANG_lo_user, llvm::dwarf::DW_TAG_base_type, llvm::dwarf::DW_TAG_compile_unit, llvm::StringRef::empty(), llvm::MDString::get(), llvm::ConstantInt::get(), llvm::MDNode::get(), llvm::Type::getInt1Ty(), llvm::Type::getInt32Ty(), llvm::Module::getOrInsertNamedMetadata(), GetTagConstant(), and llvm::MDNode::getTemporary().

DICompositeType DIBuilder::createEnumerationType ( DIDescriptor  Scope,
StringRef  Name,
DIFile  File,
unsigned  LineNumber,
uint64_t  SizeInBits,
uint64_t  AlignInBits,
DIArray  Elements,
DIType  UnderlyingType,
StringRef  UniqueIdentifier = StringRef() 
)

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

References llvm::dwarf::DW_TAG_enumeration_type, llvm::StringRef::empty(), llvm::MDString::get(), llvm::ConstantInt::get(), llvm::MDNode::get(), llvm::DIFile::getFileNode(), llvm::Type::getInt32Ty(), llvm::Type::getInt64Ty(), getNonCompileUnitScope(), llvm::DIScope::getRef(), GetTagConstant(), llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), and retainType().

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

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

References llvm::dwarf::DW_TAG_expression, llvm::ConstantInt::get(), llvm::MDNode::get(), llvm::Type::getInt64Ty(), GetTagConstant(), I, and llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back().

Referenced by createPieceExpression(), 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 210 of file DIBuilder.cpp.

References createFilePathPair(), llvm::dwarf::DW_TAG_file_type, llvm::MDNode::get(), and GetTagConstant().

DICompositeType DIBuilder::createForwardDecl ( unsigned  Tag,
StringRef  Name,
DIDescriptor  Scope,
DIFile  F,
unsigned  Line,
unsigned  RuntimeLang = 0,
uint64_t  SizeInBits = 0,
uint64_t  AlignInBits = 0,
StringRef  UniqueIdentifier = StringRef() 
)
DISubprogram DIBuilder::createFunction ( DIDescriptor  Scope,
StringRef  Name,
StringRef  LinkageName,
DIFile  File,
unsigned  LineNo,
DICompositeType  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 1059 of file DIBuilder.cpp.

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

Referenced by createFunction().

DISubprogram DIBuilder::createFunction ( DIScopeRef  Scope,
StringRef  Name,
StringRef  LinkageName,
DIFile  File,
unsigned  LineNo,
DICompositeType  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 1004 of file DIBuilder.cpp.

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

DIGlobalVariable DIBuilder::createGlobalVariable ( DIDescriptor  Context,
StringRef  Name,
StringRef  LinkageName,
DIFile  File,
unsigned  LineNo,
DITypeRef  Ty,
bool  isLocalToUnit,
llvm::Value 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 923 of file DIBuilder.cpp.

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

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

References createImportedModule(), llvm::dwarf::DW_TAG_imported_declaration, llvm::DIScope::getRef(), and Name.

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

References llvm::dwarf::DW_TAG_imported_module.

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

References createImportedModule(), and llvm::dwarf::DW_TAG_imported_module.

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

References llvm::dwarf::DW_TAG_inheritance, llvm::ConstantInt::get(), llvm::MDNode::get(), llvm::Type::getInt32Ty(), llvm::Type::getInt64Ty(), llvm::DIScope::getRef(), GetTagConstant(), and llvm::DIDescriptor::isType().

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

References llvm::dwarf::DW_TAG_lexical_block, llvm::ConstantInt::get(), llvm::MDNode::get(), llvm::DIFile::getFileNode(), llvm::Type::getInt32Ty(), getNonCompileUnitScope(), GetTagConstant(), and llvm::DILexicalBlock::Verify().

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

References llvm::dwarf::DW_TAG_lexical_block, llvm::ConstantInt::get(), llvm::MDNode::get(), llvm::DIFile::getFileNode(), llvm::Type::getInt32Ty(), GetTagConstant(), and llvm::DILexicalBlockFile::Verify().

DIVariable DIBuilder::createLocalVariable ( unsigned  Tag,
DIDescriptor  Scope,
StringRef  Name,
DIFile  File,
unsigned  LineNo,
DITypeRef  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 954 of file DIBuilder.cpp.

References llvm::NamedMDNode::addOperand(), llvm::ARMBuildAttrs::File, llvm::MDString::get(), llvm::ConstantInt::get(), llvm::MDNode::get(), llvm::getDISubprogram(), llvm::Type::getInt32Ty(), getNonCompileUnitScope(), llvm::Constant::getNullValue(), llvm::getOrInsertFnSpecificMDNode(), GetTagConstant(), llvm::DIDescriptor::isScope(), llvm::DIDescriptor::isVariable(), and Node.

Create debugging information entry for a pointer to member.

Parameters:
PointeeTyType pointed to by this pointer.
ClassType for which this pointer points to members of.

Definition at line 308 of file DIBuilder.cpp.

References llvm::dwarf::DW_TAG_ptr_to_member_type, llvm::ConstantInt::get(), llvm::MDNode::get(), llvm::Type::getInt32Ty(), llvm::Type::getInt64Ty(), llvm::DIScope::getRef(), and GetTagConstant().

DIDerivedType DIBuilder::createMemberType ( DIDescriptor  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 402 of file DIBuilder.cpp.

References llvm::dwarf::DW_TAG_member, llvm::MDString::get(), llvm::ConstantInt::get(), llvm::MDNode::get(), llvm::DIFile::getFileNode(), llvm::Type::getInt32Ty(), llvm::Type::getInt64Ty(), getNonCompileUnitScope(), llvm::DIScope::getRef(), and GetTagConstant().

DISubprogram DIBuilder::createMethod ( DIDescriptor  Scope,
StringRef  Name,
StringRef  LinkageName,
DIFile  File,
unsigned  LineNo,
DICompositeType  Ty,
bool  isLocalToUnit,
bool  isDefinition,
unsigned  Virtuality = 0,
unsigned  VTableIndex = 0,
DIType  VTableHolder = DIType(),
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 1095 of file DIBuilder.cpp.

References llvm::dwarf::DW_TAG_subprogram, llvm::dwarf::DW_TAG_subroutine_type, llvm::MDString::get(), llvm::ConstantInt::get(), llvm::MDNode::get(), llvm::DIFile::getFileNode(), llvm::Type::getInt1Ty(), llvm::Type::getInt32Ty(), getNonCompileUnitScope(), llvm::Constant::getNullValue(), llvm::DIScope::getRef(), llvm::DIDescriptor::getTag(), GetTagConstant(), llvm::DIDescriptor::isSubprogram(), Node, and llvm::SmallVectorTemplateBase< T, isPodLike >::push_back().

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

References llvm::dwarf::DW_TAG_namespace, llvm::MDString::get(), llvm::ConstantInt::get(), llvm::MDNode::get(), llvm::DIFile::getFileNode(), llvm::Type::getInt32Ty(), getNonCompileUnitScope(), GetTagConstant(), and llvm::DINameSpace::Verify().

Create C++11 nullptr type.

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

References llvm::dwarf::DW_TAG_member, llvm::MDString::get(), llvm::ConstantInt::get(), llvm::MDNode::get(), llvm::DIFile::getFileNode(), llvm::Type::getInt32Ty(), llvm::Type::getInt64Ty(), getNonCompileUnitScope(), and GetTagConstant().

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

References llvm::dwarf::DW_TAG_APPLE_property, llvm::ARMBuildAttrs::File, llvm::MDString::get(), llvm::ConstantInt::get(), llvm::MDNode::get(), llvm::Type::getInt32Ty(), and GetTagConstant().

DIExpression DIBuilder::createPieceExpression ( unsigned  OffsetInBytes,
unsigned  SizeInBytes 
)

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

Parameters:
OffsetInBytesOffset of the piece in bytes.
SizeInBytesSize of the piece in bytes.

Definition at line 998 of file DIBuilder.cpp.

References createExpression(), and llvm::dwarf::DW_OP_piece.

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

createPointerType - Create debugging information entry for a pointer.

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

Definition at line 290 of file DIBuilder.cpp.

References llvm::dwarf::DW_TAG_pointer_type, llvm::MDString::get(), llvm::ConstantInt::get(), llvm::MDNode::get(), llvm::Type::getInt32Ty(), llvm::Type::getInt64Ty(), llvm::DIScope::getRef(), and GetTagConstant().

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

References llvm::MDString::get(), llvm::ConstantInt::get(), llvm::MDNode::get(), llvm::Type::getInt32Ty(), llvm::Type::getInt64Ty(), llvm::DIScope::getRef(), and GetTagConstant().

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

Definition at line 327 of file DIBuilder.cpp.

References llvm::ConstantInt::get(), llvm::MDNode::get(), llvm::Type::getInt32Ty(), llvm::Type::getInt64Ty(), llvm::DIScope::getRef(), GetTagConstant(), and llvm::DIDescriptor::isType().

DICompositeType DIBuilder::createReplaceableForwardDecl ( unsigned  Tag,
StringRef  Name,
DIDescriptor  Scope,
DIFile  F,
unsigned  Line,
unsigned  RuntimeLang = 0,
uint64_t  SizeInBits = 0,
uint64_t  AlignInBits = 0,
StringRef  UniqueIdentifier = StringRef() 
)
DIDerivedType DIBuilder::createStaticMemberType ( DIDescriptor  Scope,
StringRef  Name,
DIFile  File,
unsigned  LineNo,
DIType  Ty,
unsigned  Flags,
llvm::Value 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 425 of file DIBuilder.cpp.

References llvm::dwarf::DW_TAG_member, llvm::DIDescriptor::FlagStaticMember, llvm::MDString::get(), llvm::ConstantInt::get(), llvm::MDNode::get(), llvm::DIFile::getFileNode(), llvm::Type::getInt32Ty(), llvm::Type::getInt64Ty(), getNonCompileUnitScope(), llvm::DIScope::getRef(), and GetTagConstant().

DICompositeType DIBuilder::createStructType ( DIDescriptor  Scope,
StringRef  Name,
DIFile  File,
unsigned  LineNumber,
uint64_t  SizeInBits,
uint64_t  AlignInBits,
unsigned  Flags,
DIType  DerivedFrom,
DIArray  Elements,
unsigned  RunTimeLang = 0,
DIType  VTableHolder = DIType(),
StringRef  UniqueIdentifier = StringRef() 
)

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

References llvm::dwarf::DW_TAG_structure_type, llvm::StringRef::empty(), llvm::MDString::get(), llvm::ConstantInt::get(), llvm::MDNode::get(), llvm::DIFile::getFileNode(), llvm::Type::getInt32Ty(), llvm::Type::getInt64Ty(), getNonCompileUnitScope(), llvm::DIScope::getRef(), GetTagConstant(), llvm::DIDescriptor::isCompositeType(), and retainType().

DISubroutineType DIBuilder::createSubroutineType ( DIFile  File,
DITypeArray  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 660 of file DIBuilder.cpp.

References llvm::dwarf::DW_TAG_subroutine_type, llvm::MDString::get(), llvm::ConstantInt::get(), llvm::MDNode::get(), llvm::Type::getInt32Ty(), llvm::Type::getInt64Ty(), llvm::Constant::getNullValue(), and GetTagConstant().

DISubprogram DIBuilder::createTempFunctionFwdDecl ( DIDescriptor  Scope,
StringRef  Name,
StringRef  LinkageName,
DIFile  File,
unsigned  LineNo,
DICompositeType  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 1080 of file DIBuilder.cpp.

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

DIGlobalVariable DIBuilder::createTempGlobalVariableFwdDecl ( DIDescriptor  Context,
StringRef  Name,
StringRef  LinkageName,
DIFile  File,
unsigned  LineNo,
DITypeRef  Ty,
bool  isLocalToUnit,
llvm::Value Val,
MDNode Decl = nullptr 
)

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

Definition at line 940 of file DIBuilder.cpp.

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

DITemplateValueParameter DIBuilder::createTemplateParameterPack ( DIDescriptor  Scope,
StringRef  Name,
DIType  Ty,
DIArray  Val,
MDNode File = nullptr,
unsigned  LineNo = 0,
unsigned  ColumnNo = 0 
)

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.
FileFile where this type parameter is defined.
LineNoLine number.
ColumnNoColumn Number.

Definition at line 543 of file DIBuilder.cpp.

References llvm::dwarf::DW_TAG_GNU_template_parameter_pack.

DITemplateValueParameter DIBuilder::createTemplateTemplateParameter ( DIDescriptor  Scope,
StringRef  Name,
DIType  Ty,
StringRef  Val,
MDNode File = nullptr,
unsigned  LineNo = 0,
unsigned  ColumnNo = 0 
)

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.
FileFile where this type parameter is defined.
LineNoLine number.
ColumnNoColumn Number.

Definition at line 533 of file DIBuilder.cpp.

References llvm::dwarf::DW_TAG_GNU_template_template_param, and llvm::MDString::get().

DITemplateTypeParameter DIBuilder::createTemplateTypeParameter ( DIDescriptor  Scope,
StringRef  Name,
DIType  Ty,
MDNode File = nullptr,
unsigned  LineNo = 0,
unsigned  ColumnNo = 0 
)

createTemplateTypeParameter - Create debugging information for template type parameter.

Parameters:
ScopeScope in which this type is defined.
NameType parameter name.
TyParameter type.
FileFile where this type parameter is defined.
LineNoLine number.
ColumnNoColumn Number.

Definition at line 488 of file DIBuilder.cpp.

References llvm::dwarf::DW_TAG_template_type_parameter, llvm::ARMBuildAttrs::File, llvm::MDString::get(), llvm::ConstantInt::get(), llvm::MDNode::get(), llvm::Type::getInt32Ty(), getNonCompileUnitScope(), llvm::DIScope::getRef(), and GetTagConstant().

DITemplateValueParameter DIBuilder::createTemplateValueParameter ( DIDescriptor  Scope,
StringRef  Name,
DIType  Ty,
Value Val,
MDNode File = nullptr,
unsigned  LineNo = 0,
unsigned  ColumnNo = 0 
)

createTemplateValueParameter - Create debugging information for template value parameter.

Parameters:
ScopeScope in which this type is defined.
NameValue parameter name.
TyParameter type.
ValConstant parameter value.
FileFile where this type parameter is defined.
LineNoLine number.
ColumnNoColumn Number.

Definition at line 523 of file DIBuilder.cpp.

References llvm::dwarf::DW_TAG_template_value_parameter.

DIDerivedType DIBuilder::createTypedef ( DIType  Ty,
StringRef  Name,
DIFile  File,
unsigned  LineNo,
DIDescriptor  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 345 of file DIBuilder.cpp.

References llvm::dwarf::DW_TAG_typedef, llvm::MDString::get(), llvm::ConstantInt::get(), llvm::MDNode::get(), llvm::DIFile::getFileNode(), llvm::Type::getInt32Ty(), llvm::Type::getInt64Ty(), getNonCompileUnitScope(), llvm::DIScope::getRef(), and GetTagConstant().

DICompositeType DIBuilder::createUnionType ( DIDescriptor  Scope,
StringRef  Name,
DIFile  File,
unsigned  LineNumber,
uint64_t  SizeInBits,
uint64_t  AlignInBits,
unsigned  Flags,
DIArray  Elements,
unsigned  RunTimeLang = 0,
StringRef  UniqueIdentifier = StringRef() 
)

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

References llvm::dwarf::DW_TAG_union_type, llvm::StringRef::empty(), llvm::MDString::get(), llvm::ConstantInt::get(), llvm::MDNode::get(), llvm::DIFile::getFileNode(), llvm::Type::getInt32Ty(), llvm::Type::getInt64Ty(), getNonCompileUnitScope(), llvm::DIScope::getRef(), GetTagConstant(), and retainType().

createUnspecifiedParameter - Create unspecified parameter type for a subroutine type.

Definition at line 804 of file DIBuilder.cpp.

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

createVectorType - Create debugging information entry for a vector type.

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

Definition at line 737 of file DIBuilder.cpp.

References llvm::dwarf::DW_TAG_array_type, llvm::DIDescriptor::FlagVector, llvm::MDString::get(), llvm::ConstantInt::get(), llvm::MDNode::get(), llvm::Type::getInt32Ty(), llvm::Type::getInt64Ty(), llvm::DIScope::getRef(), and GetTagConstant().

getOrCreateArray - Get a DIArray, create one if required.

Definition at line 873 of file DIBuilder.cpp.

References llvm::MDNode::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 888 of file DIBuilder.cpp.

References llvm::dwarf::DW_TAG_subrange_type, llvm::ConstantInt::get(), llvm::MDNode::get(), llvm::Type::getInt64Ty(), and GetTagConstant().

getOrCreateTypeArray - Get a DITypeArray, create one if required.

Definition at line 877 of file DIBuilder.cpp.

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

Instruction * DIBuilder::insertDbgValueIntrinsic ( llvm::Value Val,
uint64_t  Offset,
DIVariable  VarInfo,
DIExpression  Expr,
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.
InsertAtEndLocation for the new intrinsic.

Definition at line 1243 of file DIBuilder.cpp.

References llvm::CallInst::Create(), llvm::ConstantInt::get(), llvm::MDNode::get(), llvm::Value::getContext(), llvm::Intrinsic::getDeclaration(), llvm::Type::getInt64Ty(), and llvm::DIDescriptor::isVariable().

Referenced by llvm::ConvertDebugDeclareToDebugValue().

Instruction * DIBuilder::insertDbgValueIntrinsic ( llvm::Value Val,
uint64_t  Offset,
DIVariable  VarInfo,
DIExpression  Expr,
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.
InsertBeforeLocation for the new intrinsic.

Definition at line 1227 of file DIBuilder.cpp.

References llvm::CallInst::Create(), llvm::ConstantInt::get(), llvm::MDNode::get(), llvm::Value::getContext(), llvm::Intrinsic::getDeclaration(), llvm::Type::getInt64Ty(), and llvm::DIDescriptor::isVariable().

Instruction * DIBuilder::insertDeclare ( llvm::Value Storage,
DIVariable  VarInfo,
DIExpression  Expr,
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.
InsertAtEndLocation for the new intrinsic.

Definition at line 1208 of file DIBuilder.cpp.

References llvm::CallInst::Create(), llvm::MDNode::get(), llvm::Value::getContext(), llvm::Intrinsic::getDeclaration(), llvm::BasicBlock::getTerminator(), and llvm::DIDescriptor::isVariable().

Referenced by llvm::replaceDbgDeclareForAlloca().

Instruction * DIBuilder::insertDeclare ( llvm::Value Storage,
DIVariable  VarInfo,
DIExpression  Expr,
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.
InsertBeforeLocation for the new intrinsic.

Definition at line 1195 of file DIBuilder.cpp.

References llvm::CallInst::Create(), llvm::MDNode::get(), llvm::Value::getContext(), llvm::Intrinsic::getDeclaration(), and llvm::DIDescriptor::isVariable().

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

Definition at line 800 of file DIBuilder.cpp.

References llvm::SmallVectorTemplateBase< T, isPodLike >::push_back().

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


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