13#ifndef LLVM_IR_DEBUGINFOMETADATA_H
14#define LLVM_IR_DEBUGINFOMETADATA_H
38#define DEFINE_MDNODE_GET_UNPACK_IMPL(...) __VA_ARGS__
39#define DEFINE_MDNODE_GET_UNPACK(ARGS) DEFINE_MDNODE_GET_UNPACK_IMPL ARGS
40#define DEFINE_MDNODE_GET_DISTINCT_TEMPORARY(CLASS, FORMAL, ARGS) \
41 static CLASS *getDistinct(LLVMContext &Context, \
42 DEFINE_MDNODE_GET_UNPACK(FORMAL)) { \
43 return getImpl(Context, DEFINE_MDNODE_GET_UNPACK(ARGS), Distinct); \
45 static Temp##CLASS getTemporary(LLVMContext &Context, \
46 DEFINE_MDNODE_GET_UNPACK(FORMAL)) { \
48 getImpl(Context, DEFINE_MDNODE_GET_UNPACK(ARGS), Temporary)); \
50#define DEFINE_MDNODE_GET(CLASS, FORMAL, ARGS) \
51 static CLASS *get(LLVMContext &Context, DEFINE_MDNODE_GET_UNPACK(FORMAL)) { \
52 return getImpl(Context, DEFINE_MDNODE_GET_UNPACK(ARGS), Uniqued); \
54 static CLASS *getIfExists(LLVMContext &Context, \
55 DEFINE_MDNODE_GET_UNPACK(FORMAL)) { \
56 return getImpl(Context, DEFINE_MDNODE_GET_UNPACK(ARGS), Uniqued, \
59 DEFINE_MDNODE_GET_DISTINCT_TEMPORARY(CLASS, FORMAL, ARGS)
67class DbgVariableIntrinsic;
68class DbgVariableRecord;
79 explicit operator bool()
const {
return get(); }
87 unsigned size()
const {
return N ?
N->getNumOperands() : 0u; }
89 return cast_or_null<DIType>(
N->getOperand(
I));
152 if (
auto *S = getOperandAs<MDString>(
I))
153 return S->getString();
174#define HANDLE_DI_FLAG(ID, NAME) Flag##NAME = ID,
175#define DI_FLAG_LARGEST_NEEDED
176#include "llvm/IR/DebugInfoFlags.def"
179 FlagVirtualInheritance,
197 case GenericDINodeKind:
199 case DIEnumeratorKind:
200 case DIBasicTypeKind:
201 case DIStringTypeKind:
202 case DIDerivedTypeKind:
203 case DICompositeTypeKind:
204 case DISubroutineTypeKind:
206 case DICompileUnitKind:
207 case DISubprogramKind:
208 case DILexicalBlockKind:
209 case DILexicalBlockFileKind:
210 case DINamespaceKind:
211 case DICommonBlockKind:
212 case DITemplateTypeParameterKind:
213 case DITemplateValueParameterKind:
214 case DIGlobalVariableKind:
215 case DILocalVariableKind:
217 case DIObjCPropertyKind:
218 case DIImportedEntityKind:
220 case DIGenericSubrangeKind:
248 void recalculateHash();
250 static GenericDINode *getImpl(LLVMContext &Context,
unsigned Tag,
257 static GenericDINode *getImpl(LLVMContext &Context,
unsigned Tag,
261 TempGenericDINode cloneImpl()
const {
279 TempGenericDINode
clone()
const {
return cloneImpl(); }
318 bool ShouldCreate =
true);
327 return Context.getReplaceableUses()->getAllDbgVariableRecordUsers();
357 bool ShouldCreate =
true);
361 bool ShouldCreate =
true);
366 bool ShouldCreate =
true);
368 TempDISubrange cloneImpl()
const {
370 getRawUpperBound(), getRawStride());
385 TempDISubrange
clone()
const {
return cloneImpl(); }
395 typedef PointerUnion<ConstantInt *, DIVariable *, DIExpression *> BoundType;
422 bool ShouldCreate =
true);
424 TempDIGenericSubrange cloneImpl()
const {
433 (CountNode, LowerBound, UpperBound, Stride))
435 TempDIGenericSubrange
clone()
const {
return cloneImpl(); }
477 static DIEnumerator *getImpl(LLVMContext &Context,
const APInt &Value,
481 TempDIEnumerator cloneImpl()
const {
499 TempDIEnumerator
clone()
const {
return cloneImpl(); }
530 inline std::optional<StringRef>
getSource()
const;
542 return isa<DIFile>(
this) ?
const_cast<DIScope *
>(
this)
550 case DIBasicTypeKind:
551 case DIStringTypeKind:
552 case DIDerivedTypeKind:
553 case DICompositeTypeKind:
554 case DISubroutineTypeKind:
556 case DICompileUnitKind:
557 case DISubprogramKind:
558 case DILexicalBlockKind:
559 case DILexicalBlockFileKind:
560 case DINamespaceKind:
561 case DICommonBlockKind:
609 std::optional<ChecksumInfo<MDString *>> Checksum;
614 std::optional<ChecksumInfo<MDString *>>
CS,
MDString *Src,
620 std::optional<ChecksumInfo<StringRef>>
CS,
622 bool ShouldCreate =
true) {
623 std::optional<ChecksumInfo<MDString *>> MDChecksum;
631 static DIFile *getImpl(LLVMContext &Context, MDString *
Filename,
633 std::optional<ChecksumInfo<MDString *>>
CS,
635 bool ShouldCreate =
true);
637 TempDIFile cloneImpl()
const {
646 std::optional<StringRef> Source = std::nullopt),
654 TempDIFile
clone()
const {
return cloneImpl(); }
658 std::optional<ChecksumInfo<StringRef>> getChecksum()
const {
659 std::optional<ChecksumInfo<StringRef>> StringRefChecksum;
661 StringRefChecksum.emplace(Checksum->Kind, Checksum->Value->getString());
662 return StringRefChecksum;
664 std::optional<StringRef>
getSource()
const {
665 return Source ? std::optional<StringRef>(
Source->getString())
669 MDString *getRawFilename()
const {
return getOperandAs<MDString>(0); }
670 MDString *getRawDirectory()
const {
return getOperandAs<MDString>(1); }
671 std::optional<ChecksumInfo<MDString *>> getRawChecksum()
const {
674 MDString *getRawSource()
const {
return Source; }
676 static StringRef getChecksumKindAsString(
ChecksumKind CSKind);
677 static std::optional<ChecksumKind>
getChecksumKind(StringRef CSKindStr);
686 return F->getFilename();
692 return F->getDirectory();
698 return F->getSource();
720 init(Line, SizeInBits, AlignInBits, OffsetInBits, Flags);
728 this->SizeInBits = SizeInBits;
730 this->OffsetInBits = OffsetInBits;
738 init(Line, SizeInBits, AlignInBits, OffsetInBits, Flags);
761 auto NewTy =
clone();
762 NewTy->Flags = NewFlags;
781 return getFlags() & FlagObjcClassComplete;
790 return getFlags() & FlagTypePassByReference;
800 case DIBasicTypeKind:
801 case DIStringTypeKind:
802 case DIDerivedTypeKind:
803 case DICompositeTypeKind:
804 case DISubroutineTypeKind:
825 Encoding(Encoding) {}
832 bool ShouldCreate =
true) {
837 static DIBasicType *getImpl(LLVMContext &Context,
unsigned Tag,
841 bool ShouldCreate =
true);
843 TempDIBasicType cloneImpl()
const {
850 (
Tag,
Name, 0, 0, 0, FlagZero))
866 TempDIBasicType
clone()
const {
return cloneImpl(); }
893 Encoding(Encoding) {}
901 bool ShouldCreate =
true) {
906 static DIStringType *getImpl(LLVMContext &Context,
unsigned Tag,
911 bool ShouldCreate =
true);
913 TempDIStringType cloneImpl()
const {
941 TempDIStringType
clone()
const {
return cloneImpl(); }
988 bool IsaPointer,
bool AuthenticatesNullValues) {
990 assert(Discriminator <= 0xffff);
991 RawData = (Key << 0) | (IsDiscr ? (1 << 4) : 0) | (Discriminator << 5) |
992 (IsaPointer ? (1 << 21) : 0) |
993 (AuthenticatesNullValues ? (1 << 22) : 0);
1009 std::optional<unsigned> DWARFAddressSpace;
1014 std::optional<unsigned> DWARFAddressSpace,
1019 DWARFAddressSpace(DWARFAddressSpace) {
1028 std::optional<unsigned> DWARFAddressSpace,
1031 bool ShouldCreate =
true) {
1037 static DIDerivedType *
1041 std::optional<unsigned> DWARFAddressSpace,
1044 bool ShouldCreate =
true);
1046 TempDIDerivedType cloneImpl()
const {
1050 getDWARFAddressSpace(), getPtrAuthData(),
getFlags(),
1060 std::optional<unsigned> DWARFAddressSpace,
1071 std::optional<unsigned> DWARFAddressSpace,
1079 TempDIDerivedType
clone()
const {
return cloneImpl(); }
1087 std::optional<unsigned> getDWARFAddressSpace()
const {
1088 return DWARFAddressSpace;
1091 std::optional<PtrAuthData> getPtrAuthData()
const;
1115 return dyn_cast_or_null<DIObjCProperty>(
getExtraData());
1139 return !(Lhs == Rhs);
1150 unsigned RuntimeLang;
1158 RuntimeLang(RuntimeLang) {}
1162 void mutate(
unsigned Tag,
unsigned Line,
unsigned RuntimeLang,
1167 this->RuntimeLang = RuntimeLang;
1171 static DICompositeType *
1180 bool ShouldCreate =
true) {
1188 static DICompositeType *
1198 TempDICompositeType cloneImpl()
const {
1239 TempDICompositeType
clone()
const {
return cloneImpl(); }
1299 return getOperandAs<DIDerivedType>(8);
1324 if (
auto *MD = dyn_cast_or_null<ConstantAsMetadata>(
getRawRank()))
1325 return dyn_cast_or_null<ConstantInt>(MD->getValue());
1329 return dyn_cast_or_null<DIExpression>(
getRawRank());
1347 "Lost a member during member list replacement");
1384 bool ShouldCreate =
true) {
1390 bool ShouldCreate =
true);
1392 TempDISubroutineType cloneImpl()
const {
1404 TempDISubroutineType
clone()
const {
return cloneImpl(); }
1407 auto NewTy =
clone();
1454 unsigned RuntimeVersion;
1456 unsigned EmissionKind;
1457 unsigned NameTableKind;
1459 bool SplitDebugInlining;
1460 bool DebugInfoForProfiling;
1461 bool RangesBaseAddress;
1464 bool IsOptimized,
unsigned RuntimeVersion,
1465 unsigned EmissionKind,
uint64_t DWOId,
bool SplitDebugInlining,
1466 bool DebugInfoForProfiling,
unsigned NameTableKind,
1474 unsigned EmissionKind, DICompositeTypeArray
EnumTypes,
1478 uint64_t DWOId,
bool SplitDebugInlining,
bool DebugInfoForProfiling,
1487 DebugInfoForProfiling, NameTableKind, RangesBaseAddress,
1491 static DICompileUnit *
1492 getImpl(LLVMContext &Context,
unsigned SourceLanguage,
Metadata *
File,
1498 bool DebugInfoForProfiling,
unsigned NameTableKind,
1499 bool RangesBaseAddress, MDString *
SysRoot, MDString *
SDK,
1502 TempDICompileUnit cloneImpl()
const {
1524 uint64_t DWOId,
bool SplitDebugInlining,
bool DebugInfoForProfiling,
1530 DebugInfoForProfiling, (
unsigned)NameTableKind, RangesBaseAddress,
1539 bool SplitDebugInlining,
bool DebugInfoForProfiling,
1545 DebugInfoForProfiling, NameTableKind, RangesBaseAddress,
SysRoot,
SDK))
1547 TempDICompileUnit
clone()
const {
return cloneImpl(); }
1585 this->SplitDebugInlining = SplitDebugInlining;
1593 return getOperandAs<MDString>(3);
1673 unsigned VirtualIndex;
1683#define HANDLE_DISP_FLAG(ID, NAME) SPFlag##NAME = ID,
1684#define DISP_FLAG_LARGEST_NEEDED
1685#include "llvm/IR/DebugInfoFlags.def"
1705 bool IsMainSubprogram =
false);
1712 unsigned ScopeLine,
unsigned VirtualIndex,
int ThisAdjustment,
1720 unsigned VirtualIndex,
int ThisAdjustment,
DIFlags Flags,
1734 static DISubprogram *
1742 bool ShouldCreate =
true);
1744 TempDISubprogram cloneImpl()
const {
1747 getContainingType(), getVirtualIndex(),
1748 getThisAdjustment(),
getFlags(), getSPFlags(),
1749 getUnit(), getTemplateParams(), getDeclaration(),
1750 getRetainedNodes(), getThrownTypes(), getAnnotations(),
1751 getTargetFuncName());
1782 TempDISubprogram
clone()
const {
return cloneImpl(); }
1785 TempDISubprogram cloneWithFlags(
DIFlags NewFlags)
const {
1786 auto NewSP =
clone();
1787 NewSP->Flags = NewFlags;
1792 unsigned getLine()
const {
return Line; }
1794 unsigned getVirtualIndex()
const {
return VirtualIndex; }
1795 int getThisAdjustment()
const {
return ThisAdjustment; }
1796 unsigned getScopeLine()
const {
return ScopeLine; }
1797 void setScopeLine(
unsigned L) {
1802 DISPFlags getSPFlags()
const {
return SPFlags; }
1803 bool isLocalToUnit()
const {
return getSPFlags() & SPFlagLocalToUnit; }
1804 bool isDefinition()
const {
return getSPFlags() & SPFlagDefinition; }
1805 bool isOptimized()
const {
return getSPFlags() & SPFlagOptimized; }
1806 bool isMainSubprogram()
const {
return getSPFlags() & SPFlagMainSubprogram; }
1808 bool isArtificial()
const {
return getFlags() & FlagArtificial; }
1809 bool isPrivate()
const {
1812 bool isProtected()
const {
1815 bool isPublic()
const {
1818 bool isExplicit()
const {
return getFlags() & FlagExplicit; }
1819 bool isPrototyped()
const {
return getFlags() & FlagPrototyped; }
1820 bool areAllCallsDescribed()
const {
1821 return getFlags() & FlagAllCallsDescribed;
1823 bool isPure()
const {
return getSPFlags() & SPFlagPure; }
1824 bool isElemental()
const {
return getSPFlags() & SPFlagElemental; }
1825 bool isRecursive()
const {
return getSPFlags() & SPFlagRecursive; }
1826 bool isObjCDirect()
const {
return getSPFlags() & SPFlagObjCDirect; }
1832 bool isDeleted()
const {
return getSPFlags() & SPFlagDeleted; }
1838 bool isLValueReference()
const {
return getFlags() & FlagLValueReference; }
1844 bool isRValueReference()
const {
return getFlags() & FlagRValueReference; }
1849 bool isNoReturn()
const {
return getFlags() & FlagNoReturn; }
1854 bool isThunk()
const {
return getFlags() & FlagThunk; }
1856 DIScope *
getScope()
const {
return cast_or_null<DIScope>(getRawScope()); }
1863 DISubroutineType *
getType()
const {
1864 return cast_or_null<DISubroutineType>(getRawType());
1866 DIType *getContainingType()
const {
1867 return cast_or_null<DIType>(getRawContainingType());
1869 void replaceType(DISubroutineType *Ty) {
1874 DICompileUnit *getUnit()
const {
1875 return cast_or_null<DICompileUnit>(getRawUnit());
1878 DITemplateParameterArray getTemplateParams()
const {
1879 return cast_or_null<MDTuple>(getRawTemplateParams());
1882 return cast_or_null<DISubprogram>(getRawDeclaration());
1885 DINodeArray getRetainedNodes()
const {
1886 return cast_or_null<MDTuple>(getRawRetainedNodes());
1888 DITypeArray getThrownTypes()
const {
1889 return cast_or_null<MDTuple>(getRawThrownTypes());
1891 DINodeArray getAnnotations()
const {
1892 return cast_or_null<MDTuple>(getRawAnnotations());
1894 StringRef getTargetFuncName()
const {
1899 MDString *getRawName()
const {
return getOperandAs<MDString>(2); }
1900 MDString *getRawLinkageName()
const {
return getOperandAs<MDString>(3); }
1905 Metadata *getRawContainingType()
const {
1906 return getNumOperands() > 8 ? getOperandAs<Metadata>(8) : nullptr;
1908 Metadata *getRawTemplateParams()
const {
1909 return getNumOperands() > 9 ? getOperandAs<Metadata>(9) : nullptr;
1911 Metadata *getRawThrownTypes()
const {
1912 return getNumOperands() > 10 ? getOperandAs<Metadata>(10) : nullptr;
1914 Metadata *getRawAnnotations()
const {
1915 return getNumOperands() > 11 ? getOperandAs<Metadata>(11) : nullptr;
1917 MDString *getRawTargetFuncName()
const {
1918 return getNumOperands() > 12 ? getOperandAs<MDString>(12) : nullptr;
1921 void replaceRawLinkageName(MDString *
LinkageName) {
1924 void replaceRetainedNodes(DINodeArray
N) {
1931 bool describes(
const Function *
F)
const;
1966 TempDILocation cloneImpl()
const {
1988 TempDILocation
clone()
const {
return cloneImpl(); }
1996 StringRef getSubprogramLinkageName()
const {
1997 DISubprogram *SP =
getScope()->getSubprogram();
2000 auto Name = SP->getLinkageName();
2003 return SP->getName();
2006 DILocation *getInlinedAt()
const {
2019 DIFile *getFile()
const {
return getScope()->getFile(); }
2021 StringRef getDirectory()
const {
return getScope()->getDirectory(); }
2022 std::optional<StringRef> getSource()
const {
return getScope()->getSource(); }
2028 DILocalScope *getInlinedAtScope()
const {
2029 if (
auto *IA = getInlinedAt())
2030 return IA->getInlinedAtScope();
2068 inline unsigned getDiscriminator()
const;
2079 return ((Discriminator & 0x7) == 0x7) && (Discriminator & 0xFFFFFFF8);
2089 inline std::optional<const DILocation *>
2106 inline std::optional<const DILocation *>
2144 bool IsFSDiscriminator =
false) {
2153 if (IsFSDiscriminator)
2244 assert(Column < (1u << 16) &&
"Expected 16-bit column");
2251 bool ShouldCreate =
true) {
2257 static DILexicalBlock *getImpl(LLVMContext &Context,
Metadata *
Scope,
2261 TempDILexicalBlock cloneImpl()
const {
2276 TempDILexicalBlock
clone()
const {
return cloneImpl(); }
2300 bool ShouldCreate =
true) {
2306 static DILexicalBlockFile *getImpl(LLVMContext &Context,
Metadata *
Scope,
2309 bool ShouldCreate =
true);
2311 TempDILexicalBlockFile cloneImpl()
const {
2325 TempDILexicalBlockFile
clone()
const {
return cloneImpl(); }
2333unsigned DILocation::getDiscriminator()
const {
2334 if (
auto *
F = dyn_cast<DILexicalBlockFile>(
getScope()))
2335 return F->getDiscriminator();
2346 for (
auto *LBF = dyn_cast<DILexicalBlockFile>(
Scope);
2347 LBF && LBF->getDiscriminator() != 0;
2348 LBF = dyn_cast<DILexicalBlockFile>(
Scope))
2349 Scope = LBF->getScope();
2369std::optional<const DILocation *>
2371 unsigned BD,
DF, CI;
2385 return std::nullopt;
2388std::optional<const DILocation *>
2406 return std::nullopt;
2430 TempDINamespace cloneImpl()
const {
2443 TempDINamespace
clone()
const {
return cloneImpl(); }
2473 bool ShouldCreate =
true) {
2486 TempDIModule cloneImpl()
const {
2488 getConfigurationMacros(), getIncludePath(),
2489 getAPINotesFile(), getLineNo(), getIsDecl());
2497 bool IsDecl =
false),
2504 bool IsDecl =
false),
2508 TempDIModule
clone()
const {
return cloneImpl(); }
2510 DIScope *
getScope()
const {
return cast_or_null<DIScope>(getRawScope()); }
2519 MDString *getRawName()
const {
return getOperandAs<MDString>(2); }
2520 MDString *getRawConfigurationMacros()
const {
2521 return getOperandAs<MDString>(3);
2523 MDString *getRawIncludePath()
const {
return getOperandAs<MDString>(4); }
2524 MDString *getRawAPINotesFile()
const {
return getOperandAs<MDString>(5); }
2527 return MD->getMetadataID() == DIModuleKind;
2552 return MD->
getMetadataID() == DITemplateTypeParameterKind ||
2568 bool ShouldCreate =
true) {
2575 bool ShouldCreate =
true);
2577 TempDITemplateTypeParameter cloneImpl()
const {
2589 TempDITemplateTypeParameter
clone()
const {
return cloneImpl(); }
2611 bool ShouldCreate =
true) {
2615 static DITemplateValueParameter *getImpl(LLVMContext &Context,
unsigned Tag,
2619 bool ShouldCreate =
true);
2621 TempDITemplateValueParameter cloneImpl()
const {
2636 TempDITemplateValueParameter
clone()
const {
return cloneImpl(); }
2670 if (
auto *
BT = dyn_cast<DIBasicType>(
getType()))
2671 return BT->getSignedness();
2672 return std::nullopt;
2677 return F->getFilename();
2683 return F->getDirectory();
2689 return F->getSource();
2690 return std::nullopt;
2717 std::vector<uint64_t> Elements;
2721 Elements(Elements.begin(), Elements.end()) {}
2726 bool ShouldCreate =
true);
2728 TempDIExpression cloneImpl()
const {
2735 TempDIExpression
clone()
const {
return cloneImpl(); }
2742 assert(
I < Elements.size() &&
"Index out of range");
2749 std::optional<SignedOrUnsignedConstant>
isConstant()
const;
2893 uint64_t StartInBits = std::max(
A.OffsetInBits,
B.OffsetInBits);
2894 uint64_t EndInBits = std::min(
A.endInBits(),
B.endInBits());
2895 if (EndInBits <= StartInBits)
2902 static std::optional<FragmentInfo>
getFragmentInfo(expr_op_iterator Start,
2903 expr_op_iterator
End);
2953 static std::optional<const DIExpression *>
2979 bool SecondIndirect);
2996 unsigned &AddrClass);
3060 static std::optional<DIExpression *>
3062 unsigned SizeInBits);
3088 unsigned ToSize,
bool Signed);
3099 auto Fragment2 = *
Other->getFragmentInfo();
3117 std::pair<DIExpression *, const ConstantInt *>
3123 return std::tie(
A.SizeInBits,
A.OffsetInBits) ==
3124 std::tie(
B.SizeInBits,
B.OffsetInBits);
3129 return std::tie(
A.SizeInBits,
A.OffsetInBits) <
3130 std::tie(
B.SizeInBits,
B.OffsetInBits);
3135 static const uint64_t MaxVal = std::numeric_limits<uint64_t>::max();
3162 IsLocalToUnit(IsLocalToUnit), IsDefinition(IsDefinition) {}
3168 bool IsLocalToUnit,
bool IsDefinition,
3171 bool ShouldCreate =
true) {
3178 static DIGlobalVariable *
3181 bool IsLocalToUnit,
bool IsDefinition,
3184 bool ShouldCreate =
true);
3186 TempDIGlobalVariable cloneImpl()
const {
3198 unsigned Line,
DIType *
Type,
bool IsLocalToUnit,
bool IsDefinition,
3212 TempDIGlobalVariable
clone()
const {
return cloneImpl(); }
3256 bool ShouldCreate =
true);
3258 TempDICommonBlock cloneImpl()
const {
3273 TempDICommonBlock
clone()
const {
return cloneImpl(); }
3277 return cast_or_null<DIGlobalVariable>(
getRawDecl());
3307 Arg(Arg), Flags(Flags) {
3308 assert(Arg < (1 << 16) &&
"DILocalVariable: Arg out of range");
3317 bool ShouldCreate =
true) {
3322 static DILocalVariable *getImpl(LLVMContext &Context,
Metadata *
Scope,
3327 bool ShouldCreate =
true);
3329 TempDILocalVariable cloneImpl()
const {
3349 TempDILocalVariable
clone()
const {
return cloneImpl(); }
3397 bool ShouldCreate =
true) {
3403 bool ShouldCreate =
true);
3405 TempDILabel cloneImpl()
const {
3420 TempDILabel
clone()
const {
return cloneImpl(); }
3455 unsigned Attributes;
3476 TempDIObjCProperty cloneImpl()
const {
3496 TempDIObjCProperty
clone()
const {
return cloneImpl(); }
3508 return F->getFilename();
3514 return F->getDirectory();
3547 bool ShouldCreate =
true) {
3552 static DIImportedEntity *
3557 TempDIImportedEntity cloneImpl()
const {
3559 getFile(), getLine(),
getName(), getElements());
3566 DINodeArray Elements =
nullptr),
3574 TempDIImportedEntity
clone()
const {
return cloneImpl(); }
3577 DIScope *
getScope()
const {
return cast_or_null<DIScope>(getRawScope()); }
3578 DINode *getEntity()
const {
return cast_or_null<DINode>(getRawEntity()); }
3580 DIFile *getFile()
const {
return cast_or_null<DIFile>(getRawFile()); }
3581 DINodeArray getElements()
const {
3582 return cast_or_null<MDTuple>(getRawElements());
3587 MDString *getRawName()
const {
return getOperandAs<MDString>(2); }
3592 return MD->getMetadataID() == DIImportedEntityKind;
3610 TempDIGlobalVariableExpression cloneImpl()
const {
3619 TempDIGlobalVariableExpression
clone()
const {
return cloneImpl(); }
3634 return MD->
getMetadataID() == DIGlobalVariableExpressionKind;
3655 assert(MIType < 1u << 16);
3665 if (
auto *S = getOperandAs<MDString>(
I))
3666 return S->getString();
3684 case DIMacroFileKind:
3706 bool ShouldCreate =
true) {
3710 static DIMacro *getImpl(LLVMContext &Context,
unsigned MIType,
unsigned Line,
3712 bool ShouldCreate =
true);
3714 TempDIMacro cloneImpl()
const {
3729 TempDIMacro
clone()
const {
return cloneImpl(); }
3761 bool ShouldCreate =
true) {
3766 static DIMacroFile *getImpl(LLVMContext &Context,
unsigned MIType,
3770 TempDIMacroFile cloneImpl()
const {
3785 TempDIMacroFile
clone()
const {
return cloneImpl(); }
3791 "Lost a macro node during macro node list replacement");
3822 Args(Args.begin(), Args.end()) {
3829 void dropAllReferences(
bool Untrack);
3832 static DIArgList *
get(LLVMContext &Context, ArrayRef<ValueAsMetadata *> Args);
3865 std::optional<FragmentInfo> Fragment;
3879 : Variable(Var), Fragment(
FragmentInfo), InlinedAt(InlinedAt) {}
3884 Fragment(DIExpr ? DIExpr->getFragmentInfo() :
std::nullopt),
3885 InlinedAt(InlinedAt) {}
3892 return Fragment.value_or(DefaultFragment);
3896 return F == DefaultFragment;
3900 return std::tie(Variable, Fragment, InlinedAt) ==
3905 return std::tie(Variable, Fragment, InlinedAt) <
3925 const std::optional<FragmentInfo> Fragment =
D.getFragment();
3951#undef DEFINE_MDNODE_GET_UNPACK_IMPL
3952#undef DEFINE_MDNODE_GET_UNPACK
3953#undef DEFINE_MDNODE_GET
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
static std::string getLinkageName(GlobalValue::LinkageTypes LT)
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
This file contains the declarations for the subclasses of Constant, which represent the different fla...
static RegisterPass< DebugifyFunctionPass > DF("debugify-function", "Attach debug info to a function")
static unsigned getNextComponentInDiscriminator(unsigned D)
Returns the next component stored in discriminator.
static unsigned getUnsignedFromPrefixEncoding(unsigned U)
Reverse transformation as getPrefixEncodingFromUnsigned.
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
static SmallString< 128 > getFilename(const DISubprogram *SP)
Extract a filename for a DISubprogram.
This file defines the PointerUnion class, which is a discriminated union of pointer types.
static StringRef getName(Value *V)
static void r2(uint32_t &A, uint32_t &B, uint32_t &C, uint32_t &D, uint32_t &E, int I, uint32_t *Buf)
static void r1(uint32_t &A, uint32_t &B, uint32_t &C, uint32_t &D, uint32_t &E, int I, uint32_t *Buf)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static SPIRV::Scope::Scope getScope(SyncScope::ID Ord, SPIRVMachineModuleInfo *MMI)
static enum BaseType getBaseType(const Value *Val)
Return the baseType for Val which states whether Val is exclusively derived from constant/null,...
This file defines the SmallVector class.
static uint32_t getFlags(const Symbol *Sym)
static SymbolRef::Type getType(const Symbol *Sym)
Class for arbitrary precision integers.
Annotations lets you mark points and ranges inside source code, for tests:
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
This is the shared class of boolean and integer constants.
This is an important base class in LLVM.
List of ValueAsMetadata, to be used as an argument to a dbg.value intrinsic.
ArrayRef< ValueAsMetadata * > getArgs() const
void handleChangedOperand(void *Ref, Metadata *New)
static bool classof(const Metadata *MD)
static DIArgList * get(LLVMContext &Context, ArrayRef< ValueAsMetadata * > Args)
SmallVector< DbgVariableRecord * > getAllDbgVariableRecordUsers()
static bool classof(const Metadata *MD)
SmallVector< DbgVariableRecord * > getAllDbgVariableRecordUsers()
static TempDIAssignID getTemporary(LLVMContext &Context)
static DIAssignID * getDistinct(LLVMContext &Context)
void replaceOperandWith(unsigned I, Metadata *New)=delete
Basic type, like 'int' or 'float'.
unsigned StringRef uint64_t FlagZero unsigned StringRef uint64_t uint32_t unsigned DIFlags Flags
DEFINE_MDNODE_GET(DIBasicType,(unsigned Tag, StringRef Name),(Tag, Name, 0, 0, 0, FlagZero)) DEFINE_MDNODE_GET(DIBasicType
static bool classof(const Metadata *MD)
unsigned StringRef uint64_t SizeInBits
std::optional< Signedness > getSignedness() const
Return the signedness of this type, or std::nullopt if this type is neither signed nor unsigned.
unsigned getEncoding() const
unsigned StringRef uint64_t FlagZero unsigned StringRef uint64_t uint32_t AlignInBits
Metadata * getRawScope() const
Metadata Metadata MDString Metadata unsigned LineNo TempDICommonBlock clone() const
Metadata * getRawDecl() const
Metadata * getRawFile() const
Metadata Metadata MDString Metadata unsigned LineNo
Metadata Metadata MDString * Name
MDString * getRawName() const
static bool classof(const Metadata *MD)
unsigned getLineNo() const
Metadata Metadata MDString Metadata * File
StringRef getName() const
DIScope * getScope() const
DEFINE_MDNODE_GET(DICommonBlock,(DIScope *Scope, DIGlobalVariable *Decl, StringRef Name, DIFile *File, unsigned LineNo),(Scope, Decl, Name, File, LineNo)) DEFINE_MDNODE_GET(DICommonBlock
DIGlobalVariable * getDecl() const
MDString * getRawSplitDebugFilename() const
bool getDebugInfoForProfiling() const
Metadata * getRawRetainedTypes() const
static const char * nameTableKindString(DebugNameTableKind PK)
static const char * emissionKindString(DebugEmissionKind EK)
void setSplitDebugInlining(bool SplitDebugInlining)
DICompositeTypeArray getEnumTypes() const
DebugEmissionKind getEmissionKind() const
unsigned Metadata MDString bool MDString unsigned MDString unsigned Metadata Metadata Metadata Metadata Metadata * Macros
unsigned Metadata MDString bool MDString * Flags
bool isDebugDirectivesOnly() const
StringRef getFlags() const
MDString * getRawProducer() const
void replaceEnumTypes(DICompositeTypeArray N)
Replace arrays.
MDString * getRawSysRoot() const
unsigned Metadata MDString bool MDString unsigned MDString unsigned Metadata * EnumTypes
unsigned Metadata MDString bool MDString unsigned MDString unsigned Metadata Metadata * RetainedTypes
static void getIfExists()=delete
bool getRangesBaseAddress() const
DIMacroNodeArray getMacros() const
unsigned getRuntimeVersion() const
Metadata * getRawMacros() const
void replaceRetainedTypes(DITypeArray N)
static bool classof(const Metadata *MD)
void replaceGlobalVariables(DIGlobalVariableExpressionArray N)
void replaceMacros(DIMacroNodeArray N)
bool getSplitDebugInlining() const
StringRef getSysRoot() const
DebugNameTableKind getNameTableKind() const
MDString * getRawSDK() const
MDString * getRawFlags() const
unsigned Metadata MDString bool MDString unsigned MDString unsigned Metadata Metadata Metadata * GlobalVariables
DIImportedEntityArray getImportedEntities() const
unsigned Metadata MDString bool MDString unsigned MDString unsigned Metadata Metadata Metadata Metadata Metadata uint64_t bool bool unsigned bool MDString MDString * SDK
unsigned Metadata MDString * Producer
Metadata * getRawEnumTypes() const
unsigned Metadata MDString bool MDString unsigned MDString unsigned Metadata Metadata Metadata Metadata Metadata uint64_t bool bool unsigned bool MDString * SysRoot
StringRef getProducer() const
unsigned Metadata MDString bool MDString unsigned MDString * SplitDebugFilename
unsigned Metadata MDString bool MDString unsigned MDString unsigned Metadata Metadata Metadata Metadata * ImportedEntities
void setDWOId(uint64_t DwoId)
DIScopeArray getRetainedTypes() const
void replaceImportedEntities(DIImportedEntityArray N)
Metadata * getRawGlobalVariables() const
DIGlobalVariableExpressionArray getGlobalVariables() const
unsigned Metadata MDString bool MDString unsigned MDString unsigned Metadata Metadata Metadata Metadata Metadata uint64_t bool bool unsigned bool MDString MDString SDK TempDICompileUnit clone() const
unsigned getSourceLanguage() const
Metadata * getRawImportedEntities() const
uint64_t getDWOId() const
StringRef getSplitDebugFilename() const
DEFINE_MDNODE_GET_DISTINCT_TEMPORARY(DICompileUnit,(unsigned SourceLanguage, DIFile *File, StringRef Producer, bool IsOptimized, StringRef Flags, unsigned RuntimeVersion, StringRef SplitDebugFilename, DebugEmissionKind EmissionKind, DICompositeTypeArray EnumTypes, DIScopeArray RetainedTypes, DIGlobalVariableExpressionArray GlobalVariables, DIImportedEntityArray ImportedEntities, DIMacroNodeArray Macros, uint64_t DWOId, bool SplitDebugInlining, bool DebugInfoForProfiling, DebugNameTableKind NameTableKind, bool RangesBaseAddress, StringRef SysRoot, StringRef SDK),(SourceLanguage, File, Producer, IsOptimized, Flags, RuntimeVersion, SplitDebugFilename, EmissionKind, EnumTypes, RetainedTypes, GlobalVariables, ImportedEntities, Macros, DWOId, SplitDebugInlining, DebugInfoForProfiling,(unsigned) NameTableKind, RangesBaseAddress, SysRoot, SDK)) DEFINE_MDNODE_GET_DISTINCT_TEMPORARY(DICompileUnit
unsigned MDString Metadata unsigned Metadata Metadata uint64_t uint32_t AlignInBits
Metadata * getRawVTableHolder() const
DIExpression * getRankExp() const
unsigned MDString Metadata unsigned Line
Metadata * getRawRank() const
unsigned MDString Metadata unsigned Metadata Metadata uint64_t uint32_t uint64_t DIFlags Metadata * Elements
unsigned MDString Metadata unsigned Metadata Metadata uint64_t uint32_t uint64_t DIFlags Metadata unsigned Metadata Metadata * TemplateParams
DIExpression * getAssociatedExp() const
DIVariable * getAllocated() const
DIExpression * getDataLocationExp() const
Metadata * getRawDiscriminator() const
unsigned MDString Metadata unsigned Metadata Metadata uint64_t uint32_t uint64_t DIFlags Metadata unsigned Metadata Metadata MDString Metadata Metadata Metadata Metadata Metadata * Rank
static DICompositeType * getODRTypeIfExists(LLVMContext &Context, MDString &Identifier)
DIVariable * getAssociated() const
DIDerivedType * getDiscriminator() const
DIVariable * getDataLocation() const
unsigned getRuntimeLang() const
DEFINE_MDNODE_GET(DICompositeType,(unsigned Tag, StringRef Name, DIFile *File, unsigned Line, DIScope *Scope, DIType *BaseType, uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits, DIFlags Flags, DINodeArray Elements, unsigned RuntimeLang, DIType *VTableHolder, DITemplateParameterArray TemplateParams=nullptr, StringRef Identifier="", DIDerivedType *Discriminator=nullptr, Metadata *DataLocation=nullptr, Metadata *Associated=nullptr, Metadata *Allocated=nullptr, Metadata *Rank=nullptr, DINodeArray Annotations=nullptr),(Tag, Name, File, Line, Scope, BaseType, SizeInBits, AlignInBits, OffsetInBits, Flags, Elements, RuntimeLang, VTableHolder, TemplateParams, Identifier, Discriminator, DataLocation, Associated, Allocated, Rank, Annotations)) DEFINE_MDNODE_GET(DICompositeType
Metadata * getRawElements() const
void replaceVTableHolder(DIType *VTableHolder)
static DICompositeType * buildODRType(LLVMContext &Context, MDString &Identifier, unsigned Tag, MDString *Name, Metadata *File, unsigned Line, Metadata *Scope, Metadata *BaseType, uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits, DIFlags Flags, Metadata *Elements, unsigned RuntimeLang, Metadata *VTableHolder, Metadata *TemplateParams, Metadata *Discriminator, Metadata *DataLocation, Metadata *Associated, Metadata *Allocated, Metadata *Rank, Metadata *Annotations)
Build a DICompositeType with the given ODR identifier.
StringRef getIdentifier() const
unsigned MDString Metadata unsigned Metadata Metadata uint64_t uint32_t uint64_t OffsetInBits
unsigned MDString Metadata unsigned Metadata * Scope
unsigned MDString Metadata * File
Metadata * getRawDataLocation() const
Metadata * getRawTemplateParams() const
unsigned MDString Metadata unsigned Metadata Metadata uint64_t uint32_t uint64_t DIFlags Metadata unsigned Metadata Metadata MDString Metadata Metadata Metadata Metadata * Allocated
unsigned MDString Metadata unsigned Metadata Metadata uint64_t uint32_t uint64_t DIFlags Flags
DINodeArray getElements() const
DITemplateParameterArray getTemplateParams() const
unsigned MDString Metadata unsigned Metadata Metadata uint64_t uint32_t uint64_t DIFlags Metadata unsigned Metadata Metadata MDString Metadata * Discriminator
Metadata * getRawAnnotations() const
Metadata * getRawAllocated() const
unsigned MDString Metadata unsigned Metadata Metadata uint64_t uint32_t uint64_t DIFlags Metadata unsigned Metadata Metadata MDString Metadata Metadata Metadata Metadata Metadata Metadata * Annotations
DIExpression * getAllocatedExp() const
void replaceElements(DINodeArray Elements)
Replace operands.
unsigned MDString Metadata unsigned Metadata Metadata uint64_t uint32_t uint64_t DIFlags Metadata unsigned Metadata Metadata MDString Metadata Metadata * DataLocation
unsigned MDString Metadata unsigned Metadata Metadata uint64_t uint32_t uint64_t DIFlags Metadata unsigned Metadata Metadata MDString * Identifier
unsigned MDString Metadata unsigned Metadata Metadata uint64_t SizeInBits
DIType * getVTableHolder() const
unsigned MDString Metadata unsigned Metadata Metadata uint64_t uint32_t uint64_t DIFlags Metadata unsigned Metadata Metadata MDString Metadata Metadata Metadata * Associated
DINodeArray getAnnotations() const
Metadata * getRawAssociated() const
ConstantInt * getRankConst() const
void replaceTemplateParams(DITemplateParameterArray TemplateParams)
Metadata * getRawBaseType() const
MDString * getRawIdentifier() const
static bool classof(const Metadata *MD)
unsigned MDString Metadata unsigned Metadata Metadata uint64_t uint32_t uint64_t DIFlags Metadata unsigned Metadata * VTableHolder
DIType * getBaseType() const
Metadata * getRawExtraData() const
DINodeArray getAnnotations() const
Get annotations associated with this derived type.
unsigned StringRef DIFile unsigned DIScope DIType uint64_t uint32_t uint64_t std::optional< unsigned > std::optional< PtrAuthData > DIFlags Metadata * ExtraData
unsigned StringRef DIFile unsigned DIScope DIType uint64_t SizeInBits
Metadata * getExtraData() const
Get extra data associated with this derived type.
unsigned StringRef DIFile unsigned DIScope DIType uint64_t uint32_t uint64_t std::optional< unsigned > std::optional< PtrAuthData > DIFlags Metadata DINodeArray Annotations
unsigned StringRef DIFile * File
unsigned StringRef DIFile unsigned DIScope DIType uint64_t uint32_t uint64_t OffsetInBits
DIObjCProperty * getObjCProperty() const
unsigned StringRef DIFile unsigned DIScope DIType uint64_t uint32_t AlignInBits
unsigned StringRef DIFile unsigned DIScope * Scope
Metadata * getRawAnnotations() const
DIType * getClassType() const
Get casted version of extra data.
static bool classof(const Metadata *MD)
Constant * getConstant() const
Constant * getStorageOffsetInBits() const
Constant * getDiscriminantValue() const
uint32_t getVBPtrOffset() const
unsigned StringRef DIFile unsigned DIScope DIType uint64_t uint32_t uint64_t std::optional< unsigned > std::optional< PtrAuthData > DIFlags Flags
unsigned StringRef DIFile unsigned Line
DEFINE_MDNODE_GET(DIDerivedType,(unsigned Tag, MDString *Name, Metadata *File, unsigned Line, Metadata *Scope, Metadata *BaseType, uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits, std::optional< unsigned > DWARFAddressSpace, std::optional< PtrAuthData > PtrAuthData, DIFlags Flags, Metadata *ExtraData=nullptr, Metadata *Annotations=nullptr),(Tag, Name, File, Line, Scope, BaseType, SizeInBits, AlignInBits, OffsetInBits, DWARFAddressSpace, PtrAuthData, Flags, ExtraData, Annotations)) DEFINE_MDNODE_GET(DIDerivedType
int64_t bool MDString APInt(64, Value, !IsUnsigned)
const APInt & getValue() const
int64_t bool MDString Name APInt bool MDString Name TempDIEnumerator clone() const
MDString * getRawName() const
StringRef getName() const
DEFINE_MDNODE_GET(DIEnumerator,(int64_t Value, bool IsUnsigned, StringRef Name),(APInt(64, Value, !IsUnsigned), IsUnsigned, Name)) DEFINE_MDNODE_GET(DIEnumerator
static bool classof(const Metadata *MD)
int64_t bool MDString * Name
A lightweight wrapper around an expression operand.
unsigned getSize() const
Return the size of the operand.
ExprOperand(const uint64_t *Op)
uint64_t getArg(unsigned I) const
Get an argument to the operand.
unsigned getNumArgs() const
uint64_t getOp() const
Get the operand code.
const uint64_t * get() const
void appendToVector(SmallVectorImpl< uint64_t > &V) const
Append the elements of this operand to V.
An iterator for expression operands.
bool operator==(const expr_op_iterator &X) const
std::input_iterator_tag iterator_category
expr_op_iterator & operator++()
const ExprOperand * operator->() const
bool operator!=(const expr_op_iterator &X) const
expr_op_iterator(element_iterator I)
std::ptrdiff_t difference_type
element_iterator getBase() const
const ExprOperand & operator*() const
expr_op_iterator getNext() const
Get the next iterator.
expr_op_iterator operator++(int)
expr_op_iterator()=default
element_iterator elements_end() const
bool isEntryValue() const
Check if the expression consists of exactly one entry value operand.
iterator_range< expr_op_iterator > expr_ops() const
bool isFragment() const
Return whether this is a piece of an aggregate variable.
static DIExpression * append(const DIExpression *Expr, ArrayRef< uint64_t > Ops)
Append the opcodes Ops to DIExpr.
std::array< uint64_t, 6 > ExtOps
unsigned getNumElements() const
ArrayRef< uint64_t >::iterator element_iterator
static ExtOps getExtOps(unsigned FromSize, unsigned ToSize, bool Signed)
Returns the ops for a zero- or sign-extension in a DIExpression.
expr_op_iterator expr_op_begin() const
Visit the elements via ExprOperand wrappers.
bool extractIfOffset(int64_t &Offset) const
If this is a constant offset, extract it.
static void appendOffset(SmallVectorImpl< uint64_t > &Ops, int64_t Offset)
Append Ops with operations to apply the Offset.
int fragmentCmp(const DIExpression *Other) const
Determine the relative position of the fragments described by this DIExpression and Other.
bool startsWithDeref() const
Return whether the first element a DW_OP_deref.
static bool isEqualExpression(const DIExpression *FirstExpr, bool FirstIndirect, const DIExpression *SecondExpr, bool SecondIndirect)
Determines whether two debug values should produce equivalent DWARF expressions, using their DIExpres...
expr_op_iterator expr_op_end() const
bool isImplicit() const
Return whether this is an implicit location description.
DEFINE_MDNODE_GET(DIExpression,(ArrayRef< uint64_t > Elements),(Elements)) TempDIExpression clone() const
static bool fragmentsOverlap(const FragmentInfo &A, const FragmentInfo &B)
Check if fragments overlap between a pair of FragmentInfos.
element_iterator elements_begin() const
bool hasAllLocationOps(unsigned N) const
Returns true iff this DIExpression contains at least one instance of DW_OP_LLVM_arg,...
std::optional< FragmentInfo > getFragmentInfo() const
Retrieve the details of this fragment expression.
static DIExpression * appendOpsToArg(const DIExpression *Expr, ArrayRef< uint64_t > Ops, unsigned ArgNo, bool StackValue=false)
Create a copy of Expr by appending the given list of Ops to each instance of the operand DW_OP_LLVM_a...
PrependOps
Used for DIExpression::prepend.
static int fragmentCmp(const FragmentInfo &A, const FragmentInfo &B)
Determine the relative position of the fragments passed in.
bool isComplex() const
Return whether the location is computed on the expression stack, meaning it cannot be a simple regist...
bool fragmentsOverlap(const DIExpression *Other) const
Check if fragments overlap between this DIExpression and Other.
static std::optional< const DIExpression * > convertToNonVariadicExpression(const DIExpression *Expr)
If Expr is a valid single-location expression, i.e.
std::pair< DIExpression *, const ConstantInt * > constantFold(const ConstantInt *CI)
Try to shorten an expression with an initial constant operand.
bool isDeref() const
Return whether there is exactly one operator and it is a DW_OP_deref;.
static const DIExpression * convertToVariadicExpression(const DIExpression *Expr)
If Expr is a non-variadic expression (i.e.
uint64_t getNumLocationOperands() const
Return the number of unique location operands referred to (via DW_OP_LLVM_arg) in this expression; th...
ArrayRef< uint64_t > getElements() const
static DIExpression * replaceArg(const DIExpression *Expr, uint64_t OldArg, uint64_t NewArg)
Create a copy of Expr with each instance of DW_OP_LLVM_arg, \p OldArg replaced with DW_OP_LLVM_arg,...
static bool classof(const Metadata *MD)
static void canonicalizeExpressionOps(SmallVectorImpl< uint64_t > &Ops, const DIExpression *Expr, bool IsIndirect)
Inserts the elements of Expr into Ops modified to a canonical form, which uses DW_OP_LLVM_arg (i....
uint64_t getElement(unsigned I) const
static std::optional< DIExpression * > createFragmentExpression(const DIExpression *Expr, unsigned OffsetInBits, unsigned SizeInBits)
Create a DIExpression to describe one part of an aggregate variable that is fragmented across multipl...
static const DIExpression * convertToUndefExpression(const DIExpression *Expr)
Removes all elements from Expr that do not apply to an undef debug value, which includes every operat...
static DIExpression * prepend(const DIExpression *Expr, uint8_t Flags, int64_t Offset=0)
Prepend DIExpr with a deref and offset operation and optionally turn it into a stack value or/and an ...
static DIExpression * appendToStack(const DIExpression *Expr, ArrayRef< uint64_t > Ops)
Convert DIExpr into a stack value if it isn't one already by appending DW_OP_deref if needed,...
static DIExpression * appendExt(const DIExpression *Expr, unsigned FromSize, unsigned ToSize, bool Signed)
Append a zero- or sign-extension to Expr.
std::optional< ArrayRef< uint64_t > > getSingleLocationExpressionElements() const
Returns a reference to the elements contained in this expression, skipping past the leading DW_OP_LLV...
bool isSingleLocationExpression() const
Return whether the evaluated expression makes use of a single location at the start of the expression...
std::optional< SignedOrUnsignedConstant > isConstant() const
Determine whether this represents a constant value, if so.
static const DIExpression * extractAddressClass(const DIExpression *Expr, unsigned &AddrClass)
Checks if the last 4 elements of the expression are DW_OP_constu <DWARF Address Space> DW_OP_swap DW_...
static DIExpression * prependOpcodes(const DIExpression *Expr, SmallVectorImpl< uint64_t > &Ops, bool StackValue=false, bool EntryValue=false)
Prepend DIExpr with the given opcodes and optionally turn it into a stack value.
static bool classof(const Metadata *MD)
MDString MDString * Directory
DEFINE_MDNODE_GET(DIFile,(StringRef Filename, StringRef Directory, std::optional< ChecksumInfo< StringRef > > CS=std::nullopt, std::optional< StringRef > Source=std::nullopt),(Filename, Directory, CS, Source)) DEFINE_MDNODE_GET(DIFile
static std::optional< ChecksumKind > getChecksumKind(StringRef CSKindStr)
ChecksumKind
Which algorithm (e.g.
MDString MDString std::optional< ChecksumInfo< MDString * > > CS
Metadata * getRawLowerBound() const
Metadata * getRawCountNode() const
Metadata * getRawStride() const
BoundType getLowerBound() const
DEFINE_MDNODE_GET(DIGenericSubrange,(Metadata *CountNode, Metadata *LowerBound, Metadata *UpperBound, Metadata *Stride),(CountNode, LowerBound, UpperBound, Stride)) TempDIGenericSubrange clone() const
Metadata * getRawUpperBound() const
static bool classof(const Metadata *MD)
BoundType getCount() const
BoundType getUpperBound() const
BoundType getStride() const
A pair of DIGlobalVariable and DIExpression.
DEFINE_MDNODE_GET(DIGlobalVariableExpression,(Metadata *Variable, Metadata *Expression),(Variable, Expression)) TempDIGlobalVariableExpression clone() const
Metadata * getRawExpression() const
DIGlobalVariable * getVariable() const
static bool classof(const Metadata *MD)
Metadata * getRawVariable() const
DIExpression * getExpression() const
Metadata * getRawAnnotations() const
Metadata MDString MDString Metadata unsigned Metadata bool bool Metadata Metadata * TemplateParams
Metadata MDString MDString Metadata unsigned Line
Metadata MDString MDString Metadata unsigned Metadata * Type
Metadata MDString MDString Metadata unsigned Metadata bool bool Metadata Metadata uint32_t Metadata * Annotations
DIDerivedType * getStaticDataMemberDeclaration() const
DEFINE_MDNODE_GET(DIGlobalVariable,(DIScope *Scope, StringRef Name, StringRef LinkageName, DIFile *File, unsigned Line, DIType *Type, bool IsLocalToUnit, bool IsDefinition, DIDerivedType *StaticDataMemberDeclaration, MDTuple *TemplateParams, uint32_t AlignInBits, DINodeArray Annotations),(Scope, Name, LinkageName, File, Line, Type, IsLocalToUnit, IsDefinition, StaticDataMemberDeclaration, TemplateParams, AlignInBits, Annotations)) DEFINE_MDNODE_GET(DIGlobalVariable
Metadata MDString MDString Metadata unsigned Metadata bool bool Metadata Metadata uint32_t Metadata Annotations TempDIGlobalVariable clone() const
MDTuple * getTemplateParams() const
Metadata MDString MDString Metadata unsigned Metadata bool bool Metadata * StaticDataMemberDeclaration
bool isLocalToUnit() const
Metadata * getRawStaticDataMemberDeclaration() const
Metadata MDString MDString * LinkageName
MDString * getRawLinkageName() const
StringRef getLinkageName() const
static bool classof(const Metadata *MD)
StringRef getDisplayName() const
bool isDefinition() const
Metadata MDString MDString Metadata * File
DINodeArray getAnnotations() const
Metadata * getRawTemplateParams() const
Metadata MDString MDString Metadata unsigned Metadata bool bool Metadata Metadata uint32_t AlignInBits
An imported module (C++ using directive or similar).
unsigned Metadata Metadata * Entity
DEFINE_MDNODE_GET(DIImportedEntity,(unsigned Tag, DIScope *Scope, DINode *Entity, DIFile *File, unsigned Line, StringRef Name="", DINodeArray Elements=nullptr),(Tag, Scope, Entity, File, Line, Name, Elements)) DEFINE_MDNODE_GET(DIImportedEntity
unsigned Metadata Metadata Metadata unsigned Line
unsigned Metadata Metadata Metadata unsigned MDString * Name
unsigned Metadata Metadata Metadata * File
unsigned Metadata * Scope
StringRef getName() const
static bool classof(const Metadata *MD)
Metadata MDString Metadata unsigned Line TempDILabel clone() const
DEFINE_MDNODE_GET(DILabel,(DILocalScope *Scope, StringRef Name, DIFile *File, unsigned Line),(Scope, Name, File, Line)) DEFINE_MDNODE_GET(DILabel
Metadata * getRawFile() const
DILocalScope * getScope() const
Get the local scope for this label.
MDString * getRawName() const
Metadata MDString Metadata unsigned Line
bool isValidLocationForIntrinsic(const DILocation *DL) const
Check that a location is valid for this label.
Metadata * getRawScope() const
Metadata MDString Metadata * File
static bool classof(const Metadata *MD)
void replaceScope(DIScope *Scope)
~DILexicalBlockBase()=default
Metadata * getRawScope() const
DILocalScope * getScope() const
Metadata Metadata unsigned Discriminator
static bool classof(const Metadata *MD)
unsigned getDiscriminator() const
Metadata Metadata unsigned Discriminator TempDILexicalBlockFile clone() const
DEFINE_MDNODE_GET(DILexicalBlockFile,(DILocalScope *Scope, DIFile *File, unsigned Discriminator),(Scope, File, Discriminator)) DEFINE_MDNODE_GET(DILexicalBlockFile
Metadata Metadata unsigned Line
DEFINE_MDNODE_GET(DILexicalBlock,(DILocalScope *Scope, DIFile *File, unsigned Line, unsigned Column),(Scope, File, Line, Column)) DEFINE_MDNODE_GET(DILexicalBlock
static bool classof(const Metadata *MD)
unsigned getColumn() const
Metadata Metadata unsigned unsigned Column TempDILexicalBlock clone() const
DISubprogram * getSubprogram() const
Get the subprogram for this scope.
DILocalScope * getNonLexicalBlockFileScope() const
Get the first non DILexicalBlockFile scope of this scope.
DILocalScope(LLVMContext &C, unsigned ID, StorageType Storage, unsigned Tag, ArrayRef< Metadata * > Ops)
static bool classof(const Metadata *MD)
static DILocalScope * cloneScopeForSubprogram(DILocalScope &RootScope, DISubprogram &NewSP, LLVMContext &Ctx, DenseMap< const MDNode *, MDNode * > &Cache)
Traverses the scope chain rooted at RootScope until it hits a Subprogram, recreating the chain with "...
Metadata MDString Metadata unsigned Metadata * Type
Metadata MDString Metadata * File
static bool classof(const Metadata *MD)
Metadata MDString Metadata unsigned Metadata unsigned DIFlags uint32_t Metadata Annotations TempDILocalVariable clone() const
DILocalScope * getScope() const
Get the local scope for this variable.
bool isObjectPointer() const
DINodeArray getAnnotations() const
DEFINE_MDNODE_GET(DILocalVariable,(DILocalScope *Scope, StringRef Name, DIFile *File, unsigned Line, DIType *Type, unsigned Arg, DIFlags Flags, uint32_t AlignInBits, DINodeArray Annotations),(Scope, Name, File, Line, Type, Arg, Flags, AlignInBits, Annotations)) DEFINE_MDNODE_GET(DILocalVariable
Metadata MDString Metadata unsigned Line
Metadata MDString Metadata unsigned Metadata unsigned DIFlags uint32_t Metadata * Annotations
Metadata MDString Metadata unsigned Metadata unsigned DIFlags uint32_t AlignInBits
bool isValidLocationForIntrinsic(const DILocation *DL) const
Check that a location is valid for this variable.
Metadata * getRawAnnotations() const
bool isArtificial() const
unsigned unsigned DILocalScope * Scope
static unsigned getDuplicationFactorFromDiscriminator(unsigned D)
Returns the duplication factor for a given encoded discriminator D, or 1 if no value or 0 is encoded.
static bool isPseudoProbeDiscriminator(unsigned Discriminator)
unsigned getDuplicationFactor() const
Returns the duplication factor stored in the discriminator, or 1 if no duplication factor (or 0) is e...
static DILocation * getMergedLocations(ArrayRef< DILocation * > Locs)
Try to combine the vector of locations passed as input in a single one.
DEFINE_MDNODE_GET(DILocation,(unsigned Line, unsigned Column, Metadata *Scope, Metadata *InlinedAt=nullptr, bool ImplicitCode=false),(Line, Column, Scope, InlinedAt, ImplicitCode)) DEFINE_MDNODE_GET(DILocation
static unsigned getBaseDiscriminatorBits()
Return the bits used for base discriminators.
static std::optional< unsigned > encodeDiscriminator(unsigned BD, unsigned DF, unsigned CI)
Raw encoding of the discriminator.
unsigned unsigned DILocalScope DILocation bool ImplicitCode
Metadata * getRawScope() const
static void decodeDiscriminator(unsigned D, unsigned &BD, unsigned &DF, unsigned &CI)
Raw decoder for values in an encoded discriminator D.
static DILocation * getMergedLocation(DILocation *LocA, DILocation *LocB)
When two instructions are combined into a single instruction we also need to combine the original loc...
std::optional< const DILocation * > cloneWithBaseDiscriminator(unsigned BD) const
Returns a new DILocation with updated base discriminator BD.
unsigned getBaseDiscriminator() const
Returns the base discriminator stored in the discriminator.
static unsigned getBaseDiscriminatorFromDiscriminator(unsigned D, bool IsFSDiscriminator=false)
Returns the base discriminator for a given encoded discriminator D.
Metadata * getRawInlinedAt() const
unsigned unsigned DILocalScope DILocation * InlinedAt
static unsigned getMaskedDiscriminator(unsigned D, unsigned B)
Return the masked discriminator value for an input discrimnator value D (i.e.
const DILocation * cloneWithDiscriminator(unsigned Discriminator) const
Returns a new DILocation with updated Discriminator.
static unsigned getCopyIdentifierFromDiscriminator(unsigned D)
Returns the copy identifier for a given encoded discriminator D.
void replaceOperandWith(unsigned I, Metadata *New)=delete
std::optional< const DILocation * > cloneByMultiplyingDuplicationFactor(unsigned DF) const
Returns a new DILocation with duplication factor DF * current duplication factor encoded in the discr...
static bool classof(const Metadata *MD)
unsigned getCopyIdentifier() const
Returns the copy identifier stored in the discriminator.
unsigned unsigned Metadata * File
Metadata * getRawElements() const
DEFINE_MDNODE_GET(DIMacroFile,(unsigned MIType, unsigned Line, DIFile *File, DIMacroNodeArray Elements),(MIType, Line, File, Elements)) DEFINE_MDNODE_GET(DIMacroFile
unsigned unsigned Metadata Metadata * Elements
Metadata * getRawFile() const
static bool classof(const Metadata *MD)
void replaceElements(DIMacroNodeArray Elements)
unsigned unsigned Metadata Metadata Elements TempDIMacroFile clone() const
DIMacroNodeArray getElements() const
Macro Info DWARF-like metadata node.
unsigned getMacinfoType() const
StringRef getStringOperand(unsigned I) const
static bool classof(const Metadata *MD)
static MDString * getCanonicalMDString(LLVMContext &Context, StringRef S)
Ty * getOperandAs(unsigned I) const
DIMacroNode(LLVMContext &C, unsigned ID, StorageType Storage, unsigned MIType, ArrayRef< Metadata * > Ops1, ArrayRef< Metadata * > Ops2=std::nullopt)
MDString * getRawName() const
unsigned unsigned MDString MDString Value TempDIMacro clone() const
unsigned unsigned MDString MDString * Value
unsigned unsigned MDString * Name
StringRef getName() const
MDString * getRawValue() const
DEFINE_MDNODE_GET(DIMacro,(unsigned MIType, unsigned Line, StringRef Name, StringRef Value=""),(MIType, Line, Name, Value)) DEFINE_MDNODE_GET(DIMacro
StringRef getValue() const
static bool classof(const Metadata *MD)
Represents a module in the programming language, for example, a Clang module, or a Fortran module.
Metadata Metadata * Scope
Metadata Metadata MDString * Name
Metadata Metadata MDString MDString MDString MDString * APINotesFile
Metadata Metadata MDString MDString MDString * IncludePath
Metadata Metadata MDString MDString * ConfigurationMacros
DEFINE_MDNODE_GET(DIModule,(DIFile *File, DIScope *Scope, StringRef Name, StringRef ConfigurationMacros, StringRef IncludePath, StringRef APINotesFile, unsigned LineNo, bool IsDecl=false),(File, Scope, Name, ConfigurationMacros, IncludePath, APINotesFile, LineNo, IsDecl)) DEFINE_MDNODE_GET(DIModule
Metadata Metadata MDString MDString MDString MDString unsigned LineNo
Metadata MDString bool ExportSymbols TempDINamespace clone() const
static bool classof(const Metadata *MD)
DEFINE_MDNODE_GET(DINamespace,(DIScope *Scope, StringRef Name, bool ExportSymbols),(Scope, Name, ExportSymbols)) DEFINE_MDNODE_GET(DINamespace
DIScope * getScope() const
Metadata MDString bool ExportSymbols
StringRef getName() const
MDString * getRawName() const
bool getExportSymbols() const
Metadata * getRawScope() const
Tagged DWARF-like metadata node.
DINode(LLVMContext &C, unsigned ID, StorageType Storage, unsigned Tag, ArrayRef< Metadata * > Ops1, ArrayRef< Metadata * > Ops2=std::nullopt)
dwarf::Tag getTag() const
static MDString * getCanonicalMDString(LLVMContext &Context, StringRef S)
static DIFlags getFlag(StringRef Flag)
static DIFlags splitFlags(DIFlags Flags, SmallVectorImpl< DIFlags > &SplitFlags)
Split up a flags bitfield.
void setTag(unsigned Tag)
Allow subclasses to mutate the tag.
StringRef getStringOperand(unsigned I) const
Ty * getOperandAs(unsigned I) const
static bool classof(const Metadata *MD)
static StringRef getFlagString(DIFlags Flag)
MDString Metadata unsigned MDString MDString unsigned Metadata Type TempDIObjCProperty clone() const
unsigned getAttributes() const
StringRef getFilename() const
MDString * getRawName() const
StringRef getDirectory() const
MDString * getRawSetterName() const
Metadata * getRawType() const
StringRef getGetterName() const
static bool classof(const Metadata *MD)
MDString * getRawGetterName() const
Metadata * getRawFile() const
MDString Metadata unsigned MDString * GetterName
MDString Metadata unsigned MDString MDString * SetterName
StringRef getName() const
DEFINE_MDNODE_GET(DIObjCProperty,(StringRef Name, DIFile *File, unsigned Line, StringRef GetterName, StringRef SetterName, unsigned Attributes, DIType *Type),(Name, File, Line, GetterName, SetterName, Attributes, Type)) DEFINE_MDNODE_GET(DIObjCProperty
StringRef getSetterName() const
Base class for scope-like contexts.
StringRef getFilename() const
StringRef getName() const
static bool classof(const Metadata *MD)
StringRef getDirectory() const
std::optional< StringRef > getSource() const
DIScope * getScope() const
Metadata * getRawFile() const
Return the raw underlying file.
DIScope(LLVMContext &C, unsigned ID, StorageType Storage, unsigned Tag, ArrayRef< Metadata * > Ops)
String type, Fortran CHARACTER(n)
unsigned MDString Metadata Metadata Metadata uint64_t SizeInBits
unsigned getEncoding() const
unsigned MDString Metadata Metadata Metadata uint64_t uint32_t AlignInBits
static bool classof(const Metadata *MD)
unsigned MDString Metadata Metadata Metadata * StringLocationExp
DIExpression * getStringLengthExp() const
unsigned MDString Metadata Metadata * StringLengthExp
Metadata * getRawStringLengthExp() const
Metadata * getRawStringLength() const
DIVariable * getStringLength() const
DIExpression * getStringLocationExp() const
unsigned MDString Metadata * StringLength
Metadata * getRawStringLocationExp() const
DEFINE_MDNODE_GET(DIStringType,(unsigned Tag, StringRef Name, uint64_t SizeInBits, uint32_t AlignInBits),(Tag, Name, nullptr, nullptr, nullptr, SizeInBits, AlignInBits, 0)) DEFINE_MDNODE_GET(DIStringType
Metadata MDString MDString Metadata unsigned Metadata unsigned Metadata unsigned int DIFlags DISPFlags Metadata * Unit
Metadata MDString MDString Metadata unsigned Metadata unsigned Metadata unsigned int DIFlags DISPFlags Metadata Metadata Metadata Metadata Metadata Metadata * Annotations
Metadata MDString MDString Metadata unsigned Metadata unsigned Metadata * ContainingType
Metadata MDString MDString Metadata unsigned Metadata unsigned Metadata unsigned int DIFlags DISPFlags Metadata Metadata * TemplateParams
Metadata MDString MDString Metadata unsigned Metadata unsigned Metadata unsigned int DIFlags DISPFlags Metadata Metadata Metadata * Declaration
Metadata MDString MDString Metadata unsigned Metadata unsigned Metadata unsigned int DIFlags DISPFlags Metadata Metadata Metadata Metadata Metadata Metadata MDString * TargetFuncName
static DISPFlags toSPFlags(bool IsLocalToUnit, bool IsDefinition, bool IsOptimized, unsigned Virtuality=SPFlagNonvirtual, bool IsMainSubprogram=false)
Metadata MDString MDString Metadata unsigned Metadata unsigned Metadata unsigned int DIFlags DISPFlags Metadata Metadata Metadata Metadata Metadata * ThrownTypes
static DISPFlags getFlag(StringRef Flag)
Metadata MDString MDString Metadata * File
static DISPFlags splitFlags(DISPFlags Flags, SmallVectorImpl< DISPFlags > &SplitFlags)
Split up a flags bitfield for easier printing.
static bool classof(const Metadata *MD)
Metadata MDString MDString * LinkageName
static StringRef getFlagString(DISPFlags Flag)
Metadata MDString MDString Metadata unsigned Metadata * Type
Metadata MDString MDString Metadata unsigned Metadata unsigned Metadata unsigned int DIFlags DISPFlags Metadata Metadata Metadata Metadata * RetainedNodes
DEFINE_MDNODE_GET(DISubprogram,(DIScope *Scope, StringRef Name, StringRef LinkageName, DIFile *File, unsigned Line, DISubroutineType *Type, unsigned ScopeLine, DIType *ContainingType, unsigned VirtualIndex, int ThisAdjustment, DIFlags Flags, DISPFlags SPFlags, DICompileUnit *Unit, DITemplateParameterArray TemplateParams=nullptr, DISubprogram *Declaration=nullptr, DINodeArray RetainedNodes=nullptr, DITypeArray ThrownTypes=nullptr, DINodeArray Annotations=nullptr, StringRef TargetFuncName=""),(Scope, Name, LinkageName, File, Line, Type, ScopeLine, ContainingType, VirtualIndex, ThisAdjustment, Flags, SPFlags, Unit, TemplateParams, Declaration, RetainedNodes, ThrownTypes, Annotations, TargetFuncName)) DEFINE_MDNODE_GET(DISubprogram
DISPFlags
Debug info subprogram flags.
static bool classof(const Metadata *MD)
BoundType getUpperBound() const
BoundType getStride() const
BoundType getLowerBound() const
DEFINE_MDNODE_GET(DISubrange,(int64_t Count, int64_t LowerBound=0),(Count, LowerBound)) DEFINE_MDNODE_GET(DISubrange
BoundType getCount() const
Metadata int64_t LowerBound
Type array for a subprogram.
TempDISubroutineType cloneWithCC(uint8_t CC) const
DEFINE_MDNODE_GET(DISubroutineType,(DIFlags Flags, uint8_t CC, DITypeRefArray TypeArray),(Flags, CC, TypeArray)) DEFINE_MDNODE_GET(DISubroutineType
DIFlags uint8_t Metadata * TypeArray
static bool classof(const Metadata *MD)
Metadata * getRawTypeArray() const
DITypeRefArray getTypeArray() const
DIFlags uint8_t Metadata TypeArray TempDISubroutineType clone() const
Base class for template parameters.
Metadata * getRawType() const
static bool classof(const Metadata *MD)
DITemplateParameter(LLVMContext &Context, unsigned ID, StorageType Storage, unsigned Tag, bool IsDefault, ArrayRef< Metadata * > Ops)
StringRef getName() const
MDString * getRawName() const
~DITemplateParameter()=default
MDString Metadata bool IsDefault
DEFINE_MDNODE_GET(DITemplateTypeParameter,(StringRef Name, DIType *Type, bool IsDefault),(Name, Type, IsDefault)) DEFINE_MDNODE_GET(DITemplateTypeParameter
MDString Metadata bool IsDefault TempDITemplateTypeParameter clone() const
static bool classof(const Metadata *MD)
unsigned MDString Metadata bool Metadata Value TempDITemplateValueParameter clone() const
unsigned MDString Metadata * Type
static bool classof(const Metadata *MD)
DEFINE_MDNODE_GET(DITemplateValueParameter,(unsigned Tag, StringRef Name, DIType *Type, bool IsDefault, Metadata *Value),(Tag, Name, Type, IsDefault, Value)) DEFINE_MDNODE_GET(DITemplateValueParameter
Metadata * getValue() const
unsigned MDString Metadata bool IsDefault
unsigned MDString Metadata bool Metadata * Value
bool operator!=(const iterator &X) const
DIType * operator*() const
bool operator==(const iterator &X) const
std::input_iterator_tag iterator_category
std::ptrdiff_t difference_type
iterator(MDNode::op_iterator I)
DIType * operator[](unsigned I) const
MDTuple & operator*() const
MDTuple * operator->() const
DITypeRefArray(const MDTuple *N)
bool isLittleEndian() const
bool isLValueReference() const
bool isStaticMember() const
DIType(LLVMContext &C, unsigned ID, StorageType Storage, unsigned Tag, unsigned Line, uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits, DIFlags Flags, ArrayRef< Metadata * > Ops)
TempDIType cloneWithFlags(DIFlags NewFlags) const
Returns a new temporary DIType with updated Flags.
bool isObjcClassComplete() const
MDString * getRawName() const
bool isAppleBlockExtension() const
uint64_t getOffsetInBits() const
bool isObjectPointer() const
void mutate(unsigned Tag, unsigned Line, uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits, DIFlags Flags)
Change fields in place.
Metadata * getRawScope() const
StringRef getName() const
bool isForwardDecl() const
bool isTypePassByValue() const
uint64_t getSizeInBits() const
static bool classof(const Metadata *MD)
uint32_t getAlignInBytes() const
uint32_t getAlignInBits() const
void init(unsigned Line, uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits, DIFlags Flags)
bool isRValueReference() const
bool isArtificial() const
bool getExportSymbols() const
DIScope * getScope() const
bool isTypePassByReference() const
Base class for variables.
std::optional< DIBasicType::Signedness > getSignedness() const
Return the signedness of this variable's type, or std::nullopt if this type is neither signed nor uns...
uint32_t getAlignInBits() const
MDString * getRawName() const
uint32_t getAlignInBytes() const
DIScope * getScope() const
StringRef getDirectory() const
std::optional< uint64_t > getSizeInBits() const
Determines the size of the variable's type.
Metadata * getRawFile() const
std::optional< StringRef > getSource() const
StringRef getFilename() const
Metadata * getRawType() const
static bool classof(const Metadata *MD)
StringRef getName() const
Metadata * getRawScope() const
This class represents an Operation in the Expression.
This is the common base class for debug info intrinsics for variables.
Record of a variable value-assignment, aka a non instruction representation of the dbg....
Identifies a unique instance of a whole variable (discards/ignores fragment information).
DebugVariableAggregate(const DebugVariable &V)
Identifies a unique instance of a variable.
static bool isDefaultFragment(const FragmentInfo F)
DebugVariable(const DILocalVariable *Var, const DIExpression *DIExpr, const DILocation *InlinedAt)
const DILocation * getInlinedAt() const
bool operator<(const DebugVariable &Other) const
DebugVariable(const DILocalVariable *Var, std::optional< FragmentInfo > FragmentInfo, const DILocation *InlinedAt)
bool operator==(const DebugVariable &Other) const
FragmentInfo getFragmentOrDefault() const
std::optional< FragmentInfo > getFragment() const
const DILocalVariable * getVariable() const
Class representing an expression and its matching format.
Generic tagged DWARF-like metadata node.
static bool classof(const Metadata *MD)
unsigned MDString ArrayRef< Metadata * > DwarfOps TempGenericDINode clone() const
Return a (temporary) clone of this.
dwarf::Tag getTag() const
StringRef getHeader() const
MDString * getRawHeader() const
const MDOperand & getDwarfOperand(unsigned I) const
unsigned getNumDwarfOperands() const
op_iterator dwarf_op_end() const
op_iterator dwarf_op_begin() const
unsigned MDString * Header
op_range dwarf_operands() const
DEFINE_MDNODE_GET(GenericDINode,(unsigned Tag, StringRef Header, ArrayRef< Metadata * > DwarfOps),(Tag, Header, DwarfOps)) DEFINE_MDNODE_GET(GenericDINode
void replaceDwarfOperandWith(unsigned I, Metadata *New)
unsigned MDString ArrayRef< Metadata * > DwarfOps
This is an important class for using LLVM in a threaded context.
void replaceOperandWith(unsigned I, Metadata *New)
Replace a specific operand.
const MDOperand & getOperand(unsigned I) const
static TempMDTuple getTemporary(LLVMContext &Context, ArrayRef< Metadata * > MDs)
op_iterator op_end() const
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata * > MDs)
unsigned getNumOperands() const
Return number of MDNode operands.
iterator_range< op_iterator > op_range
TempMDNode clone() const
Create a (temporary) clone of this.
void setOperand(unsigned I, Metadata *New)
Set an operand.
op_iterator op_begin() const
LLVMContext & getContext() const
Tracking metadata reference owned by Metadata.
static MDString * get(LLVMContext &Context, StringRef Str)
A discriminated union of two or more pointer types, with the discriminator in the low bit of the poin...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
typename SuperClass::iterator iterator
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
constexpr bool empty() const
empty - Check if the string is empty.
The instances of the Type class are immutable: once they are created, they are never changed.
LLVM Value Representation.
A range adaptor for a pair of iterators.
unsigned getVirtuality(StringRef VirtualityString)
This provides a very simple, boring adaptor for a begin and end iterator into a range type.
@ C
The default llvm calling convention, compatible with C.
Function * getDeclaration(Module *M, ID id, ArrayRef< Type * > Tys=std::nullopt)
Create or insert an LLVM Function declaration for an intrinsic, and return it.
This is an optimization pass for GlobalISel generic memory operations.
bool operator<(int64_t V1, const APSInt &V2)
bool operator!=(uint64_t V1, const APInt &V2)
bool operator==(const AddressRangeValuePair &LHS, const AddressRangeValuePair &RHS)
cl::opt< bool > EnableFSDiscriminator
static unsigned getBaseFSBitEnd()
@ Ref
The access may reference the value stored in memory.
@ LLVM_MARK_AS_BITMASK_ENUM
static unsigned getN1Bits(int N)
bool is_contained(R &&Range, const E &Element)
Returns true if Element is found in Range.
hash_code hash_combine(const Ts &...args)
Combine values into a single hash_code.
Implement std::hash so that hash_code can be used in STL containers.
Pointer authentication (__ptrauth) metadata.
bool authenticatesNullValues()
PtrAuthData(unsigned FromRawData)
bool isAddressDiscriminated()
PtrAuthData(unsigned Key, bool IsDiscr, unsigned Discriminator, bool IsaPointer, bool AuthenticatesNullValues)
unsigned extraDiscriminator()
Holds the characteristics of one fragment of a larger variable.
FragmentInfo(uint64_t SizeInBits, uint64_t OffsetInBits)
static DIExpression::FragmentInfo intersect(DIExpression::FragmentInfo A, DIExpression::FragmentInfo B)
Returns a zero-sized fragment if A and B don't intersect.
uint64_t endInBits() const
Return the index of the bit after the end of the fragment, e.g.
uint64_t startInBits() const
Return the index of the first bit of the fragment.
A single checksum, represented by a Kind and a Value (a string).
bool operator==(const ChecksumInfo< T > &X) const
T Value
The string value of the checksum.
ChecksumKind Kind
The kind of checksum which Value encodes.
ChecksumInfo(ChecksumKind Kind, T Value)
bool operator!=(const ChecksumInfo< T > &X) const
StringRef getKindAsString() const
static bool isEqual(const FragInfo &A, const FragInfo &B)
static FragInfo getTombstoneKey()
static unsigned getHashValue(const FragInfo &Frag)
static FragInfo getEmptyKey()
static unsigned getHashValue(const DebugVariable &D)
static DebugVariable getEmptyKey()
Empty key: no key should be generated that has no DILocalVariable.
static DebugVariable getTombstoneKey()
Difference in tombstone is that the Optional is meaningful.
static bool isEqual(const DebugVariable &A, const DebugVariable &B)
An information struct used to provide DenseMap with the various necessary components for a given valu...
static uint32_t extractProbeIndex(uint32_t Value)