24 using namespace llvm::dwarf;
36 HeaderBuilder() : IsEmpty(
true) {}
37 HeaderBuilder(
const HeaderBuilder &
X) : IsEmpty(X.IsEmpty), Chars(X.Chars) {}
38 HeaderBuilder(HeaderBuilder &&
X)
39 : IsEmpty(
X.IsEmpty), Chars(std::move(
X.Chars)) {}
41 template <
class Twineable> HeaderBuilder &concat(Twineable &&
X) {
54 static HeaderBuilder
get(
unsigned Tag) {
60 DIBuilder::DIBuilder(
Module &m,
bool AllowUnresolvedNodes)
61 : M(m), VMContext(M.getContext()), CUNode(nullptr),
62 DeclareFn(nullptr), ValueFn(nullptr),
63 AllowUnresolvedNodes(AllowUnresolvedNodes) {}
65 void DIBuilder::trackIfUnresolved(
MDNode *
N) {
71 assert(AllowUnresolvedNodes &&
"Cannot handle unresolved nodes");
72 UnresolvedNodes.emplace_back(N);
77 assert(!AllowUnresolvedNodes &&
78 "creating type nodes without a CU is not supported");
90 for (
unsigned I = 0, E = AllRetainTypes.size();
I < E;
I++)
91 if (RetainSet.
insert(AllRetainTypes[
I]).second)
92 RetainValues.
push_back(AllRetainTypes[I]);
94 if (!RetainValues.
empty())
97 DISubprogramArray SPs =
MDTuple::get(VMContext, AllSubprograms);
98 if (!AllSubprograms.empty())
101 for (
auto *
SP : SPs) {
102 if (
MDTuple *Temp =
SP->getVariables().get()) {
103 const auto &PV = PreservedVariables.lookup(
SP);
106 TempMDTuple(Temp)->replaceAllUsesWith(AV.get());
113 if (!AllImportedModules.empty())
116 AllImportedModules.end())));
120 for (
const auto &N : UnresolvedNodes)
123 UnresolvedNodes.clear();
126 AllowUnresolvedNodes =
false;
131 if (!N || isa<DICompileUnit>(N))
133 return cast<DIScope>(
N);
141 assert(((Lang <= dwarf::DW_LANG_Fortran08 && Lang >= dwarf::DW_LANG_C89) ||
143 "Invalid Language tag");
144 assert(!Filename.
empty() &&
145 "Unable to create compile unit without filename");
147 assert(!CUNode &&
"Can only make one compile unit per DIBuilder instance");
149 VMContext, Lang,
DIFile::get(VMContext, Filename, Directory), Producer,
150 isOptimized, Flags, RunTimeVer, SplitName, Kind,
nullptr,
151 nullptr,
nullptr,
nullptr,
nullptr, DWOId);
163 trackIfUnresolved(CUNode);
180 Context, NS, Line,
StringRef(), AllImportedModules);
187 Context, NS, Line,
StringRef(), AllImportedModules);
193 Context, M, Line,
StringRef(), AllImportedModules);
208 return DIFile::get(VMContext, Filename, Directory);
212 assert(!Name.
empty() &&
"Unable to create enumerator without name");
217 assert(!Name.
empty() &&
"Unable to create type without name");
226 uint64_t AlignInBits,
228 assert(!Name.
empty() &&
"Unable to create type without name");
229 return DIBasicType::get(VMContext, dwarf::DW_TAG_base_type, Name, SizeInBits,
230 AlignInBits, Encoding);
240 uint64_t AlignInBits,
245 SizeInBits, AlignInBits, 0, 0);
251 uint64_t AlignInBits) {
254 SizeInBits, AlignInBits, 0, 0,
259 assert(RTy &&
"Unable to create reference type");
274 assert(Ty &&
"Invalid type!");
275 assert(FriendTy &&
"Invalid friend type!");
284 assert(Ty &&
"Unable to create inheritance");
293 uint64_t AlignInBits,
294 uint64_t OffsetInBits,
297 VMContext, dwarf::DW_TAG_member, Name, File, LineNumber,
299 SizeInBits, AlignInBits, OffsetInBits, Flags);
313 Flags |= DINode::FlagStaticMember;
315 VMContext, dwarf::DW_TAG_member, Name, File, LineNumber,
323 uint64_t AlignInBits,
324 uint64_t OffsetInBits,
unsigned Flags,
327 VMContext, dwarf::DW_TAG_member, Name, File, LineNumber,
329 SizeInBits, AlignInBits, OffsetInBits, Flags, PropertyNode);
335 unsigned PropertyAttributes,
DIType *Ty) {
337 SetterName, PropertyAttributes,
344 assert((!Context || isa<DICompileUnit>(Context)) &&
"Expected compile unit");
352 assert((!Context || isa<DICompileUnit>(Context)) &&
"Expected compile unit");
361 VMContext, dwarf::DW_TAG_template_value_parameter, Context, Name, Ty,
369 VMContext, dwarf::DW_TAG_GNU_template_template_param, Context, Name, Ty,
375 DIType *Ty, DINodeArray Val) {
377 VMContext, dwarf::DW_TAG_GNU_template_parameter_pack, Context, Name, Ty,
383 uint64_t SizeInBits, uint64_t AlignInBits, uint64_t OffsetInBits,
384 unsigned Flags,
DIType *DerivedFrom, DINodeArray Elements,
386 assert((!Context || isa<DIScope>(Context)) &&
387 "createClassType should be called with a valid Context");
390 VMContext, dwarf::DW_TAG_structure_type, Name, File, LineNumber,
392 DITypeRef::get(DerivedFrom), SizeInBits, AlignInBits, OffsetInBits, Flags,
394 cast_or_null<MDTuple>(TemplateParams), UniqueIdentifier);
395 if (!UniqueIdentifier.
empty())
397 trackIfUnresolved(R);
403 uint64_t SizeInBits, uint64_t AlignInBits,
unsigned Flags,
404 DIType *DerivedFrom, DINodeArray Elements,
unsigned RunTimeLang,
407 VMContext, dwarf::DW_TAG_structure_type, Name, File, LineNumber,
409 DITypeRef::get(DerivedFrom), SizeInBits, AlignInBits, 0, Flags, Elements,
410 RunTimeLang,
DITypeRef::get(VTableHolder),
nullptr, UniqueIdentifier);
411 if (!UniqueIdentifier.
empty())
413 trackIfUnresolved(R);
419 uint64_t SizeInBits, uint64_t AlignInBits,
unsigned Flags,
420 DINodeArray Elements,
unsigned RunTimeLang,
StringRef UniqueIdentifier) {
422 VMContext, dwarf::DW_TAG_union_type, Name, File, LineNumber,
424 AlignInBits, 0, Flags, Elements, RunTimeLang,
nullptr,
nullptr,
426 if (!UniqueIdentifier.
empty())
428 trackIfUnresolved(R);
440 uint64_t SizeInBits, uint64_t AlignInBits, DINodeArray Elements,
443 VMContext, dwarf::DW_TAG_enumeration_type, Name, File, LineNumber,
445 DITypeRef::get(UnderlyingType), SizeInBits, AlignInBits, 0, 0, Elements,
446 0,
nullptr,
nullptr, UniqueIdentifier);
447 AllEnumTypes.push_back(CTy);
448 if (!UniqueIdentifier.
empty())
450 trackIfUnresolved(CTy);
456 DINodeArray Subscripts) {
459 AlignInBits, 0, 0, Subscripts, 0,
nullptr);
460 trackIfUnresolved(R);
465 uint64_t AlignInBits,
DIType *Ty,
466 DINodeArray Subscripts) {
470 DINode::FlagVector, Subscripts, 0,
nullptr);
471 trackIfUnresolved(R);
476 unsigned FlagsToSet) {
477 auto NewTy = Ty->
clone();
478 NewTy->setFlags(NewTy->getFlags() | FlagsToSet);
493 unsigned Flags = DINode::FlagObjectPointer | DINode::FlagArtificial;
498 assert(T &&
"Expected non-null type");
499 AllRetainTypes.emplace_back(T);
506 DIFile *
F,
unsigned Line,
unsigned RuntimeLang,
507 uint64_t SizeInBits, uint64_t AlignInBits,
512 VMContext, Tag, Name, F, Line,
514 AlignInBits, 0, DINode::FlagFwdDecl,
nullptr, RuntimeLang,
nullptr,
515 nullptr, UniqueIdentifier);
516 if (!UniqueIdentifier.
empty())
518 trackIfUnresolved(RetTy);
524 unsigned RuntimeLang, uint64_t SizeInBits, uint64_t AlignInBits,
527 VMContext, Tag, Name, F, Line,
529 SizeInBits, AlignInBits, 0, Flags,
nullptr, RuntimeLang,
530 nullptr,
nullptr, UniqueIdentifier)
532 if (!UniqueIdentifier.
empty())
534 trackIfUnresolved(RetTy);
544 for (
unsigned i = 0, e = Elements.
size(); i != e; ++i) {
545 if (Elements[i] && isa<MDNode>(Elements[i]))
561 assert(CT->getIdentifier().empty() &&
562 "Context of a global variable should not be a type with identifier");
568 unsigned LineNumber,
DIType *Ty,
bool isLocalToUnit,
Constant *Val,
573 Name, LinkageName, F, LineNumber,
575 cast_or_null<DIDerivedType>(Decl));
582 unsigned LineNumber,
DIType *Ty,
bool isLocalToUnit,
Constant *Val,
587 VMContext, cast_or_null<DIScope>(Context), Name, LinkageName, F,
589 cast_or_null<DIDerivedType>(Decl))
595 DIType *Ty,
bool AlwaysPreserve,
unsigned Flags,
unsigned ArgNo) {
603 VMContext, Tag, cast_or_null<DILocalScope>(Context), Name, File, LineNo,
605 if (AlwaysPreserve) {
610 assert(Fn &&
"Missing subprogram for local variable");
611 PreservedVariables[Fn].emplace_back(Node);
627 unsigned SizeInBytes) {
628 uint64_t Addr[] = {dwarf::DW_OP_bit_piece, OffsetInBytes, SizeInBytes};
635 bool isLocalToUnit,
bool isDefinition,
636 unsigned ScopeLine,
unsigned Flags,
643 LineNo, Ty, isLocalToUnit, isDefinition, ScopeLine,
644 Flags, isOptimized, Fn, TParams, Decl);
650 bool isLocalToUnit,
bool isDefinition,
651 unsigned ScopeLine,
unsigned Flags,
654 assert(Ty->
getTag() == dwarf::DW_TAG_subroutine_type &&
655 "function types should be subroutines");
658 LinkageName, File, LineNo, Ty, isLocalToUnit, isDefinition, ScopeLine,
659 nullptr, 0, 0, Flags, isOptimized, Fn, cast_or_null<MDTuple>(TParams),
660 cast_or_null<DISubprogram>(Decl),
664 AllSubprograms.push_back(Node);
665 trackIfUnresolved(Node);
672 bool isDefinition,
unsigned ScopeLine,
unsigned Flags,
bool isOptimized,
676 LinkageName, File, LineNo, Ty, isLocalToUnit, isDefinition,
677 ScopeLine,
nullptr, 0, 0, Flags, isOptimized, Fn,
678 cast_or_null<MDTuple>(TParams), cast_or_null<DISubprogram>(Decl),
686 bool isLocalToUnit,
bool isDefinition,
unsigned VK,
687 unsigned VIndex,
DIType *VTableHolder,
unsigned Flags,
689 assert(Ty->
getTag() == dwarf::DW_TAG_subroutine_type &&
690 "function types should be subroutines");
692 "Methods should have both a Context and a context that isn't "
693 "the compile unit.");
696 VMContext,
DIScopeRef::get(cast<DIScope>(Context)), Name, LinkageName, F,
697 LineNo, Ty, isLocalToUnit, isDefinition, LineNo,
699 cast_or_null<MDTuple>(TParam),
nullptr,
nullptr);
702 AllSubprograms.push_back(
SP);
703 trackIfUnresolved(
SP);
718 ConfigurationMacros, IncludePath, ISysRoot);
723 unsigned Discriminator) {
728 unsigned Line,
unsigned Col) {
736 assert(V &&
"no value passed to dbg intrinsic");
748 assert(VarInfo &&
"empty or invalid DILocalVariable* passed to dbg.declare");
749 assert(DL &&
"Expected debug loc");
750 assert(DL->getScope()->getSubprogram() ==
752 "Expected matching subprograms");
756 trackIfUnresolved(VarInfo);
757 trackIfUnresolved(Expr);
767 assert(VarInfo &&
"empty or invalid DILocalVariable* passed to dbg.declare");
768 assert(DL &&
"Expected debug loc");
769 assert(DL->getScope()->getSubprogram() ==
771 "Expected matching subprograms");
775 trackIfUnresolved(VarInfo);
776 trackIfUnresolved(Expr);
793 assert(V &&
"no value passed to dbg.value");
794 assert(VarInfo &&
"empty or invalid DILocalVariable* passed to dbg.value");
795 assert(DL &&
"Expected debug loc");
796 assert(DL->getScope()->getSubprogram() ==
798 "Expected matching subprograms");
802 trackIfUnresolved(VarInfo);
803 trackIfUnresolved(Expr);
816 assert(V &&
"no value passed to dbg.value");
817 assert(VarInfo &&
"empty or invalid DILocalVariable* passed to dbg.value");
818 assert(DL &&
"Expected debug loc");
819 assert(DL->getScope()->getSubprogram() ==
821 "Expected matching subprograms");
825 trackIfUnresolved(VarInfo);
826 trackIfUnresolved(Expr);
844 if (T != VTableHolder)
851 if (
auto *N = dyn_cast_or_null<MDNode>(O))
852 trackIfUnresolved(N);
856 DINodeArray TParams) {
874 trackIfUnresolved(Elements.get());
876 trackIfUnresolved(TParams.get());
void finalize()
Construct any deferred debug info descriptors.
void toVector(SmallVectorImpl< char > &Out) const
Append the concatenated string into the given SmallString or SmallVector.
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.
void push_back(const T &Elt)
Tracking metadata reference owned by Metadata.
static Value * getDbgIntrinsicValueImpl(LLVMContext &VMContext, Value *V)
DICompositeType * createArrayType(uint64_t Size, uint64_t AlignInBits, DIType *Ty, DINodeArray Subscripts)
Create debugging information entry for an array.
bool isArtificial() const
A Module instance is used to store all the information related to an LLVM module. ...
static MDTuple * getDistinct(LLVMContext &Context, ArrayRef< Metadata * > MDs)
static MDString * get(LLVMContext &Context, StringRef Str)
DILocalScope * getScope() const
Get the local scope for this variable.
void addOperand(MDNode *M)
static DIType * createTypeWithFlags(LLVMContext &Context, DIType *Ty, unsigned FlagsToSet)
NamedMDNode * getOrInsertNamedMetadata(StringRef Name)
Return the named MDNode in the module with the specified name.
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.
static IntegerType * getInt64Ty(LLVMContext &C)
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.
void replaceRetainedTypes(DITypeArray N)
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.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
static CallInst * Create(Value *Func, ArrayRef< Value * > Args, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
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.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
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.
TypedDINodeRef< DINode > DINodeRef
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.
DISubprogram * getDISubprogram(const MDNode *Scope)
Find subprogram that is enclosing this scope.
static DIImportedEntity * createImportedModule(LLVMContext &C, dwarf::Tag Tag, DIScope *Context, Metadata *NS, unsigned Line, StringRef Name, SmallVectorImpl< TrackingMDNodeRef > &AllImportedModules)
T * resolve(const MapTy &Map) const
void resolveCycles()
Resolve cycles.
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.
bool LLVM_ATTRIBUTE_UNUSED_RESULT empty() const
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)...
Function * getDeclaration(Module *M, ID id, ArrayRef< Type * > Tys=None)
Create or insert an LLVM Function declaration for an intrinsic, and return it.
static TempMDTuple getTemporary(LLVMContext &Context, ArrayRef< Metadata * > MDs)
Return a temporary node.
size_t size() const
size - Get the array size.
DIBasicType * createNullPtrType()
Create C++11 nullptr type.
static Instruction * withDebugLoc(Instruction *I, const DILocation *DL)
void replaceElements(DINodeArray Elements)
Replace operands.
void replaceGlobalVariables(DIGlobalVariableArray N)
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.
Subclasses of this class are all able to terminate a basic block.
void setDebugLoc(DebugLoc Loc)
setDebugLoc - Set the debug location information for this instruction.
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.
static void checkGlobalVariableScope(DIScope *Context)
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata * > MDs)
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.
void replaceSubprograms(DISubprogramArray N)
This is an important base class in LLVM.
This file contains the declarations for the subclasses of Constant, which represent the different fla...
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
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.
void replaceEnumTypes(DICompositeTypeArray N)
Replace arrays.
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang","erlang-compatible garbage collector")
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...
bool isObjectPointer() const
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.
static DIScope * getNonCompileUnitScope(DIScope *N)
If N is compile unit return NULL otherwise return N.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements...
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...
Module.h This file contains the declarations for the Module class.
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...
void replaceVTableHolder(DITypeRef VTableHolder)
static Twine utohexstr(const uint64_t &Val)
DIExpression * createExpression(ArrayRef< uint64_t > Addr=None)
Create a new descriptor for the specified variable which has a complex address expression for its add...
static Constant * get(Type *Ty, uint64_t V, bool isSigned=false)
If Ty is a vector type, return a Constant with a splat of the given value.
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.
static TempMDTuple getTemporary(LLVMContext &Context, ArrayRef< Metadata * > MDs)
DITemplateValueParameter * createTemplateTemplateParameter(DIScope *Scope, StringRef Name, DIType *Ty, StringRef Val)
Create debugging information for a template template parameter.
static TypedDINodeRef get(const T *N)
Create a reference.
Type array for a subprogram.
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata * > MDs)
void emplace_back(ArgTypes &&...Args)
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.
TerminatorInst * getTerminator()
Returns the terminator instruction if the block is well formed or null if the block is not well forme...
static DITemplateValueParameter * createTemplateValueParameterHelper(LLVMContext &VMContext, unsigned Tag, DIScope *Context, StringRef Name, DIType *Ty, Metadata *MD)
op_range operands() const
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
static ConstantAsMetadata * getConstantOrNull(Constant *C)
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.
void replaceTemplateParams(DITemplateParameterArray TemplateParams)
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.
bool isResolved() const
Check if node is fully resolved.
DISubprogram * getSubprogram() const
Get the subprogram for this scope.
DIDerivedType * createFriend(DIType *Ty, DIType *FriendTy)
Create debugging information entry for a 'friend'.
void replaceImportedEntities(DIImportedEntityArray N)
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.
bool empty() const
empty - Check if the string is empty.
Basic type, like 'int' or 'float'.
DIFile * createFile(StringRef Filename, StringRef Directory)
Create a file descriptor to hold debugging information for a file.