LLVM
8.0.1
|
#include "llvm/IR/DIBuilder.h"
Public Member Functions | |
DIBuilder (Module &M, bool AllowUnresolved=true, DICompileUnit *CU=nullptr) | |
Construct a builder for a module. More... | |
DIBuilder (const DIBuilder &)=delete | |
DIBuilder & | operator= (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... | |
DICompileUnit * | createCompileUnit (unsigned Lang, DIFile *File, StringRef Producer, bool isOptimized, StringRef Flags, unsigned RV, StringRef SplitName=StringRef(), DICompileUnit::DebugEmissionKind Kind=DICompileUnit::DebugEmissionKind::FullDebug, uint64_t DWOId=0, bool SplitDebugInlining=true, bool DebugInfoForProfiling=false, DICompileUnit::DebugNameTableKind NameTableKind=DICompileUnit::DebugNameTableKind::Default, bool RangesBaseAddress=false) |
A CompileUnit provides an anchor for all debugging information generated during this instance of compilation. More... | |
DIFile * | createFile (StringRef Filename, StringRef Directory, Optional< DIFile::ChecksumInfo< StringRef >> Checksum=None, Optional< StringRef > Source=None) |
Create a file descriptor to hold debugging information for a file. More... | |
DIMacro * | createMacro (DIMacroFile *Parent, unsigned Line, unsigned MacroType, StringRef Name, StringRef Value=StringRef()) |
Create debugging information entry for a macro. More... | |
DIMacroFile * | createTempMacroFile (DIMacroFile *Parent, unsigned Line, DIFile *File) |
Create debugging information temporary entry for a macro file. More... | |
DIEnumerator * | createEnumerator (StringRef Name, int64_t Val, bool IsUnsigned=false) |
Create a single enumerator value. More... | |
DIBasicType * | createUnspecifiedType (StringRef Name) |
Create a DWARF unspecified type. More... | |
DIBasicType * | createNullPtrType () |
Create C++11 nullptr type. More... | |
DIBasicType * | createBasicType (StringRef Name, uint64_t SizeInBits, unsigned Encoding, DINode::DIFlags Flags=DINode::FlagZero) |
Create debugging information entry for a basic type. More... | |
DIDerivedType * | createQualifiedType (unsigned Tag, DIType *FromTy) |
Create debugging information entry for a qualified type, e.g. More... | |
DIDerivedType * | createPointerType (DIType *PointeeTy, uint64_t SizeInBits, uint32_t AlignInBits=0, Optional< unsigned > DWARFAddressSpace=None, StringRef Name="") |
Create debugging information entry for a pointer. More... | |
DIDerivedType * | 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. More... | |
DIDerivedType * | 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. More... | |
DIDerivedType * | createTypedef (DIType *Ty, StringRef Name, DIFile *File, unsigned LineNo, DIScope *Context) |
Create debugging information entry for a typedef. More... | |
DIDerivedType * | createFriend (DIType *Ty, DIType *FriendTy) |
Create debugging information entry for a 'friend'. More... | |
DIDerivedType * | createInheritance (DIType *Ty, DIType *BaseTy, uint64_t BaseOffset, uint32_t VBPtrOffset, DINode::DIFlags Flags) |
Create debugging information entry to establish inheritance relationship between two types. More... | |
DIDerivedType * | 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. More... | |
DIDerivedType * | createVariantMemberType (DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo, uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits, Constant *Discriminant, DINode::DIFlags Flags, DIType *Ty) |
Create debugging information entry for a variant. More... | |
DIDerivedType * | 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. More... | |
DIDerivedType * | createStaticMemberType (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... | |
DIDerivedType * | 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. More... | |
DIObjCProperty * | createObjCProperty (StringRef Name, DIFile *File, unsigned LineNumber, StringRef GetterName, StringRef SetterName, unsigned PropertyAttributes, DIType *Ty) |
Create debugging information entry for Objective-C property. More... | |
DICompositeType * | 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. More... | |
DICompositeType * | 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. More... | |
DICompositeType * | 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. More... | |
DICompositeType * | createVariantPart (DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber, uint64_t SizeInBits, uint32_t AlignInBits, DINode::DIFlags Flags, DIDerivedType *Discriminator, DINodeArray Elements, StringRef UniqueIdentifier="") |
Create debugging information entry for a variant part. More... | |
DITemplateTypeParameter * | createTemplateTypeParameter (DIScope *Scope, StringRef Name, DIType *Ty) |
Create debugging information for template type parameter. More... | |
DITemplateValueParameter * | createTemplateValueParameter (DIScope *Scope, StringRef Name, DIType *Ty, Constant *Val) |
Create debugging information for template value parameter. More... | |
DITemplateValueParameter * | createTemplateTemplateParameter (DIScope *Scope, StringRef Name, DIType *Ty, StringRef Val) |
Create debugging information for a template template parameter. More... | |
DITemplateValueParameter * | createTemplateParameterPack (DIScope *Scope, StringRef Name, DIType *Ty, DINodeArray Val) |
Create debugging information for a template parameter pack. More... | |
DICompositeType * | createArrayType (uint64_t Size, uint32_t AlignInBits, DIType *Ty, DINodeArray Subscripts) |
Create debugging information entry for an array. More... | |
DICompositeType * | createVectorType (uint64_t Size, uint32_t AlignInBits, DIType *Ty, DINodeArray Subscripts) |
Create debugging information entry for a vector type. More... | |
DICompositeType * | createEnumerationType (DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber, uint64_t SizeInBits, uint32_t AlignInBits, DINodeArray Elements, DIType *UnderlyingType, StringRef UniqueIdentifier="", bool IsScoped=false) |
Create debugging information entry for an enumeration. More... | |
DISubroutineType * | createSubroutineType (DITypeRefArray ParameterTypes, DINode::DIFlags Flags=DINode::FlagZero, unsigned CC=0) |
Create subroutine type. More... | |
DICompositeType * | 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. More... | |
DICompositeType * | 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. More... | |
void | retainType (DIScope *T) |
Retain DIScope* in a module even if it is not referenced through debug info anchors. More... | |
DIBasicType * | createUnspecifiedParameter () |
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... | |
DISubrange * | getOrCreateSubrange (int64_t Lo, int64_t Count) |
Create a descriptor for a value range. More... | |
DISubrange * | getOrCreateSubrange (int64_t Lo, Metadata *CountNode) |
DIGlobalVariableExpression * | createGlobalVariableExpression (DIScope *Context, StringRef Name, StringRef LinkageName, DIFile *File, unsigned LineNo, DIType *Ty, bool isLocalToUnit, DIExpression *Expr=nullptr, MDNode *Decl=nullptr, MDTuple *templateParams=nullptr, uint32_t AlignInBits=0) |
Create a new descriptor for the specified variable. More... | |
DIGlobalVariable * | createTempGlobalVariableFwdDecl (DIScope *Context, StringRef Name, StringRef LinkageName, DIFile *File, unsigned LineNo, DIType *Ty, bool isLocalToUnit, MDNode *Decl=nullptr, MDTuple *templateParams=nullptr, uint32_t AlignInBits=0) |
Identical to createGlobalVariable except that the resulting DbgNode is temporary and meant to be RAUWed. More... | |
DILocalVariable * | 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. More... | |
DILabel * | createLabel (DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo, bool AlwaysPreserve=false) |
Create a new descriptor for an label. More... | |
DILocalVariable * | 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. More... | |
DIExpression * | createExpression (ArrayRef< uint64_t > Addr=None) |
Create a new descriptor for the specified variable which has a complex address expression for its address. More... | |
DIExpression * | createExpression (ArrayRef< int64_t > Addr) |
DIExpression * | createConstantValueExpression (uint64_t Val) |
Create an expression for a variable that does not have an address, but does have a constant value. More... | |
DISubprogram * | createFunction (DIScope *Scope, StringRef Name, StringRef LinkageName, DIFile *File, unsigned LineNo, DISubroutineType *Ty, unsigned ScopeLine, DINode::DIFlags Flags=DINode::FlagZero, DISubprogram::DISPFlags SPFlags=DISubprogram::SPFlagZero, DITemplateParameterArray TParams=nullptr, DISubprogram *Decl=nullptr, DITypeArray ThrownTypes=nullptr) |
Create a new descriptor for the specified subprogram. More... | |
DISubprogram * | createTempFunctionFwdDecl (DIScope *Scope, StringRef Name, StringRef LinkageName, DIFile *File, unsigned LineNo, DISubroutineType *Ty, unsigned ScopeLine, DINode::DIFlags Flags=DINode::FlagZero, DISubprogram::DISPFlags SPFlags=DISubprogram::SPFlagZero, DITemplateParameterArray TParams=nullptr, DISubprogram *Decl=nullptr, DITypeArray ThrownTypes=nullptr) |
Identical to createFunction, except that the resulting DbgNode is meant to be RAUWed. More... | |
DISubprogram * | createMethod (DIScope *Scope, StringRef Name, StringRef LinkageName, DIFile *File, unsigned LineNo, DISubroutineType *Ty, unsigned VTableIndex=0, int ThisAdjustment=0, DIType *VTableHolder=nullptr, DINode::DIFlags Flags=DINode::FlagZero, DISubprogram::DISPFlags SPFlags=DISubprogram::SPFlagZero, DITemplateParameterArray TParams=nullptr, DITypeArray ThrownTypes=nullptr) |
Create a new descriptor for the specified C++ method. More... | |
DINamespace * | createNameSpace (DIScope *Scope, StringRef Name, bool ExportSymbols) |
This creates new descriptor for a namespace with the specified parent scope. More... | |
DIModule * | createModule (DIScope *Scope, StringRef Name, StringRef ConfigurationMacros, StringRef IncludePath, StringRef ISysRoot) |
This creates new descriptor for a module with the specified parent scope. More... | |
DILexicalBlockFile * | createLexicalBlockFile (DIScope *Scope, DIFile *File, unsigned Discriminator=0) |
This creates a descriptor for a lexical block with a new file attached. More... | |
DILexicalBlock * | createLexicalBlock (DIScope *Scope, DIFile *File, unsigned Line, unsigned Col) |
This creates a descriptor for a lexical block with the specified parent context. More... | |
DIImportedEntity * | createImportedModule (DIScope *Context, DINamespace *NS, DIFile *File, unsigned Line) |
Create a descriptor for an imported module. More... | |
DIImportedEntity * | createImportedModule (DIScope *Context, DIImportedEntity *NS, DIFile *File, unsigned Line) |
Create a descriptor for an imported module. More... | |
DIImportedEntity * | createImportedModule (DIScope *Context, DIModule *M, DIFile *File, unsigned Line) |
Create a descriptor for an imported module. More... | |
DIImportedEntity * | createImportedDeclaration (DIScope *Context, DINode *Decl, DIFile *File, unsigned Line, StringRef Name="") |
Create a descriptor for an imported function. More... | |
Instruction * | insertDeclare (llvm::Value *Storage, DILocalVariable *VarInfo, DIExpression *Expr, const DILocation *DL, BasicBlock *InsertAtEnd) |
Insert a new llvm.dbg.declare intrinsic call. More... | |
Instruction * | insertDeclare (llvm::Value *Storage, DILocalVariable *VarInfo, DIExpression *Expr, const DILocation *DL, Instruction *InsertBefore) |
Insert a new llvm.dbg.declare intrinsic call. More... | |
Instruction * | insertLabel (DILabel *LabelInfo, const DILocation *DL, Instruction *InsertBefore) |
Insert a new llvm.dbg.label intrinsic call. More... | |
Instruction * | insertLabel (DILabel *LabelInfo, const DILocation *DL, BasicBlock *InsertAtEnd) |
Insert a new llvm.dbg.label intrinsic call. More... | |
Instruction * | insertDbgValueIntrinsic (llvm::Value *Val, DILocalVariable *VarInfo, DIExpression *Expr, const DILocation *DL, BasicBlock *InsertAtEnd) |
Insert a new llvm.dbg.value intrinsic call. More... | |
Instruction * | insertDbgValueIntrinsic (llvm::Value *Val, DILocalVariable *VarInfo, DIExpression *Expr, const DILocation *DL, Instruction *InsertBefore) |
Insert a new llvm.dbg.value intrinsic call. More... | |
void | replaceVTableHolder (DICompositeType *&T, DIType *VTableHolder) |
Replace the vtable holder in the given type. More... | |
void | replaceArrays (DICompositeType *&T, DINodeArray Elements, DINodeArray TParams=DINodeArray()) |
Replace arrays on a composite type. More... | |
template<class NodeTy > | |
NodeTy * | replaceTemporary (TempMDNode &&N, NodeTy *Replacement) |
Replace a temporary node. More... | |
Static Public Member Functions | |
static DISubprogram * | createArtificialSubprogram (DISubprogram *SP) |
Create a distinct clone of SP with FlagArtificial set. More... | |
static DIType * | createArtificialType (DIType *Ty) |
Create a uniqued clone of Ty with FlagArtificial set. More... | |
static DIType * | createObjectPointerType (DIType *Ty) |
Create a uniqued clone of Ty with FlagObjectPointer and FlagArtificial set. More... | |
Definition at line 42 of file DIBuilder.h.
|
explicit |
Construct a builder for a module.
If AllowUnresolved
, collect unresolved nodes attached to the module in order to resolve cycles during finalize().
If CU
is given a value other than nullptr, then set CUNode
to CU.
Definition at line 34 of file DIBuilder.cpp.
References assert(), llvm::MDNode::isResolved(), and N.
DICompositeType * DIBuilder::createArrayType | ( | uint64_t | Size, |
uint32_t | AlignInBits, | ||
DIType * | Ty, | ||
DINodeArray | Subscripts | ||
) |
Create debugging information entry for an array.
Size | Array size. |
AlignInBits | Alignment. |
Ty | Element type. |
Subscripts | Subscripts. |
Definition at line 518 of file DIBuilder.cpp.
References llvm::MDNode::get().
|
static |
Create a distinct clone of SP
with FlagArtificial set.
Definition at line 538 of file DIBuilder.cpp.
References llvm::MDNode::replaceWithDistinct().
Create a uniqued clone of Ty
with FlagArtificial set.
Definition at line 549 of file DIBuilder.cpp.
References createTypeWithFlags(), and llvm::DIType::isArtificial().
DILocalVariable * DIBuilder::createAutoVariable | ( | DIScope * | Scope, |
StringRef | Name, | ||
DIFile * | File, | ||
unsigned | LineNo, | ||
DIType * | Ty, | ||
bool | AlwaysPreserve = false , |
||
DINode::DIFlags | Flags = DINode::FlagZero , |
||
uint32_t | AlignInBits = 0 |
||
) |
Create a new descriptor for an auto variable.
This is a local variable that is not a subprogram parameter.
Scope
must be a DILocalScope, and thus its scope chain eventually leads to a DISubprogram.
If AlwaysPreserve
, this variable will be referenced from its containing subprogram, and will survive some optimizations.
Definition at line 696 of file DIBuilder.cpp.
References createLocalVariable().
DIBasicType * DIBuilder::createBasicType | ( | StringRef | Name, |
uint64_t | SizeInBits, | ||
unsigned | Encoding, | ||
DINode::DIFlags | Flags = DINode::FlagZero |
||
) |
Create debugging information entry for a basic type.
Name | Type name. |
SizeInBits | Size of the type. |
Encoding | DWARF encoding code, e.g., dwarf::DW_ATE_float. |
Flags | Optional DWARF attributes, e.g., DW_AT_endianity. |
Definition at line 260 of file DIBuilder.cpp.
References assert(), llvm::StringRef::empty(), and llvm::MDNode::get().
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.
Scope | Member scope. |
Name | Member name. |
File | File where this member is defined. |
LineNo | Line number. |
SizeInBits | Member size. |
OffsetInBits | Member offset. |
StorageOffsetInBits | Member storage offset. |
Flags | Flags to encode member attribute. |
Ty | Parent type. |
Definition at line 361 of file DIBuilder.cpp.
References llvm::IntegerType::get(), llvm::ConstantInt::get(), llvm::ConstantAsMetadata::get(), llvm::MDNode::get(), getNonCompileUnitScope(), and llvm::None.
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.
Scope | Scope in which this class is defined. |
Name | class name. |
File | File where this member is defined. |
LineNumber | Line number. |
SizeInBits | Member size. |
AlignInBits | Member alignment. |
OffsetInBits | Member offset. |
Flags | Flags to encode member attribute, e.g. private |
Elements | class members. |
VTableHolder | Debug 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. |
TemplateParms | Template type parameters. |
UniqueIdentifier | A unique identifier for the class. |
Definition at line 444 of file DIBuilder.cpp.
References assert(), llvm::MDNode::get(), and getNonCompileUnitScope().
DICompileUnit * DIBuilder::createCompileUnit | ( | unsigned | Lang, |
DIFile * | File, | ||
StringRef | Producer, | ||
bool | isOptimized, | ||
StringRef | Flags, | ||
unsigned | RV, | ||
StringRef | SplitName = StringRef() , |
||
DICompileUnit::DebugEmissionKind | Kind = DICompileUnit::DebugEmissionKind::FullDebug , |
||
uint64_t | DWOId = 0 , |
||
bool | SplitDebugInlining = true , |
||
bool | DebugInfoForProfiling = false , |
||
DICompileUnit::DebugNameTableKind | NameTableKind = DICompileUnit::DebugNameTableKind::Default , |
||
bool | RangesBaseAddress = false |
||
) |
A CompileUnit provides an anchor for all debugging information generated during this instance of compilation.
Lang | Source programming language, eg. dwarf::DW_LANG_C99 |
File | File info. |
Producer | Identify the producer of debugging information and code. Usually this is a compiler version string. |
isOptimized | A boolean flag which indicates whether optimization is enabled or not. |
Flags | This 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. |
RV | This indicates runtime version for languages like Objective-C. |
SplitName | The name of the file that we'll split debug info out into. |
Kind | The kind of debug information to generate. |
DWOId | The DWOId if this is a split skeleton compile unit. |
SplitDebugInlining | Whether to emit inline debug info. |
DebugInfoForProfiling | Whether to emit extra debug info for profile collection. |
NameTableKind | Whether to emit .debug_gnu_pubnames, .debug_pubnames, or no pubnames at all. |
Definition at line 138 of file DIBuilder.cpp.
References llvm::NamedMDNode::addOperand(), assert(), llvm::dwarf::DW_LANG_lo_user, llvm::MDNode::getDistinct(), and llvm::Module::getOrInsertNamedMetadata().
|
inline |
Create an expression for a variable that does not have an address, but does have a constant value.
Definition at line 643 of file DIBuilder.h.
References createFunction(), createImportedDeclaration(), createImportedModule(), createLexicalBlock(), createLexicalBlockFile(), createMethod(), createModule(), createNameSpace(), createTempFunctionFwdDecl(), llvm::MDNode::get(), replaceArrays(), and replaceVTableHolder().
DICompositeType * DIBuilder::createEnumerationType | ( | DIScope * | Scope, |
StringRef | Name, | ||
DIFile * | File, | ||
unsigned | LineNumber, | ||
uint64_t | SizeInBits, | ||
uint32_t | AlignInBits, | ||
DINodeArray | Elements, | ||
DIType * | UnderlyingType, | ||
StringRef | UniqueIdentifier = "" , |
||
bool | IsScoped = false |
||
) |
Create debugging information entry for an enumeration.
Scope | Scope in which this enumeration is defined. |
Name | Union name. |
File | File where this member is defined. |
LineNumber | Line number. |
SizeInBits | Member size. |
AlignInBits | Member alignment. |
Elements | Enumeration elements. |
UnderlyingType | Underlying type of a C++11/ObjC fixed enum. |
UniqueIdentifier | A unique identifier for the enum. |
IsScoped | Boolean flag indicate if this is C++11/ObjC 'enum class'. |
Definition at line 504 of file DIBuilder.cpp.
References llvm::MDNode::get(), and getNonCompileUnitScope().
DIEnumerator * DIBuilder::createEnumerator | ( | StringRef | Name, |
int64_t | Val, | ||
bool | IsUnsigned = false |
||
) |
Create a single enumerator value.
Definition at line 245 of file DIBuilder.cpp.
References assert(), llvm::StringRef::empty(), and llvm::MDNode::get().
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.
Addr | An array of complex address operations. |
Definition at line 735 of file DIBuilder.cpp.
References llvm::MDNode::get().
Referenced by createExpression(), createGlobalVariableExpression(), and replaceOneDbgValueForAlloca().
DIExpression * DIBuilder::createExpression | ( | ArrayRef< int64_t > | Addr | ) |
Definition at line 739 of file DIBuilder.cpp.
References llvm::ArrayRef< T >::begin(), createExpression(), and llvm::ArrayRef< T >::end().
DIFile * DIBuilder::createFile | ( | StringRef | Filename, |
StringRef | Directory, | ||
Optional< DIFile::ChecksumInfo< StringRef >> | Checksum = None , |
||
Optional< StringRef > | Source = None |
||
) |
Create a file descriptor to hold debugging information for a file.
Filename | File name. |
Directory | Directory. |
Checksum | Optional checksum kind (e.g. CSK_MD5, CSK_SHA1, etc.) and value. |
Source | Optional source text. |
Definition at line 214 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 , |
||
uint32_t | AlignInBits = 0 , |
||
StringRef | UniqueIdentifier = "" |
||
) |
Create a permanent forward-declared type.
Definition at line 575 of file DIBuilder.cpp.
References llvm::MDNode::get(), and getNonCompileUnitScope().
DIDerivedType * DIBuilder::createFriend | ( | DIType * | Ty, |
DIType * | FriendTy | ||
) |
Create debugging information entry for a 'friend'.
Definition at line 315 of file DIBuilder.cpp.
References assert(), llvm::MDNode::get(), and llvm::None.
DISubprogram * DIBuilder::createFunction | ( | DIScope * | Scope, |
StringRef | Name, | ||
StringRef | LinkageName, | ||
DIFile * | File, | ||
unsigned | LineNo, | ||
DISubroutineType * | Ty, | ||
unsigned | ScopeLine, | ||
DINode::DIFlags | Flags = DINode::FlagZero , |
||
DISubprogram::DISPFlags | SPFlags = DISubprogram::SPFlagZero , |
||
DITemplateParameterArray | TParams = nullptr , |
||
DISubprogram * | Decl = nullptr , |
||
DITypeArray | ThrownTypes = nullptr |
||
) |
Create a new descriptor for the specified subprogram.
See comments in DISubprogram* for descriptions of these fields.
Scope | Function scope. |
Name | Function name. |
LinkageName | Mangled function name. |
File | File where this variable is defined. |
LineNo | Line number. |
Ty | Function type. |
ScopeLine | Set to the beginning of the scope this starts |
Flags | e.g. is this function prototyped or not. These flags are used to emit dwarf attributes. |
SPFlags | Additional flags specific to subprograms. |
TParams | Function template parameters. |
ThrownTypes | Exception types this function may throw. |
Definition at line 752 of file DIBuilder.cpp.
Referenced by createConstantValueExpression(), and INITIALIZE_PASS().
DIGlobalVariableExpression * DIBuilder::createGlobalVariableExpression | ( | DIScope * | Context, |
StringRef | Name, | ||
StringRef | LinkageName, | ||
DIFile * | File, | ||
unsigned | LineNo, | ||
DIType * | Ty, | ||
bool | isLocalToUnit, | ||
DIExpression * | Expr = nullptr , |
||
MDNode * | Decl = nullptr , |
||
MDTuple * | templateParams = nullptr , |
||
uint32_t | AlignInBits = 0 |
||
) |
Create a new descriptor for the specified variable.
Context | Variable scope. |
Name | Name of the variable. |
LinkageName | Mangled name of the variable. |
File | File where this variable is defined. |
LineNo | Line number. |
Ty | Variable Type. |
isLocalToUnit | Boolean flag indicate whether this variable is externally visible or not. |
Expr | The location of the global relative to the attached GlobalVariable. |
Decl | Reference to the corresponding declaration. |
AlignInBits | Variable alignment(or 0 if no alignment attr was specified) |
Definition at line 640 of file DIBuilder.cpp.
References checkGlobalVariableScope(), createExpression(), llvm::MDNode::get(), llvm::MDNode::getDistinct(), and N.
DIImportedEntity * DIBuilder::createImportedDeclaration | ( | DIScope * | Context, |
DINode * | Decl, | ||
DIFile * | File, | ||
unsigned | Line, | ||
StringRef | Name = "" |
||
) |
Create a descriptor for an imported function.
Context | The scope this module is imported into. |
Decl | The declaration (or definition) of a function, type, or variable. |
File | File where the declaration is located. |
Line | Line number of the declaration. |
Definition at line 202 of file DIBuilder.cpp.
References createImportedModule().
Referenced by createConstantValueExpression().
DIImportedEntity * DIBuilder::createImportedModule | ( | DIScope * | Context, |
DINamespace * | NS, | ||
DIFile * | File, | ||
unsigned | Line | ||
) |
Create a descriptor for an imported module.
Context | The scope this module is imported into |
NS | The namespace being imported here. |
File | File where the declaration is located. |
Line | Line number of the declaration. |
Definition at line 179 of file DIBuilder.cpp.
References createImportedModule().
Referenced by createConstantValueExpression().
DIImportedEntity * DIBuilder::createImportedModule | ( | DIScope * | Context, |
DIImportedEntity * | NS, | ||
DIFile * | File, | ||
unsigned | Line | ||
) |
Create a descriptor for an imported module.
Context | The scope this module is imported into. |
NS | An aliased namespace. |
File | File where the declaration is located. |
Line | Line number of the declaration. |
Definition at line 187 of file DIBuilder.cpp.
References createImportedModule().
DIImportedEntity * DIBuilder::createImportedModule | ( | DIScope * | Context, |
DIModule * | M, | ||
DIFile * | File, | ||
unsigned | Line | ||
) |
Create a descriptor for an imported module.
Context | The scope this module is imported into. |
M | The module being imported here |
File | File where the declaration is located. |
Line | Line number of the declaration. |
Definition at line 195 of file DIBuilder.cpp.
References createImportedModule().
DIDerivedType * DIBuilder::createInheritance | ( | DIType * | Ty, |
DIType * | BaseTy, | ||
uint64_t | BaseOffset, | ||
uint32_t | VBPtrOffset, | ||
DINode::DIFlags | Flags | ||
) |
Create debugging information entry to establish inheritance relationship between two types.
Ty | Original type. |
BaseTy | Base type. Ty is inherits from base. |
BaseOffset | Base offset. |
VBPtrOffset | Virtual base pointer offset. |
Flags | Flags to describe inheritance attribute, e.g. private |
Definition at line 322 of file DIBuilder.cpp.
References assert(), llvm::IntegerType::get(), llvm::ConstantInt::get(), llvm::ConstantAsMetadata::get(), llvm::MDNode::get(), and llvm::None.
DILabel * DIBuilder::createLabel | ( | DIScope * | Scope, |
StringRef | Name, | ||
DIFile * | File, | ||
unsigned | LineNo, | ||
bool | AlwaysPreserve = false |
||
) |
Create a new descriptor for an label.
Scope
must be a DILocalScope, and thus its scope chain eventually leads to a DISubprogram.
The optimizer may remove labels. If there is an interest to preserve label info in such situation then append it to the list of retained nodes of the DISubprogram.
Definition at line 715 of file DIBuilder.cpp.
References Context, and getNonCompileUnitScope().
DILexicalBlock * DIBuilder::createLexicalBlock | ( | DIScope * | Scope, |
DIFile * | File, | ||
unsigned | Line, | ||
unsigned | Col | ||
) |
This creates a descriptor for a lexical block with the specified parent context.
Scope | Parent lexical scope. |
File | Source file. |
Line | Line number. |
Col | Column number. |
Definition at line 835 of file DIBuilder.cpp.
References llvm::MDNode::getDistinct(), and getNonCompileUnitScope().
Referenced by createConstantValueExpression().
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.
Scope | Lexical block. |
File | Source file. |
Discriminator | DWARF path discriminator value. |
Definition at line 829 of file DIBuilder.cpp.
References llvm::MDNode::get().
Referenced by createConstantValueExpression().
DIMacro * DIBuilder::createMacro | ( | DIMacroFile * | Parent, |
unsigned | Line, | ||
unsigned | MacroType, | ||
StringRef | Name, | ||
StringRef | Value = StringRef() |
||
) |
Create debugging information entry for a macro.
Parent | Macro parent (could be nullptr). |
Line | Source line number where the macro is defined. |
MacroType | DW_MACINFO_define or DW_MACINFO_undef. |
Name | Macro name. |
Value | Macro value. |
Definition at line 220 of file DIBuilder.cpp.
References assert(), llvm::dwarf::DW_MACINFO_define, llvm::dwarf::DW_MACINFO_undef, llvm::StringRef::empty(), and llvm::MDNode::get().
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.
PointeeTy | Type pointed to by this pointer. |
SizeInBits | Size. |
AlignInBits | Alignment. (optional) |
Class | Type for which this pointer points to members of. |
Definition at line 286 of file DIBuilder.cpp.
References llvm::MDNode::get(), and llvm::None.
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.
Scope | Member scope. |
Name | Member name. |
File | File where this member is defined. |
LineNo | Line number. |
SizeInBits | Member size. |
AlignInBits | Member alignment. |
OffsetInBits | Member offset. |
Flags | Flags to encode member attribute, e.g. private |
Ty | Parent type. |
Definition at line 334 of file DIBuilder.cpp.
References llvm::MDNode::get(), getNonCompileUnitScope(), and llvm::None.
DISubprogram * DIBuilder::createMethod | ( | DIScope * | Scope, |
StringRef | Name, | ||
StringRef | LinkageName, | ||
DIFile * | File, | ||
unsigned | LineNo, | ||
DISubroutineType * | Ty, | ||
unsigned | VTableIndex = 0 , |
||
int | ThisAdjustment = 0 , |
||
DIType * | VTableHolder = nullptr , |
||
DINode::DIFlags | Flags = DINode::FlagZero , |
||
DISubprogram::DISPFlags | SPFlags = DISubprogram::SPFlagZero , |
||
DITemplateParameterArray | TParams = nullptr , |
||
DITypeArray | ThrownTypes = nullptr |
||
) |
Create a new descriptor for the specified C++ method.
See comments in DISubprogram* for descriptions of these fields.
Scope | Function scope. |
Name | Function name. |
LinkageName | Mangled function name. |
File | File where this variable is defined. |
LineNo | Line number. |
Ty | Function type. |
VTableIndex | Index no of this method in virtual table, or -1u if unrepresentable. |
ThisAdjustment | MS ABI-specific adjustment of 'this' that occurs in the prologue. |
VTableHolder | Type that holds vtable. |
Flags | e.g. is this function prototyped or not. This flags are used to emit dwarf attributes. |
SPFlags | Additional flags specific to subprograms. |
TParams | Function template parameters. |
ThrownTypes | Exception types this function may throw. |
Definition at line 786 of file DIBuilder.cpp.
References assert(), getNonCompileUnitScope(), and getSubprogram().
Referenced by createConstantValueExpression().
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.
Scope | Parent scope |
Name | Name of this module |
ConfigurationMacros | A space-separated shell-quoted list of -D macro definitions as they would appear on a command line. |
IncludePath | The path to the module map file. |
ISysRoot | The clang system root (value of -isysroot). |
Definition at line 821 of file DIBuilder.cpp.
References llvm::MDNode::get(), and getNonCompileUnitScope().
Referenced by createConstantValueExpression().
DINamespace * DIBuilder::createNameSpace | ( | DIScope * | Scope, |
StringRef | Name, | ||
bool | ExportSymbols | ||
) |
This creates new descriptor for a namespace with the specified parent scope.
Scope | Namespace scope |
Name | Name of this namespace |
ExportSymbols | True for C++ inline namespaces. |
Definition at line 809 of file DIBuilder.cpp.
References llvm::MDNode::get(), and getNonCompileUnitScope().
Referenced by createConstantValueExpression().
DIBasicType * DIBuilder::createNullPtrType | ( | ) |
Create C++11 nullptr type.
Definition at line 256 of file DIBuilder.cpp.
References createUnspecifiedType().
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.
Name | Member name. |
File | File where this member is defined. |
LineNo | Line number. |
SizeInBits | Member size. |
AlignInBits | Member alignment. |
OffsetInBits | Member offset. |
Flags | Flags to encode member attribute, e.g. private |
Ty | Parent type. |
PropertyNode | Property associated with this ivar. |
Definition at line 387 of file DIBuilder.cpp.
References llvm::MDNode::get(), getNonCompileUnitScope(), and llvm::None.
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.
Name | Property name. |
File | File where this property is defined. |
LineNumber | Line number. |
GetterName | Name of the Objective C property getter selector. |
SetterName | Name of the Objective C property setter selector. |
PropertyAttributes | Objective C property attributes. |
Ty | Type. |
Definition at line 398 of file DIBuilder.cpp.
References llvm::MDNode::get().
Create a uniqued clone of Ty
with FlagObjectPointer and FlagArtificial set.
Definition at line 556 of file DIBuilder.cpp.
References createTypeWithFlags(), and llvm::DIType::isObjectPointer().
DILocalVariable * DIBuilder::createParameterVariable | ( | DIScope * | Scope, |
StringRef | Name, | ||
unsigned | ArgNo, | ||
DIFile * | File, | ||
unsigned | LineNo, | ||
DIType * | Ty, | ||
bool | AlwaysPreserve = false , |
||
DINode::DIFlags | Flags = DINode::FlagZero |
||
) |
Create a new descriptor for a parameter variable.
Scope
must be a DILocalScope, and thus its scope chain eventually leads to a DISubprogram.
ArgNo
is the index (starting from 1
) of this variable in the subprogram parameters. ArgNo
should not conflict with other parameters of the same subprogram.
If AlwaysPreserve
, this variable will be referenced from its containing subprogram, and will survive some optimizations.
Definition at line 706 of file DIBuilder.cpp.
References assert(), and createLocalVariable().
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.
PointeeTy | Type pointed by this pointer. |
SizeInBits | Size. |
AlignInBits | Alignment. (optional) |
DWARFAddressSpace | DWARF address space. (optional) |
Name | Pointer type name. (optional) |
Definition at line 273 of file DIBuilder.cpp.
References llvm::MDNode::get().
DIDerivedType * DIBuilder::createQualifiedType | ( | unsigned | Tag, |
DIType * | FromTy | ||
) |
Create debugging information entry for a qualified type, e.g.
'const int'.
Definition at line 268 of file DIBuilder.cpp.
References llvm::MDNode::get(), and llvm::None.
DIDerivedType * DIBuilder::createReferenceType | ( | unsigned | Tag, |
DIType * | RTy, | ||
uint64_t | SizeInBits = 0 , |
||
uint32_t | AlignInBits = 0 , |
||
Optional< unsigned > | DWARFAddressSpace = None |
||
) |
Create debugging information entry for a c++ style reference or rvalue reference type.
Definition at line 296 of file DIBuilder.cpp.
References assert(), and llvm::MDNode::get().
DICompositeType * DIBuilder::createReplaceableCompositeType | ( | unsigned | Tag, |
StringRef | Name, | ||
DIScope * | Scope, | ||
DIFile * | F, | ||
unsigned | Line, | ||
unsigned | RuntimeLang = 0 , |
||
uint64_t | SizeInBits = 0 , |
||
uint32_t | AlignInBits = 0 , |
||
DINode::DIFlags | Flags = DINode::FlagFwdDecl , |
||
StringRef | UniqueIdentifier = "" |
||
) |
Create a temporary forward-declared type.
Definition at line 589 of file DIBuilder.cpp.
References getNonCompileUnitScope(), and llvm::MDNode::getTemporary().
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.
Scope | Member scope. |
Name | Member name. |
File | File where this member is declared. |
LineNo | Line number. |
Ty | Type of the static member. |
Flags | Flags to encode member attribute, e.g. private. |
Val | Const initializer of the member. |
AlignInBits | Member alignment. |
Definition at line 375 of file DIBuilder.cpp.
References llvm::MDNode::get(), getConstantOrNull(), getNonCompileUnitScope(), and llvm::None.
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.
Scope | Scope in which this struct is defined. |
Name | Struct name. |
File | File where this member is defined. |
LineNumber | Line number. |
SizeInBits | Member size. |
AlignInBits | Member alignment. |
Flags | Flags to encode member attribute, e.g. private |
Elements | Struct elements. |
RunTimeLang | Optional parameter, Objective-C runtime version. |
UniqueIdentifier | A unique identifier for the struct. |
Definition at line 461 of file DIBuilder.cpp.
References llvm::MDNode::get(), and getNonCompileUnitScope().
DISubroutineType * DIBuilder::createSubroutineType | ( | DITypeRefArray | ParameterTypes, |
DINode::DIFlags | Flags = DINode::FlagZero , |
||
unsigned | CC = 0 |
||
) |
Create subroutine type.
ParameterTypes | An array of subroutine parameter types. This includes return type at 0th index. |
Flags | E.g.: LValueReference. These flags are used to emit dwarf attributes. |
CC | Calling convention, e.g. dwarf::DW_CC_normal |
Definition at line 498 of file DIBuilder.cpp.
References llvm::MDNode::get().
Referenced by INITIALIZE_PASS().
DISubprogram * DIBuilder::createTempFunctionFwdDecl | ( | DIScope * | Scope, |
StringRef | Name, | ||
StringRef | LinkageName, | ||
DIFile * | File, | ||
unsigned | LineNo, | ||
DISubroutineType * | Ty, | ||
unsigned | ScopeLine, | ||
DINode::DIFlags | Flags = DINode::FlagZero , |
||
DISubprogram::DISPFlags | SPFlags = DISubprogram::SPFlagZero , |
||
DITemplateParameterArray | TParams = nullptr , |
||
DISubprogram * | Decl = nullptr , |
||
DITypeArray | ThrownTypes = nullptr |
||
) |
Identical to createFunction, except that the resulting DbgNode is meant to be RAUWed.
Definition at line 771 of file DIBuilder.cpp.
References getNonCompileUnitScope(), and llvm::MDNode::getTemporary().
Referenced by createConstantValueExpression().
DIGlobalVariable * DIBuilder::createTempGlobalVariableFwdDecl | ( | DIScope * | Context, |
StringRef | Name, | ||
StringRef | LinkageName, | ||
DIFile * | File, | ||
unsigned | LineNo, | ||
DIType * | Ty, | ||
bool | isLocalToUnit, | ||
MDNode * | Decl = nullptr , |
||
MDTuple * | templateParams = nullptr , |
||
uint32_t | AlignInBits = 0 |
||
) |
Identical to createGlobalVariable except that the resulting DbgNode is temporary and meant to be RAUWed.
Definition at line 657 of file DIBuilder.cpp.
References checkGlobalVariableScope(), and llvm::MDNode::getTemporary().
DITemplateValueParameter * DIBuilder::createTemplateParameterPack | ( | DIScope * | Scope, |
StringRef | Name, | ||
DIType * | Ty, | ||
DINodeArray | Val | ||
) |
Create debugging information for a template parameter pack.
Scope | Scope in which this type is defined. |
Name | Value parameter name. |
Ty | Parameter type. |
Val | An array of types in the pack. |
Definition at line 437 of file DIBuilder.cpp.
References createTemplateValueParameterHelper(), and llvm::MDNode::get().
DITemplateValueParameter * DIBuilder::createTemplateTemplateParameter | ( | DIScope * | Scope, |
StringRef | Name, | ||
DIType * | Ty, | ||
StringRef | Val | ||
) |
Create debugging information for a template template parameter.
Scope | Scope in which this type is defined. |
Name | Value parameter name. |
Ty | Parameter type. |
Val | The fully qualified name of the template. |
Definition at line 429 of file DIBuilder.cpp.
References createTemplateValueParameterHelper(), and llvm::MDString::get().
DITemplateTypeParameter * DIBuilder::createTemplateTypeParameter | ( | DIScope * | Scope, |
StringRef | Name, | ||
DIType * | Ty | ||
) |
Create debugging information for template type parameter.
Scope | Scope in which this type is defined. |
Name | Type parameter name. |
Ty | Parameter type. |
Definition at line 406 of file DIBuilder.cpp.
References assert(), and llvm::MDNode::get().
DITemplateValueParameter * DIBuilder::createTemplateValueParameter | ( | DIScope * | Scope, |
StringRef | Name, | ||
DIType * | Ty, | ||
Constant * | Val | ||
) |
Create debugging information for template value parameter.
Scope | Scope in which this type is defined. |
Name | Value parameter name. |
Ty | Parameter type. |
Val | Constant parameter value. |
Definition at line 421 of file DIBuilder.cpp.
References createTemplateValueParameterHelper(), and getConstantOrNull().
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.
Parent | Macro file parent (could be nullptr). |
Line | Source line number where the macro file is included. |
File | File descriptor containing the name of the macro file. |
Definition at line 232 of file DIBuilder.cpp.
References llvm::dwarf::DW_MACINFO_start_file, and llvm::MDNode::getTemporary().
DIDerivedType * DIBuilder::createTypedef | ( | DIType * | Ty, |
StringRef | Name, | ||
DIFile * | File, | ||
unsigned | LineNo, | ||
DIScope * | Context | ||
) |
Create debugging information entry for a typedef.
Ty | Original type. |
Name | Typedef name. |
File | File where this type is defined. |
LineNo | Line number. |
Context | The surrounding context for the typedef. |
Definition at line 307 of file DIBuilder.cpp.
References llvm::MDNode::get(), getNonCompileUnitScope(), and llvm::None.
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.
Scope | Scope in which this union is defined. |
Name | Union name. |
File | File where this member is defined. |
LineNumber | Line number. |
SizeInBits | Member size. |
AlignInBits | Member alignment. |
Flags | Flags to encode member attribute, e.g. private |
Elements | Union elements. |
RunTimeLang | Optional parameter, Objective-C runtime version. |
UniqueIdentifier | A unique identifier for the union. |
Definition at line 474 of file DIBuilder.cpp.
References llvm::MDNode::get(), and getNonCompileUnitScope().
DIBasicType * DIBuilder::createUnspecifiedParameter | ( | ) |
Create unspecified parameter type for a subroutine type.
Definition at line 572 of file DIBuilder.cpp.
DIBasicType * DIBuilder::createUnspecifiedType | ( | StringRef | Name | ) |
Create a DWARF unspecified type.
Definition at line 251 of file DIBuilder.cpp.
References assert(), llvm::StringRef::empty(), and llvm::MDNode::get().
Referenced by createNullPtrType().
DIDerivedType * DIBuilder::createVariantMemberType | ( | DIScope * | Scope, |
StringRef | Name, | ||
DIFile * | File, | ||
unsigned | LineNo, | ||
uint64_t | SizeInBits, | ||
uint32_t | AlignInBits, | ||
uint64_t | OffsetInBits, | ||
Constant * | Discriminant, | ||
DINode::DIFlags | Flags, | ||
DIType * | Ty | ||
) |
Create debugging information entry for a variant.
A variant normally should be a member of a variant part.
Scope | Member scope. |
Name | Member name. |
File | File where this member is defined. |
LineNo | Line number. |
SizeInBits | Member size. |
AlignInBits | Member alignment. |
OffsetInBits | Member offset. |
Flags | Flags to encode member attribute, e.g. private |
Discriminant | The discriminant for this branch; null for the default branch |
Ty | Parent type. |
Definition at line 351 of file DIBuilder.cpp.
References llvm::MDNode::get(), getConstantOrNull(), getNonCompileUnitScope(), and llvm::None.
DICompositeType * DIBuilder::createVariantPart | ( | DIScope * | Scope, |
StringRef | Name, | ||
DIFile * | File, | ||
unsigned | LineNumber, | ||
uint64_t | SizeInBits, | ||
uint32_t | AlignInBits, | ||
DINode::DIFlags | Flags, | ||
DIDerivedType * | Discriminator, | ||
DINodeArray | Elements, | ||
StringRef | UniqueIdentifier = "" |
||
) |
Create debugging information entry for a variant part.
A variant part normally has a discriminator (though this is not required) and a number of variant children.
Scope | Scope in which this union is defined. |
Name | Union name. |
File | File where this member is defined. |
LineNumber | Line number. |
SizeInBits | Member size. |
AlignInBits | Member alignment. |
Flags | Flags to encode member attribute, e.g. private |
Discriminator | Discriminant member |
Elements | Variant elements. |
UniqueIdentifier | A unique identifier for the union. |
Definition at line 486 of file DIBuilder.cpp.
References llvm::MDNode::get(), and getNonCompileUnitScope().
DICompositeType * DIBuilder::createVectorType | ( | uint64_t | Size, |
uint32_t | AlignInBits, | ||
DIType * | Ty, | ||
DINodeArray | Subscripts | ||
) |
Create debugging information entry for a vector type.
Size | Array size. |
AlignInBits | Alignment. |
Ty | Element type. |
Subscripts | Subscripts. |
Definition at line 528 of file DIBuilder.cpp.
References llvm::MDNode::get().
void DIBuilder::finalize | ( | ) |
Construct any deferred debug info descriptors.
Definition at line 69 of file DIBuilder.cpp.
References assert(), llvm::dwarf::DW_MACINFO_start_file, E, llvm::SmallVectorBase::empty(), finalizeSubprogram(), llvm::MDNode::get(), llvm::MDTuple::get(), getOrCreateMacroArray(), I, llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::MDNode::isResolved(), llvm::SmallVectorTemplateBase< T >::push_back(), llvm::DICompileUnit::replaceEnumTypes(), llvm::DICompileUnit::replaceGlobalVariables(), llvm::DICompileUnit::replaceImportedEntities(), llvm::DICompileUnit::replaceMacros(), llvm::DICompileUnit::replaceRetainedTypes(), replaceTemporary(), and llvm::MDNode::resolveCycles().
Referenced by INITIALIZE_PASS().
void DIBuilder::finalizeSubprogram | ( | DISubprogram * | SP | ) |
Finalize a specific subprogram - no new variables may be added to this subprogram afterwards.
Definition at line 49 of file DIBuilder.cpp.
References llvm::SmallVectorImpl< T >::append(), llvm::MDNode::get(), llvm::MDNode::isTemporary(), and llvm::AArch64CC::PL.
Referenced by finalize(), and INITIALIZE_PASS().
Get a DINodeArray, create one if required.
Definition at line 603 of file DIBuilder.cpp.
References llvm::MDTuple::get().
Get a DIMacroNodeArray, create one if required.
Definition at line 608 of file DIBuilder.cpp.
References llvm::MDTuple::get().
Referenced by finalize().
DISubrange * DIBuilder::getOrCreateSubrange | ( | int64_t | Lo, |
int64_t | Count | ||
) |
Create a descriptor for a value range.
This implicitly uniques the values returned.
Definition at line 623 of file DIBuilder.cpp.
References llvm::MDNode::get().
DISubrange * DIBuilder::getOrCreateSubrange | ( | int64_t | Lo, |
Metadata * | CountNode | ||
) |
Definition at line 627 of file DIBuilder.cpp.
References llvm::MDNode::get().
DITypeRefArray DIBuilder::getOrCreateTypeArray | ( | ArrayRef< Metadata *> | Elements | ) |
Get a DITypeRefArray, create one if required.
Definition at line 612 of file DIBuilder.cpp.
References llvm::MDNode::get(), llvm::SmallVectorTemplateBase< T >::push_back(), and llvm::ArrayRef< T >::size().
Referenced by INITIALIZE_PASS().
Instruction * DIBuilder::insertDbgValueIntrinsic | ( | llvm::Value * | Val, |
DILocalVariable * | VarInfo, | ||
DIExpression * | Expr, | ||
const DILocation * | DL, | ||
BasicBlock * | InsertAtEnd | ||
) |
Insert a new llvm.dbg.value intrinsic call.
Val | llvm::Value of the variable |
VarInfo | Variable's debug info descriptor. |
Expr | A complex location expression. |
DL | Debug info location. |
InsertAtEnd | Location for the new intrinsic. |
Definition at line 881 of file DIBuilder.cpp.
Instruction * DIBuilder::insertDbgValueIntrinsic | ( | llvm::Value * | Val, |
DILocalVariable * | VarInfo, | ||
DIExpression * | Expr, | ||
const DILocation * | DL, | ||
Instruction * | InsertBefore | ||
) |
Insert a new llvm.dbg.value intrinsic call.
Val | llvm::Value of the variable |
VarInfo | Variable's debug info descriptor. |
Expr | A complex location expression. |
DL | Debug info location. |
InsertBefore | Location for the new intrinsic. |
Definition at line 871 of file DIBuilder.cpp.
References llvm::Instruction::getParent().
Instruction * DIBuilder::insertDeclare | ( | llvm::Value * | Storage, |
DILocalVariable * | VarInfo, | ||
DIExpression * | Expr, | ||
const DILocation * | DL, | ||
BasicBlock * | InsertAtEnd | ||
) |
Insert a new llvm.dbg.declare intrinsic call.
Storage | llvm::Value of the variable |
VarInfo | Variable's debug info descriptor. |
Expr | A complex location expression. |
DL | Debug info location. |
InsertAtEnd | Location for the new intrinsic. |
Definition at line 850 of file DIBuilder.cpp.
References llvm::BasicBlock::getTerminator().
Instruction * DIBuilder::insertDeclare | ( | llvm::Value * | Storage, |
DILocalVariable * | VarInfo, | ||
DIExpression * | Expr, | ||
const DILocation * | DL, | ||
Instruction * | InsertBefore | ||
) |
Insert a new llvm.dbg.declare intrinsic call.
Storage | llvm::Value of the variable |
VarInfo | Variable's debug info descriptor. |
Expr | A complex location expression. |
DL | Debug info location. |
InsertBefore | Location for the new intrinsic. |
Definition at line 843 of file DIBuilder.cpp.
References llvm::Instruction::getParent().
Instruction * DIBuilder::insertLabel | ( | DILabel * | LabelInfo, |
const DILocation * | DL, | ||
Instruction * | InsertBefore | ||
) |
Insert a new llvm.dbg.label intrinsic call.
LabelInfo | Label's debug info descriptor. |
DL | Debug info location. |
InsertBefore | Location for the new intrinsic. |
Definition at line 859 of file DIBuilder.cpp.
References llvm::Instruction::getParent().
Instruction * DIBuilder::insertLabel | ( | DILabel * | LabelInfo, |
const DILocation * | DL, | ||
BasicBlock * | InsertAtEnd | ||
) |
Insert a new llvm.dbg.label intrinsic call.
LabelInfo | Label's debug info descriptor. |
DL | Debug info location. |
InsertAtEnd | Location for the new intrinsic. |
Definition at line 866 of file DIBuilder.cpp.
void DIBuilder::replaceArrays | ( | DICompositeType *& | T, |
DINodeArray | Elements, | ||
DINodeArray | TParams = DINodeArray() |
||
) |
Replace arrays on a composite type.
If T
is resolved, but the arrays aren't – which can happen if T
has a self-reference – DIBuilder needs to track the array to resolve cycles.
Definition at line 994 of file DIBuilder.cpp.
References llvm::TypedTrackingMDRef< T >::get(), llvm::MDNode::isResolved(), N, llvm::DICompositeType::replaceElements(), and llvm::DICompositeType::replaceTemplateParams().
Referenced by createConstantValueExpression().
|
inline |
Replace a temporary node.
Call MDNode::replaceAllUsesWith() on N
, replacing it with Replacement
.
If Replacement
is the same as N.get()
, instead call MDNode::replaceWithUniqued(). In this case, the uniqued node could have a different address, so we return the final address.
Definition at line 867 of file DIBuilder.h.
References DEFINE_ISA_CONVERSION_FUNCTIONS, llvm::MDNode::get(), llvm::MDNode::replaceAllUsesWith(), and llvm::MDNode::replaceWithUniqued().
Referenced by finalize().
void DIBuilder::replaceVTableHolder | ( | DICompositeType *& | T, |
DIType * | VTableHolder | ||
) |
Replace the vtable holder in the given type.
If this creates a self reference, it may orphan some unresolved cycles in the operands of T
, so DIBuilder needs to track that.
Definition at line 974 of file DIBuilder.cpp.
References llvm::TypedTrackingMDRef< T >::get(), llvm::MDNode::isResolved(), N, llvm::RISCVFenceField::O, llvm::MDNode::operands(), and llvm::DICompositeType::replaceVTableHolder().
Referenced by createConstantValueExpression().
void DIBuilder::retainType | ( | DIScope * | T | ) |
Retain DIScope* in a module even if it is not referenced through debug info anchors.
Definition at line 564 of file DIBuilder.cpp.
References assert().