15 #ifndef LLVM_IR_DIBUILDER_H 16 #define LLVM_IR_DIBUILDER_H 64 bool AllowUnresolvedNodes;
79 void trackIfUnresolved(
MDNode *
N);
141 bool isOptimized,
StringRef Flags,
unsigned RV,
144 DICompileUnit::DebugEmissionKind::FullDebug,
145 uint64_t DWOId = 0,
bool SplitDebugInlining =
true,
146 bool DebugInfoForProfiling =
false,
149 bool RangesBaseAddress =
false);
224 uint64_t SizeInBits,
uint32_t AlignInBits = 0,
230 uint64_t SizeInBits = 0,
256 uint64_t BaseOffset,
uint32_t VBPtrOffset,
270 DIFile *File,
unsigned LineNo,
273 uint64_t OffsetInBits,
290 DIFile *File,
unsigned LineNo,
293 uint64_t OffsetInBits,
309 uint64_t SizeInBits, uint64_t OffsetInBits,
323 DIFile *File,
unsigned LineNo,
340 uint64_t SizeInBits,
uint32_t AlignInBits,
357 unsigned PropertyAttributes,
DIType *Ty);
377 uint64_t SizeInBits,
uint32_t AlignInBits, uint64_t OffsetInBits,
379 DIType *VTableHolder =
nullptr,
MDNode *TemplateParms =
nullptr,
396 DIType *DerivedFrom, DINodeArray Elements,
unsigned RunTimeLang = 0,
411 DIFile *File,
unsigned LineNumber,
412 uint64_t SizeInBits,
uint32_t AlignInBits,
414 DINodeArray Elements,
415 unsigned RunTimeLang = 0,
432 DIFile *File,
unsigned LineNumber,
433 uint64_t SizeInBits,
uint32_t AlignInBits,
436 DINodeArray Elements,
484 DIType *Ty, DINodeArray Subscripts);
492 DIType *Ty, DINodeArray Subscripts);
508 uint64_t SizeInBits,
uint32_t AlignInBits, DINodeArray Elements,
509 DIType *UnderlyingType,
StringRef UniqueIdentifier =
"",
bool IsScoped =
false);
535 unsigned RuntimeLang = 0,
536 uint64_t SizeInBits = 0,
543 unsigned RuntimeLang = 0, uint64_t SizeInBits = 0,
585 unsigned LineNo,
DIType *Ty,
bool isLocalToUnit,
593 unsigned LineNo,
DIType *Ty,
bool isLocalToUnit,
MDNode *Decl =
nullptr,
606 unsigned LineNo,
DIType *Ty,
bool AlwaysPreserve =
false,
616 bool AlwaysPreserve =
false);
632 bool AlwaysPreserve =
false,
645 VMContext, {dwarf::DW_OP_constu, Val, dwarf::DW_OP_stack_value});
667 DITemplateParameterArray TParams =
nullptr,
669 DITypeArray ThrownTypes =
nullptr);
678 DITemplateParameterArray TParams =
nullptr,
679 DISubprogram *Decl =
nullptr, DITypeArray ThrownTypes =
nullptr);
703 unsigned VTableIndex = 0,
int ThisAdjustment = 0,
704 DIType *VTableHolder =
nullptr,
707 DITemplateParameterArray TParams =
nullptr,
708 DITypeArray ThrownTypes =
nullptr);
739 unsigned Discriminator = 0);
748 unsigned Line,
unsigned Col);
756 DIFile *File,
unsigned Line);
773 DIFile *File,
unsigned Line);
782 DIFile *File,
unsigned Line,
856 DINodeArray TParams = DINodeArray());
866 template <
class NodeTy>
868 if (N.
get() == Replacement)
881 #endif // LLVM_IR_DIBUILDER_H void finalize()
Construct any deferred debug info descriptors.
DIDerivedType * createPointerType(DIType *PointeeTy, uint64_t SizeInBits, uint32_t AlignInBits=0, Optional< unsigned > DWARFAddressSpace=None, StringRef Name="")
Create debugging information entry for a pointer.
This class represents lattice values for constants.
A Module instance is used to store all the information related to an LLVM module. ...
DINamespace * createNameSpace(DIScope *Scope, StringRef Name, bool ExportSymbols)
This creates new descriptor for a namespace with the specified parent scope.
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.
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.
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...
DICompositeType * createArrayType(uint64_t Size, uint32_t AlignInBits, DIType *Ty, DINodeArray Subscripts)
Create debugging information entry for an array.
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.
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.
This class implements a map that also provides access to all stored values in a deterministic order...
struct LLVMOpaqueDIBuilder * LLVMDIBuilderRef
Represents an LLVM debug info builder.
DISubrange * getOrCreateSubrange(int64_t Lo, int64_t Count)
Create a descriptor for a value range.
DIMacro * createMacro(DIMacroFile *Parent, unsigned Line, unsigned MacroType, StringRef Name, StringRef Value=StringRef())
Create debugging information entry for a macro.
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.
void replaceArrays(DICompositeType *&T, DINodeArray Elements, DINodeArray TParams=DINodeArray())
Replace arrays on a composite type.
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.
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.
DILabel * createLabel(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo, bool AlwaysPreserve=false)
Create a new descriptor for an label.
static DIType * createObjectPointerType(DIType *Ty)
Create a uniqued clone of Ty with FlagObjectPointer and FlagArtificial set.
DIImportedEntity * createImportedModule(DIScope *Context, DINamespace *NS, DIFile *File, unsigned Line)
Create a descriptor for an imported module.
DIMacroNodeArray getOrCreateMacroArray(ArrayRef< Metadata *> Elements)
Get a DIMacroNodeArray, create one if required.
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.
Tagged DWARF-like metadata node.
DILexicalBlockFile * createLexicalBlockFile(DIScope *Scope, DIFile *File, unsigned Discriminator=0)
This creates a descriptor for a lexical block with a new file attached.
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.
amdgpu Simplify well known AMD library false Value Value const Twine & Name
DITemplateTypeParameter * createTemplateTypeParameter(DIScope *Scope, StringRef Name, DIType *Ty)
Create debugging information for template type parameter.
DIDerivedType * createTypedef(DIType *Ty, StringRef Name, DIFile *File, unsigned LineNo, DIScope *Context)
Create debugging information entry for a typedef.
DIBasicType * createUnspecifiedType(StringRef Name)
Create a DWARF unspecified type.
DIMacroFile * createTempMacroFile(DIMacroFile *Parent, unsigned Line, DIFile *File)
Create debugging information temporary entry for a macro file.
DISubroutineType * createSubroutineType(DITypeRefArray ParameterTypes, DINode::DIFlags Flags=DINode::FlagZero, unsigned CC=0)
Create subroutine type.
#define DEFINE_ISA_CONVERSION_FUNCTIONS(ty, ref)
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.
DIEnumerator * createEnumerator(StringRef Name, int64_t Val, bool IsUnsigned=false)
Create a single enumerator value.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
void replaceAllUsesWith(Metadata *MD)
RAUW a temporary.
DIBasicType * createNullPtrType()
Create C++11 nullptr type.
DITypeRefArray getOrCreateTypeArray(ArrayRef< Metadata *> Elements)
Get a DITypeRefArray, create one if required.
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.
DINodeArray getOrCreateArray(ArrayRef< Metadata *> Elements)
Get a DINodeArray, create one if required.
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata *> MDs)
static DIType * createArtificialType(DIType *Ty)
Create a uniqued clone of Ty with FlagArtificial set.
static std::enable_if< std::is_base_of< MDNode, T >::value, T * >::type replaceWithUniqued(std::unique_ptr< T, TempMDNodeDeleter > N)
Replace a temporary node with a uniqued one.
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.
A single checksum, represented by a Kind and a Value (a string).
LLVM Basic Block Representation.
This is an important class for using LLVM in a threaded context.
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.
This is an important base class in LLVM.
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 comp...
A pair of DIGlobalVariable and DIExpression.
DIBasicType * createUnspecifiedParameter()
Create unspecified parameter type for a subroutine type.
void retainType(DIScope *T)
Retain DIScope* in a module even if it is not referenced through debug info anchors.
An imported module (C++ using directive or similar).
Base class for scope-like contexts.
DITemplateValueParameter * createTemplateValueParameter(DIScope *Scope, StringRef Name, DIType *Ty, Constant *Val)
Create debugging information for template value parameter.
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.
static DISubprogram * createArtificialSubprogram(DISubprogram *SP)
Create a distinct clone of SP with FlagArtificial set.
DIExpression * createConstantValueExpression(uint64_t Val)
Create an expression for a variable that does not have an address, but does have a constant value...
DITemplateValueParameter * createTemplateParameterPack(DIScope *Scope, StringRef Name, DIType *Ty, DINodeArray Val)
Create debugging information for a template parameter pack.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
DIExpression * createExpression(ArrayRef< uint64_t > Addr=None)
Create a new descriptor for the specified variable which has a complex address expression for its add...
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.
DIBuilder(Module &M, bool AllowUnresolved=true, DICompileUnit *CU=nullptr)
Construct a builder for a module.
A (clang) module that has been imported by the compile unit.
DIObjCProperty * createObjCProperty(StringRef Name, DIFile *File, unsigned LineNumber, StringRef GetterName, StringRef SetterName, unsigned PropertyAttributes, DIType *Ty)
Create debugging information entry for Objective-C property.
DITemplateValueParameter * createTemplateTemplateParameter(DIScope *Scope, StringRef Name, DIType *Ty, StringRef Val)
Create debugging information for a template template parameter.
Type array for a subprogram.
NodeTy * replaceTemporary(TempMDNode &&N, NodeTy *Replacement)
Replace a temporary node.
DICompositeType * createVectorType(uint64_t Size, uint32_t AlignInBits, DIType *Ty, DINodeArray Subscripts)
Create debugging information entry for a vector type.
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.
DILexicalBlock * createLexicalBlock(DIScope *Scope, DIFile *File, unsigned Line, unsigned Col)
This creates a descriptor for a lexical block with the specified parent context.
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.
void replaceVTableHolder(DICompositeType *&T, DIType *VTableHolder)
Replace the vtable holder in the given type.
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.
DISPFlags
Debug info subprogram flags.
void finalizeSubprogram(DISubprogram *SP)
Finalize a specific subprogram - no new variables may be added to this subprogram afterwards...
DIBasicType * createBasicType(StringRef Name, uint64_t SizeInBits, unsigned Encoding, DINode::DIFlags Flags=DINode::FlagZero)
Create debugging information entry for a basic type.
DIImportedEntity * createImportedDeclaration(DIScope *Context, DINode *Decl, DIFile *File, unsigned Line, StringRef Name="")
Create a descriptor for an imported function.
DIModule * createModule(DIScope *Scope, StringRef Name, StringRef ConfigurationMacros, StringRef IncludePath, StringRef ISysRoot)
This creates new descriptor for a module with the specified parent scope.
LLVM Value Representation.
DIBuilder & operator=(const DIBuilder &)=delete
StringRef - Represent a constant reference to a string, i.e.
DIDerivedType * createQualifiedType(unsigned Tag, DIType *FromTy)
Create debugging information entry for a qualified type, e.g.
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.
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.
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.
DIDerivedType * createFriend(DIType *Ty, DIType *FriendTy)
Create debugging information entry for a 'friend'.
Basic type, like 'int' or 'float'.
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 RAUW...