15 #ifndef LLVM_IR_DIBUILDER_H
16 #define LLVM_IR_DIBUILDER_H
23 #include "llvm/Support/DataTypes.h"
52 bool AllowUnresolvedNodes;
58 void operator=(
const DIBuilder &) =
delete;
63 void trackIfUnresolved(
MDNode *
N);
111 bool EmitDebugInfo =
true);
133 uint64_t AlignInBits,
unsigned Encoding);
147 uint64_t AlignInBits = 0,
157 uint64_t AlignInBits = 0);
170 unsigned LineNo,
DIScope *Context);
183 uint64_t BaseOffset,
unsigned Flags);
196 DIFile *File,
unsigned LineNo,
197 uint64_t SizeInBits, uint64_t AlignInBits,
198 uint64_t OffsetInBits,
unsigned Flags,
211 DIFile *File,
unsigned LineNo,
212 DIType *Ty,
unsigned Flags,
227 uint64_t SizeInBits, uint64_t AlignInBits,
228 uint64_t OffsetInBits,
unsigned Flags,
244 unsigned PropertyAttributes,
DIType *Ty);
263 DIFile *File,
unsigned LineNumber,
264 uint64_t SizeInBits, uint64_t AlignInBits,
265 uint64_t OffsetInBits,
unsigned Flags,
266 DIType *DerivedFrom, DINodeArray Elements,
267 DIType *VTableHolder =
nullptr,
268 MDNode *TemplateParms =
nullptr,
284 uint64_t SizeInBits, uint64_t AlignInBits,
unsigned Flags,
285 DIType *DerivedFrom, DINodeArray Elements,
unsigned RunTimeLang = 0,
300 DIFile *File,
unsigned LineNumber,
301 uint64_t SizeInBits, uint64_t AlignInBits,
302 unsigned Flags, DINodeArray Elements,
303 unsigned RunTimeLang = 0,
351 DIType *Ty, DINodeArray Subscripts);
359 DIType *Ty, DINodeArray Subscripts);
374 uint64_t SizeInBits, uint64_t AlignInBits, DINodeArray Elements,
397 unsigned RuntimeLang = 0,
398 uint64_t SizeInBits = 0,
399 uint64_t AlignInBits = 0,
405 unsigned RuntimeLang = 0, uint64_t SizeInBits = 0,
406 uint64_t AlignInBits = 0,
unsigned Flags = DINode::FlagFwdDecl,
441 unsigned LineNo,
DIType *Ty,
469 unsigned LineNo,
DIType *Ty,
470 bool AlwaysPreserve =
false,
486 unsigned SizeInBits);
507 bool isLocalToUnit,
bool isDefinition,
unsigned ScopeLine,
508 unsigned Flags = 0,
bool isOptimized =
false,
517 bool isDefinition,
unsigned ScopeLine,
unsigned Flags = 0,
518 bool isOptimized =
false,
Function *Fn =
nullptr,
526 bool isLocalToUnit,
bool isDefinition,
unsigned ScopeLine,
527 unsigned Flags = 0,
bool isOptimized =
false,
553 bool isLocalToUnit,
bool isDefinition,
unsigned Virtuality = 0,
554 unsigned VTableIndex = 0,
DIType *VTableHolder =
nullptr,
555 unsigned Flags = 0,
bool isOptimized =
false,
588 unsigned Discriminator = 0);
597 unsigned Line,
unsigned Col);
688 DINodeArray TParems = DINodeArray());
698 template <
class NodeTy>
700 if (N.
get() == Replacement)
void finalize()
Construct any deferred debug info descriptors.
DIDerivedType * createObjCIVar(StringRef Name, DIFile *File, unsigned LineNo, uint64_t SizeInBits, uint64_t AlignInBits, uint64_t OffsetInBits, unsigned Flags, DIType *Ty, MDNode *PropertyNode)
Create debugging information entry for Objective-C instance variable.
DICompositeType * createArrayType(uint64_t Size, uint64_t AlignInBits, DIType *Ty, DINodeArray Subscripts)
Create debugging information entry for an array.
A Module instance is used to store all the information related to an LLVM module. ...
DIDerivedType * createMemberPointerType(DIType *PointeeTy, DIType *Class, uint64_t SizeInBits, uint64_t AlignInBits=0)
Create debugging information entry for a pointer to member.
DISubrange * getOrCreateSubrange(int64_t Lo, int64_t Count)
Create a descriptor for a value range.
Instruction * insertDbgValueIntrinsic(llvm::Value *Val, uint64_t Offset, DILocalVariable *VarInfo, DIExpression *Expr, const DILocation *DL, BasicBlock *InsertAtEnd)
Insert a new llvm.dbg.value intrinsic call.
DIType * createObjectPointerType(DIType *Ty)
Create a new DIType* with the "object pointer" flag set.
DITypeRefArray getOrCreateTypeArray(ArrayRef< Metadata * > Elements)
Get a DITypeRefArray, create one if required.
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.
DINodeArray getOrCreateArray(ArrayRef< Metadata * > Elements)
Get a DINodeArray, create one if required.
DITemplateTypeParameter * createTemplateTypeParameter(DIScope *Scope, StringRef Name, DIType *Ty)
Create debugging information for template type parameter.
Instruction * insertDeclare(llvm::Value *Storage, DILocalVariable *VarInfo, DIExpression *Expr, const DILocation *DL, BasicBlock *InsertAtEnd)
Insert a new llvm.dbg.declare intrinsic call.
DIDerivedType * createTypedef(DIType *Ty, StringRef Name, DIFile *File, unsigned LineNo, DIScope *Context)
Create debugging information entry for a typedef.
DICompositeType * createEnumerationType(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber, uint64_t SizeInBits, uint64_t AlignInBits, DINodeArray Elements, DIType *UnderlyingType, StringRef UniqueIdentifier="")
Create debugging information entry for an enumeration.
DIBasicType * createUnspecifiedType(StringRef Name)
Create a DWARF unspecified type.
DICompositeType * createStructType(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber, uint64_t SizeInBits, uint64_t AlignInBits, unsigned Flags, DIType *DerivedFrom, DINodeArray Elements, unsigned RunTimeLang=0, DIType *VTableHolder=nullptr, StringRef UniqueIdentifier="")
Create debugging information entry for a struct.
DIDerivedType * createInheritance(DIType *Ty, DIType *BaseTy, uint64_t BaseOffset, unsigned Flags)
Create debugging information entry to establish inheritance relationship between two types...
Pointer union between a subclass of DINode and MDString.
DIEnumerator * createEnumerator(StringRef Name, int64_t Val)
Create a single enumerator value.
DISubprogram * createTempFunctionFwdDecl(DIScope *Scope, StringRef Name, StringRef LinkageName, DIFile *File, unsigned LineNo, DISubroutineType *Ty, bool isLocalToUnit, bool isDefinition, unsigned ScopeLine, unsigned Flags=0, bool isOptimized=false, Function *Fn=nullptr, MDNode *TParam=nullptr, MDNode *Decl=nullptr)
Identical to createFunction, except that the resulting DbgNode is meant to be RAUWed.
DICompositeType * createReplaceableCompositeType(unsigned Tag, StringRef Name, DIScope *Scope, DIFile *F, unsigned Line, unsigned RuntimeLang=0, uint64_t SizeInBits=0, uint64_t AlignInBits=0, unsigned Flags=DINode::FlagFwdDecl, StringRef UniqueIdentifier="")
Create a temporary forward-declared type.
DIExpression * createBitPieceExpression(unsigned OffsetInBits, unsigned SizeInBits)
Create a descriptor to describe one part of aggregate variable that is fragmented across multiple Val...
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.
DIType * createArtificialType(DIType *Ty)
Create a new DIType* with "artificial" flag 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.
void replaceVTableHolder(DICompositeType *&T, DICompositeType *VTableHolder)
Replace the vtable holder in the given composite type.
LLVM Basic Block Representation.
This is an important class for using LLVM in a threaded context.
DILocalVariable * createLocalVariable(unsigned Tag, DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo, DIType *Ty, bool AlwaysPreserve=false, unsigned Flags=0, unsigned ArgNo=0)
Create a new descriptor for the specified local variable.
This is an important base class in LLVM.
void replaceArrays(DICompositeType *&T, DINodeArray Elements, DINodeArray TParems=DINodeArray())
Replace arrays on a composite type.
DIGlobalVariable * createGlobalVariable(DIScope *Context, StringRef Name, StringRef LinkageName, DIFile *File, unsigned LineNo, DIType *Ty, bool isLocalToUnit, llvm::Constant *Val, MDNode *Decl=nullptr)
Create a new descriptor for the specified variable.
DIImportedEntity * createImportedDeclaration(DIScope *Context, DINode *Decl, unsigned Line, StringRef Name="")
Create a descriptor for an imported function.
DIBasicType * createUnspecifiedParameter()
Create unspecified parameter type for a subroutine type.
DICompileUnit * createCompileUnit(unsigned Lang, StringRef File, StringRef Dir, StringRef Producer, bool isOptimized, StringRef Flags, unsigned RV, StringRef SplitName=StringRef(), DebugEmissionKind Kind=FullDebug, uint64_t DWOId=0, bool EmitDebugInfo=true)
A CompileUnit provides an anchor for all debugging information generated during this instance of comp...
DIDerivedType * createReferenceType(unsigned Tag, DIType *RTy)
Create debugging information entry for a c++ style reference or rvalue reference type.
DIBasicType * createBasicType(StringRef Name, uint64_t SizeInBits, uint64_t AlignInBits, unsigned Encoding)
Create debugging information entry for a basic type.
An imported module (C++ using directive or similar).
Base class for scope-like contexts.
DICompositeType * createUnionType(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber, uint64_t SizeInBits, uint64_t AlignInBits, unsigned Flags, DINodeArray Elements, unsigned RunTimeLang=0, StringRef UniqueIdentifier="")
Create debugging information entry for an union.
DITemplateValueParameter * createTemplateValueParameter(DIScope *Scope, StringRef Name, DIType *Ty, Constant *Val)
Create debugging information for template value parameter.
void retainType(DIType *T)
Retain DIType* in a module even if it is not referenced through debug info anchors.
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...
DIGlobalVariable * createTempGlobalVariableFwdDecl(DIScope *Context, StringRef Name, StringRef LinkageName, DIFile *File, unsigned LineNo, DIType *Ty, bool isLocalToUnit, llvm::Constant *Val, MDNode *Decl=nullptr)
Identical to createGlobalVariable except that the resulting DbgNode is temporary and meant to be RAUW...
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 * createForwardDecl(unsigned Tag, StringRef Name, DIScope *Scope, DIFile *F, unsigned Line, unsigned RuntimeLang=0, uint64_t SizeInBits=0, uint64_t AlignInBits=0, StringRef UniqueIdentifier="")
Create a permanent forward-declared type.
DIDerivedType * createStaticMemberType(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo, DIType *Ty, unsigned Flags, llvm::Constant *Val)
Create debugging information entry for a C++ static data member.
DIImportedEntity * createImportedModule(DIScope *Context, DINamespace *NS, unsigned Line)
Create a descriptor for an imported module.
DICompositeType * createVectorType(uint64_t Size, uint64_t AlignInBits, DIType *Ty, DINodeArray Subscripts)
Create debugging information entry for a vector type.
DISubprogram * createMethod(DIScope *Scope, StringRef Name, StringRef LinkageName, DIFile *File, unsigned LineNo, DISubroutineType *Ty, bool isLocalToUnit, bool isDefinition, unsigned Virtuality=0, unsigned VTableIndex=0, DIType *VTableHolder=nullptr, unsigned Flags=0, bool isOptimized=false, Function *Fn=nullptr, MDNode *TParam=nullptr)
Create a new descriptor for the specified C++ method.
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.
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata * > MDs)
NodeTy * replaceTemporary(TempMDNode &&N, NodeTy *Replacement)
Replace a temporary node.
DISubroutineType * createSubroutineType(DIFile *File, DITypeRefArray ParameterTypes, unsigned Flags=0)
Create subroutine type.
DILexicalBlock * createLexicalBlock(DIScope *Scope, DIFile *File, unsigned Line, unsigned Col)
This creates a descriptor for a lexical block with the specified parent context.
DINamespace * createNameSpace(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo)
This creates new descriptor for a namespace with the specified parent scope.
const ARM::ArchExtKind Kind
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.
DICompositeType * createClassType(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber, uint64_t SizeInBits, uint64_t AlignInBits, uint64_t OffsetInBits, unsigned Flags, DIType *DerivedFrom, DINodeArray Elements, DIType *VTableHolder=nullptr, MDNode *TemplateParms=nullptr, StringRef UniqueIdentifier="")
Create debugging information entry for a class.
DIDerivedType * createMemberType(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo, uint64_t SizeInBits, uint64_t AlignInBits, uint64_t OffsetInBits, unsigned Flags, DIType *Ty)
Create debugging information entry for a member.
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.
DIDerivedType * createFriend(DIType *Ty, DIType *FriendTy)
Create debugging information entry for a 'friend'.
DISubprogram * createFunction(DIScope *Scope, StringRef Name, StringRef LinkageName, DIFile *File, unsigned LineNo, DISubroutineType *Ty, bool isLocalToUnit, bool isDefinition, unsigned ScopeLine, unsigned Flags=0, bool isOptimized=false, Function *Fn=nullptr, MDNode *TParam=nullptr, MDNode *Decl=nullptr)
Create a new descriptor for the specified subprogram.
DIDerivedType * createPointerType(DIType *PointeeTy, uint64_t SizeInBits, uint64_t AlignInBits=0, StringRef Name="")
Create debugging information entry for a pointer.
Basic type, like 'int' or 'float'.
DIFile * createFile(StringRef Filename, StringRef Directory)
Create a file descriptor to hold debugging information for a file.