Go to the documentation of this file.
32 :
M(m), VMContext(
M.getContext()), CUNode(
CU), DeclareFn(nullptr),
33 ValueFn(nullptr), LabelFn(nullptr), AddrFn(nullptr),
34 AllowUnresolvedNodes(AllowUnresolvedNodes) {
37 AllEnumTypes.assign(ETs.begin(), ETs.end());
39 AllRetainTypes.assign(RTs.begin(), RTs.end());
41 AllGVs.assign(GVs.begin(), GVs.end());
43 AllImportedModules.assign(IMs.begin(), IMs.end());
44 if (
const auto &MNs = CUNode->
getMacros())
45 AllMacrosPerParent.insert({
nullptr, {MNs.begin(), MNs.end()}});
49 void DIBuilder::trackIfUnresolved(
MDNode *
N) {
55 assert(AllowUnresolvedNodes &&
"Cannot handle unresolved nodes");
56 UnresolvedNodes.emplace_back(
N);
66 auto PV = PreservedVariables.find(SP);
67 if (PV != PreservedVariables.end())
68 RetainedNodes.
append(PV->second.begin(), PV->second.end());
70 auto PL = PreservedLabels.find(SP);
71 if (
PL != PreservedLabels.end())
72 RetainedNodes.
append(
PL->second.begin(),
PL->second.end());
76 TempMDTuple(Temp)->replaceAllUsesWith(Node.get());
81 assert(!AllowUnresolvedNodes &&
82 "creating type nodes without a CU is not supported");
86 if (!AllEnumTypes.empty())
95 for (
unsigned I = 0,
E = AllRetainTypes.size();
I <
E;
I++)
96 if (RetainSet.
insert(AllRetainTypes[
I]).second)
97 RetainValues.push_back(AllRetainTypes[
I]);
99 if (!RetainValues.empty())
102 DISubprogramArray SPs =
MDTuple::get(VMContext, AllSubprograms);
105 for (
auto *
N : RetainValues)
106 if (
auto *SP = dyn_cast<DISubprogram>(
N))
112 if (!AllImportedModules.empty())
115 AllImportedModules.end())));
117 for (
const auto &
I : AllMacrosPerParent) {
124 auto *TMF = cast<DIMacroFile>(
I.first);
126 TMF->getLine(), TMF->getFile(),
133 for (
const auto &
N : UnresolvedNodes)
134 if (
N && !
N->isResolved())
136 UnresolvedNodes.clear();
139 AllowUnresolvedNodes =
false;
144 if (!
N || isa<DICompileUnit>(
N))
146 return cast<DIScope>(
N);
153 bool SplitDebugInlining,
bool DebugInfoForProfiling,
157 assert(((Lang <= dwarf::DW_LANG_Fortran08 && Lang >= dwarf::DW_LANG_C89) ||
159 "Invalid Language tag");
161 assert(!CUNode &&
"Can only make one compile unit per DIBuilder instance");
163 VMContext, Lang, File, Producer, isOptimized, Flags, RunTimeVer,
164 SplitName,
Kind,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr, DWOId,
166 RangesBaseAddress, SysRoot, SDK);
171 trackIfUnresolved(CUNode);
178 DINodeArray Elements,
181 assert(File &&
"Source location has line number but no file");
182 unsigned EntitiesCount =
C.pImpl->DIImportedEntitys.size();
184 File, Line,
Name, Elements);
185 if (EntitiesCount < C.pImpl->DIImportedEntitys.size())
195 DINodeArray Elements) {
203 DIFile *File,
unsigned Line,
204 DINodeArray Elements) {
211 DIFile *File,
unsigned Line,
212 DINodeArray Elements) {
220 DIFile *File,
unsigned Line,
238 assert(!
Name.empty() &&
"Unable to create macro without name");
241 "Unexpected macro type");
243 AllMacrosPerParent[Parent].insert(M);
248 unsigned LineNumber,
DIFile *File) {
250 LineNumber, File, DIMacroNodeArray())
252 AllMacrosPerParent[Parent].insert(MF);
256 AllMacrosPerParent.insert({MF, {}});
262 assert(!
Name.empty() &&
"Unable to create enumerator without name");
268 assert(!
Name.empty() &&
"Unable to create enumerator without name");
273 assert(!
Name.empty() &&
"Unable to create type without name");
284 assert(!
Name.empty() &&
"Unable to create type without name");
290 assert(!
Name.empty() &&
"Unable to create type without name");
298 assert(!
Name.empty() &&
"Unable to create type without name");
300 StringLength,
nullptr, StrLocationExp, 0, 0, 0);
306 assert(!
Name.empty() &&
"Unable to create type without name");
308 StringLengthExp, StrLocationExp, 0, 0, 0);
313 0, 0,
None, DINode::FlagZero);
323 nullptr, 0,
nullptr, PointeeTy, SizeInBits,
324 AlignInBits, 0, DWARFAddressSpace, DINode::FlagZero,
334 nullptr, 0,
nullptr, PointeeTy, SizeInBits,
342 assert(RTy &&
"Unable to create reference type");
344 SizeInBits, AlignInBits, 0, DWARFAddressSpace,
349 DIFile *File,
unsigned LineNo,
354 AlignInBits, 0,
None, DINode::FlagZero,
nullptr,
359 assert(Ty &&
"Invalid type!");
360 assert(FriendTy &&
"Invalid friend type!");
362 FriendTy, 0, 0, 0,
None, DINode::FlagZero);
369 assert(Ty &&
"Unable to create inheritance");
373 0, Ty, BaseTy, 0, 0, BaseOffset,
None, Flags,
383 SizeInBits, AlignInBits, OffsetInBits,
None, Flags,
399 SizeInBits, AlignInBits, OffsetInBits,
None, Flags,
407 Flags |= DINode::FlagBitField;
409 VMContext, dwarf::DW_TAG_member,
Name, File, LineNumber,
411 OffsetInBits,
None, Flags,
413 StorageOffsetInBits)),
419 unsigned LineNumber,
DIType *Ty,
422 Flags |= DINode::FlagStaticMember;
425 AlignInBits, 0,
None, Flags,
436 SizeInBits, AlignInBits, OffsetInBits,
None, Flags,
443 unsigned PropertyAttributes,
DIType *Ty) {
445 SetterName, PropertyAttributes, Ty);
450 DIType *Ty,
bool isDefault) {
465 DIType *Ty,
bool isDefault,
468 VMContext, dwarf::DW_TAG_template_value_parameter,
Context,
Name, Ty,
476 VMContext, dwarf::DW_TAG_GNU_template_template_param,
Context,
Name, Ty,
482 DIType *Ty, DINodeArray Val) {
484 VMContext, dwarf::DW_TAG_GNU_template_parameter_pack,
Context,
Name, Ty,
494 "createClassType should be called with a valid Context");
497 VMContext, dwarf::DW_TAG_structure_type,
Name, File, LineNumber,
499 OffsetInBits, Flags, Elements, 0, VTableHolder,
500 cast_or_null<MDTuple>(TemplateParams), UniqueIdentifier);
501 trackIfUnresolved(R);
508 DIType *DerivedFrom, DINodeArray Elements,
unsigned RunTimeLang,
511 VMContext, dwarf::DW_TAG_structure_type,
Name, File, LineNumber,
513 Flags, Elements, RunTimeLang, VTableHolder,
nullptr, UniqueIdentifier);
514 trackIfUnresolved(R);
521 DINodeArray Elements,
unsigned RunTimeLang,
StringRef UniqueIdentifier) {
523 VMContext, dwarf::DW_TAG_union_type,
Name, File, LineNumber,
525 Elements, RunTimeLang,
nullptr,
nullptr, UniqueIdentifier);
526 trackIfUnresolved(R);
532 unsigned LineNumber,
uint64_t SizeInBits,
537 VMContext, dwarf::DW_TAG_variant_part,
Name, File, LineNumber,
539 Elements, 0,
nullptr,
nullptr, UniqueIdentifier, Discriminator);
540 trackIfUnresolved(R);
555 VMContext, dwarf::DW_TAG_enumeration_type,
Name, File, LineNumber,
557 IsScoped ? DINode::FlagEnumClass : DINode::FlagZero, Elements, 0,
nullptr,
558 nullptr, UniqueIdentifier);
559 AllEnumTypes.push_back(CTy);
560 trackIfUnresolved(CTy);
565 DIFile *File,
unsigned LineNo,
571 AlignInBits, 0,
None, DINode::FlagZero);
572 trackIfUnresolved(R);
578 DINodeArray Subscripts,
584 VMContext, dwarf::DW_TAG_array_type,
"",
nullptr, 0,
nullptr, Ty, Size,
585 AlignInBits, 0, DINode::FlagZero, Subscripts, 0,
nullptr,
nullptr,
"",
595 trackIfUnresolved(R);
601 DINodeArray Subscripts) {
603 nullptr, 0,
nullptr, Ty, Size, AlignInBits, 0,
604 DINode::FlagVector, Subscripts, 0,
nullptr);
605 trackIfUnresolved(R);
610 auto NewSP = SP->cloneWithFlags(SP->getFlags() | DINode::FlagArtificial);
631 DINode::DIFlags Flags = DINode::FlagObjectPointer | DINode::FlagArtificial;
636 assert(
T &&
"Expected non-null type");
637 assert((isa<DIType>(
T) || (isa<DISubprogram>(
T) &&
638 cast<DISubprogram>(
T)->isDefinition() ==
false)) &&
639 "Expected type or subprogram declaration");
640 AllRetainTypes.emplace_back(
T);
647 DIFile *
F,
unsigned Line,
unsigned RuntimeLang,
654 SizeInBits, AlignInBits, 0, DINode::FlagFwdDecl,
nullptr, RuntimeLang,
655 nullptr,
nullptr, UniqueIdentifier);
656 trackIfUnresolved(RetTy);
668 SizeInBits, AlignInBits, 0, Flags,
nullptr, RuntimeLang,
nullptr,
669 nullptr, UniqueIdentifier,
nullptr,
nullptr,
nullptr,
nullptr,
672 trackIfUnresolved(RetTy);
688 if (isa_and_nonnull<MDNode>(
E))
689 Elts.push_back(cast<DIType>(
E));
723 ConvToMetadata(LB), ConvToMetadata(UB),
724 ConvToMetadata(Stride));
731 assert(CT->getIdentifier().empty() &&
732 "Context of a global variable should not be a type with identifier");
738 unsigned LineNumber,
DIType *Ty,
bool IsLocalToUnit,
bool isDefined,
745 LineNumber, Ty, IsLocalToUnit, isDefined,
746 cast_or_null<DIDerivedType>(Decl), TemplateParams, AlignInBits,
757 unsigned LineNumber,
DIType *Ty,
bool IsLocalToUnit,
MDNode *Decl,
763 LineNumber, Ty, IsLocalToUnit,
false,
764 cast_or_null<DIDerivedType>(Decl), TemplateParams, AlignInBits,
782 VMContext, cast_or_null<DILocalScope>(
Context),
Name, File, LineNo, Ty,
784 if (AlwaysPreserve) {
789 assert(Fn &&
"Missing subprogram for local variable");
790 PreservedVariables[Fn].emplace_back(Node);
796 DIFile *File,
unsigned LineNo,
797 DIType *Ty,
bool AlwaysPreserve,
801 0, File, LineNo, Ty, AlwaysPreserve,
809 assert(ArgNo &&
"Expected non-zero argument number for parameter");
811 File, LineNo, Ty, AlwaysPreserve, Flags,
816 unsigned LineNo,
bool AlwaysPreserve) {
822 if (AlwaysPreserve) {
827 assert(Fn &&
"Missing subprogram for label");
828 PreservedLabels[Fn].emplace_back(Node);
837 template <
class... Ts>
851 bool IsDefinition = SPFlags & DISubprogram::SPFlagDefinition;
854 Name,
LinkageName, File, LineNo, Ty, ScopeLine,
nullptr, 0, 0, Flags,
855 SPFlags, IsDefinition ? CUNode :
nullptr, TParams, Decl,
860 AllSubprograms.push_back(Node);
861 trackIfUnresolved(Node);
870 DITypeArray ThrownTypes) {
871 bool IsDefinition = SPFlags & DISubprogram::SPFlagDefinition;
874 ScopeLine,
nullptr, 0, 0, Flags, SPFlags,
875 IsDefinition ? CUNode :
nullptr, TParams,
876 Decl,
nullptr, ThrownTypes)
885 DITypeArray ThrownTypes) {
887 "Methods should have both a Context and a context that isn't "
888 "the compile unit.");
890 bool IsDefinition = SPFlags & DISubprogram::SPFlagDefinition;
892 IsDefinition, VMContext, cast<DIScope>(
Context),
Name,
893 LinkageName,
F, LineNo, Ty, LineNo, VTableHolder, VIndex, ThisAdjustment,
894 Flags, SPFlags, IsDefinition ? CUNode :
nullptr, TParams,
nullptr,
895 nullptr, ThrownTypes);
898 AllSubprograms.push_back(SP);
899 trackIfUnresolved(SP);
911 bool ExportSymbols) {
925 DIFile *File,
unsigned LineNo,
bool IsDecl) {
927 ConfigurationMacros, IncludePath, APINotesFile, LineNo,
933 unsigned Discriminator) {
938 unsigned Line,
unsigned Col) {
948 return insertDeclare(Storage, VarInfo, Expr,
DL, InsertBefore->
getParent(),
958 return insertDeclare(Storage, VarInfo, Expr,
DL, InsertAtEnd, InsertBefore);
963 return insertLabel(LabelInfo,
DL,
964 InsertBefore ? InsertBefore->
getParent() :
nullptr,
970 return insertLabel(LabelInfo,
DL, InsertAtEnd,
nullptr);
978 return insertDbgValueIntrinsic(
979 V, VarInfo, Expr,
DL, InsertBefore ? InsertBefore->
getParent() :
nullptr,
988 return insertDbgValueIntrinsic(V, VarInfo, Expr,
DL, InsertAtEnd,
nullptr);
996 return insertDbgAddrIntrinsic(
997 V, VarInfo, Expr,
DL, InsertBefore ? InsertBefore->
getParent() :
nullptr,
1006 return insertDbgAddrIntrinsic(V, VarInfo, Expr,
DL, InsertAtEnd,
nullptr);
1014 Builder.SetInsertPoint(InsertBefore);
1016 Builder.SetInsertPoint(InsertBB);
1021 assert(V &&
"no value passed to dbg intrinsic");
1027 : Intrinsic::dbg_declare);
1035 return insertDbgIntrinsic(ValueFn, Val, VarInfo, Expr,
DL, InsertBB,
1044 return insertDbgIntrinsic(AddrFn, Val, VarInfo, Expr,
DL, InsertBB,
1052 assert(VarInfo &&
"empty or invalid DILocalVariable* passed to dbg.declare");
1053 assert(
DL &&
"Expected debug loc");
1054 assert(
DL->getScope()->getSubprogram() ==
1056 "Expected matching subprograms");
1060 trackIfUnresolved(VarInfo);
1061 trackIfUnresolved(Expr);
1068 return B.CreateCall(DeclareFn,
Args);
1077 assert(IntrinsicFn &&
"must pass a non-null intrinsic function");
1078 assert(V &&
"must pass a value to a dbg intrinsic");
1080 "empty or invalid DILocalVariable* passed to debug intrinsic");
1081 assert(
DL &&
"Expected debug loc");
1082 assert(
DL->getScope()->getSubprogram() ==
1084 "Expected matching subprograms");
1086 trackIfUnresolved(VarInfo);
1087 trackIfUnresolved(Expr);
1094 return B.CreateCall(IntrinsicFn,
Args);
1100 assert(LabelInfo &&
"empty or invalid DILabel* passed to dbg.label");
1101 assert(
DL &&
"Expected debug loc");
1102 assert(
DL->getScope()->getSubprogram() ==
1104 "Expected matching subprograms");
1108 trackIfUnresolved(LabelInfo);
1113 return B.CreateCall(LabelFn,
Args);
1119 N->replaceVTableHolder(VTableHolder);
1124 if (
T != VTableHolder)
1129 if (
T->isResolved())
1131 if (
auto *
N = dyn_cast_or_null<MDNode>(
O))
1132 trackIfUnresolved(
N);
1136 DINodeArray TParams) {
1140 N->replaceElements(Elements);
1142 N->replaceTemplateParams(DITemplateParameterArray(TParams));
1147 if (!
T->isResolved())
1154 trackIfUnresolved(Elements.get());
1156 trackIfUnresolved(TParams.get());
DIModule * createModule(DIScope *Scope, StringRef Name, StringRef ConfigurationMacros, StringRef IncludePath, StringRef APINotesFile={}, DIFile *File=nullptr, unsigned LineNo=0, bool IsDecl=false)
This creates new descriptor for a module with the specified parent scope.
This is an optimization pass for GlobalISel generic memory operations.
DISubprogram * getSubprogram() const
Get the subprogram for this scope.
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
DITypeRefArray getOrCreateTypeArray(ArrayRef< Metadata * > Elements)
Get a DITypeRefArray, create one if required.
void finalize()
Construct any deferred debug info descriptors.
void replaceVTableHolder(DICompositeType *&T, DIType *VTableHolder)
Replace the vtable holder in the given type.
Function * getDeclaration(Module *M, ID id, ArrayRef< Type * > Tys=None)
Create or insert an LLVM Function declaration for an intrinsic, and return it.
DIMacroNodeArray getMacros() const
void finalizeSubprogram(DISubprogram *SP)
Finalize a specific subprogram - no new variables may be added to this subprogram afterwards.
DIDerivedType * createBitFieldMemberType(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo, uint64_t SizeInBits, uint64_t OffsetInBits, uint64_t StorageOffsetInBits, DINode::DIFlags Flags, DIType *Ty, DINodeArray Annotations=nullptr)
Create debugging information entry for a bit field member.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
DIDerivedType * createPointerType(DIType *PointeeTy, uint64_t SizeInBits, uint32_t AlignInBits=0, Optional< unsigned > DWARFAddressSpace=None, StringRef Name="", DINodeArray Annotations=nullptr)
Create debugging information entry for a pointer.
String type, Fortran CHARACTER(n)
A single checksum, represented by a Kind and a Value (a string).
static Function * getDeclareIntrin(Module &M)
void replaceRetainedTypes(DITypeArray N)
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...
static DILocalVariable * createLocalVariable(LLVMContext &VMContext, DenseMap< MDNode *, SmallVector< TrackingMDNodeRef, 1 >> &PreservedVariables, DIScope *Scope, StringRef Name, unsigned ArgNo, DIFile *File, unsigned LineNo, DIType *Ty, bool AlwaysPreserve, DINode::DIFlags Flags, uint32_t AlignInBits, DINodeArray Annotations=nullptr)
TempDIType cloneWithFlags(DIFlags NewFlags) const
Returns a new temporary DIType with updated Flags.
DISubprogram * getDISubprogram(const MDNode *Scope)
Find subprogram that is enclosing this scope.
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.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
DIDerivedType * createMemberType(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo, uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits, DINode::DIFlags Flags, DIType *Ty, DINodeArray Annotations=nullptr)
Create debugging information entry for a member.
DISubroutineType * createSubroutineType(DITypeRefArray ParameterTypes, DINode::DIFlags Flags=DINode::FlagZero, unsigned CC=0)
Create subroutine type.
DIDerivedType * createQualifiedType(unsigned Tag, DIType *FromTy)
Create debugging information entry for a qualified type, e.g.
DIBuilder(Module &M, bool AllowUnresolved=true, DICompileUnit *CU=nullptr)
Construct a builder for a module.
DIStringType * createStringType(StringRef Name, uint64_t SizeInBits)
Create debugging information entry for a string type.
DIObjCProperty * createObjCProperty(StringRef Name, DIFile *File, unsigned LineNumber, StringRef GetterName, StringRef SetterName, unsigned PropertyAttributes, DIType *Ty)
Create debugging information entry for Objective-C property.
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="", DINodeArray Annotations=nullptr)
Create a temporary forward-declared type.
T get() const
Returns the value of the specified pointer type.
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 MDTuple * get(LLVMContext &Context, ArrayRef< Metadata * > MDs)
DITemplateValueParameter * createTemplateParameterPack(DIScope *Scope, StringRef Name, DIType *Ty, DINodeArray Val)
Create debugging information for a template parameter pack.
LLVM Basic Block Representation.
bool is() const
Test if the Union currently holds the type matching T.
Annotations lets you mark points and ranges inside source code, for tests:
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.
DIDerivedType * createSetType(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo, uint64_t SizeInBits, uint32_t AlignInBits, DIType *Ty)
Create debugging information entry for a set.
void addOperand(MDNode *M)
static DIType * createArtificialType(DIType *Ty)
Create a uniqued clone of Ty with FlagArtificial set.
NodeTy * replaceTemporary(TempMDNode &&N, NodeTy *Replacement)
Replace a temporary node.
static DITemplateValueParameter * createTemplateValueParameterHelper(LLVMContext &VMContext, unsigned Tag, DIScope *Context, StringRef Name, DIType *Ty, bool IsDefault, Metadata *MD)
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.
void replaceEnumTypes(DICompositeTypeArray N)
Replace arrays.
static ConstantAsMetadata * getConstantOrNull(Constant *C)
DIMacro * createMacro(DIMacroFile *Parent, unsigned Line, unsigned MacroType, StringRef Name, StringRef Value=StringRef())
Create debugging information entry for a macro.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
void append(in_iter in_start, in_iter in_end)
Add the specified range to the end of the SmallVector.
DIMacroFile * createTempMacroFile(DIMacroFile *Parent, unsigned Line, DIFile *File)
Create debugging information temporary entry for a macro file.
void replaceImportedEntities(DIImportedEntityArray N)
DICommonBlock * createCommonBlock(DIScope *Scope, DIGlobalVariable *decl, StringRef Name, DIFile *File, unsigned LineNo)
Create common block entry for a Fortran common block.
(vector float) vec_cmpeq(*A, *B) C
void retainType(DIScope *T)
Retain DIScope* in a module even if it is not referenced through debug info anchors.
DISPFlags
Debug info subprogram flags.
DIEnumerator * createEnumerator(StringRef Name, const APSInt &Value)
Create a single enumerator value.
DIDerivedType * createFriend(DIType *Ty, DIType *FriendTy)
Create debugging information entry for a 'friend'.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
An arbitrary precision integer that knows its signedness.
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.
static TempMDTuple getTemporary(LLVMContext &Context, ArrayRef< Metadata * > MDs)
static void initIRBuilder(IRBuilder<> &Builder, const DILocation *DL, BasicBlock *InsertBB, Instruction *InsertBefore)
Initialize IRBuilder for inserting dbg.declare and dbg.value intrinsics.
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.
DIDerivedType * createTypedef(DIType *Ty, StringRef Name, DIFile *File, unsigned LineNo, DIScope *Context, uint32_t AlignInBits=0, DINodeArray Annotations=nullptr)
Create debugging information entry for a typedef.
static DIImportedEntity * createImportedModule(LLVMContext &C, dwarf::Tag Tag, DIScope *Context, Metadata *NS, DIFile *File, unsigned Line, StringRef Name, DINodeArray Elements, SmallVectorImpl< TrackingMDNodeRef > &AllImportedModules)
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.
void replaceArrays(DICompositeType *&T, DINodeArray Elements, DINodeArray TParams=DINodeArray())
Replace arrays on a composite type.
static DIType * createTypeWithFlags(const DIType *Ty, DINode::DIFlags FlagsToSet)
static DIType * createObjectPointerType(DIType *Ty)
Create a uniqued clone of Ty with FlagObjectPointer and FlagArtificial set.
DILocalScope * getScope() const
Get the local scope for this variable.
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.
static DIScope * getNonCompileUnitScope(DIScope *N)
If N is compile unit return NULL otherwise return N.
This is an important base class in LLVM.
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.
DIGlobalVariableExpressionArray getGlobalVariables() const
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.
DICompositeType * createArrayType(uint64_t Size, uint32_t AlignInBits, DIType *Ty, DINodeArray Subscripts, PointerUnion< DIExpression *, DIVariable * > DataLocation=nullptr, PointerUnion< DIExpression *, DIVariable * > Associated=nullptr, PointerUnion< DIExpression *, DIVariable * > Allocated=nullptr, PointerUnion< DIExpression *, DIVariable * > Rank=nullptr)
Create debugging information entry for an array.
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.
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.
DIExpression * createExpression(ArrayRef< uint64_t > Addr=None)
Create a new descriptor for the specified variable which has a complex address expression for its add...
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
static std::enable_if_t< std::is_base_of< MDNode, T >::value, T * > replaceWithUniqued(std::unique_ptr< T, TempMDNodeDeleter > N)
Replace a temporary node with a uniqued one.
This is an important class for using LLVM in a threaded context.
DITemplateValueParameter * createTemplateTemplateParameter(DIScope *Scope, StringRef Name, DIType *Ty, StringRef Val)
Create debugging information for a template template parameter.
DICompositeTypeArray getEnumTypes() const
void replaceGlobalVariables(DIGlobalVariableExpressionArray N)
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.
initializer< Ty > init(const Ty &Val)
An imported module (C++ using directive or similar).
static DISubprogram * getSubprogram(bool IsDistinct, Ts &&...Args)
static MDString * get(LLVMContext &Context, StringRef Str)
static DISubprogram * createArtificialSubprogram(DISubprogram *SP)
Create a distinct clone of SP with FlagArtificial set.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata * > MDs)
static void checkGlobalVariableScope(DIScope *Context)
DILabel * createLabel(DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo, bool AlwaysPreserve=false)
Create a new descriptor for an label.
A Module instance is used to store all the information related to an LLVM module.
DIImportedEntity * createImportedDeclaration(DIScope *Context, DINode *Decl, DIFile *File, unsigned Line, StringRef Name="", DINodeArray Elements=nullptr)
Create a descriptor for an imported function.
Basic type, like 'int' or 'float'.
Class for arbitrary precision integers.
Type array for a subprogram.
DIImportedEntity * createImportedModule(DIScope *Context, DINamespace *NS, DIFile *File, unsigned Line, DINodeArray Elements=nullptr)
Create a descriptor for an imported module.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Scope
Defines the scope in which this symbol should be visible: Default – Visible in the public interface o...
DILexicalBlockFile * createLexicalBlockFile(DIScope *Scope, DIFile *File, unsigned Discriminator=0)
This creates a descriptor for a lexical block with a new file attached.
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.
StringRef - Represent a constant reference to a string, i.e.
Tagged DWARF-like metadata node.
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
static TempMDTuple getTemporary(LLVMContext &Context, ArrayRef< Metadata * > MDs)
Return a temporary node.
Base class for variables.
static MDTuple * getDistinct(LLVMContext &Context, ArrayRef< Metadata * > MDs)
DIGenericSubrange * getOrCreateGenericSubrange(DIGenericSubrange::BoundType Count, DIGenericSubrange::BoundType LowerBound, DIGenericSubrange::BoundType UpperBound, DIGenericSubrange::BoundType Stride)
DILexicalBlock * createLexicalBlock(DIScope *Scope, DIFile *File, unsigned Line, unsigned Col)
This creates a descriptor for a lexical block with the specified parent context.
A discriminated union of two or more pointer types, with the discriminator in the low bit of the poin...
DITemplateTypeParameter * createTemplateTypeParameter(DIScope *Scope, StringRef Name, DIType *Ty, bool IsDefault)
Create debugging information for template type parameter.
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.
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, StringRef SysRoot={}, StringRef SDK={})
A CompileUnit provides an anchor for all debugging information generated during this instance of comp...
DINamespace * createNameSpace(DIScope *Scope, StringRef Name, bool ExportSymbols)
This creates new descriptor for a namespace with the specified parent scope.
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.
static IntegerType * getInt64Ty(LLVMContext &C)
DILocalScope * getScope() const
Get the local scope for this label.
DIBasicType * createUnspecifiedType(StringRef Name)
Create a DWARF unspecified type.
Base class for scope-like contexts.
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.
static ConstantInt * getSigned(IntegerType *Ty, int64_t V)
Return a ConstantInt with the specified value for the specified type.
DICompositeType * createVectorType(uint64_t Size, uint32_t AlignInBits, DIType *Ty, DINodeArray Subscripts)
Create debugging information entry for a vector type.
DINodeArray getOrCreateArray(ArrayRef< Metadata * > Elements)
Get a DINodeArray, create one if required.
NamedMDNode * getOrInsertNamedMetadata(StringRef Name)
Return the named MDNode in the module with the specified name.
DILocalVariable * createParameterVariable(DIScope *Scope, StringRef Name, unsigned ArgNo, DIFile *File, unsigned LineNo, DIType *Ty, bool AlwaysPreserve=false, DINode::DIFlags Flags=DINode::FlagZero, DINodeArray Annotations=nullptr)
Create a new descriptor for a parameter variable.
DIScopeArray getRetainedTypes() const
DIGlobalVariableExpression * createGlobalVariableExpression(DIScope *Context, StringRef Name, StringRef LinkageName, DIFile *File, unsigned LineNo, DIType *Ty, bool IsLocalToUnit, bool isDefined=true, DIExpression *Expr=nullptr, MDNode *Decl=nullptr, MDTuple *TemplateParams=nullptr, uint32_t AlignInBits=0, DINodeArray Annotations=nullptr)
Create a new descriptor for the specified variable.
A pair of DIGlobalVariable and DIExpression.
DITemplateValueParameter * createTemplateValueParameter(DIScope *Scope, StringRef Name, DIType *Ty, bool IsDefault, Constant *Val)
Create debugging information for template value parameter.
static std::enable_if_t< std::is_base_of< MDNode, T >::value, T * > replaceWithDistinct(std::unique_ptr< T, TempMDNodeDeleter > N)
Replace a temporary node with a distinct one.
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, DINodeArray Annotations=nullptr, StringRef TargetFuncName="")
Create a new descriptor for the specified subprogram.
DIBasicType * createNullPtrType()
Create C++11 nullptr type.
DISubrange * getOrCreateSubrange(int64_t Lo, int64_t Count)
Create a descriptor for a value range.
DIMacroNodeArray getOrCreateMacroArray(ArrayRef< Metadata * > Elements)
Get a DIMacroNodeArray, create one if required.
const BasicBlock * getParent() const
const Instruction * getTerminator() const LLVM_READONLY
Returns the terminator instruction if the block is well formed or null if the block is not well forme...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Represents a module in the programming language, for example, a Clang module, or a Fortran module.
static IntegerType * get(LLVMContext &C, unsigned NumBits)
This static method is the primary way of constructing an IntegerType.
static cl::opt< bool > UseDbgAddr("use-dbg-addr", llvm::cl::desc("Use llvm.dbg.addr for all local variables"), cl::init(false), cl::Hidden)
DIBasicType * createBasicType(StringRef Name, uint64_t SizeInBits, unsigned Encoding, DINode::DIFlags Flags=DINode::FlagZero)
Create debugging information entry for a basic type.
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
DIImportedEntityArray getImportedEntities() const
bool isArtificial() const
static Value * getDbgIntrinsicValueImpl(LLVMContext &VMContext, Value *V)
bool isObjectPointer() const
void replaceMacros(DIMacroNodeArray N)
LLVM Value Representation.
Tracking metadata reference owned by Metadata.
DIBasicType * createUnspecifiedParameter()
Create unspecified parameter type for a subroutine type.
reference emplace_back(ArgTypes &&... Args)
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.