LLVM: include/llvm/TableGen/Record.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14#ifndef LLVM_TABLEGEN_RECORD_H
15#define LLVM_TABLEGEN_RECORD_H
16
32#include
33#include
34#include
35#include
36#include
37#include
38#include
39#include
40#include
41#include
42
43namespace llvm {
45struct RecordKeeperImpl;
46}
47
56
57
58
59
60
62public:
63
73
74private:
75 RecTyKind Kind;
76
78
79
80 mutable const ListRecTy *ListTy = nullptr;
81
82public:
85
87
88
90
93 void dump() const;
94
95
96
98
99
100
102
103
105};
106
108 Ty.print(OS);
109 return OS;
110}
111
112
113class BitRecTy : public RecTy {
115
117
118public:
122
124
125 std::string getAsString() const override { return "bit"; }
126
128};
129
130
131class BitsRecTy : public RecTy {
132 unsigned Size;
133
134 explicit BitsRecTy(RecordKeeper &RK, unsigned Sz)
136
137public:
141
143
145
146 std::string getAsString() const override;
147
149};
150
151
152class IntRecTy : public RecTy {
154
156
157public:
161
163
164 std::string getAsString() const override { return "int"; }
165
167};
168
169
170class StringRecTy : public RecTy {
172
174
175public:
179
181
182 std::string getAsString() const override;
183
185};
186
187
188
189class ListRecTy : public RecTy {
191
192 const RecTy *ElementTy;
193
194 explicit ListRecTy(const RecTy *T)
196
197public:
201
202 static const ListRecTy *get(const RecTy *T) { return T->getListTy(); }
204
205 std::string getAsString() const override;
206
208
210};
211
212
213class DagRecTy : public RecTy {
215
217
218public:
222
224
225 std::string getAsString() const override;
226};
227
228
229
230
231
232class RecordRecTy final : public RecTy,
234 private TrailingObjects<RecordRecTy, const Record *> {
235 friend TrailingObjects;
238
239 unsigned NumClasses;
240
242
243public:
245 RecordRecTy &operator=(const RecordRecTy &) = delete;
246
247
248 void operator delete(void *Ptr) { ::operator delete(Ptr); }
249
253
254
258
260
264
266
269
270 std::string getAsString() const override;
271
274
276};
277
278
279
280const RecTy *resolveTypes(const RecTy *T1, const RecTy *T2);
281
282
283
284
285
287protected:
288
289
290
291
292
293
294
295
296
297
298
299
300
330
331private:
333
334protected:
336
337private:
338 virtual void anchor();
339
340public:
341
343
344
346
347protected:
349
350public:
354
355
357
358
359
360 virtual bool isConcrete() const { return false; }
361
362
364
365
367
368
369
371
372
373
374 void dump() const;
375
376
377
378
380
381
382
383
385
386
387
388
389
390 virtual const Init *
392 return nullptr;
393 }
394
395
396
397
399 return nullptr;
400 }
401
402
403
404
405
407
408
409 virtual const Init *getBit(unsigned Bit) const = 0;
410};
411
413 I.print(OS); return OS;
414}
415
416
417
419 const RecTy *ValueTy;
420
421protected:
424
425public:
428
433
434
436
437
439
442
445
446
447
448
450};
451
452
453class UnsetInit final : public Init {
455
456
458
460
461public:
463 UnsetInit &operator=(const UnsetInit &) = delete;
464
468
469
471
472
474
477
478 const Init *getBit(unsigned Bit) const override { return this; }
479
480
481 bool isComplete() const override { return false; }
482
483 bool isConcrete() const override { return true; }
484
485
486 std::string getAsString() const override { return "?"; }
487};
488
489
490using ArgAuxType = std::variant<unsigned, const Init *>;
492public:
497
498private:
501
502protected:
505
506public:
509
511
513
515
518
522 return std::get(Aux);
523 }
526 return std::get(Aux);
527 }
529 return get(Value, Aux);
530 }
531
533
537 return utostr(getIndex()) + ": " + Value->getAsString();
541 return "";
542 }
543
544 bool isComplete() const override { return false; }
545 bool isConcrete() const override { return false; }
546 const Init *getBit(unsigned Bit) const override { return Value->getBit(Bit); }
553};
554
555
558
559 bool Value;
560
561 explicit BitInit(bool V, const RecTy *T)
563
564public:
567
571
573
575
577
578 const Init *getBit(unsigned Bit) const override {
579 assert(Bit < 1 && "Bit index out of range!");
580 return this;
581 }
582
583 bool isConcrete() const override { return true; }
584 std::string getAsString() const override { return Value ? "1" : "0"; }
585};
586
587
588
591 private TrailingObjects<BitsInit, const Init *> {
592 friend TrailingObjects;
593 unsigned NumBits;
594
596
597public:
599 BitsInit &operator=(const BitsInit &) = delete;
600
601
602 void operator delete(void *Ptr) { ::operator delete(Ptr); }
603
607
609
611
613
618
619
621
625 std::string getAsString() const override;
626
628
630
632};
633
634
636 int64_t Value;
637
638 explicit IntInit(RecordKeeper &RK, int64_t V)
640
641public:
643 IntInit &operator=(const IntInit &) = delete;
644
648
650
651 int64_t getValue() const { return Value; }
652
656
657 bool isConcrete() const override { return true; }
658 std::string getAsString() const override;
659
663};
664
665
666class AnonymousNameInit final : public TypedInit {
667 unsigned Value;
668
669 explicit AnonymousNameInit(RecordKeeper &RK, unsigned V)
671
672public:
674 AnonymousNameInit &operator=(const AnonymousNameInit &) = delete;
675
679
681
682 unsigned getValue() const { return Value; }
683
685
686 std::string getAsString() const override;
687
689
693};
694
695
697public:
702
703private:
706
709
710public:
712 StringInit &operator=(const StringInit &) = delete;
713
717
720
724
728
730
731 bool isConcrete() const override { return true; }
732
735 return "\"" + Value.str() + "\"";
736 else
737 return "[{" + Value.str() + "}]";
738 }
739
741
745};
746
747
748
751 private TrailingObjects<ListInit, const Init *> {
752 friend TrailingObjects;
753 unsigned NumElements;
754
755public:
757
758private:
760
761public:
763 ListInit &operator=(const ListInit &) = delete;
764
765
766 void operator delete(void *Ptr) { ::operator delete(Ptr); }
767
772
774
778
779 LLVM_DEPRECATED("Use getElements instead", "getElements")
781
783
787
789
791
792
793
794
795
796
798
801 std::string getAsString() const override;
802
805
806 size_t size() const { return NumElements; }
807 bool empty() const { return NumElements == 0; }
808
812};
813
814
815
817protected:
820
821public:
824
829
830 const Init *getBit(unsigned Bit) const final;
831};
832
833
834
836public:
853
854private:
856
859
860public:
862 UnOpInit &operator=(const UnOpInit &) = delete;
863
867
869
871
874
875
876
877 const Init *Fold(const Record *CurRec, bool IsFinal = false) const;
878
880
881 std::string getAsString() const override;
882};
883
884
886public:
919
920private:
922
925
926public:
928 BinOpInit &operator=(const BinOpInit &) = delete;
929
933
938
940
944
947
948
949
951
953
954 std::string getAsString() const override;
955};
956
957
959public:
972
973private:
975
979
980public:
982 TernOpInit &operator=(const TernOpInit &) = delete;
983
987
990
992
997
998
999
1001
1003 return LHS->isComplete() && MHS->isComplete() && RHS->isComplete();
1004 }
1005
1007
1008 std::string getAsString() const override;
1009};
1010
1011
1012
1013
1016 private TrailingObjects<CondOpInit, const Init *> {
1017 friend TrailingObjects;
1018 unsigned NumConds;
1019 const RecTy *ValType;
1020
1023
1024public:
1026 CondOpInit &operator=(const CondOpInit &) = delete;
1027
1031
1035
1037
1039
1041
1043
1045
1049
1053
1055
1057
1059
1062 std::string getAsString() const override;
1063
1066
1069
1070 inline size_t case_size () const { return NumConds; }
1071 inline bool case_empty() const { return NumConds == 0; }
1072
1075
1076 inline size_t val_size () const { return NumConds; }
1077 inline bool val_empty() const { return NumConds == 0; }
1078
1079 const Init *getBit(unsigned Bit) const override;
1080};
1081
1082
1084private:
1085 const Init *Start, *List, *A, *B, *Expr;
1086
1087 FoldOpInit(const Init *Start, const Init *List, const Init *A, const Init *B,
1090 Expr(Expr) {}
1091
1092public:
1094 FoldOpInit &operator=(const FoldOpInit &) = delete;
1095
1097
1101
1103
1104
1105
1107
1109
1111
1112 const Init *getBit(unsigned Bit) const override;
1113
1114 std::string getAsString() const override;
1115};
1116
1117
1119private:
1120 const RecTy *CheckType;
1121 const Init *Expr;
1122
1123 IsAOpInit(const RecTy *CheckType, const Init *Expr)
1125 CheckType(CheckType), Expr(Expr) {}
1126
1127public:
1129 IsAOpInit &operator=(const IsAOpInit &) = delete;
1130
1132
1134
1136
1137
1138
1140
1142
1144
1145 const Init *getBit(unsigned Bit) const override;
1146
1147 std::string getAsString() const override;
1148};
1149
1150
1151
1153private:
1154 const RecTy *CheckType;
1155 const Init *Expr;
1156
1157 ExistsOpInit(const RecTy *CheckType, const Init *Expr)
1159 CheckType(CheckType), Expr(Expr) {}
1160
1161public:
1163 ExistsOpInit &operator=(const ExistsOpInit &) = delete;
1164
1166
1168
1170
1171
1172
1173 const Init *Fold(const Record *CurRec, bool IsFinal = false) const;
1174
1176
1178
1179 const Init *getBit(unsigned Bit) const override;
1180
1181 std::string getAsString() const override;
1182};
1183
1184
1185
1186
1188private:
1189 const RecTy *Type;
1190 const Init *Regex;
1191
1192 InstancesOpInit(const RecTy *Type, const Init *Regex)
1194 Regex(Regex) {}
1195
1196public:
1198 InstancesOpInit &operator=(const InstancesOpInit &) = delete;
1199
1203
1205
1207
1208 const Init *Fold(const Record *CurRec, bool IsFinal = false) const;
1209
1211
1213
1214 const Init *getBit(unsigned Bit) const override;
1215
1216 std::string getAsString() const override;
1217};
1218
1219
1221 const Init *VarName;
1222
1223 explicit VarInit(const Init *VN, const RecTy *T)
1225
1226public:
1229
1233
1236
1239
1243
1244
1245
1246
1247
1248
1250
1251 const Init *getBit(unsigned Bit) const override;
1252
1254};
1255
1256
1259 unsigned Bit;
1260
1261 VarBitInit(const TypedInit *T, unsigned B)
1263 Bit(B) {
1268 "Illegal VarBitInit expression!");
1269 }
1270
1271public:
1273 VarBitInit &operator=(const VarBitInit &) = delete;
1274
1278
1280
1283
1284 std::string getAsString() const override;
1286
1288 assert(B < 1 && "Bit index out of range!");
1289 return this;
1290 }
1291};
1292
1293
1296
1298
1299 explicit DefInit(const Record *D);
1300
1301public:
1304
1308
1310
1312
1314
1316 std::string getAsString() const override;
1317
1321};
1322
1323
1324
1325class VarDefInit final
1328 private TrailingObjects<VarDefInit, const ArgumentInit *> {
1329 friend TrailingObjects;
1331 const Record *Class;
1332 const DefInit *Def = nullptr;
1333 unsigned NumArgs;
1334
1335 explicit VarDefInit(SMLoc Loc, const Record *Class,
1337
1338 const DefInit *instantiate();
1339
1340public:
1342 VarDefInit &operator=(const VarDefInit &) = delete;
1343
1344
1345 void operator delete(void *Ptr) { ::operator delete(Ptr); }
1346
1352
1354
1357
1358 std::string getAsString() const override;
1359
1361
1363
1366
1369
1373
1377};
1378
1379
1381 const Init *Rec;
1382 const StringInit *FieldName;
1383
1386#ifndef NDEBUG
1388 llvm::errs() << "In Record = " << Rec->getAsString()
1389 << ", got FieldName = " << *FieldName
1390 << " with non-record type!\n";
1392 }
1393#endif
1394 }
1395
1396public:
1398 FieldInit &operator=(const FieldInit &) = delete;
1399
1403
1405
1408
1409 const Init *getBit(unsigned Bit) const override;
1410
1413
1416 return Rec->getAsString() + "." + FieldName->getValue().str();
1417 }
1418};
1419
1420
1421
1422
1423class DagInit final
1426 private TrailingObjects<DagInit, const Init *, const StringInit *> {
1427 friend TrailingObjects;
1428
1429 const Init *Val;
1431 unsigned NumArgs;
1432
1435
1436 size_t numTrailingObjects(OverloadToken<const Init *>) const {
1437 return NumArgs;
1438 }
1439
1440public:
1443
1447
1451
1454 return DagInit::get(V, nullptr, Args, ArgNames);
1455 }
1456
1459 ArrayRef<std::pair<const Init *, const StringInit *>> ArgAndNames);
1460
1463 ArrayRef<std::pair<const Init *, const StringInit *>> ArgAndNames) {
1464 return DagInit::get(V, nullptr, ArgAndNames);
1465 }
1466
1468
1471
1473
1475 return ValName ? ValName->getValue() : StringRef();
1476 }
1477
1479
1481
1482
1483
1485
1489
1494
1498
1502
1503
1506 using EltTy = decltype(*adl_begin(Zip));
1508 return std::make_pair(std::get<0>(E), std::get<1>(E));
1509 });
1510 }
1511
1513
1515 std::string getAsString() const override;
1516
1520
1523
1524 inline size_t arg_size () const { return NumArgs; }
1525 inline bool arg_empty() const { return NumArgs == 0; }
1526
1529
1533};
1534
1535
1536
1537
1538
1539
1540
1543
1544public:
1550
1551private:
1552 const Init *Name;
1556 bool IsUsed = false;
1557
1558
1560
1561public:
1564
1565
1567
1568
1570
1571
1573
1574
1578
1579
1581
1582
1586
1587
1591
1592
1593 const RecTy *getType() const { return TyAndKind.getPointer(); }
1594
1595
1597
1598
1600
1601
1603
1604
1606
1607
1609
1610
1612
1613
1614
1615 void setUsed(bool Used) { IsUsed = Used; }
1616 bool isUsed() const { return IsUsed; }
1617
1618 void dump() const;
1619
1620
1622};
1623
1625 RV.print(OS << " ");
1626 return OS;
1627}
1628
1630public:
1641
1650
1652
1653private:
1654 const Init *Name;
1655
1656
1657
1665
1666
1667
1669
1670
1672
1673
1674 mutable DefInit *CorrespondingDefInit = nullptr;
1675
1676
1677 unsigned ID;
1678
1679 RecordKind Kind;
1680
1681 void checkName();
1682
1683public:
1684
1687 : Name(N), Locs(locs), TrackedRecords(records),
1688 ID(getNewUID(N->getRecordKeeper())), Kind(Kind) {
1689 checkName();
1690 }
1691
1695
1696
1697
1698
1700 : Name(O.Name), Locs(O.Locs), TemplateArgs(O.TemplateArgs),
1701 Values(O.Values), Assertions(O.Assertions),
1702 DirectSuperClasses(O.DirectSuperClasses),
1704 Kind(O.Kind) {}
1705
1707
1708 unsigned getID() const { return ID; }
1709
1711
1713
1717
1718 void setName(const Init *Name);
1719
1722
1724 return ForwardDeclarationLocs;
1725 }
1726
1727
1729
1730
1732
1733
1735
1736
1738
1739
1741
1743
1745
1747
1749
1751
1754
1755
1758 SC->getSuperClasses(Classes);
1759 Classes.push_back(SC);
1760 }
1761 }
1762
1763
1765 std::vector<const Record *> Classes;
1767 return Classes;
1768 }
1769
1770
1774
1775
1777 return DirectSuperClasses;
1778 }
1779
1783
1785 for (const RecordVal &Val : Values)
1786 if (Val.Name == Name) return &Val;
1787 return nullptr;
1788 }
1789
1793
1796 static_cast<const Record *>(this)->getValue(Name));
1797 }
1798
1801 static_cast<const Record *>(this)->getValue(Name));
1802 }
1803
1806 TemplateArgs.push_back(Name);
1807 }
1808
1811 Values.push_back(RV);
1812 }
1813
1816 Values, [Name](const RecordVal &V) { return V.getNameInit() == Name; });
1817 if (It == Values.end())
1818 llvm_unreachable("Cannot remove an entry that does not exist!");
1819 Values.erase(It);
1820 }
1821
1825
1829
1833
1835 Assertions.append(Rec->Assertions);
1836 }
1837
1839
1843
1846 if (SC == R || SC->isSubClassOf(R))
1847 return true;
1848 }
1849 return false;
1850 }
1851
1855 if (SI->getValue() == Name)
1856 return true;
1857 } else if (SC->getNameInitAsString() == Name) {
1858 return true;
1859 }
1860 if (SC->isSubClassOf(Name))
1861 return true;
1862 }
1863 return false;
1864 }
1865
1867 assert(!CorrespondingDefInit &&
1868 "changing type of record after it has been referenced");
1870 DirectSuperClasses.emplace_back(R, Range);
1871 }
1872
1873
1874
1875
1876
1877
1879
1880
1881
1882
1883
1884
1886
1888 return TrackedRecords;
1889 }
1890
1891 void dump() const;
1892
1893
1894
1895
1896
1897
1899
1900
1901
1903
1904
1908
1909
1910
1911
1913
1914
1915
1916
1918
1919
1920
1921
1923
1924
1925
1926
1928
1929
1930
1931
1933
1934
1935
1936
1938
1939
1940
1941
1943
1944
1945
1946
1948
1949
1950
1951
1952
1954
1955
1956
1957
1959
1960
1961
1963
1964
1965
1966
1968
1969
1970
1971
1973};
1974
1975raw_ostream &operator<<(raw_ostream &OS, const Record &R);
1976
1978 using RecordMap = std::map<std::string, std::unique_ptr, std::less<>>;
1979 using GlobalMap = std::map<std::string, const Init *, std::less<>>;
1980
1981public:
1984
1985
1987
1988
1990
1991
1992 const RecordMap &getClasses() const { return Classes; }
1993
1994
1995 const RecordMap &getDefs() const { return Defs; }
1996
1997
1998 const GlobalMap &getGlobals() const { return ExtraGlobals; }
1999
2000
2002 auto I = Classes.find(Name);
2003 return I == Classes.end() ? nullptr : I->second.get();
2004 }
2005
2006
2008 auto I = Defs.find(Name);
2009 return I == Defs.end() ? nullptr : I->second.get();
2010 }
2011
2012
2015 return R->getDefInit();
2016 auto It = ExtraGlobals.find(Name);
2017 return It == ExtraGlobals.end() ? nullptr : It->second;
2018 }
2019
2021 InputFilename = std::move(Filename);
2022 }
2023
2025 bool Ins =
2026 Classes.try_emplace(std::string(R->getName()), std::move(R)).second;
2027 (void)Ins;
2028 assert(Ins && "Class already exists");
2029 }
2030
2031 void addDef(std::unique_ptr R) {
2032 bool Ins = Defs.try_emplace(std::string(R->getName()), std::move(R)).second;
2033 (void)Ins;
2034 assert(Ins && "Record already exists");
2035
2036 if (!Cache.empty())
2037 Cache.clear();
2038 }
2039
2041 bool Ins = ExtraGlobals.try_emplace(std::string(Name), I).second;
2042 (void)Ins;
2044 assert(Ins && "Global already exists");
2045 }
2046
2048
2050
2051
2052
2053
2054
2055
2057
2058
2059
2060 std::vector<const Record *>
2062
2063
2064
2067
2068 void dump() const;
2069
2071
2072private:
2077
2079 RecordMap Classes, Defs;
2080 mutable std::map<std::string, std::vector<const Record *>> Cache;
2081 GlobalMap ExtraGlobals;
2082
2083
2084 std::unique_ptrdetail::RecordKeeperImpl Impl;
2085 std::unique_ptr Timer;
2086};
2087
2088
2094
2095
2096
2097
2098
2101 return LHS->getID() < RHS->getID();
2102 }
2103};
2104
2105
2111
2115
2117 if (Rec.empty())
2118 return;
2119
2120 size_t Len = 0;
2121 const char *Start = Rec.data();
2122 const char *Curr = Start;
2123 bool IsDigitPart = isDigit(Curr[0]);
2124 for (size_t I = 0, E = Rec.size(); I != E; ++I, ++Len) {
2125 bool IsDigit = isDigit(Curr[I]);
2126 if (IsDigit != IsDigitPart) {
2127 Parts.emplace_back(IsDigitPart, StringRef(Start, Len));
2128 Len = 0;
2129 Start = &Curr[I];
2130 IsDigitPart = isDigit(Curr[I]);
2131 }
2132 }
2133
2134 Parts.emplace_back(IsDigitPart, StringRef(Start, Len));
2135 }
2136
2138
2139 std::pair<bool, StringRef> getPart(size_t Idx) { return Parts[Idx]; }
2140 };
2141
2143 int64_t LHSPositionOrder = Rec1->getValueAsInt("PositionOrder");
2144 int64_t RHSPositionOrder = Rec2->getValueAsInt("PositionOrder");
2145 if (LHSPositionOrder != RHSPositionOrder)
2146 return LHSPositionOrder < RHSPositionOrder;
2147
2150
2151 size_t LHSNumParts = LHSParts.size();
2152 size_t RHSNumParts = RHSParts.size();
2153 assert (LHSNumParts && RHSNumParts && "Expected at least one part!");
2154
2155 if (LHSNumParts != RHSNumParts)
2156 return LHSNumParts < RHSNumParts;
2157
2158
2159 for (size_t I = 0, E = LHSNumParts; I < E; I+=2) {
2160 std::pair<bool, StringRef> LHSPart = LHSParts.getPart(I);
2161 std::pair<bool, StringRef> RHSPart = RHSParts.getPart(I);
2162
2163 assert (LHSPart.first == false && RHSPart.first == false &&
2164 "Expected both parts to be alpha.");
2165 if (int Res = LHSPart.second.compare(RHSPart.second))
2166 return Res < 0;
2167 }
2168 for (size_t I = 1, E = LHSNumParts; I < E; I+=2) {
2169 std::pair<bool, StringRef> LHSPart = LHSParts.getPart(I);
2170 std::pair<bool, StringRef> RHSPart = RHSParts.getPart(I);
2171
2172 assert (LHSPart.first == true && RHSPart.first == true &&
2173 "Expected both parts to be numeric.");
2174 if (LHSPart.second.size() != RHSPart.second.size())
2175 return LHSPart.second.size() < RHSPart.second.size();
2176
2177 unsigned LHSVal, RHSVal;
2178
2179 bool LHSFailed = LHSPart.second.getAsInteger(10, LHSVal); (void)LHSFailed;
2180 assert(!LHSFailed && "Unable to convert LHS to integer.");
2181 bool RHSFailed = RHSPart.second.getAsInteger(10, RHSVal); (void)RHSFailed;
2182 assert(!RHSFailed && "Unable to convert RHS to integer.");
2183
2184 if (LHSVal != RHSVal)
2185 return LHSVal < RHSVal;
2186 }
2187 return LHSNumParts < RHSNumParts;
2188 }
2189};
2190
2191raw_ostream &operator<<(raw_ostream &OS, const RecordKeeper &RK);
2192
2193
2194
2195
2196
2197
2198
2200 const Record *CurRec;
2201 bool IsFinal = false;
2202
2203public:
2206
2208
2209
2210
2212
2213
2214
2215
2217
2218
2219
2220
2221 bool isFinal() const { return IsFinal; }
2222
2223 void setFinal(bool Final) { IsFinal = Final; }
2224};
2225
2226
2228 struct MappedValue {
2229 const Init *V;
2230 bool Resolved;
2231
2232 MappedValue() : V(nullptr), Resolved(false) {}
2233 MappedValue(const Init *V, bool Resolved) : V(V), Resolved(Resolved) {}
2234 };
2235
2237
2238public:
2240
2242
2244 auto It = Map.find(VarName);
2245 assert(It != Map.end() && "key must be present in map");
2246 return It->second.V->isComplete();
2247 }
2248
2250};
2251
2252
2256 const Init *Name = nullptr;
2257
2258public:
2260
2262
2264
2266};
2267
2268
2272
2273public:
2278
2280
2282 if (Shadowed.count(VarName))
2283 return nullptr;
2284 return R.resolve(VarName);
2285 }
2286};
2287
2288
2289
2292 bool FoundUnresolved = false;
2293
2294public:
2297
2299
2301};
2302
2303
2304
2306 const Init *VarNameToTrack;
2307 bool Found = false;
2308
2309public:
2311 : Resolver(nullptr), VarNameToTrack(VarNameToTrack) {}
2312
2313 bool found() const { return Found; }
2314
2316};
2317
2319void EmitJSON(const RecordKeeper &RK, raw_ostream &OS);
2320
2321}
2322
2323#endif
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
#define LLVM_DEPRECATED(MSG, FIX)
This file defines the DenseMap class.
This file defines the DenseSet and SmallDenseSet classes.
This file defines a hash set that can be used to remove duplication of nodes in a graph.
static cl::opt< std::string > InputFilename(cl::Positional, cl::desc(""), cl::init("-"))
ConstantRange Range(APInt(BitWidth, Low), APInt(BitWidth, High))
This file defines the PointerIntPair class.
This file defines the SmallVector class.
This header defines support for implementing classes that have some trailing object (or arrays of obj...
"anonymous_n" - Represent an anonymous record name
Definition Record.h:666
unsigned getValue() const
Definition Record.h:682
const Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
Definition Record.h:690
static AnonymousNameInit * get(RecordKeeper &RK, unsigned)
const StringInit * getNameInit() const
AnonymousNameInit(const AnonymousNameInit &)=delete
static bool classof(const Init *I)
Definition Record.h:676
const Init * resolveReferences(Resolver &R) const override
This function is used by classes that refer to other variables which may not be defined at the time t...
std::string getAsString() const override
Convert this value to a literal form.
AnonymousNameInit & operator=(const AnonymousNameInit &)=delete
static bool classof(const Init *I)
Definition Record.h:510
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations?
Definition Record.h:545
const Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
Definition Record.h:546
const ArgumentInit * cloneWithValue(const Init *Value) const
Definition Record.h:528
bool isNamed() const
Definition Record.h:517
const Init * convertInitializerTo(const RecTy *Ty) const override
Convert to a value whose type is Ty, or return null if this is not possible.
Definition Record.h:550
bool isPositional() const
Definition Record.h:516
ArgumentInit(const ArgumentInit &)=delete
static const ArgumentInit * get(const Init *Value, ArgAuxType Aux)
const Init * getCastTo(const RecTy *Ty) const override
If this value is convertible to type Ty, return a value whose type is Ty, generating a !...
Definition Record.h:547
const Init * getName() const
Definition Record.h:524
ArgumentInit & operator=(const ArgumentInit &)=delete
ArgumentInit(const Init *Value, ArgAuxType Aux)
Definition Record.h:503
RecordKeeper & getRecordKeeper() const
Definition Record.h:512
const Init * getValue() const
Definition Record.h:519
bool isComplete() const override
Is this a complete value with no unset (uninitialized) subvalues?
Definition Record.h:544
unsigned getIndex() const
Definition Record.h:520
Kind
Definition Record.h:493
@ Named
Definition Record.h:495
@ Positional
Definition Record.h:494
const Init * resolveReferences(Resolver &R) const override
This function is used by classes that refer to other variables which may not be defined at the time t...
std::string getAsString() const override
Convert this value to a literal form.
Definition Record.h:535
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
!op (X, Y) - Combine two inits.
Definition Record.h:885
static const BinOpInit * get(BinaryOp opc, const Init *lhs, const Init *rhs, const RecTy *Type)
BinaryOp
Definition Record.h:887
@ MUL
Definition Record.h:890
@ GETDAGARG
Definition Record.h:914
@ GETDAGNAME
Definition Record.h:915
@ LISTSPLAT
Definition Record.h:899
@ OR
Definition Record.h:893
@ SHL
Definition Record.h:895
@ LISTELEM
Definition Record.h:901
@ SUB
Definition Record.h:889
@ LT
Definition Record.h:911
@ AND
Definition Record.h:892
@ LE
Definition Record.h:910
@ LISTCONCAT
Definition Record.h:898
@ LISTREMOVE
Definition Record.h:900
@ STRCONCAT
Definition Record.h:904
@ ADD
Definition Record.h:888
@ SETDAGOP
Definition Record.h:916
@ RANGEC
Definition Record.h:903
@ XOR
Definition Record.h:894
@ SRA
Definition Record.h:896
@ LISTSLICE
Definition Record.h:902
@ MATCH
Definition Record.h:907
@ EQ
Definition Record.h:908
@ DIV
Definition Record.h:891
@ GE
Definition Record.h:912
@ SETDAGOPNAME
Definition Record.h:917
@ SRL
Definition Record.h:897
@ CONCAT
Definition Record.h:906
@ GT
Definition Record.h:913
@ NE
Definition Record.h:909
@ INTERLEAVE
Definition Record.h:905
const Init * resolveReferences(Resolver &R) const override
This function is used by classes that refer to other variables which may not be defined at the time t...
static const Init * getStrConcat(const Init *lhs, const Init *rhs)
std::string getAsString() const override
Convert this value to a literal form.
BinaryOp getOpcode() const
Definition Record.h:941
BinOpInit & operator=(const BinOpInit &)=delete
const Init * getRHS() const
Definition Record.h:943
std::optional< bool > CompareInit(unsigned Opc, const Init *LHS, const Init *RHS) const
const Init * getLHS() const
Definition Record.h:942
static bool classof(const Init *I)
Definition Record.h:930
static const Init * getListConcat(const TypedInit *lhs, const Init *rhs)
BinOpInit(const BinOpInit &)=delete
const Init * Fold(const Record *CurRec) const
'true'/'false' - Represent a concrete initializer for a bit.
Definition Record.h:556
BitInit(const BitInit &)=delete
static BitInit * get(RecordKeeper &RK, bool V)
std::string getAsString() const override
Convert this value to a literal form.
Definition Record.h:584
BitInit & operator=(BitInit &)=delete
const Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
Definition Record.h:578
bool getValue() const
Definition Record.h:574
static bool classof(const Init *I)
Definition Record.h:568
const Init * convertInitializerTo(const RecTy *Ty) const override
Convert to a value whose type is Ty, or return null if this is not possible.
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations?
Definition Record.h:583
'bit' - Represent a single bit
Definition Record.h:113
static const BitRecTy * get(RecordKeeper &RK)
static bool classof(const RecTy *RT)
Definition Record.h:119
std::string getAsString() const override
Definition Record.h:125
bool typeIsConvertibleTo(const RecTy *RHS) const override
Return true if all values of 'this' type can be converted to the specified type.
'{ a, b, c }' - Represents an initializer for a BitsRecTy value.
Definition Record.h:591
std::string getAsString() const override
Convert this value to a literal form.
static bool classof(const Init *I)
Definition Record.h:604
bool isComplete() const override
Is this a complete value with no unset (uninitialized) subvalues?
unsigned getNumBits() const
Definition Record.h:612
std::optional< int64_t > convertInitializerToInt() const
BitsInit & operator=(const BitsInit &)=delete
const Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
Definition Record.h:631
const Init * convertInitializerBitRange(ArrayRef< unsigned > Bits) const override
This function is used to implement the bit range selection operator.
const Init * resolveReferences(Resolver &R) const override
This function is used by classes that refer to other variables which may not be defined at the time t...
const Init * convertInitializerTo(const RecTy *Ty) const override
Convert to a value whose type is Ty, or return null if this is not possible.
ArrayRef< const Init * > getBits() const
Definition Record.h:629
uint64_t convertKnownBitsToInt() const
bool allInComplete() const
static BitsInit * get(RecordKeeper &RK, ArrayRef< const Init * > Range)
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations?
BitsInit(const BitsInit &)=delete
'bits' - Represent a fixed number of bits
Definition Record.h:131
bool typeIsConvertibleTo(const RecTy *RHS) const override
Return true if all values of 'this' type can be converted to the specified type.
unsigned getNumBits() const
Definition Record.h:144
static bool classof(const RecTy *RT)
Definition Record.h:138
static const BitsRecTy * get(RecordKeeper &RK, unsigned Sz)
std::string getAsString() const override
!cond(condition_1: value1, ... , condition_n: value) Selects the first value for which condition is t...
Definition Record.h:1016
CondOpInit & operator=(const CondOpInit &)=delete
SmallVectorImpl< const Init * >::const_iterator const_case_iterator
Definition Record.h:1064
const Init * Fold(const Record *CurRec) const
SmallVectorImpl< const Init * >::const_iterator const_val_iterator
Definition Record.h:1065
auto getCondAndVals() const
Definition Record.h:1054
const_val_iterator name_end() const
Definition Record.h:1074
bool case_empty() const
Definition Record.h:1071
const_case_iterator arg_end() const
Definition Record.h:1068
size_t case_size() const
Definition Record.h:1070
ArrayRef< const Init * > getVals() const
Definition Record.h:1050
CondOpInit(const CondOpInit &)=delete
const Init * resolveReferences(Resolver &R) const override
This function is used by classes that refer to other variables which may not be defined at the time t...
size_t val_size() const
Definition Record.h:1076
const Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
const Init * getCond(unsigned Num) const
Definition Record.h:1042
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations?
const_val_iterator name_begin() const
Definition Record.h:1073
std::string getAsString() const override
Convert this value to a literal form.
static const CondOpInit * get(ArrayRef< const Init * > Conds, ArrayRef< const Init * > Values, const RecTy *Type)
unsigned getNumConds() const
Definition Record.h:1040
bool val_empty() const
Definition Record.h:1077
const RecTy * getValType() const
Definition Record.h:1038
bool isComplete() const override
Is this a complete value with no unset (uninitialized) subvalues?
static bool classof(const Init *I)
Definition Record.h:1028
const Init * getVal(unsigned Num) const
Definition Record.h:1044
const_case_iterator arg_begin() const
Definition Record.h:1067
ArrayRef< const Init * > getConds() const
Definition Record.h:1046
(v a, b) - Represent a DAG tree value.
Definition Record.h:1426
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations?
static const DagInit * get(const Init *V, ArrayRef< std::pair< const Init *, const StringInit * > > ArgAndNames)
Definition Record.h:1462
unsigned getNumArgs() const
Definition Record.h:1478
const StringInit * getArgName(unsigned Num) const
Definition Record.h:1486
std::optional< unsigned > getArgNo(StringRef Name) const
This method looks up the specified argument name and returns its argument number or std::nullopt if t...
DagInit(const DagInit &)=delete
StringRef getArgNameStr(unsigned Num) const
Definition Record.h:1490
const_arg_iterator arg_begin() const
Definition Record.h:1521
const_arg_iterator arg_end() const
Definition Record.h:1522
const StringInit * getName() const
Definition Record.h:1472
const Init * getOperator() const
Definition Record.h:1469
SmallVectorImpl< const StringInit * >::const_iterator const_name_iterator
Definition Record.h:1518
SmallVectorImpl< const Init * >::const_iterator const_arg_iterator
Definition Record.h:1517
static bool classof(const Init *I)
Definition Record.h:1444
const Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
Definition Record.h:1530
const Init * resolveReferences(Resolver &R) const override
This function is used by classes that refer to other variables which may not be defined at the time t...
static const DagInit * get(const Init *V, ArrayRef< const Init * > Args, ArrayRef< const StringInit * > ArgNames)
Definition Record.h:1452
ArrayRef< const StringInit * > getArgNames() const
Definition Record.h:1499
const_name_iterator name_end() const
Definition Record.h:1528
static const DagInit * get(const Init *V, const StringInit *VN, ArrayRef< const Init * > Args, ArrayRef< const StringInit * > ArgNames)
const_name_iterator name_begin() const
Definition Record.h:1527
size_t arg_size() const
Definition Record.h:1524
bool arg_empty() const
Definition Record.h:1525
const Record * getOperatorAsDef(ArrayRef< SMLoc > Loc) const
const Init * getArg(unsigned Num) const
Definition Record.h:1480
StringRef getNameStr() const
Definition Record.h:1474
DagInit & operator=(const DagInit &)=delete
auto getArgAndNames() const
Definition Record.h:1504
ArrayRef< const Init * > getArgs() const
Definition Record.h:1495
std::string getAsString() const override
Convert this value to a literal form.
'dag' - Represent a dag fragment
Definition Record.h:213
std::string getAsString() const override
static bool classof(const RecTy *RT)
Definition Record.h:219
static const DagRecTy * get(RecordKeeper &RK)
AL - Represent a reference to a 'def' in the description.
Definition Record.h:1294
DefInit & operator=(const DefInit &)=delete
std::string getAsString() const override
Convert this value to a literal form.
const RecTy * getFieldType(const StringInit *FieldName) const override
This function is used to implement the FieldInit class.
const Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
Definition Record.h:1318
friend class Record
Definition Record.h:1295
const Init * convertInitializerTo(const RecTy *Ty) const override
Convert to a value whose type is Ty, or return null if this is not possible.
DefInit(const DefInit &)=delete
static bool classof(const Init *I)
Definition Record.h:1305
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations?
Definition Record.h:1315
const Record * getDef() const
Definition Record.h:1311
Implements a dense probed hash-table based set.
!exists(expr) - Dynamically determine if a record of type named expr exists.
Definition Record.h:1152
static bool classof(const Init *I)
Definition Record.h:1165
ExistsOpInit(const ExistsOpInit &)=delete
bool isComplete() const override
Is this a complete value with no unset (uninitialized) subvalues?
Definition Record.h:1175
static const ExistsOpInit * get(const RecTy *CheckType, const Init *Expr)
std::string getAsString() const override
Convert this value to a literal form.
ExistsOpInit & operator=(const ExistsOpInit &)=delete
const Init * resolveReferences(Resolver &R) const override
This function is used by classes that refer to other variables which may not be defined at the time t...
const Init * Fold(const Record *CurRec, bool IsFinal=false) const
const Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
X.Y - Represent a reference to a subfield of a variable.
Definition Record.h:1380
static bool classof(const Init *I)
Definition Record.h:1400
std::string getAsString() const override
Convert this value to a literal form.
Definition Record.h:1415
const Init * Fold(const Record *CurRec) const
const StringInit * getFieldName() const
Definition Record.h:1407
const Init * getRecord() const
Definition Record.h:1406
const Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
static const FieldInit * get(const Init *R, const StringInit *FN)
FieldInit & operator=(const FieldInit &)=delete
const Init * resolveReferences(Resolver &R) const override
This function is used by classes that refer to other variables which may not be defined at the time t...
FieldInit(const FieldInit &)=delete
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations?
!foldl (a, b, expr, start, lst) - Fold over a list.
Definition Record.h:1083
const Init * Fold(const Record *CurRec) const
static bool classof(const Init *I)
Definition Record.h:1096
FoldOpInit & operator=(const FoldOpInit &)=delete
std::string getAsString() const override
Convert this value to a literal form.
FoldOpInit(const FoldOpInit &)=delete
static const FoldOpInit * get(const Init *Start, const Init *List, const Init *A, const Init *B, const Init *Expr, const RecTy *Type)
const Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
bool isComplete() const override
Is this a complete value with no unset (uninitialized) subvalues?
Definition Record.h:1108
const Init * resolveReferences(Resolver &R) const override
This function is used by classes that refer to other variables which may not be defined at the time t...
FoldingSetNodeID - This class is used to gather all the unique data bits of a node.
bool found() const
Definition Record.h:2313
HasReferenceResolver(const Init *VarNameToTrack)
Definition Record.h:2310
const Init * resolve(const Init *VarName) override
Return the initializer for the given variable name (should normally be a StringInit),...
virtual const Init * resolveReferences(Resolver &R) const
This function is used by classes that refer to other variables which may not be defined at the time t...
Definition Record.h:406
uint8_t Opc
Definition Record.h:335
virtual const Init * convertInitializerBitRange(ArrayRef< unsigned > Bits) const
This function is used to implement the bit range selection operator.
Definition Record.h:391
virtual std::string getAsUnquotedString() const
Convert this value to a literal form, without adding quotes around a string.
Definition Record.h:370
void dump() const
Debugging method that may be called through a debugger; just invokes print on stderr.
void print(raw_ostream &OS) const
Print this value.
Definition Record.h:363
virtual std::string getAsString() const =0
Convert this value to a literal form.
InitKind
Discriminator enum (for isa<>, dyn_cast<>, et al.)
Definition Record.h:301
@ IK_FoldOpInit
Definition Record.h:317
@ IK_IntInit
Definition Record.h:309
@ IK_LastTypedInit
Definition Record.h:326
@ IK_UnsetInit
Definition Record.h:327
@ IK_DagInit
Definition Record.h:306
@ IK_VarBitInit
Definition Record.h:324
@ IK_ListInit
Definition Record.h:310
@ IK_FirstOpInit
Definition Record.h:311
@ IK_VarDefInit
Definition Record.h:325
@ IK_ArgumentInit
Definition Record.h:328
@ IK_ExistsOpInit
Definition Record.h:319
@ IK_DefInit
Definition Record.h:307
@ IK_BinOpInit
Definition Record.h:312
@ IK_FirstTypedInit
Definition Record.h:303
@ IK_BitInit
Definition Record.h:304
@ IK_BitsInit
Definition Record.h:305
@ IK_UnOpInit
Definition Record.h:314
@ IK_StringInit
Definition Record.h:322
@ IK_IsAOpInit
Definition Record.h:318
@ IK_First
Definition Record.h:302
@ IK_VarInit
Definition Record.h:323
@ IK_LastOpInit
Definition Record.h:315
@ IK_AnonymousNameInit
Definition Record.h:321
@ IK_CondOpInit
Definition Record.h:316
@ IK_FieldInit
Definition Record.h:308
@ IK_TernOpInit
Definition Record.h:313
@ IK_InstancesOpInit
Definition Record.h:320
InitKind getKind() const
Get the kind (type) of the value.
Definition Record.h:342
virtual bool isConcrete() const
Is this a concrete and fully resolved value without any references or stuck operations?
Definition Record.h:360
virtual bool isComplete() const
Is this a complete value with no unset (uninitialized) subvalues?
Definition Record.h:356
virtual const Init * getBit(unsigned Bit) const =0
Get the Init value of the specified bit.
virtual const RecTy * getFieldType(const StringInit *FieldName) const
This function is used to implement the FieldInit class.
Definition Record.h:398
Init(const Init &)=delete
virtual const Init * convertInitializerTo(const RecTy *Ty) const =0
Convert to a value whose type is Ty, or return null if this is not possible.
Init & operator=(const Init &)=delete
virtual const Init * getCastTo(const RecTy *Ty) const =0
If this value is convertible to type Ty, return a value whose type is Ty, generating a !...
RecordKeeper & getRecordKeeper() const
Get the record keeper that initialized this Init.
Init(InitKind K, uint8_t Opc=0)
Definition Record.h:348
!instances([regex]) - Produces a list of records whose type is type.
Definition Record.h:1187
const Init * Fold(const Record *CurRec, bool IsFinal=false) const
const Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
const Init * resolveReferences(Resolver &R) const override
This function is used by classes that refer to other variables which may not be defined at the time t...
std::string getAsString() const override
Convert this value to a literal form.
static bool classof(const Init *I)
Definition Record.h:1200
InstancesOpInit(const InstancesOpInit &)=delete
bool isComplete() const override
Is this a complete value with no unset (uninitialized) subvalues?
Definition Record.h:1210
static const InstancesOpInit * get(const RecTy *Type, const Init *Regex)
InstancesOpInit & operator=(const InstancesOpInit &)=delete
'7' - Represent an initialization by a literal integer value.
Definition Record.h:635
IntInit(const IntInit &)=delete
static IntInit * get(RecordKeeper &RK, int64_t V)
const Init * convertInitializerBitRange(ArrayRef< unsigned > Bits) const override
This function is used to implement the bit range selection operator.
const Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
Definition Record.h:660
static bool classof(const Init *I)
Definition Record.h:645
IntInit & operator=(const IntInit &)=delete
int64_t getValue() const
Definition Record.h:651
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations?
Definition Record.h:657
std::string getAsString() const override
Convert this value to a literal form.
const Init * convertInitializerTo(const RecTy *Ty) const override
Convert to a value whose type is Ty, or return null if this is not possible.
'int' - Represent an integer value of no particular size
Definition Record.h:152
static const IntRecTy * get(RecordKeeper &RK)
bool typeIsConvertibleTo(const RecTy *RHS) const override
Return true if all values of 'this' type can be converted to the specified type.
std::string getAsString() const override
Definition Record.h:164
static bool classof(const RecTy *RT)
Definition Record.h:158
!isa(expr) - Dynamically determine the type of an expression.
Definition Record.h:1118
IsAOpInit(const IsAOpInit &)=delete
IsAOpInit & operator=(const IsAOpInit &)=delete
static bool classof(const Init *I)
Definition Record.h:1131
static const IsAOpInit * get(const RecTy *CheckType, const Init *Expr)
const Init * resolveReferences(Resolver &R) const override
This function is used by classes that refer to other variables which may not be defined at the time t...
bool isComplete() const override
Is this a complete value with no unset (uninitialized) subvalues?
Definition Record.h:1141
std::string getAsString() const override
Convert this value to a literal form.
const Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
const Init * Fold() const
[AL, AH, CL] - Represent a list of defs
Definition Record.h:751
std::string getAsString() const override
Convert this value to a literal form.
ListInit & operator=(const ListInit &)=delete
const RecTy * getElementType() const
Definition Record.h:784
const Init *const * const_iterator
Definition Record.h:756
static const ListInit * get(ArrayRef< const Init * > Range, const RecTy *EltTy)
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations?
ListInit(const ListInit &)=delete
bool isComplete() const override
Is this a complete value with no unset (uninitialized) subvalues?
const Init * resolveReferences(Resolver &R) const override
This method is used by classes that refer to other variables which may not be defined at the time the...
size_t size() const
Definition Record.h:806
const Init * convertInitializerTo(const RecTy *Ty) const override
Convert to a value whose type is Ty, or return null if this is not possible.
ArrayRef< const Init * > getValues() const
Definition Record.h:780
const Record * getElementAsRecord(unsigned Idx) const
const_iterator begin() const
Definition Record.h:803
const_iterator end() const
Definition Record.h:804
ArrayRef< const Init * > getElements() const
Definition Record.h:775
bool empty() const
Definition Record.h:807
const Init * getElement(unsigned Idx) const
Definition Record.h:782
const Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
Definition Record.h:809
static bool classof(const Init *I)
Definition Record.h:768
'list' - Represent a list of element values, all of which must be of the specified type.
Definition Record.h:189
const RecTy * getElementType() const
Definition Record.h:203
static bool classof(const RecTy *RT)
Definition Record.h:198
bool typeIsA(const RecTy *RHS) const override
Return true if 'this' type is equal to or a subtype of RHS.
static const ListRecTy * get(const RecTy *T)
Definition Record.h:202
std::string getAsString() const override
bool typeIsConvertibleTo(const RecTy *RHS) const override
Return true if all values of 'this' type can be converted to the specified type.
void set(const Init *Key, const Init *Value)
Definition Record.h:2241
bool isComplete(Init *VarName) const
Definition Record.h:2243
MapResolver(const Record *CurRec=nullptr)
Definition Record.h:2239
const Init * resolve(const Init *VarName) override
Return the initializer for the given variable name (should normally be a StringInit),...
Base class for operators.
Definition Record.h:816
OpInit & operator=(OpInit &)=delete
static bool classof(const Init *I)
Definition Record.h:825
OpInit(const OpInit &)=delete
const Init * getBit(unsigned Bit) const final
Get the Init value of the specified bit.
OpInit(InitKind K, const RecTy *Type, uint8_t Opc)
Definition Record.h:818
PointerIntPair - This class implements a pair of a pointer and small integer.
RecordKeeper & getRecordKeeper() const
Return the RecordKeeper that uniqued this Type.
Definition Record.h:89
virtual bool typeIsA(const RecTy *RHS) const
Return true if 'this' type is equal to or a subtype of RHS.
virtual bool typeIsConvertibleTo(const RecTy *RHS) const
Return true if all values of 'this' type can be converted to the specified type.
RecTyKind
Subclass discriminator (for dyn_cast<> et al.)
Definition Record.h:64
@ RecordRecTyKind
Definition Record.h:71
@ ListRecTyKind
Definition Record.h:69
@ BitsRecTyKind
Definition Record.h:66
@ DagRecTyKind
Definition Record.h:70
@ IntRecTyKind
Definition Record.h:67
@ StringRecTyKind
Definition Record.h:68
@ BitRecTyKind
Definition Record.h:65
RecTy(RecTyKind K, RecordKeeper &RK)
Definition Record.h:83
virtual std::string getAsString() const =0
RecTyKind getRecTyKind() const
Definition Record.h:86
const ListRecTy * getListTy() const
Returns the type representing list.
void print(raw_ostream &OS) const
Definition Record.h:92
void addDef(std::unique_ptr< Record > R)
Definition Record.h:2031
void addClass(std::unique_ptr< Record > R)
Definition Record.h:2024
TGTimer & getTimer() const
Definition Record.h:2049
const Record * getClass(StringRef Name) const
Get the class with the specified name.
Definition Record.h:2001
const RecordMap & getClasses() const
Get the map of classes.
Definition Record.h:1992
const Init * getNewAnonymousName()
GetNewAnonymousName - Generate a unique anonymous name that can be used as an identifier.
const RecordMap & getDefs() const
Get the map of records (defs).
Definition Record.h:1995
StringRef getInputFilename() const
Get the main TableGen input file's name.
Definition Record.h:1989
detail::RecordKeeperImpl & getImpl()
Return the internal implementation of the RecordKeeper.
Definition Record.h:1986
void saveInputFilename(std::string Filename)
Definition Record.h:2020
const GlobalMap & getGlobals() const
Get the map of global variables.
Definition Record.h:1998
const Init * getGlobal(StringRef Name) const
Get the Init value of the specified global variable.
Definition Record.h:2013
void dumpAllocationStats(raw_ostream &OS) const
ArrayRef< const Record * > getAllDerivedDefinitionsIfDefined(StringRef ClassName) const
Get all the concrete records that inherit from specified class, if the class is defined.
void addExtraGlobal(StringRef Name, const Init *I)
Definition Record.h:2040
const Record * getDef(StringRef Name) const
Get the concrete record with the specified name.
Definition Record.h:2007
ArrayRef< const Record * > getAllDerivedDefinitions(StringRef ClassName) const
Get all the concrete records that inherit from the one specified class.
'[classname]' - Type of record values that have zero or more superclasses.
Definition Record.h:234
bool typeIsConvertibleTo(const RecTy *RHS) const override
Return true if all values of 'this' type can be converted to the specified type.
RecordRecTy & operator=(const RecordRecTy &)=delete
bool isSubClassOf(const Record *Class) const
const Record *const * const_record_iterator
Definition Record.h:265
ArrayRef< const Record * > getClasses() const
Definition Record.h:261
const_record_iterator classes_begin() const
Definition Record.h:267
friend class Record
Definition Record.h:236
const_record_iterator classes_end() const
Definition Record.h:268
std::string getAsString() const override
RecordRecTy(const RecordRecTy &)=delete
bool typeIsA(const RecTy *RHS) const override
Return true if 'this' type is equal to or a subtype of RHS.
static bool classof(const RecTy *RT)
Definition Record.h:250
static const RecordRecTy * get(RecordKeeper &RK, ArrayRef< const Record * > Classes)
Get the record type with the given non-redundant list of superclasses.
bool keepUnsetBits() const override
Definition Record.h:2265
RecordResolver(const Record &R)
Definition Record.h:2259
const Init * resolve(const Init *VarName) override
Return the initializer for the given variable name (should normally be a StringInit),...
void setName(const Init *NewName)
Definition Record.h:2261
This class represents a field in a record, including its name, type, value, and source location.
Definition Record.h:1541
bool isTemplateArg() const
Is this a template argument?
Definition Record.h:1588
std::string getNameInitAsString() const
Get the name of the field as a std::string.
Definition Record.h:1575
void setUsed(bool Used)
Whether this value is used.
Definition Record.h:1615
bool isNonconcreteOK() const
Is this a field where nonconcrete values are okay?
Definition Record.h:1583
bool setValue(const Init *V)
Set the value of the field from an Init.
RecordKeeper & getRecordKeeper() const
Get the record keeper used to unique this value.
Definition Record.h:1566
SMLoc getLoc() const
Get the source location of the point where the field was defined.
Definition Record.h:1580
const Init * getValue() const
Get the value of the field as an Init.
Definition Record.h:1599
bool isUsed() const
Definition Record.h:1616
StringRef getName() const
Get the name of the field as a StringRef.
void addReferenceLoc(SMRange Loc)
Add a reference to this record value.
Definition Record.h:1608
friend class Record
Definition Record.h:1542
void print(raw_ostream &OS, bool PrintSem=true) const
Print the value to an output stream, possibly with a semicolon.
RecordVal(const Init *N, const RecTy *T, FieldKind K)
const Init * getNameInit() const
Get the name of the field as an Init.
Definition Record.h:1572
ArrayRef< SMRange > getReferenceLocs() const
Return the references of this record value.
Definition Record.h:1611
std::string getPrintType() const
Get the type of the field for printing purposes.
FieldKind
Definition Record.h:1545
@ FK_NonconcreteOK
Definition Record.h:1547
@ FK_TemplateArg
Definition Record.h:1548
@ FK_Normal
Definition Record.h:1546
const RecTy * getType() const
Get the type of the field value as a RecTy.
Definition Record.h:1593
std::vector< int64_t > getValueAsListOfInts(StringRef FieldName) const
This method looks up the specified field and returns its value as a vector of integers,...
const RecordRecTy * getType() const
const Init * getValueInit(StringRef FieldName) const
Return the initializer for a value with the specified name, or throw an exception if the field does n...
bool getValueAsBitOrUnset(StringRef FieldName, bool &Unset) const
This method looks up the specified field and returns its value as a bit.
bool getValueAsBit(StringRef FieldName) const
This method looks up the specified field and returns its value as a bit, throwing an exception if the...
unsigned getID() const
Definition Record.h:1708
RecordKind
Definition Record.h:1651
@ RK_Class
Definition Record.h:1651
@ RK_AnonymousDef
Definition Record.h:1651
@ RK_MultiClass
Definition Record.h:1651
@ RK_Def
Definition Record.h:1651
static unsigned getNewUID(RecordKeeper &RK)
ArrayRef< SMLoc > getLoc() const
Definition Record.h:1720
void addDump(SMLoc Loc, const Init *Message)
Definition Record.h:1830
void checkUnusedTemplateArgs()
ArrayRef< DumpInfo > getDumps() const
Definition Record.h:1753
std::vector< const Record * > getValueAsListOfDefs(StringRef FieldName) const
This method looks up the specified field and returns its value as a vector of records,...
bool isAnonymous() const
Definition Record.h:1746
ArrayRef< AssertionInfo > getAssertions() const
Definition Record.h:1752
std::string getNameInitAsString() const
Definition Record.h:1714
void removeValue(StringRef Name)
Definition Record.h:1822
const Record * getValueAsDef(StringRef FieldName) const
This method looks up the specified field and returns its value as a Record, throwing an exception if ...
RecordKeeper & getRecords() const
Definition Record.h:1887
const DagInit * getValueAsDag(StringRef FieldName) const
This method looks up the specified field and returns its value as an Dag, throwing an exception if th...
std::vector< StringRef > getValueAsListOfStrings(StringRef FieldName) const
This method looks up the specified field and returns its value as a vector of strings,...
const RecordVal * getValue(const Init *Name) const
Definition Record.h:1784
void addTemplateArg(const Init *Name)
Definition Record.h:1804
void appendLoc(SMLoc Loc)
Definition Record.h:1721
Record(const Record &O)
Definition Record.h:1699
bool isValueUnset(StringRef FieldName) const
Return true if the named field is unset.
Definition Record.h:1905
std::vector< const Record * > getSuperClasses() const
Return all superclasses in post-order.
Definition Record.h:1764
bool isMultiClass() const
Definition Record.h:1744
bool hasDirectSuperClass(const Record *SuperClass) const
Determine whether this record has the specified direct superclass.
Definition Record.h:1771
void addValue(const RecordVal &RV)
Definition Record.h:1809
const Record * getValueAsOptionalDef(StringRef FieldName) const
This method looks up the specified field and returns its value as a Record, returning null if the fie...
void addAssertion(SMLoc Loc, const Init *Condition, const Init *Message)
Definition Record.h:1826
Record(StringRef N, ArrayRef< SMLoc > locs, RecordKeeper &records, RecordKind Kind=RK_Def)
Definition Record.h:1692
bool isClass() const
Definition Record.h:1742
ArrayRef< std::pair< const Record *, SMRange > > getDirectSuperClasses() const
Return the direct superclasses of this record.
Definition Record.h:1776
StringRef getName() const
Definition Record.h:1710
Record(const Init *N, ArrayRef< SMLoc > locs, RecordKeeper &records, RecordKind Kind=RK_Def)
Definition Record.h:1685
bool isTemplateArg(const Init *Name) const
Definition Record.h:1780
void setName(const Init *Name)
bool isSubClassOf(StringRef Name) const
Definition Record.h:1852
const ListInit * getValueAsListInit(StringRef FieldName) const
This method looks up the specified field and returns its value as a ListInit, throwing an exception i...
void appendDumps(const Record *Rec)
Definition Record.h:1838
bool isSubClassOf(const Record *R) const
Definition Record.h:1844
DefInit * getDefInit() const
get the corresponding DefInit.
ArrayRef< RecordVal > getValues() const
Definition Record.h:1750
SMLoc getFieldLoc(StringRef FieldName) const
Return the source location for the named field.
ArrayRef< SMLoc > getForwardDeclarationLocs() const
Definition Record.h:1723
const RecordVal * getValue(StringRef Name) const
Definition Record.h:1790
void resolveReferences(const Init *NewName=nullptr)
If there are any field references that refer to fields that have been filled in, we can propagate the...
std::optional< StringRef > getValueAsOptionalString(StringRef FieldName) const
This method looks up the specified field and returns its value as a string, throwing an exception if ...
void removeValue(const Init *Name)
Definition Record.h:1814
ArrayRef< const Init * > getTemplateArgs() const
Definition Record.h:1748
ArrayRef< SMRange > getReferenceLocs() const
Return the references of this record value.
Definition Record.h:1731
void updateClassLoc(SMLoc Loc)
RecordVal * getValue(const Init *Name)
Definition Record.h:1794
const BitsInit * getValueAsBitsInit(StringRef FieldName) const
This method looks up the specified field and returns its value as a BitsInit, throwing an exception i...
void addDirectSuperClass(const Record *R, SMRange Range)
Definition Record.h:1866
void appendAssertions(const Record *Rec)
Definition Record.h:1834
const Init * getNameInit() const
Definition Record.h:1712
void getSuperClasses(std::vector< const Record * > &Classes) const
Append all superclasses in post-order to Classes.
Definition Record.h:1756
int64_t getValueAsInt(StringRef FieldName) const
This method looks up the specified field and returns its value as an int64_t, throwing an exception i...
RecordVal * getValue(StringRef Name)
Definition Record.h:1799
void checkRecordAssertions()
void appendReferenceLoc(SMRange Loc) const
Add a reference to this record value.
Definition Record.h:1728
StringRef getValueAsString(StringRef FieldName) const
This method looks up the specified field and returns its value as a string, throwing an exception if ...
Interface for looking up the initializer for a variable name, used by Init::resolveReferences.
Definition Record.h:2199
virtual ~Resolver()=default
bool isFinal() const
Definition Record.h:2221
Resolver(const Record *CurRec)
Definition Record.h:2204
const Record * getCurrentRecord() const
Definition Record.h:2207
void setFinal(bool Final)
Definition Record.h:2223
virtual bool keepUnsetBits() const
Definition Record.h:2216
virtual const Init * resolve(const Init *VarName)=0
Return the initializer for the given variable name (should normally be a StringInit),...
Represents a location in source code.
Represents a range in source code.
ShadowResolver(Resolver &R)
Definition Record.h:2274
const Init * resolve(const Init *VarName) override
Return the initializer for the given variable name (should normally be a StringInit),...
Definition Record.h:2281
void addShadow(const Init *Key)
Definition Record.h:2279
typename SuperClass::const_iterator const_iterator
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
"foo" - Represent an initialization by a string value.
Definition Record.h:696
StringInit(const StringInit &)=delete
StringFormat
Definition Record.h:698
@ SF_Code
Definition Record.h:700
@ SF_String
Definition Record.h:699
std::string getAsString() const override
Convert this value to a literal form.
Definition Record.h:733
StringInit & operator=(const StringInit &)=delete
static const StringInit * get(RecordKeeper &RK, StringRef, StringFormat Fmt=SF_String)
StringFormat getFormat() const
Definition Record.h:726
bool hasCodeFormat() const
Definition Record.h:727
StringRef getValue() const
Definition Record.h:725
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations?
Definition Record.h:731
static StringFormat determineFormat(StringFormat Fmt1, StringFormat Fmt2)
Definition Record.h:721
static bool classof(const Init *I)
Definition Record.h:714
std::string getAsUnquotedString() const override
Convert this value to a literal form, without adding quotes around a string.
Definition Record.h:740
const Init * convertInitializerTo(const RecTy *Ty) const override
Convert to a value whose type is Ty, or return null if this is not possible.
const Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
Definition Record.h:742
'string' - Represent an string value
Definition Record.h:170
static bool classof(const RecTy *RT)
Definition Record.h:176
std::string getAsString() const override
static const StringRecTy * get(RecordKeeper &RK)
bool typeIsConvertibleTo(const RecTy *RHS) const override
Return true if all values of 'this' type can be converted to the specified type.
StringRef - Represent a constant reference to a string, i.e.
constexpr bool empty() const
empty - Check if the string is empty.
constexpr size_t size() const
size - Get the string size.
constexpr const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
LLVM_ABI int compare_numeric(StringRef RHS) const
compare_numeric - Compare two strings, treating sequences of digits as numbers.
!op (X, Y, Z) - Combine two inits.
Definition Record.h:958
TernOpInit(const TernOpInit &)=delete
const Init * Fold(const Record *CurRec) const
const Init * getLHS() const
Definition Record.h:994
bool isComplete() const override
Is this a complete value with no unset (uninitialized) subvalues?
Definition Record.h:1002
static bool classof(const Init *I)
Definition Record.h:984
TernaryOp
Definition Record.h:960
@ FIND
Definition Record.h:968
@ SETDAGARG
Definition Record.h:969
@ SUBST
Definition Record.h:961
@ SETDAGNAME
Definition Record.h:970
@ SUBSTR
Definition Record.h:967
@ FOREACH
Definition Record.h:962
@ RANGE
Definition Record.h:966
@ IF
Definition Record.h:964
@ FILTER
Definition Record.h:963
@ DAG
Definition Record.h:965
const Init * getMHS() const
Definition Record.h:995
const Init * getRHS() const
Definition Record.h:996
static const TernOpInit * get(TernaryOp opc, const Init *lhs, const Init *mhs, const Init *rhs, const RecTy *Type)
std::string getAsString() const override
Convert this value to a literal form.
const Init * resolveReferences(Resolver &R) const override
This function is used by classes that refer to other variables which may not be defined at the time t...
TernOpInit & operator=(const TernOpInit &)=delete
TernaryOp getOpcode() const
Definition Record.h:993
This class is used to track the amount of time spent between invocations of its startTimer()/stopTime...
const Init * resolve(const Init *VarName) override
Return the initializer for the given variable name (should normally be a StringInit),...
bool foundUnresolved() const
Definition Record.h:2298
TrackUnresolvedResolver(Resolver *R=nullptr)
Definition Record.h:2295
const T * getTrailingObjects() const
The instances of the Type class are immutable: once they are created, they are never changed.
This is the common superclass of types that have a specific, explicit type, stored in ValueTy.
Definition Record.h:418
const RecTy * getFieldType(const StringInit *FieldName) const override
This method is used to implement the FieldInit class.
static bool classof(const Init *I)
Definition Record.h:429
TypedInit(InitKind K, const RecTy *T, uint8_t Opc=0)
Definition Record.h:422
const Init * convertInitializerBitRange(ArrayRef< unsigned > Bits) const override
This function is used to implement the bit range selection operator.
RecordKeeper & getRecordKeeper() const
Get the record keeper that initialized this Init.
Definition Record.h:438
TypedInit(const TypedInit &)=delete
TypedInit & operator=(const TypedInit &)=delete
const Init * getCastTo(const RecTy *Ty) const override
If this value is convertible to type Ty, return a value whose type is Ty, generating a !...
const Init * convertInitializerTo(const RecTy *Ty) const override
Convert to a value whose type is Ty, or return null if this is not possible.
const RecTy * getType() const
Get the type of the Init as a RecTy.
Definition Record.h:435
!op (X) - Transform an init.
Definition Record.h:835
const Init * getOperand() const
Definition Record.h:873
UnOpInit & operator=(const UnOpInit &)=delete
static bool classof(const Init *I)
Definition Record.h:864
UnaryOp getOpcode() const
Definition Record.h:872
static const UnOpInit * get(UnaryOp opc, const Init *lhs, const RecTy *Type)
UnOpInit(const UnOpInit &)=delete
UnaryOp
Definition Record.h:837
@ REPR
Definition Record.h:849
@ LOG2
Definition Record.h:848
@ TOUPPER
Definition Record.h:839
@ HEAD
Definition Record.h:842
@ GETDAGOPNAME
Definition Record.h:847
@ INITIALIZED
Definition Record.h:851
@ EMPTY
Definition Record.h:845
@ SIZE
Definition Record.h:844
@ CAST
Definition Record.h:840
@ NOT
Definition Record.h:841
@ TAIL
Definition Record.h:843
@ GETDAGOP
Definition Record.h:846
@ LISTFLATTEN
Definition Record.h:850
@ TOLOWER
Definition Record.h:838
const Init * resolveReferences(Resolver &R) const override
This function is used by classes that refer to other variables which may not be defined at the time t...
std::string getAsString() const override
Convert this value to a literal form.
const Init * Fold(const Record *CurRec, bool IsFinal=false) const
'?' - Represents an uninitialized value.
Definition Record.h:453
UnsetInit & operator=(const UnsetInit &)=delete
bool isComplete() const override
Is this a complete value with no unset (uninitialized) subvalues?
Definition Record.h:481
const Init * getCastTo(const RecTy *Ty) const override
If this value is convertible to type Ty, return a value whose type is Ty, generating a !...
UnsetInit(const UnsetInit &)=delete
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations?
Definition Record.h:483
const Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
Definition Record.h:478
const Init * convertInitializerTo(const RecTy *Ty) const override
Convert to a value whose type is Ty, or return null if this is not possible.
static UnsetInit * get(RecordKeeper &RK)
Get the singleton unset Init.
static bool classof(const Init *I)
Definition Record.h:465
std::string getAsString() const override
Get the string representation of the Init.
Definition Record.h:486
RecordKeeper & getRecordKeeper() const
Get the record keeper that initialized this Init.
Definition Record.h:473
LLVM Value Representation.
Opcode{0} - Represent access to one bit of a variable or field.
Definition Record.h:1257
static const VarBitInit * get(const TypedInit *T, unsigned B)
unsigned getBitNum() const
Definition Record.h:1282
VarBitInit(const VarBitInit &)=delete
std::string getAsString() const override
Convert this value to a literal form.
const Init * getBitVar() const
Definition Record.h:1281
static bool classof(const Init *I)
Definition Record.h:1275
const Init * getBit(unsigned B) const override
Get the Init value of the specified bit.
Definition Record.h:1287
VarBitInit & operator=(const VarBitInit &)=delete
const Init * resolveReferences(Resolver &R) const override
This function is used by classes that refer to other variables which may not be defined at the time t...
classname<targs...> - Represent an uninstantiated anonymous class instantiation.
Definition Record.h:1328
size_t args_size() const
Definition Record.h:1367
ArrayRef< const ArgumentInit * > args() const
Definition Record.h:1370
const ArgumentInit * getArg(unsigned i) const
Definition Record.h:1360
const_iterator args_end() const
Definition Record.h:1365
static const VarDefInit * get(SMLoc Loc, const Record *Class, ArrayRef< const ArgumentInit * > Args)
const_iterator args_begin() const
Definition Record.h:1364
const Init * resolveReferences(Resolver &R) const override
This function is used by classes that refer to other variables which may not be defined at the time t...
const Init * Fold() const
VarDefInit & operator=(const VarDefInit &)=delete
const Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
Definition Record.h:1374
const ArgumentInit *const * const_iterator
Definition Record.h:1362
static bool classof(const Init *I)
Definition Record.h:1347
VarDefInit(const VarDefInit &)=delete
bool args_empty() const
Definition Record.h:1368
std::string getAsString() const override
Convert this value to a literal form.
'Opcode' - Represent a reference to an entire variable object.
Definition Record.h:1220
static const VarInit * get(StringRef VN, const RecTy *T)
VarInit & operator=(const VarInit &)=delete
static bool classof(const Init *I)
Definition Record.h:1230
const Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
StringRef getName() const
std::string getAsString() const override
Convert this value to a literal form.
Definition Record.h:1253
VarInit(const VarInit &)=delete
const Init * getNameInit() const
Definition Record.h:1238
const Init * resolveReferences(Resolver &R) const override
This method is used by classes that refer to other variables which may not be defined at the time the...
std::string getNameInitAsString() const
Definition Record.h:1240
This class implements an extremely fast bulk output stream that can only output to a stream.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
A self-contained host- and target-independent arbitrary-precision floating-point software implementat...
This is an optimization pass for GlobalISel generic memory operations.
FunctionAddr VTableAddr Value
detail::zippy< detail::zip_first, T, U, Args... > zip_equal(T &&t, U &&u, Args &&...args)
zip iterator that assumes that all iteratees have the same length.
constexpr auto adl_begin(RangeT &&range) -> decltype(adl_detail::begin_impl(std::forward< RangeT >(range)))
Returns the begin iterator to range using std::begin and function found through Argument-Dependent Lo...
decltype(auto) dyn_cast(const From &Val)
dyn_cast - Return the argument parameter cast to the specified type.
FoldingSetBase::Node FoldingSetNode
std::string utostr(uint64_t X, bool isNeg=false)
auto map_range(ContainerTy &&C, FuncTy F)
decltype(auto) get(const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &Pair)
auto make_first_range(ContainerTy &&c)
Given a container of pairs, return a range over the first elements.
bool isDigit(char C)
Checks if character C is one of the 10 decimal digits.
bool isa(const From &Val)
isa - Return true if the parameter to the template is an instance of one of the template type argu...
LLVM_ATTRIBUTE_VISIBILITY_DEFAULT AnalysisKey InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key
LLVM_ABI raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
void EmitJSON(const RecordKeeper &RK, raw_ostream &OS)
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
ArrayRef(const T &OneElt) -> ArrayRef< T >
void EmitDetailedRecords(const RecordKeeper &RK, raw_ostream &OS)
decltype(auto) cast(const From &Val)
cast - Return the argument parameter cast to the specified type.
auto find_if(R &&Range, UnaryPredicate P)
Provide wrappers to std::find_if which take ranges instead of having to pass begin/end explicitly.
bool is_contained(R &&Range, const E &Element)
Returns true if Element is found in Range.
const RecTy * resolveTypes(const RecTy *T1, const RecTy *T2)
Find a common type that T1 and T2 convert to.
std::variant< unsigned, const Init * > ArgAuxType
Definition Record.h:490
This class represents the internal implementation of the RecordKeeper.
Sorting predicate to sort record pointers by their unique ID.
Definition Record.h:2099
bool operator()(const Record *LHS, const Record *RHS) const
Definition Record.h:2100
Sorting predicate to sort record pointers by their Name field.
Definition Record.h:2106
bool operator()(const Record *Rec1, const Record *Rec2) const
Definition Record.h:2107
size_t size()
Definition Record.h:2137
std::pair< bool, StringRef > getPart(size_t Idx)
Definition Record.h:2139
SmallVector< std::pair< bool, StringRef >, 4 > Parts
Definition Record.h:2114
RecordParts(StringRef Rec)
Definition Record.h:2116
bool operator()(const Record *Rec1, const Record *Rec2) const
Definition Record.h:2142
Sorting predicate to sort record pointers by name.
Definition Record.h:2089
bool operator()(const Record *Rec1, const Record *Rec2) const
Definition Record.h:2090
SMLoc Loc
Definition Record.h:1632
const Init * Condition
Definition Record.h:1633
AssertionInfo(SMLoc Loc, const Init *Condition, const Init *Message)
Definition Record.h:1638
const Init * Message
Definition Record.h:1634
DumpInfo(SMLoc Loc, const Init *Message)
Definition Record.h:1648
const Init * Message
Definition Record.h:1644
SMLoc Loc
Definition Record.h:1643