LLVM: include/llvm/IR/DebugInfoMetadata.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13#ifndef LLVM_IR_DEBUGINFOMETADATA_H
14#define LLVM_IR_DEBUGINFOMETADATA_H
15
30#include
31#include
32#include
33#include
34#include
35#include
36#include
37
38
39#define DEFINE_MDNODE_GET_UNPACK_IMPL(...) __VA_ARGS__
40#define DEFINE_MDNODE_GET_UNPACK(ARGS) DEFINE_MDNODE_GET_UNPACK_IMPL ARGS
41#define DEFINE_MDNODE_GET_DISTINCT_TEMPORARY(CLASS, FORMAL, ARGS) \
42 static CLASS *getDistinct(LLVMContext &Context, \
43 DEFINE_MDNODE_GET_UNPACK(FORMAL)) { \
44 return getImpl(Context, DEFINE_MDNODE_GET_UNPACK(ARGS), Distinct); \
45 } \
46 static Temp##CLASS getTemporary(LLVMContext &Context, \
47 DEFINE_MDNODE_GET_UNPACK(FORMAL)) { \
48 return Temp##CLASS( \
49 getImpl(Context, DEFINE_MDNODE_GET_UNPACK(ARGS), Temporary)); \
50 }
51#define DEFINE_MDNODE_GET(CLASS, FORMAL, ARGS) \
52 static CLASS *get(LLVMContext &Context, DEFINE_MDNODE_GET_UNPACK(FORMAL)) { \
53 return getImpl(Context, DEFINE_MDNODE_GET_UNPACK(ARGS), Uniqued); \
54 } \
55 static CLASS *getIfExists(LLVMContext &Context, \
56 DEFINE_MDNODE_GET_UNPACK(FORMAL)) { \
57 return getImpl(Context, DEFINE_MDNODE_GET_UNPACK(ARGS), Uniqued, \
58 false); \
59 } \
60 DEFINE_MDNODE_GET_DISTINCT_TEMPORARY(CLASS, FORMAL, ARGS)
61
62namespace llvm {
63
64namespace dwarf {
66}
67
68class DbgVariableIntrinsic;
69class DbgVariableRecord;
70
72
74 const MDTuple *N = nullptr;
75
76public:
79
80 explicit operator bool() const { return get(); }
81 explicit operator MDTuple *() const { return get(); }
82
86
87
88 unsigned size() const { return N ? N->getNumOperands() : 0u; }
90 return cast_or_null(N->getOperand(I));
91 }
92
95
96 public:
102
105
107
109 ++I;
110 return *this;
111 }
112
115 ++I;
116 return Temp;
117 }
118
121 };
122
123
126};
127
128
129
130
131
132
133
134
138
139protected:
145 }
147
150 }
151
153 if (auto *S = getOperandAs(I))
154 return S->getString();
156 }
157
160 return nullptr;
162 }
163
164
166
167public:
169
170
171
172
173
175#define HANDLE_DI_FLAG(ID, NAME) Flag##NAME = ID,
176#define DI_FLAG_LARGEST_NEEDED
177#include "llvm/IR/DebugInfoFlags.def"
179 FlagPtrToMemberRep = FlagSingleInheritance | FlagMultipleInheritance |
180 FlagVirtualInheritance,
182 };
183
186
187
188
189
190
193
196 default:
197 return false;
198 case GenericDINodeKind:
199 case DISubrangeKind:
200 case DIEnumeratorKind:
201 case DIBasicTypeKind:
202 case DIStringTypeKind:
203 case DIDerivedTypeKind:
204 case DICompositeTypeKind:
205 case DISubroutineTypeKind:
206 case DIFileKind:
207 case DICompileUnitKind:
208 case DISubprogramKind:
209 case DILexicalBlockKind:
210 case DILexicalBlockFileKind:
211 case DINamespaceKind:
212 case DICommonBlockKind:
213 case DITemplateTypeParameterKind:
214 case DITemplateValueParameterKind:
215 case DIGlobalVariableKind:
216 case DILocalVariableKind:
217 case DILabelKind:
218 case DIObjCPropertyKind:
219 case DIImportedEntityKind:
220 case DIModuleKind:
221 case DIGenericSubrangeKind:
222 case DIAssignIDKind:
223 return true;
224 }
225 }
226};
227
228
229
230
231
232
233
234
235
239
244 setHash(Hash);
245 }
247
248 void setHash(unsigned Hash) { SubclassData32 = Hash; }
249 void recalculateHash();
250
251 static GenericDINode *getImpl(LLVMContext &Context, unsigned Tag,
256 }
257
258 static GenericDINode *getImpl(LLVMContext &Context, unsigned Tag,
261
262 TempGenericDINode cloneImpl() const {
265 }
266
267public:
269
278
279
280 TempGenericDINode clone() const { return cloneImpl(); }
281
285
290 }
291
295 }
298 }
299
302 }
303};
304
305
306
307
308
312
315
317
319 bool ShouldCreate = true);
320
322
323public:
324
326
328 return Context.getReplaceableUses()->getAllDbgVariableRecordUsers();
329 }
330
332 return getImpl(Context, Distinct);
333 }
335 return TempDIAssignID(getImpl(Context, Temporary));
336 }
337
338
341 }
342};
343
344
345
346
347
351
353
355
358 bool ShouldCreate = true);
359
362 bool ShouldCreate = true);
363
367 bool ShouldCreate = true);
368
369 TempDISubrange cloneImpl() const {
371 getRawUpperBound(), getRawStride());
372 }
373
374public:
377
380
385
386 TempDISubrange clone() const { return cloneImpl(); }
387
389
391
393
395
396 typedef PointerUnion<ConstantInt *, DIVariable *, DIExpression *> BoundType;
397
399
401
403
405
408 }
409};
410
414
417
419
423 bool ShouldCreate = true);
424
425 TempDIGenericSubrange cloneImpl() const {
428 }
429
430public:
434 (CountNode, LowerBound, UpperBound, Stride))
435
436 TempDIGenericSubrange clone() const { return cloneImpl(); }
437
442
444
449
451 return MD->getMetadataID() == DIGenericSubrangeKind;
452 }
453};
454
455
456
457
458
462
469 Ops) {}
471
477 }
478 static DIEnumerator *getImpl(LLVMContext &Context, const APInt &Value,
481
482 TempDIEnumerator cloneImpl() const {
484 }
485
486public:
499
500 TempDIEnumerator clone() const { return cloneImpl(); }
501
505
507
510 }
511};
512
513
514
515
516
517
518
520protected:
525
526public:
528
531 inline std::optional getSource() const;
532
535
536
537
538
539
540
541
543 return isa(this) ? const_cast<DIScope *>(this)
545 }
546
549 default:
550 return false;
551 case DIBasicTypeKind:
552 case DIStringTypeKind:
553 case DIDerivedTypeKind:
554 case DICompositeTypeKind:
555 case DISubroutineTypeKind:
556 case DIFileKind:
557 case DICompileUnitKind:
558 case DISubprogramKind:
559 case DILexicalBlockKind:
560 case DILexicalBlockFileKind:
561 case DINamespaceKind:
562 case DICommonBlockKind:
563 case DIModuleKind:
564 return true;
565 }
566 }
567};
568
569
570
571
572
576
577public:
578
579
580
581
583
584
585
586
592
593
595
597
599
603 return Kind == X.Kind && Value == X.Value;
604 }
607 };
608
609private:
610 std::optional<ChecksumInfo<MDString *>> Checksum;
611
613
615 std::optional<ChecksumInfo<MDString *>> CS, MDString *Src,
618
621 std::optional<ChecksumInfo> CS,
623 bool ShouldCreate = true) {
624 std::optional<ChecksumInfo<MDString *>> MDChecksum;
625 if (CS)
630 ShouldCreate);
631 }
632 static DIFile *getImpl(LLVMContext &Context, MDString *Filename,
634 std::optional<ChecksumInfo<MDString *>> CS,
636 bool ShouldCreate = true);
637
638 TempDIFile cloneImpl() const {
641 }
642
643public:
647 std::optional Source = std::nullopt),
654
655 TempDIFile clone() const { return cloneImpl(); }
656
659 std::optional<ChecksumInfo> getChecksum() const {
660 std::optional<ChecksumInfo> StringRefChecksum;
661 if (Checksum)
662 StringRefChecksum.emplace(Checksum->Kind, Checksum->Value->getString());
663 return StringRefChecksum;
664 }
665 std::optional getSource() const {
666 return Source ? std::optional(Source->getString())
667 : std::nullopt;
668 }
669
670 MDString *getRawFilename() const { return getOperandAs(0); }
671 MDString *getRawDirectory() const { return getOperandAs(1); }
672 std::optional<ChecksumInfo<MDString *>> getRawChecksum() const {
673 return Checksum;
674 }
675 MDString *getRawSource() const { return Source; }
676
677 static StringRef getChecksumKindAsString(ChecksumKind CSKind);
678 static std::optional getChecksumKind(StringRef CSKindStr);
679
682 }
683};
684
687 return F->getFilename();
688 return "";
689}
690
693 return F->getDirectory();
694 return "";
695}
696
699 return F->getSource();
700 return std::nullopt;
701}
702
703
704
705
706
707
708
709
711 unsigned Line;
715 uint32_t NumExtraInhabitants;
716
717protected:
723 init(Line, SizeInBits, AlignInBits, OffsetInBits, NumExtraInhabitants,
724 Flags);
725 }
727
731 this->Line = Line;
732 this->Flags = Flags;
733 this->SizeInBits = SizeInBits;
735 this->OffsetInBits = OffsetInBits;
736 this->NumExtraInhabitants = NumExtraInhabitants;
737 }
738
739
745 init(Line, SizeInBits, AlignInBits, OffsetInBits, NumExtraInhabitants,
746 Flags);
747 }
748
749public:
752 }
753
754 unsigned getLine() const { return Line; }
761
764
767
768
770 auto NewTy = clone();
771 NewTy->Flags = NewFlags;
772 return NewTy;
773 }
774
777 }
780 }
783 }
790 return getFlags() & FlagObjcClassComplete;
791 }
799 return getFlags() & FlagTypePassByReference;
800 }
804
807 default:
808 return false;
809 case DIBasicTypeKind:
810 case DIStringTypeKind:
811 case DIDerivedTypeKind:
812 case DICompositeTypeKind:
813 case DISubroutineTypeKind:
814 return true;
815 }
816 }
817};
818
819
820
821
822
826
827 unsigned Encoding;
828
835 Encoding(Encoding) {}
837
846 }
847 static DIBasicType *getImpl(LLVMContext &Context, unsigned Tag,
852
853 TempDIBasicType cloneImpl() const {
857 }
858
859public:
861 (Tag, Name, 0, 0, 0, 0, FlagZero))
888
889 TempDIBasicType clone() const { return cloneImpl(); }
890
892
894
895
896
898
901 }
902};
903
904
908
909 unsigned Encoding;
910
915 0, FlagZero, Ops),
916 Encoding(Encoding) {}
918
924 bool ShouldCreate = true) {
928 }
929 static DIStringType *getImpl(LLVMContext &Context, unsigned Tag,
934 bool ShouldCreate = true);
935
936 TempDIStringType cloneImpl() const {
941 }
942
943public:
953 unsigned Encoding),
960 unsigned Encoding),
963
964 TempDIStringType clone() const { return cloneImpl(); }
965
968 }
969
972 }
973
976 }
977
980 }
981
983
985
987
989};
990
991
992
993
994
995
996
998public:
999
1001
1002
1003
1004
1005
1006
1008
1010 PtrAuthData(unsigned Key, bool IsDiscr, unsigned Discriminator,
1011 bool IsaPointer, bool AuthenticatesNullValues) {
1013 assert(Discriminator <= 0xffff);
1014 RawData = (Key << 0) | (IsDiscr ? (1 << 4) : 0) | (Discriminator << 5) |
1015 (IsaPointer ? (1 << 21) : 0) |
1016 (AuthenticatesNullValues ? (1 << 22) : 0);
1017 }
1018
1024 };
1025
1026private:
1029
1030
1031
1032 std::optional DWARFAddressSpace;
1033
1037 std::optional DWARFAddressSpace,
1042 DWARFAddressSpace(DWARFAddressSpace) {
1045 }
1051 std::optional DWARFAddressSpace,
1052 std::optional PtrAuthData, DIFlags Flags,
1054 bool ShouldCreate = true) {
1059 }
1060 static DIDerivedType *
1061 getImpl(LLVMContext &Context, unsigned Tag, MDString *Name, Metadata *File,
1064 std::optional DWARFAddressSpace,
1065 std::optional PtrAuthData, DIFlags Flags,
1067 bool ShouldCreate = true);
1068
1069 TempDIDerivedType cloneImpl() const {
1073 getDWARFAddressSpace(), getPtrAuthData(), getFlags(),
1075 }
1076
1077public:
1083 std::optional DWARFAddressSpace,
1094 std::optional DWARFAddressSpace,
1101
1102 TempDIDerivedType clone() const { return cloneImpl(); }
1103
1104
1105 DIType *getBaseType() const { return cast_or_null(getRawBaseType()); }
1107
1108
1109
1110 std::optional getDWARFAddressSpace() const {
1111 return DWARFAddressSpace;
1112 }
1113
1114 std::optional getPtrAuthData() const;
1115
1116
1117
1118
1119
1120
1121
1122
1123
1126
1127
1129 return cast_or_null(getExtraData());
1130 }
1131
1132
1135 }
1137
1138
1139
1141
1143 return dyn_cast_or_null(getExtraData());
1144 }
1145
1147
1149
1151
1153
1154
1156 return MD->getMetadataID() == DIDerivedTypeKind;
1157 }
1158};
1159
1163}
1164
1167 return !(Lhs == Rhs);
1168}
1169
1170
1171
1172
1173
1177
1178 unsigned RuntimeLang;
1179
1187 RuntimeLang(RuntimeLang) {}
1189
1190
1191 void mutate(unsigned Tag, unsigned Line, unsigned RuntimeLang,
1196 this->RuntimeLang = RuntimeLang;
1199 }
1200
1201 static DICompositeType *
1202 getImpl(LLVMContext &Context, unsigned Tag, StringRef Name, Metadata *File,
1211 bool ShouldCreate = true) {
1219 }
1220 static DICompositeType *
1221 getImpl(LLVMContext &Context, unsigned Tag, MDString *Name, Metadata *File,
1230 bool ShouldCreate = true);
1231
1232 TempDICompositeType cloneImpl() const {
1241 }
1242
1243public:
1275
1276 TempDICompositeType clone() const { return cloneImpl(); }
1277
1278
1279
1280
1281
1282
1283
1284
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1317
1321 }
1324 }
1327 }
1330
1338 return getOperandAs(8);
1339 }
1343 }
1346 }
1350 }
1353 }
1357 }
1359 return dyn_cast_or_null(getRawAllocated());
1360 }
1363 if (auto *MD = dyn_cast_or_null(getRawRank()))
1364 return dyn_cast_or_null(MD->getValue());
1365 return nullptr;
1366 }
1368 return dyn_cast_or_null(getRawRank());
1369 }
1370
1374 }
1375
1379 }
1380
1381
1382
1383
1384
1385
1387#ifndef NDEBUG
1390 "Lost a member during member list replacement");
1391#endif
1393 }
1394
1397 }
1398
1401 }
1402
1403
1405 return MD->getMetadataID() == DICompositeTypeKind;
1406 }
1407};
1408
1409
1410
1411
1415
1416
1417
1419
1423
1427 bool ShouldCreate = true) {
1429 }
1433 bool ShouldCreate = true);
1434
1435 TempDISubroutineType cloneImpl() const {
1437 }
1438
1439public:
1446
1447 TempDISubroutineType clone() const { return cloneImpl(); }
1448
1450 auto NewTy = clone();
1451 NewTy->CC = CC;
1452 return NewTy;
1453 }
1454
1456
1459 }
1460
1462
1464 return MD->getMetadataID() == DISubroutineTypeKind;
1465 }
1466};
1467
1468
1472
1473public:
1481
1484 GNU = 1,
1488 };
1489
1494
1495private:
1497 unsigned RuntimeVersion;
1499 unsigned EmissionKind;
1500 unsigned NameTableKind;
1501 bool IsOptimized;
1502 bool SplitDebugInlining;
1503 bool DebugInfoForProfiling;
1504 bool RangesBaseAddress;
1505
1507 bool IsOptimized, unsigned RuntimeVersion,
1508 unsigned EmissionKind, uint64_t DWOId, bool SplitDebugInlining,
1509 bool DebugInfoForProfiling, unsigned NameTableKind,
1512
1517 unsigned EmissionKind, DICompositeTypeArray EnumTypes,
1521 uint64_t DWOId, bool SplitDebugInlining, bool DebugInfoForProfiling,
1522 unsigned NameTableKind, bool RangesBaseAddress, StringRef SysRoot,
1524 return getImpl(
1530 DebugInfoForProfiling, NameTableKind, RangesBaseAddress,
1533 }
1534 static DICompileUnit *
1536 MDString *Producer, bool IsOptimized, MDString *Flags,
1541 bool DebugInfoForProfiling, unsigned NameTableKind,
1542 bool RangesBaseAddress, MDString *SysRoot, MDString *SDK,
1544
1545 TempDICompileUnit cloneImpl() const {
1553 }
1554
1555public:
1556 static void get() = delete;
1558
1562 bool IsOptimized, StringRef Flags, unsigned RuntimeVersion,
1567 uint64_t DWOId, bool SplitDebugInlining, bool DebugInfoForProfiling,
1573 DebugInfoForProfiling, (unsigned)NameTableKind, RangesBaseAddress,
1582 bool SplitDebugInlining, bool DebugInfoForProfiling,
1588 DebugInfoForProfiling, NameTableKind, RangesBaseAddress, SysRoot, SDK))
1589
1590 TempDICompileUnit clone() const { return cloneImpl(); }
1591
1597 }
1600 }
1604 }
1611 }
1614 }
1617 }
1620 }
1622 return cast_or_null(getRawMacros());
1623 }
1628 this->SplitDebugInlining = SplitDebugInlining;
1629 }
1632
1636 return getOperandAs(3);
1637 }
1645
1646
1647
1648
1649
1650
1651
1654 }
1658 }
1661 }
1663
1664
1666 return MD->getMetadataID() == DICompileUnitKind;
1667 }
1668};
1669
1670
1671
1672
1673
1674
1676protected:
1681
1682public:
1683
1684
1685
1686
1688
1689
1690
1695
1696
1697
1698
1699
1701
1703 return MD->getMetadataID() == DISubprogramKind ||
1706 }
1707};
1708
1709
1713
1714 unsigned Line;
1715 unsigned ScopeLine;
1716 unsigned VirtualIndex;
1717
1718
1719
1720
1721 int ThisAdjustment;
1722
1723public:
1724
1726#define HANDLE_DISP_FLAG(ID, NAME) SPFlag##NAME = ID,
1727#define DISP_FLAG_LARGEST_NEEDED
1728#include "llvm/IR/DebugInfoFlags.def"
1732 };
1733
1736
1737
1738
1739
1740
1743
1744
1746 bool IsOptimized,
1748 bool IsMainSubprogram = false);
1749
1750private:
1753
1755 unsigned ScopeLine, unsigned VirtualIndex, int ThisAdjustment,
1758
1763 unsigned VirtualIndex, int ThisAdjustment, DIFlags Flags,
1771 ScopeLine, ContainingType, VirtualIndex, ThisAdjustment,
1776 }
1777 static DISubprogram *
1785 bool ShouldCreate = true);
1786
1787 TempDISubprogram cloneImpl() const {
1790 getContainingType(), getVirtualIndex(),
1791 getThisAdjustment(), getFlags(), getSPFlags(),
1792 getUnit(), getTemplateParams(), getDeclaration(),
1793 getRetainedNodes(), getThrownTypes(), getAnnotations(),
1794 getTargetFuncName());
1795 }
1796
1797public:
1811
1824
1825 TempDISubprogram clone() const { return cloneImpl(); }
1826
1827
1828 TempDISubprogram cloneWithFlags(DIFlags NewFlags) const {
1829 auto NewSP = clone();
1830 NewSP->Flags = NewFlags;
1831 return NewSP;
1832 }
1833
1834public:
1835 unsigned getLine() const { return Line; }
1837 unsigned getVirtualIndex() const { return VirtualIndex; }
1838 int getThisAdjustment() const { return ThisAdjustment; }
1839 unsigned getScopeLine() const { return ScopeLine; }
1840 void setScopeLine(unsigned L) {
1842 ScopeLine = L;
1843 }
1845 DISPFlags getSPFlags() const { return SPFlags; }
1846 bool isLocalToUnit() const { return getSPFlags() & SPFlagLocalToUnit; }
1847 bool isDefinition() const { return getSPFlags() & SPFlagDefinition; }
1848 bool isOptimized() const { return getSPFlags() & SPFlagOptimized; }
1849 bool isMainSubprogram() const { return getSPFlags() & SPFlagMainSubprogram; }
1850
1851 bool isArtificial() const { return getFlags() & FlagArtificial; }
1852 bool isPrivate() const {
1854 }
1855 bool isProtected() const {
1857 }
1858 bool isPublic() const {
1860 }
1861 bool isExplicit() const { return getFlags() & FlagExplicit; }
1862 bool isPrototyped() const { return getFlags() & FlagPrototyped; }
1863 bool areAllCallsDescribed() const {
1864 return getFlags() & FlagAllCallsDescribed;
1865 }
1866 bool isPure() const { return getSPFlags() & SPFlagPure; }
1867 bool isElemental() const { return getSPFlags() & SPFlagElemental; }
1868 bool isRecursive() const { return getSPFlags() & SPFlagRecursive; }
1869 bool isObjCDirect() const { return getSPFlags() & SPFlagObjCDirect; }
1870
1871
1872
1873
1874
1875 bool isDeleted() const { return getSPFlags() & SPFlagDeleted; }
1876
1877
1878
1879
1880
1881 bool isLValueReference() const { return getFlags() & FlagLValueReference; }
1882
1883
1884
1885
1886
1887 bool isRValueReference() const { return getFlags() & FlagRValueReference; }
1888
1889
1890
1891
1892 bool isNoReturn() const { return getFlags() & FlagNoReturn; }
1893
1894
1895
1896
1897 bool isThunk() const { return getFlags() & FlagThunk; }
1898
1899 DIScope *getScope() const { return cast_or_null(getRawScope()); }
1900
1903
1904 void replaceLinkageName(MDString *LN) { replaceOperandWith(3, LN); }
1905
1906 DISubroutineType *getType() const {
1907 return cast_or_null(getRawType());
1908 }
1909 DIType *getContainingType() const {
1910 return cast_or_null(getRawContainingType());
1911 }
1912 void replaceType(DISubroutineType *Ty) {
1915 }
1916
1917 DICompileUnit *getUnit() const {
1918 return cast_or_null(getRawUnit());
1919 }
1921 DITemplateParameterArray getTemplateParams() const {
1922 return cast_or_null(getRawTemplateParams());
1923 }
1924 DISubprogram *getDeclaration() const {
1925 return cast_or_null(getRawDeclaration());
1926 }
1927 void replaceDeclaration(DISubprogram *Decl) { replaceOperandWith(6, Decl); }
1928 DINodeArray getRetainedNodes() const {
1929 return cast_or_null(getRawRetainedNodes());
1930 }
1931 DITypeArray getThrownTypes() const {
1932 return cast_or_null(getRawThrownTypes());
1933 }
1934 DINodeArray getAnnotations() const {
1935 return cast_or_null(getRawAnnotations());
1936 }
1937 StringRef getTargetFuncName() const {
1938 return (getRawTargetFuncName()) ? getStringOperand(12) : StringRef();
1939 }
1940
1942 MDString *getRawName() const { return getOperandAs(2); }
1943 MDString *getRawLinkageName() const { return getOperandAs(3); }
1948 Metadata *getRawContainingType() const {
1949 return getNumOperands() > 8 ? getOperandAs(8) : nullptr;
1950 }
1951 Metadata *getRawTemplateParams() const {
1952 return getNumOperands() > 9 ? getOperandAs(9) : nullptr;
1953 }
1954 Metadata *getRawThrownTypes() const {
1955 return getNumOperands() > 10 ? getOperandAs(10) : nullptr;
1956 }
1957 Metadata *getRawAnnotations() const {
1958 return getNumOperands() > 11 ? getOperandAs(11) : nullptr;
1959 }
1960 MDString *getRawTargetFuncName() const {
1961 return getNumOperands() > 12 ? getOperandAs(12) : nullptr;
1962 }
1963
1964 void replaceRawLinkageName(MDString *LinkageName) {
1966 }
1967 void replaceRetainedNodes(DINodeArray N) {
1969 }
1970
1971
1972
1973
1974 bool describes(const Function *F) const;
1975
1978 }
1979};
1980
1981
1982
1983
1984
1985
1986
1987
1991
1995
2006 ShouldCreate);
2007 }
2008
2009 TempDILocation cloneImpl() const {
2010
2011
2014 }
2015
2016public:
2017
2019
2029
2030
2031 TempDILocation clone() const { return cloneImpl(); }
2032
2034 unsigned getColumn() const { return SubclassData16; }
2035 DILocalScope *getScope() const { return cast(getRawScope()); }
2036
2037
2038
2039 StringRef getSubprogramLinkageName() const {
2040 DISubprogram *SP = getScope()->getSubprogram();
2041 if (!SP)
2042 return "";
2043 auto Name = SP->getLinkageName();
2044 if (.empty())
2045 return Name;
2046 return SP->getName();
2047 }
2048
2049 DILocation *getInlinedAt() const {
2051 }
2052
2053
2054
2055
2056
2057
2058
2059 bool isImplicitCode() const { return SubclassData1; }
2061
2062 DIFile *getFile() const { return getScope()->getFile(); }
2063 StringRef getFilename() const { return getScope()->getFilename(); }
2064 StringRef getDirectory() const { return getScope()->getDirectory(); }
2065 std::optional getSource() const { return getScope()->getSource(); }
2066
2067
2068
2069
2070
2071 DILocalScope *getInlinedAtScope() const {
2072 if (auto *IA = getInlinedAt())
2073 return IA->getInlinedAtScope();
2074 return getScope();
2075 }
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111 inline unsigned getDiscriminator() const;
2112
2113
2114
2115
2116
2117
2118
2119
2120
2122 return ((Discriminator & 0x7) == 0x7) && (Discriminator & 0xFFFFFFF8);
2123 }
2124
2125
2127
2128
2129
2130
2131
2132 inline std::optional<const DILocation *>
2134
2135
2136
2138
2139
2141
2142
2144
2145
2146
2147
2148
2149 inline std::optional<const DILocation *>
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2167
2168
2169
2170
2171
2173
2174
2175
2176
2179 }
2180
2181
2183
2184
2185 static unsigned
2187 bool IsFSDiscriminator = false) {
2188
2189
2191 auto DwarfBaseDiscriminator =
2193 if (DwarfBaseDiscriminator)
2194 return *DwarfBaseDiscriminator;
2195
2196
2197
2198
2199
2201 }
2202
2203 if (IsFSDiscriminator)
2206 }
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2222 unsigned CI);
2223
2224
2226 unsigned &CI);
2227
2228
2229
2232 return 1;
2235 if (Ret == 0)
2236 return 1;
2237 return Ret;
2238 }
2239
2240
2244 }
2245
2250 return nullptr;
2251 }
2252
2255 }
2256};
2257
2259protected:
2263
2264public:
2266
2268
2272 }
2273
2275 return MD->getMetadataID() == DILexicalBlockKind ||
2277 }
2278};
2279
2280
2281
2282
2286
2288
2292 Column(Column) {
2294 assert(Column < (1u << 16) && "Expected 16-bit column");
2295 }
2297
2301 bool ShouldCreate = true) {
2302 return getImpl(Context, static_cast<Metadata *>(Scope),
2304 ShouldCreate);
2305 }
2306
2307 static DILexicalBlock *getImpl(LLVMContext &Context, Metadata *Scope,
2310
2311 TempDILexicalBlock cloneImpl() const {
2314 }
2315
2316public:
2319 unsigned Column),
2323 unsigned Column),
2325
2326 TempDILexicalBlock clone() const { return cloneImpl(); }
2327
2330
2332 return MD->getMetadataID() == DILexicalBlockKind;
2333 }
2334};
2335
2339
2344 }
2346
2350 bool ShouldCreate = true) {
2351 return getImpl(Context, static_cast<Metadata *>(Scope),
2353 ShouldCreate);
2354 }
2355
2356 static DILexicalBlockFile *getImpl(LLVMContext &Context, Metadata *Scope,
2359 bool ShouldCreate = true);
2360
2361 TempDILexicalBlockFile cloneImpl() const {
2364 }
2365
2366public:
2374
2375 TempDILexicalBlockFile clone() const { return cloneImpl(); }
2377
2379 return MD->getMetadataID() == DILexicalBlockFileKind;
2380 }
2381};
2382
2383unsigned DILocation::getDiscriminator() const {
2384 if (auto *F = dyn_cast(getScope()))
2385 return F->getDiscriminator();
2386 return 0;
2387}
2388
2389const DILocation *
2392
2393
2394
2395
2396 for (auto *LBF = dyn_cast(Scope);
2397 LBF && LBF->getDiscriminator() != 0;
2398 LBF = dyn_cast(Scope))
2399 Scope = LBF->getScope();
2403 getInlinedAt());
2404}
2405
2409}
2410
2413}
2414
2417}
2418
2419std::optional<const DILocation *>
2421 unsigned BD, DF, CI;
2422
2425 if (D == BD)
2426 return this;
2428 }
2429
2431 if (D == BD)
2432 return this;
2435 return std::nullopt;
2436}
2437
2438std::optional<const DILocation *>
2441
2442
2443
2444
2446 return this;
2447
2449 if (DF <= 1)
2450 return this;
2451
2456 return std::nullopt;
2457}
2458
2459
2460
2461
2465
2469
2475 }
2479
2480 TempDINamespace cloneImpl() const {
2483 }
2484
2485public:
2492
2493 TempDINamespace clone() const { return cloneImpl(); }
2494
2498
2501
2504 }
2505};
2506
2507
2508
2509
2510
2514
2518
2523 bool ShouldCreate = true) {
2529 }
2535
2536 TempDIModule cloneImpl() const {
2538 getConfigurationMacros(), getIncludePath(),
2539 getAPINotesFile(), getLineNo(), getIsDecl());
2540 }
2541
2542public:
2547 bool IsDecl = false),
2554 bool IsDecl = false),
2557
2558 TempDIModule clone() const { return cloneImpl(); }
2559
2560 DIScope *getScope() const { return cast_or_null(getRawScope()); }
2562 StringRef getConfigurationMacros() const { return getStringOperand(3); }
2563 StringRef getIncludePath() const { return getStringOperand(4); }
2564 StringRef getAPINotesFile() const { return getStringOperand(5); }
2565 unsigned getLineNo() const { return SubclassData32; }
2566 bool getIsDecl() const { return SubclassData1; }
2567
2569 MDString *getRawName() const { return getOperandAs(2); }
2570 MDString *getRawConfigurationMacros() const {
2571 return getOperandAs(3);
2572 }
2573 MDString *getRawIncludePath() const { return getOperandAs(4); }
2574 MDString *getRawAPINotesFile() const { return getOperandAs(5); }
2575
2577 return MD->getMetadataID() == DIModuleKind;
2578 }
2579};
2580
2581
2582
2583
2585protected:
2590 }
2592
2593public:
2596
2600
2602 return MD->getMetadataID() == DITemplateTypeParameterKind ||
2603 MD->getMetadataID() == DITemplateValueParameterKind;
2604 }
2605};
2606
2610
2614
2618 bool ShouldCreate = true) {
2621 }
2625 bool ShouldCreate = true);
2626
2627 TempDITemplateTypeParameter cloneImpl() const {
2629 }
2630
2631public:
2638
2639 TempDITemplateTypeParameter clone() const { return cloneImpl(); }
2640
2642 return MD->getMetadataID() == DITemplateTypeParameterKind;
2643 }
2644};
2645
2649
2656
2661 bool ShouldCreate = true) {
2664 }
2665 static DITemplateValueParameter *getImpl(LLVMContext &Context, unsigned Tag,
2669 bool ShouldCreate = true);
2670
2671 TempDITemplateValueParameter cloneImpl() const {
2674 }
2675
2676public:
2685
2686 TempDITemplateValueParameter clone() const { return cloneImpl(); }
2687
2689
2691 return MD->getMetadataID() == DITemplateValueParameterKind;
2692 }
2693};
2694
2695
2696
2697
2699 unsigned Line;
2700
2701protected:
2705
2706public:
2707 unsigned getLine() const { return Line; }
2714
2716
2717
2718
2720 if (auto *BT = dyn_cast(getType()))
2721 return BT->getSignedness();
2722 return std::nullopt;
2723 }
2724
2727 return F->getFilename();
2728 return "";
2729 }
2730
2733 return F->getDirectory();
2734 return "";
2735 }
2736
2739 return F->getSource();
2740 return std::nullopt;
2741 }
2742
2747
2749 return MD->getMetadataID() == DILocalVariableKind ||
2751 }
2752};
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2766
2767 std::vector<uint64_t> Elements;
2768
2771 Elements(Elements.begin(), Elements.end()) {}
2772 ~DIExpression() = default;
2773
2774 static DIExpression *getImpl(LLVMContext &Context,
2776 bool ShouldCreate = true);
2777
2778 TempDIExpression cloneImpl() const {
2780 }
2781
2782public:
2784
2785 TempDIExpression clone() const { return cloneImpl(); }
2786
2788
2790
2792 assert(I < Elements.size() && "Index out of range");
2793 return Elements[I];
2794 }
2795
2797
2798
2799 std::optional isConstant() const;
2800
2801
2802
2803
2804
2805
2806
2807
2808
2810
2812
2815
2816
2817
2818
2819
2822
2823 public:
2826
2828
2829
2831
2832
2833
2834
2836
2838
2839
2840
2841
2842 unsigned getSize() const;
2843
2844
2847 }
2848 };
2849
2850
2853
2854 public:
2860
2863
2867
2869 increment();
2870 return *this;
2871 }
2874 increment();
2875 return T;
2876 }
2877
2878
2879
2880
2881
2882
2884
2886 return getBase() == X.getBase();
2887 }
2889 return getBase() != X.getBase();
2890 }
2891
2892 private:
2894 };
2895
2896
2897
2898
2899
2900
2901
2902
2903
2906 }
2909 }
2912 }
2913
2914
2916
2919 }
2920
2921
2923
2924
2926
2928
2929
2930
2931
2932
2934
2935
2938
2939
2942 }
2943
2944
2946
2947
2949
2950
2951
2953
2954
2955
2956
2958
2959
2960
2961
2962
2963
2965
2966
2967
2968
2969
2970
2971
2973
2974
2975
2976
2979
2980
2981
2982
2983
2984
2985
2986
2987 static std::optional<const DIExpression *>
2989
2990
2991
2992
2993
2994
2997 bool IsIndirect);
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3011 bool FirstIndirect,
3013 bool SecondIndirect);
3014
3015
3017
3018
3019
3021
3022
3023
3024
3025
3026
3027
3028
3031
3032
3033
3035
3036
3037
3038
3040 unsigned &AddrClass);
3041
3042
3050
3051
3052
3054 int64_t Offset = 0);
3055
3056
3057
3062
3063
3064
3065
3066
3068
3069
3070
3071
3072
3075
3076
3077
3078
3079
3083
3084
3085
3086
3087
3088
3089
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104 static std::optional<DIExpression *>
3106 unsigned SizeInBits);
3107
3108
3109
3110
3116 if (r1 <= l2)
3117 return -1;
3118 else if (r2 <= l1)
3119 return 1;
3120 else
3121 return 0;
3122 }
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3156 uint64_t SliceSizeInBits, const Value *DbgPtr, int64_t DbgPtrOffsetInBits,
3158 std::optionalDIExpression::FragmentInfo &Result,
3159 int64_t &OffsetFromLocationInBits);
3160
3161 using ExtOps = std::array<uint64_t, 6>;
3162
3163
3165
3166
3167
3169 unsigned ToSize, bool Signed);
3170
3171
3174 }
3175
3176
3177
3180 auto Fragment2 = *Other->getFragmentInfo();
3181 return fragmentCmp(Fragment1, Fragment2);
3182 }
3183
3184
3187 return true;
3189 }
3190
3191
3192
3194
3195
3196
3197
3198 std::pair<DIExpression *, const ConstantInt *>
3200
3201
3202
3203
3205};
3206
3209 return std::tie(A.SizeInBits, A.OffsetInBits) ==
3210 std::tie(B.SizeInBits, B.OffsetInBits);
3211}
3212
3215 return std::tie(A.SizeInBits, A.OffsetInBits) <
3216 std::tie(B.SizeInBits, B.OffsetInBits);
3217}
3218
3221 static const uint64_t MaxVal = std::numeric_limits<uint64_t>::max();
3222
3224
3226
3229 }
3230
3232};
3233
3234
3235
3238
3239public:
3241 if (!Expr) {
3243 return;
3244 }
3247 }
3248
3250 : Start(Expr.begin()), End(Expr.end()) {}
3251
3253
3254
3255 std::optionalDIExpression::ExprOperand take() {
3256 if (Start == End)
3257 return std::nullopt;
3258 return *(Start++);
3259 }
3260
3261
3262 void consume(unsigned N) { std::advance(Start, N); }
3263
3264
3265 std::optionalDIExpression::ExprOperand peek() const {
3266 if (Start == End)
3267 return std::nullopt;
3268 return *(Start);
3269 }
3270
3271
3272 std::optionalDIExpression::ExprOperand peekNext() const {
3273 if (Start == End)
3274 return std::nullopt;
3275
3276 auto Next = Start.getNext();
3277 if (Next == End)
3278 return std::nullopt;
3279
3280 return *Next;
3281 }
3282
3283 std::optionalDIExpression::ExprOperand peekNextN(unsigned N) const {
3284 if (Start == End)
3285 return std::nullopt;
3287 for (unsigned I = 0; I < N; I++) {
3289 if (Nth == End)
3290 return std::nullopt;
3291 }
3292 return *Nth;
3293 }
3294
3298 }
3299
3300
3301 operator bool() const { return Start != End; }
3302
3305
3306
3309 }
3310};
3311
3312
3313
3314
3318
3319 bool IsLocalToUnit;
3320 bool IsDefinition;
3321
3326 IsLocalToUnit(IsLocalToUnit), IsDefinition(IsDefinition) {}
3328
3332 bool IsLocalToUnit, bool IsDefinition,
3335 bool ShouldCreate = true) {
3341 }
3342 static DIGlobalVariable *
3345 bool IsLocalToUnit, bool IsDefinition,
3348 bool ShouldCreate = true);
3349
3350 TempDIGlobalVariable cloneImpl() const {
3356 }
3357
3358public:
3362 unsigned Line, DIType *Type, bool IsLocalToUnit, bool IsDefinition,
3375
3376 TempDIGlobalVariable clone() const { return cloneImpl(); }
3377
3384 }
3387 }
3388
3394
3396 return MD->getMetadataID() == DIGlobalVariableKind;
3397 }
3398};
3399
3400
3401
3402
3406
3409
3416 }
3420 bool ShouldCreate = true);
3421
3422 TempDICommonBlock cloneImpl() const {
3425 }
3426
3427public:
3436
3437 TempDICommonBlock clone() const { return cloneImpl(); }
3438
3441 return cast_or_null(getRawDecl());
3442 }
3446
3451
3453 return MD->getMetadataID() == DICommonBlockKind;
3454 }
3455};
3456
3457
3458
3459
3463
3464 unsigned Arg : 16;
3466
3471 Arg(Arg), Flags(Flags) {
3472 assert(Arg < (1 << 16) && "DILocalVariable: Arg out of range");
3473 }
3475
3481 bool ShouldCreate = true) {
3485 }
3486 static DILocalVariable *getImpl(LLVMContext &Context, Metadata *Scope,
3491 bool ShouldCreate = true);
3492
3493 TempDILocalVariable cloneImpl() const {
3497 }
3498
3499public:
3512
3513 TempDILocalVariable clone() const { return cloneImpl(); }
3514
3515
3516
3517
3520 }
3521
3523 unsigned getArg() const { return Arg; }
3525
3528 }
3530
3533
3534
3535
3536
3537
3538
3541 }
3542
3544 return MD->getMetadataID() == DILocalVariableKind;
3545 }
3546};
3547
3548
3549
3550
3554
3558
3561 bool ShouldCreate = true) {
3564 }
3567 bool ShouldCreate = true);
3568
3569 TempDILabel cloneImpl() const {
3572 }
3573
3574public:
3577 unsigned Line),
3583
3584 TempDILabel clone() const { return cloneImpl(); }
3585
3586
3587
3588
3590 return cast_or_null(getRawScope());
3591 }
3595
3599
3600
3601
3602
3603
3604
3607 }
3608
3611 }
3612};
3613
3617
3618 unsigned Line;
3619 unsigned Attributes;
3620
3624
3633 }
3639
3640 TempDIObjCProperty cloneImpl() const {
3644 }
3645
3646public:
3659
3660 TempDIObjCProperty clone() const { return cloneImpl(); }
3661
3662 unsigned getLine() const { return Line; }
3669
3672 return F->getFilename();
3673 return "";
3674 }
3675
3678 return F->getDirectory();
3679 return "";
3680 }
3681
3687
3689 return MD->getMetadataID() == DIObjCPropertyKind;
3690 }
3691};
3692
3693
3694
3695
3699
3704 }
3706
3711 bool ShouldCreate = true) {
3714 ShouldCreate);
3715 }
3716 static DIImportedEntity *
3720
3721 TempDIImportedEntity cloneImpl() const {
3723 getFile(), getLine(), getName(), getElements());
3724 }
3725
3726public:
3730 DINodeArray Elements = nullptr),
3735 Metadata *Elements = nullptr),
3737
3738 TempDIImportedEntity clone() const { return cloneImpl(); }
3739
3741 DIScope *getScope() const { return cast_or_null(getRawScope()); }
3742 DINode *getEntity() const { return cast_or_null(getRawEntity()); }
3744 DIFile *getFile() const { return cast_or_null(getRawFile()); }
3745 DINodeArray getElements() const {
3746 return cast_or_null(getRawElements());
3747 }
3748
3751 MDString *getRawName() const { return getOperandAs(2); }
3754
3756 return MD->getMetadataID() == DIImportedEntityKind;
3757 }
3758};
3759
3760
3764
3767 : MDNode(C, DIGlobalVariableExpressionKind, Storage, Ops) {}
3769
3773
3774 TempDIGlobalVariableExpression cloneImpl() const {
3776 }
3777
3778public:
3782
3783 TempDIGlobalVariableExpression clone() const { return cloneImpl(); }
3784
3786
3788 return cast_or_null(getRawVariable());
3789 }
3790
3792
3795 }
3796
3798 return MD->getMetadataID() == DIGlobalVariableExpressionKind;
3799 }
3800};
3801
3802
3803
3804
3805
3806
3807
3808
3809
3813
3814protected:
3818 assert(MIType < 1u << 16);
3820 }
3822
3825 }
3826
3828 if (auto *S = getOperandAs(I))
3829 return S->getString();
3831 }
3832
3835 return nullptr;
3837 }
3838
3839public:
3841
3844 default:
3845 return false;
3846 case DIMacroKind:
3847 case DIMacroFileKind:
3848 return true;
3849 }
3850 }
3851};
3852
3853
3854
3855
3859
3864 }
3866
3869 bool ShouldCreate = true) {
3872 }
3873 static DIMacro *getImpl(LLVMContext &Context, unsigned MIType, unsigned Line,
3875 bool ShouldCreate = true);
3876
3877 TempDIMacro cloneImpl() const {
3880 }
3881
3882public:
3891
3892 TempDIMacro clone() const { return cloneImpl(); }
3893
3895
3898
3901
3904 }
3905};
3906
3907
3908
3909
3913
3918 }
3920
3924 bool ShouldCreate = true) {
3927 }
3928
3929 static DIMacroFile *getImpl(LLVMContext &Context, unsigned MIType,
3932
3933 TempDIMacroFile cloneImpl() const {
3936 }
3937
3938public:
3947
3948 TempDIMacroFile clone() const { return cloneImpl(); }
3949
3951#ifndef NDEBUG
3954 "Lost a macro node during macro node list replacement");
3955#endif
3957 }
3958
3961
3964 }
3965
3968
3971 }
3972};
3973
3974
3975
3980
3982
3985 Args(Args) {
3986 track();
3987 }
3989
3990 void track();
3991 void untrack();
3992 void dropAllReferences(bool Untrack);
3993
3994public:
3995 static DIArgList *get(LLVMContext &Context, ArrayRef<ValueAsMetadata *> Args);
3996
3998
4001
4004 }
4005
4008 }
4009
4011};
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4026
4028 std::optional Fragment;
4030
4031
4032
4034
4035public:
4038
4042 : Variable(Var), Fragment(FragmentInfo), InlinedAt(InlinedAt) {}
4043
4046 : Variable(Var),
4047 Fragment(DIExpr ? DIExpr->getFragmentInfo() : std::nullopt),
4048 InlinedAt(InlinedAt) {}
4049
4051 std::optional getFragment() const { return Fragment; }
4053
4055 return Fragment.value_or(DefaultFragment);
4056 }
4057
4059 return F == DefaultFragment;
4060 }
4061
4063 return std::tie(Variable, Fragment, InlinedAt) ==
4064 std::tie(Other.Variable, Other.Fragment, Other.InlinedAt);
4065 }
4066
4068 return std::tie(Variable, Fragment, InlinedAt) <
4069 std::tie(Other.Variable, Other.Fragment, Other.InlinedAt);
4070 }
4071};
4072
4075
4076
4078 return DebugVariable(nullptr, std::nullopt, nullptr);
4079 }
4080
4081
4083 return DebugVariable(nullptr, {{0, 0}}, nullptr);
4084 }
4085
4087 unsigned HV = 0;
4088 const std::optional Fragment = D.getFragment();
4089 if (Fragment)
4091
4092 return hash_combine(D.getVariable(), HV, D.getInlinedAt());
4093 }
4094
4097 }
4098};
4099
4100
4101
4103public:
4107};
4108
4109template <>
4112}
4113
4114#undef DEFINE_MDNODE_GET_UNPACK_IMPL
4115#undef DEFINE_MDNODE_GET_UNPACK
4116#undef DEFINE_MDNODE_GET
4117
4118#endif
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 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
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 unsigned DIFlags Flags unsigned StringRef uint64_t uint32_t unsigned uint32_t NumExtraInhabitants
unsigned StringRef uint64_t FlagZero unsigned StringRef uint64_t uint32_t AlignInBits
DEFINE_MDNODE_GET(DIBasicType,(unsigned Tag, StringRef Name),(Tag, Name, 0, 0, 0, 0, FlagZero)) DEFINE_MDNODE_GET(DIBasicType
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 MDString Metadata Metadata Metadata Metadata Metadata Metadata Metadata * Specification
unsigned MDString Metadata unsigned Metadata Metadata uint64_t uint32_t uint64_t DIFlags Metadata unsigned Metadata Metadata * TemplateParams
Metadata * getRawSpecification() 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 Metadata uint32_t NumExtraInhabitants
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
DIType * getSpecification() const
Metadata * getRawElements() const
void replaceVTableHolder(DIType *VTableHolder)
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, DIType *Specification=nullptr, uint32_t NumExtraInhabitants=0),(Tag, Name, File, Line, Scope, BaseType, SizeInBits, AlignInBits, OffsetInBits, Specification, NumExtraInhabitants, Flags, Elements, RuntimeLang, VTableHolder, TemplateParams, Identifier, Discriminator, DataLocation, Associated, Allocated, Rank, Annotations)) DEFINE_MDNODE_GET(DICompositeType
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
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, Metadata *Specification, uint32_t NumExtraInhabitants, 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.
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
DITemplateParameterArray getTemplateParams() const
Get the template parameters from a template alias.
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
Holds a DIExpression and keeps track of how many operands have been consumed so far.
std::optional< DIExpression::ExprOperand > peekNext() const
Return the next operation.
std::optional< DIExpression::FragmentInfo > getFragmentInfo() const
Retrieve the fragment information, if any.
DIExpressionCursor(const DIExpressionCursor &)=default
DIExpressionCursor(const DIExpression *Expr)
DIExpression::expr_op_iterator end() const
std::optional< DIExpression::ExprOperand > peekNextN(unsigned N) const
std::optional< DIExpression::ExprOperand > peek() const
Return the current operation.
void consume(unsigned N)
Consume N operations.
std::optional< DIExpression::ExprOperand > take()
Consume one operation.
DIExpressionCursor(ArrayRef< uint64_t > Expr)
DIExpression::expr_op_iterator begin() const
void assignNewExpr(ArrayRef< uint64_t > Expr)
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.
DbgVariableFragmentInfo FragmentInfo
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.
static bool calculateFragmentIntersect(const DataLayout &DL, const Value *SliceStart, uint64_t SliceOffsetInBits, uint64_t SliceSizeInBits, const Value *DbgPtr, int64_t DbgPtrOffsetInBits, int64_t DbgExtractOffsetInBits, DIExpression::FragmentInfo VarFrag, std::optional< DIExpression::FragmentInfo > &Result, int64_t &OffsetFromLocationInBits)
Computes a fragment, bit-extract operation if needed, and new constant offset to describe a part of a...
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.
DIExpression * foldConstantMath()
Try to shorten an expression with constant math operations that can be evaluated at compile time.
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)
std::optional< uint64_t > getActiveBits(DIVariable *Var)
Return the number of bits that have an active value, i.e.
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...
bool extractLeadingOffset(int64_t &OffsetInBytes, SmallVectorImpl< uint64_t > &RemainingOps) const
Assuming that the expression operates on an address, extract a constant offset and the successive ops...
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 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.
DIMacroNode(LLVMContext &C, unsigned ID, StorageType Storage, unsigned MIType, ArrayRef< Metadata * > Ops1, ArrayRef< Metadata * > Ops2={})
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
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.
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.
DINode(LLVMContext &C, unsigned ID, StorageType Storage, unsigned Tag, ArrayRef< Metadata * > Ops1, ArrayRef< Metadata * > Ops2={})
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
uint32_t getNumExtraInhabitants() const
bool isLValueReference() const
bool isStaticMember() const
TempDIType cloneWithFlags(DIFlags NewFlags) const
Returns a new temporary DIType with updated Flags.
bool isObjcClassComplete() const
MDString * getRawName() const
DIType(LLVMContext &C, unsigned ID, StorageType Storage, unsigned Tag, unsigned Line, uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits, uint32_t NumExtraInhabitants, DIFlags Flags, ArrayRef< Metadata * > Ops)
bool isAppleBlockExtension() const
uint64_t getOffsetInBits() const
bool isObjectPointer() const
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 mutate(unsigned Tag, unsigned Line, uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits, uint32_t NumExtraInhabitants, DIFlags Flags)
Change fields in place.
void init(unsigned Line, uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits, uint32_t NumExtraInhabitants, 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.
A parsed version of the target data layout string in and methods for querying it.
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.
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()
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)
static std::optional< uint32_t > extractDwarfBaseDiscriminator(uint32_t Value)