22 #include "llvm/Config/llvm-config.h" 52 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) 63 assert(RHS &&
"NULL pointer");
72 if (
const BitsRecTy *BitsTy = dyn_cast<BitsRecTy>(RHS))
73 return BitsTy->getNumBits() == 1;
78 static std::vector<BitsRecTy*> Shared;
79 if (Sz >= Shared.size())
80 Shared.resize(Sz + 1);
93 return cast<BitsRecTy>(RHS)->
Size ==
Size;
99 if (
const BitsRecTy *RHSb = dyn_cast<BitsRecTy>(RHS))
100 return RHSb->Size ==
Size;
124 return "list<" + Ty->getAsString() +
">";
128 if (
const auto *ListTy = dyn_cast<ListRecTy>(RHS))
134 if (
const ListRecTy *RHSl = dyn_cast<ListRecTy>(RHS))
135 return getElementType()->typeIsA(RHSl->getElementType());
151 if (UnsortedClasses.
empty()) {
157 UnsortedClasses[0]->getRecords().RecordTypePool;
160 UnsortedClasses.
end());
175 for (
unsigned i = 0; i < Classes.size(); ++i) {
176 for (
unsigned j = 0; j < Classes.size(); ++j) {
177 assert(i == j || !Classes[i]->isSubClassOf(Classes[j]));
179 assert(&Classes[0]->getRecords() == &Classes[i]->getRecords());
183 void *Mem = Allocator.
Allocate(totalSizeToAlloc<Record *>(Classes.size()),
186 std::uninitialized_copy(Classes.begin(), Classes.end(),
198 return getClasses()[0]->getNameInitAsString();
200 std::string Str =
"{";
202 for (
Record *R : getClasses()) {
206 Str += R->getNameInitAsString();
214 return MySuperClass == Class ||
228 return isSubClassOf(TargetClass);
242 while (!Stack.
empty()) {
260 if (
RecordRecTy *RecTy1 = dyn_cast<RecordRecTy>(T1)) {
261 if (
RecordRecTy *RecTy2 = dyn_cast<RecordRecTy>(T2))
270 if (
ListRecTy *ListTy1 = dyn_cast<ListRecTy>(T1)) {
271 if (
ListRecTy *ListTy2 = dyn_cast<ListRecTy>(T2)) {
273 ListTy2->getElementType());
286 void Init::anchor() {}
288 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) 309 return V ? &True : &False;
313 if (isa<BitRecTy>(Ty))
314 return const_cast<BitInit *
>(
this);
316 if (isa<IntRecTy>(Ty))
319 if (
auto *BRT = dyn_cast<BitsRecTy>(Ty)) {
321 if (BRT->getNumBits() == 1)
332 for (
Init *
I : Range)
346 void *Mem = Allocator.
Allocate(totalSizeToAlloc<Init *>(Range.
size()),
349 std::uninitialized_copy(Range.
begin(), Range.
end(),
360 if (isa<BitRecTy>(Ty)) {
361 if (getNumBits() != 1)
return nullptr;
365 if (
auto *BRT = dyn_cast<BitsRecTy>(Ty)) {
368 if (getNumBits() != BRT->getNumBits())
return nullptr;
369 return const_cast<BitsInit *
>(
this);
372 if (isa<IntRecTy>(Ty)) {
374 for (
unsigned i = 0, e = getNumBits(); i != e; ++i)
375 if (
auto *
Bit = dyn_cast<BitInit>(getBit(i)))
376 Result |=
static_cast<int64_t
>(
Bit->getValue()) << i;
389 for (
unsigned i = 0, e = Bits.
size(); i != e; ++i) {
390 if (Bits[i] >= getNumBits())
392 NewBits[i] = getBit(Bits[i]);
398 for (
unsigned i = 0, e = getNumBits(); i != e; ++i) {
399 if (!getBit(i)->isConcrete())
406 std::string
Result =
"{ ";
407 for (
unsigned i = 0, e = getNumBits(); i != e; ++i) {
408 if (i) Result +=
", ";
410 Result +=
Bit->getAsString();
414 return Result +
" }";
420 bool Changed =
false;
423 Init *CachedBitVarRef =
nullptr;
424 Init *CachedBitVarResolved =
nullptr;
426 for (
unsigned i = 0, e = getNumBits(); i != e; ++i) {
427 Init *CurBit = getBit(i);
428 Init *NewBit = CurBit;
430 if (
VarBitInit *CurBitVar = dyn_cast<VarBitInit>(CurBit)) {
431 if (CurBitVar->getBitVar() != CachedBitVarRef) {
432 CachedBitVarRef = CurBitVar->getBitVar();
436 NewBit = CachedBitVarResolved->
getBit(CurBitVar->getBitNum());
445 Changed |= CurBit != NewBit;
451 return const_cast<BitsInit *
>(
this);
468 return (NumBits >=
sizeof(Value) * 8) ||
469 (Value >> NumBits == 0) || (Value >> (NumBits-1) == -1);
473 if (isa<IntRecTy>(Ty))
474 return const_cast<IntInit *
>(
this);
476 if (isa<BitRecTy>(Ty)) {
477 int64_t Val = getValue();
478 if (Val != 0 && Val != 1)
return nullptr;
482 if (
auto *BRT = dyn_cast<BitsRecTy>(Ty)) {
483 int64_t
Value = getValue();
489 for (
unsigned i = 0; i != BRT->getNumBits(); ++i)
502 for (
unsigned i = 0, e = Bits.
size(); i != e; ++i) {
514 auto &Entry = *ThePool.
insert(std::make_pair(V,
nullptr)).first;
523 auto &Entry = *ThePool.
insert(std::make_pair(V,
nullptr)).first;
530 if (isa<StringRecTy>(Ty))
532 if (isa<CodeRecTy>(Ty))
539 if (isa<CodeRecTy>(Ty))
540 return const_cast<CodeInit *
>(
this);
541 if (isa<StringRecTy>(Ty))
553 for (
Init *
I : Range)
567 assert(Range.
empty() || !isa<TypedInit>(Range[0]) ||
568 cast<TypedInit>(Range[0])->getType()->typeIsConvertibleTo(EltTy));
570 void *Mem = Allocator.
Allocate(totalSizeToAlloc<Init *>(Range.
size()),
573 std::uninitialized_copy(Range.
begin(), Range.
end(),
580 RecTy *EltTy = cast<ListRecTy>(
getType())->getElementType();
589 if (
auto *LRT = dyn_cast<ListRecTy>(Ty)) {
595 bool Changed =
false;
596 RecTy *ElementType = LRT->getElementType();
597 for (
Init *
I : getValues())
598 if (
Init *CI =
I->convertInitializerTo(ElementType)) {
616 for (
unsigned Element : Elements) {
617 if (Element >=
size())
625 assert(i < NumValues &&
"List element index out of range!");
635 bool Changed =
false;
637 for (
Init *CurElt : getValues()) {
638 Init *
E = CurElt->resolveReferences(R);
639 Changed |= E != CurElt;
645 return const_cast<ListInit *
>(
this);
649 for (
Init *Element : *
this) {
658 const char *sep =
"";
659 for (
Init *Element : *
this) {
669 return const_cast<OpInit*
>(
this);
700 switch (getOpcode()) {
702 if (isa<StringRecTy>(
getType())) {
703 if (
StringInit *LHSs = dyn_cast<StringInit>(LHS))
706 if (
DefInit *LHSd = dyn_cast<DefInit>(LHS))
709 if (
IntInit *LHSi = dyn_cast<IntInit>(LHS))
711 }
else if (isa<RecordRecTy>(
getType())) {
713 assert(CurRec &&
"NULL pointer");
727 Twine(
"Undefined reference to record: '") +
728 Name->getValue() +
"'\n");
736 Twine(
"Expected type '") +
737 getType()->getAsString() +
"', got '" +
750 if (
ListInit *LHSl = dyn_cast<ListInit>(LHS)) {
751 assert(!LHSl->empty() &&
"Empty list in head");
752 return LHSl->getElement(0);
757 if (
ListInit *LHSl = dyn_cast<ListInit>(LHS)) {
758 assert(!LHSl->empty() &&
"Empty list in tail");
761 return ListInit::get(LHSl->getValues().slice(1), LHSl->getElementType());
766 if (
ListInit *LHSl = dyn_cast<ListInit>(LHS))
771 if (
ListInit *LHSl = dyn_cast<ListInit>(LHS))
773 if (
StringInit *LHSs = dyn_cast<StringInit>(LHS))
777 return const_cast<UnOpInit *
>(
this);
783 if (LHS != lhs || (R.
isFinal() && getOpcode() == CAST))
786 return const_cast<UnOpInit *
>(
this);
791 switch (getOpcode()) {
792 case CAST: Result =
"!cast<" +
getType()->getAsString() +
">";
break;
793 case HEAD: Result =
"!head";
break;
794 case TAIL: Result =
"!tail";
break;
795 case SIZE: Result =
"!size";
break;
796 case EMPTY: Result =
"!empty";
break;
798 return Result +
"(" + LHS->getAsString() +
")";
839 if (
const StringInit *I0s = dyn_cast<StringInit>(I0))
840 if (
const StringInit *I1s = dyn_cast<StringInit>(I1))
846 switch (getOpcode()) {
855 if (LOp->
getDef() != ROp->getDef()) {
857 LHSs->
getAsString() +
"' vs. '" + RHSs->getAsString() +
862 for (
unsigned i = 0, e = LHSs->
getNumArgs(); i != e; ++i) {
866 for (
unsigned i = 0, e = RHSs->getNumArgs(); i != e; ++i) {
867 Args.push_back(RHSs->getArg(i));
880 Args.
insert(Args.
end(), RHSs->begin(), RHSs->end());
901 dyn_cast_or_null<IntInit>(LHS->convertInitializerTo(
IntRecTy::get()));
903 dyn_cast_or_null<IntInit>(RHS->convertInitializerTo(
IntRecTy::get()));
907 switch (getOpcode()) {
908 case EQ: Result = L->
getValue() == R->getValue();
break;
909 case NE: Result = L->
getValue() != R->getValue();
break;
910 case LE: Result = L->
getValue() <= R->getValue();
break;
911 case LT: Result = L->
getValue() < R->getValue();
break;
912 case GE: Result = L->
getValue() >= R->getValue();
break;
913 case GT: Result = L->
getValue() > R->getValue();
break;
919 if (getOpcode() ==
EQ || getOpcode() ==
NE) {
939 dyn_cast_or_null<IntInit>(LHS->convertInitializerTo(
IntRecTy::get()));
941 dyn_cast_or_null<IntInit>(RHS->convertInitializerTo(
IntRecTy::get()));
943 int64_t LHSv = LHSi->
getValue(), RHSv = RHSi->getValue();
945 switch (getOpcode()) {
947 case ADD: Result = LHSv + RHSv;
break;
948 case AND: Result = LHSv & RHSv;
break;
949 case OR: Result = LHSv | RHSv;
break;
950 case SHL: Result = LHSv << RHSv;
break;
951 case SRA: Result = LHSv >> RHSv;
break;
952 case SRL: Result = (uint64_t)LHSv >> (uint64_t)RHSv;
break;
966 if (LHS != lhs || RHS != rhs)
974 switch (getOpcode()) {
975 case CONCAT: Result =
"!con";
break;
976 case ADD: Result =
"!add";
break;
977 case AND: Result =
"!and";
break;
978 case OR: Result =
"!or";
break;
979 case SHL: Result =
"!shl";
break;
980 case SRA: Result =
"!sra";
break;
981 case SRL: Result =
"!srl";
break;
982 case EQ: Result =
"!eq";
break;
983 case NE: Result =
"!ne";
break;
984 case LE: Result =
"!le";
break;
985 case LT: Result =
"!lt";
break;
986 case GE: Result =
"!ge";
break;
987 case GT: Result =
"!gt";
break;
988 case LISTCONCAT: Result =
"!listconcat";
break;
989 case STRCONCAT: Result =
"!strconcat";
break;
991 return Result +
"(" + LHS->getAsString() +
", " + RHS->getAsString() +
")";
1032 bool Change =
false;
1038 for (
unsigned int i = 0; i < MHSd->
getNumArgs(); ++i) {
1043 if (
DagInit *Argd = dyn_cast<DagInit>(Arg))
1048 NewArgs.
push_back(std::make_pair(NewArg, ArgName));
1061 if (
DagInit *MHSd = dyn_cast<DagInit>(MHS))
1064 if (
ListInit *MHSl = dyn_cast<ListInit>(MHS)) {
1067 for (
Init *&Item : NewList) {
1069 if (NewItem != Item)
1072 return ListInit::get(NewList, cast<ListRecTy>(Type)->getElementType());
1079 switch (getOpcode()) {
1093 if (LHSd && MHSd && RHSd) {
1094 Record *Val = RHSd->getDef();
1096 Val = MHSd->getDef();
1099 if (LHSv && MHSv && RHSv) {
1100 std::string Val = RHSv->getName();
1101 if (LHSv->getAsString() == RHSv->getAsString())
1102 Val = MHSv->getName();
1105 if (LHSs && MHSs && RHSs) {
1106 std::string Val = RHSs->getValue();
1108 std::string::size_type found;
1109 std::string::size_type idx = 0;
1111 found = Val.find(LHSs->getValue(), idx);
1112 if (found == std::string::npos)
1114 Val.replace(found, LHSs->getValue().size(), MHSs->getValue());
1115 idx = found + MHSs->getValue().size();
1130 if (
IntInit *LHSi = dyn_cast_or_null<IntInit>(
1132 if (LHSi->getValue())
1142 bool MHSok = MHSl || isa<UnsetInit>(MHS);
1143 bool RHSok = RHSl || isa<UnsetInit>(RHS);
1145 if (isa<UnsetInit>(MHS) && isa<UnsetInit>(RHS))
1148 if (MHSok && RHSok && (!MHSl || !RHSl || MHSl->
size() == RHSl->size())) {
1150 unsigned Size = MHSl ? MHSl->
size() : RHSl->size();
1151 for (
unsigned i = 0; i !=
Size; ++i) {
1154 if (!isa<StringInit>(Name) && !isa<UnsetInit>(Name))
1156 Children.
emplace_back(Node, dyn_cast<StringInit>(Name));
1170 if (getOpcode() ==
IF && lhs != LHS) {
1174 if (
Value->getValue())
1183 if (getOpcode() == FOREACH) {
1191 if (LHS != lhs || MHS != mhs || RHS != rhs)
1199 bool UnquotedLHS =
false;
1200 switch (getOpcode()) {
1201 case SUBST: Result =
"!subst";
break;
1202 case FOREACH: Result =
"!foreach"; UnquotedLHS =
true;
break;
1203 case IF: Result =
"!if";
break;
1204 case DAG: Result =
"!dag";
break;
1206 return (Result +
"(" +
1207 (UnquotedLHS ? LHS->getAsUnquotedString() : LHS->getAsString()) +
1208 ", " + MHS->getAsString() +
", " + RHS->getAsString() +
")");
1244 Init *Accum = Start;
1245 for (
Init *Elt : *LI) {
1257 Init *NewStart = Start->resolveReferences(R);
1258 Init *NewList =
List->resolveReferences(R);
1264 if (Start == NewStart &&
List == NewList && Expr == NewExpr)
1267 return get(NewStart, NewList, A,
B, NewExpr,
getType())
1276 return (
Twine(
"!foldl(") + Start->getAsString() +
", " +
List->getAsString() +
1277 ", " + A->getAsUnquotedString() +
", " +
B->getAsUnquotedString() +
1278 ", " + Expr->getAsString() +
")")
1308 if (
TypedInit *TI = dyn_cast<TypedInit>(Expr)) {
1310 if (TI->getType()->typeIsConvertibleTo(
CheckType))
1317 if (!
CheckType->typeIsConvertibleTo(TI->getType()) || isa<DefInit>(Expr))
1329 if (Expr != NewExpr)
1340 Expr->getAsString() +
")")
1346 for (
Record *Rec : RecordType->getClasses()) {
1348 return Field->getType();
1359 if (isa<BitRecTy>(
getType()) && isa<BitsRecTy>(Ty) &&
1360 cast<BitsRecTy>(Ty)->getNumBits() == 1)
1368 if (!T)
return nullptr;
1373 for (
unsigned Bit : Bits) {
1387 if (
Init *Converted = convertInitializerTo(Ty)) {
1388 assert(!isa<TypedInit>(Converted) ||
1402 if (!T)
return nullptr;
1404 if (Elements.
size() == 1)
1409 for (
unsigned Element : Elements)
1422 using Key = std::pair<RecTy *, Init *>;
1425 Key TheKey(std::make_pair(T, VN));
1434 StringInit *NameString = cast<StringInit>(getNameInit());
1440 return const_cast<VarInit*
>(
this);
1447 return const_cast<VarInit *
>(
this);
1451 using Key = std::pair<TypedInit *, unsigned>;
1454 Key TheKey(std::make_pair(T, B));
1463 return TI->getAsString() +
"{" +
utostr(
Bit) +
"}";
1467 Init *
I = TI->resolveReferences(R);
1469 return I->
getBit(getBitNum());
1476 using Key = std::pair<TypedInit *, unsigned>;
1479 Key TheKey(std::make_pair(T, E));
1487 return TI->getAsString() +
"[" +
utostr(Element) +
"]";
1495 if (getElementNum() <
List->size())
1496 return List->getElement(getElementNum());
1498 if (NewTI != TI && isa<TypedInit>(NewTI))
1517 if (
auto *RRT = dyn_cast<RecordRecTy>(Ty))
1519 return const_cast<DefInit *
>(
this);
1525 return RV->getType();
1530 return Def->getName();
1539 for (
Init *
I : Args)
1553 void *Mem = Allocator.
Allocate(totalSizeToAlloc<Init *>(Args.
size()),
1556 std::uninitialized_copy(Args.
begin(), Args.
end(),
1566 DefInit *VarDefInit::instantiate() {
1570 Class->getLoc(), Records,
1572 Record *NewRec = NewRecOwner.get();
1575 for (
const RecordVal &Val : Class->getValues())
1582 for (
unsigned i = 0, e = TArgs.
size(); i != e; ++i) {
1583 if (i < args_size())
1584 R.
set(TArgs[i], getArg(i));
1586 R.
set(TArgs[i], NewRec->getValue(TArgs[i])->getValue());
1588 NewRec->removeValue(TArgs[i]);
1591 NewRec->resolveReferences(R);
1595 for (
const auto &SCPair : SCs)
1596 NewRec->addSuperClass(SCPair.first, SCPair.second);
1598 NewRec->addSuperClass(Class,
1599 SMRange(Class->getLoc().back(),
1600 Class->getLoc().back()));
1603 NewRec->resolveReferences();
1604 Records.
addDef(std::move(NewRecOwner));
1614 bool Changed =
false;
1619 Init *NewArg =
Arg->resolveReferences(UR);
1621 Changed |= NewArg !=
Arg;
1627 return New->instantiate();
1639 Arg->resolveReferences(R);
1642 return const_cast<VarDefInit *>(
this)->instantiate();
1647 std::string
Result = Class->getNameInitAsString() +
"<";
1648 const char *sep =
"";
1652 Result +=
Arg->getAsString();
1654 return Result +
">";
1658 using Key = std::pair<Init *, StringInit *>;
1661 Key TheKey(std::make_pair(R, FN));
1682 if (
DefInit *DI = dyn_cast<DefInit>(Rec)) {
1686 Twine(
"Attempting to access field '") +
1687 FieldName->getAsUnquotedString() +
"' of '" +
1688 Rec->getAsString() +
"' is a forbidden self-reference");
1690 if (FieldVal->isComplete())
1704 while (Arg != ArgRange.
end()) {
1705 assert(Name != NameRange.
end() &&
"Arg name underflow!");
1709 assert(Name == NameRange.
end() &&
"Arg name overflow!");
1724 void *Mem = Allocator.
Allocate(totalSizeToAlloc<Init *, StringInit *>(ArgRange.
size(), NameRange.
size()),
alignof(
BitsInit));
1726 std::uninitialized_copy(ArgRange.
begin(), ArgRange.
end(),
1728 std::uninitialized_copy(NameRange.
begin(), NameRange.
end(),
1736 ArrayRef<std::pair<Init*, StringInit*>> args) {
1740 for (
const auto &
Arg : args) {
1755 bool ArgsChanged =
false;
1756 for (
const Init *
Arg : getArgs()) {
1757 Init *NewArg =
Arg->resolveReferences(R);
1759 ArgsChanged |= NewArg !=
Arg;
1762 Init *
Op = Val->resolveReferences(R);
1763 if (Op != Val || ArgsChanged)
1764 return DagInit::get(Op, ValName, NewArgs, getArgNames());
1766 return const_cast<DagInit *
>(
this);
1770 if (!Val->isConcrete())
1772 for (
const Init *Elt : getArgs()) {
1773 if (!Elt->isConcrete())
1780 std::string
Result =
"(" + Val->getAsString();
1782 Result +=
":" + ValName->getAsUnquotedString();
1784 Result +=
" " + getArg(0)->getAsString();
1785 if (getArgName(0)) Result +=
":$" + getArgName(0)->getAsUnquotedString();
1786 for (
unsigned i = 1, e = getNumArgs(); i != e; ++i) {
1787 Result +=
", " + getArg(i)->getAsString();
1788 if (getArgName(i)) Result +=
":$" + getArgName(i)->getAsUnquotedString();
1791 return Result +
")";
1799 :
Name(N), TyAndPrefix(T, P) {
1801 assert(
Value &&
"Cannot create unset value for current type!");
1815 if (!isa<BitsInit>(
Value)) {
1817 Bits.
reserve(BTy->getNumBits());
1818 for (
unsigned i = 0, e = BTy->getNumBits(); i < e; ++i)
1824 return Value ==
nullptr;
1830 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) 1841 if (PrintSem) OS <<
";\n";
1844 unsigned Record::LastID = 0;
1846 void Record::checkName() {
1848 const TypedInit *TypedName = cast<const TypedInit>(Name);
1849 if (!isa<StringRecTy>(TypedName->
getType()))
1851 "' is not a string!");
1856 getDirectSuperClasses(DirectSCs);
1884 while (!SCs.
empty()) {
1895 if (SkipVal == &
Value)
1899 if (
Value.setValue(VR)) {
1901 if (
TypedInit *VRT = dyn_cast<TypedInit>(VR))
1903 (
Twine(
"of type '") + VRT->getType()->getAsString() +
"' ").str();
1905 "is found when setting '" +
1906 Value.getNameInitAsString() +
1909 "' after resolving references: " +
1916 if (NewName != OldName) {
1925 resolveReferences(R);
1930 resolveReferences(R, RV);
1933 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) 1941 if (!TArgs.
empty()) {
1943 bool NeedComma =
false;
1944 for (
const Init *
TA : TArgs) {
1945 if (NeedComma) OS <<
", ";
1948 assert(RV &&
"Template argument record not found??");
1949 RV->
print(OS,
false);
1958 for (
const auto &SuperPair : SC)
1959 OS <<
" " << SuperPair.first->getNameInitAsString();
1967 if (!Val.getPrefix() && !R.
isTemplateArg(Val.getNameInit()))
1977 "' does not have a field named `" + FieldName +
"'!\n");
1985 "' does not have a field named `" + FieldName +
"'!\n");
1988 return SI->getValue();
1990 return CI->getValue();
1993 FieldName +
"' does not have a string initializer!");
2000 "' does not have a field named `" + FieldName +
"'!\n");
2005 FieldName +
"' does not have a BitsInit initializer!");
2012 "' does not have a field named `" + FieldName +
"'!\n");
2017 FieldName +
"' does not have a list initializer!");
2020 std::vector<Record*>
2023 std::vector<Record*> Defs;
2025 if (
DefInit *DI = dyn_cast<DefInit>(
I))
2026 Defs.push_back(DI->getDef());
2029 FieldName +
"' list is not entirely DefInit!");
2038 "' does not have a field named `" + FieldName +
"'!\n");
2041 return II->getValue();
2044 "' does not have an int initializer: " +
2048 std::vector<int64_t>
2051 std::vector<int64_t> Ints;
2053 if (
IntInit *II = dyn_cast<IntInit>(
I))
2054 Ints.push_back(II->getValue());
2057 Twine(
"Record `") +
getName() +
"', field `" + FieldName +
2058 "' does not have a list of ints initializer: " +
2064 std::vector<StringRef>
2067 std::vector<StringRef> Strings;
2070 Strings.push_back(
SI->getValue());
2073 Twine(
"Record `") +
getName() +
"', field `" + FieldName +
2074 "' does not have a list of strings initializer: " +
2084 "' does not have a field named `" + FieldName +
"'!\n");
2087 return DI->getDef();
2089 FieldName +
"' does not have a def initializer!");
2096 "' does not have a field named `" + FieldName +
"'!\n");
2099 return BI->getValue();
2101 FieldName +
"' does not have a bit initializer!");
2108 "' does not have a field named `" + FieldName.
str() +
"'!\n");
2110 if (isa<UnsetInit>(R->
getValue())) {
2116 return BI->getValue();
2118 FieldName +
"' does not have a bit initializer!");
2125 "' does not have a field named `" + FieldName +
"'!\n");
2130 FieldName +
"' does not have a dag initializer!");
2133 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) 2138 OS <<
"------------- Classes -----------------\n";
2140 OS <<
"class " << *
C.second;
2142 OS <<
"------------- Defs -----------------\n";
2144 OS <<
"def " << *D.second;
2154 std::vector<Record *>
2156 Record *Class = getClass(ClassName);
2158 PrintFatalError(
"ERROR: Couldn't find the `" + ClassName +
"' class!\n");
2160 std::vector<Record*> Defs;
2161 for (
const auto &D : getDefs())
2163 Defs.push_back(D.second.get());
2169 auto It = Map.find(VarName);
2170 if (It == Map.end())
2173 Init *
I = It->second.V;
2175 if (!It->second.Resolved && Map.size() > 1) {
2187 Init *Val = Cache.lookup(VarName);
2191 for (
Init *S : Stack) {
2197 if (!isa<UnsetInit>(RV->getValue())) {
2198 Val = RV->getValue();
2199 Stack.push_back(VarName);
2213 I = R->resolve(VarName);
2214 if (I && !FoundUnresolved) {
2220 FoundUnresolved |= Sub.FoundUnresolved;
2225 FoundUnresolved =
true;
2231 if (VarName == VarNameToTrack)
static BinOpInit * get(BinaryOp opc, Init *lhs, Init *rhs, RecTy *Type)
Represents a range in source code.
void AddPointer(const void *Ptr)
Add* - Add various data types to Bit data.
Init * convertInitializerTo(RecTy *Ty) const override
Convert to an initializer whose type is-a Ty, or return nullptr if this is not possible (this can hap...
void push_back(const T &Elt)
StringRef getName() 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...
RecTyKind
Subclass discriminator (for dyn_cast<> et al.)
void print(raw_ostream &OS) const
Init * getBit(unsigned Bit) const override
This method is used to return the initializer for the specified bit.
raw_ostream & errs()
This returns a reference to a raw_ostream for standard error.
StringRef getName() const
Record * getValueAsDef(StringRef FieldName) const
This method looks up the specified field and returns its value as a Record, throwing an exception if ...
LLVM_NODISCARD std::string str() const
str - Get the contents as an std::string.
BitsInit * getValueAsBitsInit(StringRef FieldName) const
This method looks up the specified field and returns its value as a BitsInit, throwing an exception i...
const T & back() const
back - Get the last element.
Compute iterated dominance frontiers using a linear time algorithm.
X.Y - Represent a reference to a subfield of a variable.
Init * convertInitializerBitRange(ArrayRef< unsigned > Bits) const override
This method is used to implement the bitrange selection operator.
virtual std::string getAsUnquotedString() const
Convert this value to a string form, without adding quote markers.
Record * getCurrentRecord() const
bool foundUnresolved() const
[AL, AH, CL] - Represent a list of defs
'7' - Represent an initialization by a literal integer value.
static void ProfileFoldOpInit(FoldingSetNodeID &ID, Init *A, Init *B, Init *Start, Init *List, Init *Expr, RecTy *Type)
'list<Ty>' - Represent a list of values, all of which must be of the specified type.
void getDirectSuperClasses(SmallVectorImpl< Record *> &Classes) const
Append the direct super classes of this record to Classes.
!op (X, Y) - Combine two inits.
Init * getBit(unsigned Bit) const override
This method is used to return the initializer for the specified bit.
bool typeIsA(const RecTy *RHS) const override
Return true if 'this' type is equal to or a subtype of RHS.
void Profile(FoldingSetNodeID &ID) 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::string getAsString() const override
Convert this value to a string form.
Init * convertInitializerTo(RecTy *Ty) const override
Convert to an initializer whose type is-a Ty, or return nullptr if this is not possible (this can hap...
AL - Represent a reference to a 'def' in the description.
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...
Init * resolve(Init *VarName) override
Return the initializer for the given variable name (should normally be a StringInit), or nullptr if the name could not be resolved.
Init * getBit(unsigned Bit) const override
This method is used to return the initializer for the specified bit.
T * FindNodeOrInsertPos(const FoldingSetNodeID &ID, void *&InsertPos)
FindNodeOrInsertPos - Look up the node specified by ID.
static UnOpInit * get(UnaryOp opc, Init *lhs, RecTy *Type)
void addDef(std::unique_ptr< Record > R)
Init * convertInitializerBitRange(ArrayRef< unsigned > Bits) const override
This method is used to implement the bitrange selection operator.
RecTy * getFieldType(StringInit *FieldName) const override
This method is used to implement the FieldInit class.
Init * getCastTo(RecTy *Ty) const override
If this initializer is convertible to Ty, return an initializer whose type is-a Ty, generating a !cast operation if required.
Init * Fold(Record *CurRec, bool IsFinal=false) const
std::string getAsString() const override
Convert this value to a string form.
static Init * getStrConcat(Init *lhs, Init *rhs)
bool all_of(R &&range, UnaryPredicate P)
Provide wrappers to std::all_of which take ranges instead of having to pass begin/end explicitly...
static VarInit * get(StringRef VN, RecTy *T)
ListInit * getValueAsListInit(StringRef FieldName) const
This method looks up the specified field and returns its value as a ListInit, throwing an exception i...
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...
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds...
Resolve all references to a specific RecordVal.
const_record_iterator classes_begin() const
static BumpPtrAllocator Allocator
void reserve(size_type N)
virtual Init * getCastTo(RecTy *Ty) const =0
If this initializer is convertible to Ty, return an initializer whose type is-a Ty, generating a !cast operation if required.
Resolve all variables from a record except for unset variables.
bool typeIsA(const RecTy *RHS) const override
Return true if 'this' type is equal to or a subtype of RHS.
'{ a, b, c }' - Represents an initializer for a BitsRecTy value.
Record * getElementAsRecord(unsigned i) const
std::string getAsString() const override
std::string getNameInitAsString() const
void dump() const
Debugging method that may be called through a debugger, just invokes print on stderr.
This file defines the MallocAllocator and BumpPtrAllocator interfaces.
static IntInit * get(int64_t V)
static BitsInit * get(ArrayRef< Init *> Range)
(Optionally) delegate resolving to a sub-resolver, and keep track whether there were unresolved refer...
bool getValueAsBitOrUnset(StringRef FieldName, bool &Unset) const
This method looks up the specified field and returns its value as a bit.
Init * getArg(unsigned Num) const
ArrayRef< std::pair< Record *, SMRange > > getSuperClasses() const
'?' - Represents an uninitialized value
'true'/'false' - Represent a concrete initializer for a bit.
Init * convertInitializerBitRange(ArrayRef< unsigned > Bits) const override
This method is used to implement the bitrange selection operator.
static Init * ForeachApply(Init *LHS, Init *MHSe, Init *RHS, Record *CurRec)
static BitsRecTy * get(unsigned Sz)
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
This is the common super-class of types that have a specific, explicit, type.
ArrayRef< T > makeArrayRef(const T &OneElt)
Construct an ArrayRef from a single element.
static RecordRecTy * resolveRecordTypes(RecordRecTy *T1, RecordRecTy *T2)
Shift and rotation operations.
bool typeIsConvertibleTo(const RecTy *RHS) const override
Return true if all values of 'this' type can be converted to the specified type.
void Profile(FoldingSetNodeID &ID) const
Init * getBit(unsigned Bit) const override
This method is used to return the initializer for the specified bit.
RecTy * getElementType() const
static StringRecTy * get()
void Profile(FoldingSetNodeID &ID) const
ArrayRef< Init * > getTemplateArgs() const
std::string getAsString() const override
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
std::string getAsString() const override
List[4] - Represent access to one element of a var or field.
'[classname]' - Type of record values that have zero or more superclasses.
Init * convertInitializerTo(RecTy *Ty) const override
Convert to an initializer whose type is-a Ty, or return nullptr if this is not possible (this can hap...
std::string getAsString() const override
Convert this value to a string form.
std::vector< Record * > getValueAsListOfDefs(StringRef FieldName) const
This method looks up the specified field and returns its value as a vector of records, throwing an exception if the field does not exist or if the value is not the right type.
void AddInteger(signed I)
!foldl (a, b, expr, start, lst) - Fold over a list.
Init * getValueInit(StringRef FieldName) const
Return the initializer for a value with the specified name, or throw an exception if the field does n...
void print(raw_ostream &OS, bool PrintSem=true) const
std::string getAsString() const override
Convert this value to a string form.
const_iterator end() const
virtual Init * resolve(Init *VarName)=0
Return the initializer for the given variable name (should normally be a StringInit), or nullptr if the name could not be resolved.
StringInit * getArgName(unsigned Num) const
void InsertNode(T *N, void *InsertPos)
InsertNode - Insert the specified node into the folding set, knowing that it is not already in the fo...
ArrayRef< SMLoc > getLoc() const
Type * getType() const
All values are typed, get the type of this value.
'bits<n>' - Represent a fixed number of bits
ArrayRef< Record * > getClasses() const
std::string itostr(int64_t X)
void Profile(FoldingSetNodeID &ID) const
bool isTemplateArg(Init *Name) 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...
Simple integer binary arithmetic operators.
bool isSubClassOf(const Record *R) const
ArrayRef< Init * > getValues() const
std::string getAsString() const override
Convert this value to a string form.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
unsigned getNumBits() 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...
bool typeIsConvertibleTo(const RecTy *RHS) const override
Return true if all values of 'this' type can be converted to the specified type.
Init * resolve(Init *VarName) override
Return the initializer for the given variable name (should normally be a StringInit), or nullptr if the name could not be resolved.
virtual Init * getBit(unsigned Bit) const =0
This method is used to return the initializer for the specified bit.
ArrayRef< RecordVal > getValues() const
const_record_iterator classes_end() const
Init * convertInitListSlice(ArrayRef< unsigned > Elements) const override
This method is used to implement the list slice selection operator.
'code' - Represent a code fragment
void resolveReferencesTo(const RecordVal *RV)
If anything in this record refers to RV, replace the reference to RV with the RHS of RV...
bool isSubClassOf(Record *Class) const
Init * convertInitializerTo(RecTy *Ty) const override
Convert to an initializer whose type is-a Ty, or return nullptr if this is not possible (this can hap...
virtual Init * convertInitializerTo(RecTy *Ty) const =0
Convert to an initializer whose type is-a Ty, or return nullptr if this is not possible (this can hap...
void addShadow(Init *Key)
Init * convertInitializerTo(RecTy *Ty) const override
Convert to an initializer whose type is-a Ty, or return nullptr if this is not possible (this can hap...
bool typeIsConvertibleTo(const RecTy *RHS) const override
Return true if all values of 'this' type can be converted to the specified type.
FoldingSetNodeID - This class is used to gather all the unique data bits of a node.
Base class for operators.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
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...
bool typeIsConvertibleTo(const RecTy *RHS) const override
Return true if all values of 'this' type can be converted to the specified type.
Init * getElement(unsigned i) const
Resolve arbitrary mappings.
Init * getNameInit() const
The instances of the Type class are immutable: once they are created, they are never changed...
Allocate memory in an ever growing pool, as if by bump-pointer.
virtual bool isConcrete() const
Is this a concrete and fully resolved value without any references or stuck operations? Unset values are concrete.
void resolveReferences()
If there are any field references that refer to fields that have been filled in, we can propagate the...
size_t size() const
size - Get the array size.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
void set(Init *Key, Init *Value)
"foo" - Represent an initialization by a string value.
RecTy * getFieldType(StringInit *FieldName) const override
This method is used to implement the FieldInit class.
static void ProfileTernOpInit(FoldingSetNodeID &ID, unsigned Opcode, Init *LHS, Init *MHS, Init *RHS, RecTy *Type)
LLVM_ATTRIBUTE_RETURNS_NONNULL LLVM_ATTRIBUTE_RETURNS_NOALIAS void * Allocate(size_t Size, size_t Alignment)
Allocate space at the specified alignment.
Interface for looking up the initializer for a variable name, used by Init::resolveReferences.
static void ProfileUnOpInit(FoldingSetNodeID &ID, unsigned Opcode, Init *Op, RecTy *Type)
static ManagedStatic< OptionRegistry > OR
const T * getTrailingObjects() const
Returns a pointer to the trailing object array of the given type (which must be one of those specifie...
bool typeIsConvertibleTo(const RecTy *RHS) const override
Return true if all values of 'this' type can be converted to the specified type.
!op (X) - Transform an init.
Init * getCastTo(RecTy *Ty) const override
If this initializer is convertible to Ty, return an initializer whose type is-a Ty, generating a !cast operation if required.
const std::string getNameInitAsString() const
static void ProfileDagInit(FoldingSetNodeID &ID, Init *V, StringInit *VN, ArrayRef< Init *> ArgRange, ArrayRef< StringInit *> NameRange)
static DagInit * get(Init *V, StringInit *VN, ArrayRef< Init *> ArgRange, ArrayRef< StringInit *> NameRange)
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...
bool any_of(R &&Range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly...
StringRef getValueAsString(StringRef FieldName) const
This method looks up the specified field and returns its value as a string, throwing an exception if ...
'string' - Represent an string value
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...
static BitInit * get(bool V)
static bool canFitInBitfield(int64_t Value, unsigned NumBits)
std::string getAsString() const override
Convert this value to a string form.
static CodeInit * get(StringRef)
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...
static void ProfileBinOpInit(FoldingSetNodeID &ID, unsigned Opcode, Init *LHS, Init *RHS, RecTy *Type)
DefInit * getDefInit()
get the corresponding DefInit.
static wasm::ValType getType(const TargetRegisterClass *RC)
static Init * ForeachHelper(Init *LHS, Init *MHS, Init *RHS, RecTy *Type, Record *CurRec)
FoldingSet - This template class is used to instantiate a specialized implementation of the folding s...
std::string getAsString() const override
Convert this value to a string form.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
std::vector< int64_t > getValueAsListOfInts(StringRef FieldName) const
This method looks up the specified field and returns its value as a vector of integers, throwing an exception if the field does not exist or if the value is not the right type.
static RecordRecTy * get(ArrayRef< Record *> Classes)
Get the record type with the given non-redundant list of superclasses.
void sort(IteratorTy Start, IteratorTy End)
Init * convertInitializerTo(RecTy *Ty) const override
Convert to an initializer whose type is-a Ty, or return nullptr if this is not possible (this can hap...
std::vector< Record * > getAllDerivedDefinitions(StringRef ClassName) const
This method returns all concrete definitions that derive from the specified class name...
Delegate resolving to a sub-resolver, but shadow some variable names.
void setFinal(bool Final)
std::vector< StringRef > getValueAsListOfStrings(StringRef FieldName) const
This method looks up the specified field and returns its value as a vector of strings, throwing an exception if the field does not exist or if the value is not the right type.
static FieldInit * get(Init *R, StringInit *FN)
virtual Init * resolveReferences(Resolver &R) const
This method is used by classes that refer to other variables which may not be defined at the time the...
Init * Fold(Record *CurRec) const
std::string getAsString() const override
Init * convertInitListSlice(ArrayRef< unsigned > Elements) const override
This method is used to implement the list slice selection operator.
static StringInit * ConcatStringInits(const StringInit *I0, const StringInit *I1)
bool typeIsA(const RecTy *RHS) const override
Return true if 'this' type is equal to or a subtype of RHS.
auto size(R &&Range, typename std::enable_if< std::is_same< typename std::iterator_traits< decltype(Range.begin())>::iterator_category, std::random_access_iterator_tag >::value, void >::type *=nullptr) -> decltype(std::distance(Range.begin(), Range.end()))
Get the size of a range.
virtual bool typeIsA(const RecTy *RHS) const
Return true if 'this' type is equal to or a subtype of RHS.
Init * resolve(Init *VarName) override
Return the initializer for the given variable name (should normally be a StringInit), or nullptr if the name could not be resolved.
const RecordVal * getValue(const Init *Name) const
const RecordMap & getClasses() const
Init * getOperator() const
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
static VarBitInit * get(TypedInit *T, unsigned B)
static StringInit * get(StringRef)
RecordKeeper & getRecords() const
std::string getAsString() const override
Convert this value to a string form.
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...
CHAIN = SC CHAIN, Imm128 - System call.
Init * Fold(Record *CurRec) const
unsigned getNumArgs() const
Init * convertInitializerTo(RecTy *Ty) const override
Convert to an initializer whose type is-a Ty, or return nullptr if this is not possible (this can hap...
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
RecTy * getElementType() const
static DefInit * get(Record *)
ArrayRef< T > drop_back(size_t N=1) const
Drop the last N elements of the array.
classname<targs...> - Represent an uninstantiated anonymous class instantiation.
std::string utostr(uint64_t X, bool isNeg=false)
Init * convertInitializerTo(RecTy *Ty) const override
Convert to an initializer whose type is-a Ty, or return nullptr if this is not possible (this can hap...
static VarDefInit * get(Record *Class, ArrayRef< Init *> Args)
bool insert(MapEntryTy *KeyValue)
insert - Insert the specified key/value pair into the map.
static IsAOpInit * get(RecTy *CheckType, Init *Expr)
StringMap - This is an unconventional map that is specialized for handling keys that are "strings"...
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...
Init * resolve(Init *VarName) override
Return the initializer for the given variable name (should normally be a StringInit), or nullptr if the name could not be resolved.
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...
LLVM_ATTRIBUTE_NORETURN void PrintFatalError(const Twine &Msg)
void Profile(FoldingSetNodeID &ID) const
void Profile(FoldingSetNodeID &ID) const
!isa<type>(expr) - Dynamically determine the type of an expression.
iterator insert(iterator I, T &&Elt)
static FoldOpInit * get(Init *Start, Init *List, Init *A, Init *B, Init *Expr, RecTy *Type)
static void ProfileIsAOpInit(FoldingSetNodeID &ID, RecTy *CheckType, Init *Expr)
'int' - Represent an integer value of no particular size
amdgpu Simplify well known AMD library false Value Value * Arg
Init * getBit(unsigned Bit) const override
This method is used to return the initializer for the specified 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...
std::string getAsString() const override
Convert this value to a string form.
void Profile(FoldingSetNodeID &ID) const
bool typeIsConvertibleTo(const RecTy *RHS) const override
Return true if all values of 'this' type can be converted to the specified type.
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator end()
Bitwise operators - logical and, logical or, logical xor.
Init * getNameInit() const
void emplace_back(ArgTypes &&... Args)
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations? Unset values are concrete.
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations? Unset values are concrete.
static Init * ForeachDagApply(Init *LHS, DagInit *MHSd, Init *RHS, Record *CurRec)
LLVM_NODISCARD bool empty() const
Init * Fold(Record *CurRec) const
bool typeIsConvertibleTo(const RecTy *RHS) const override
Return true if all values of 'this' type can be converted to the specified type.
void addValue(const RecordVal &RV)
static TernOpInit * get(TernaryOp opc, Init *lhs, Init *mhs, Init *rhs, RecTy *Type)
const_iterator begin() const
static VarListElementInit * get(TypedInit *T, unsigned E)
RecTy * resolveTypes(RecTy *T1, RecTy *T2)
Find a common type that T1 and T2 convert to.
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...
static void ProfileVarDefInit(FoldingSetNodeID &ID, Record *Class, ArrayRef< Init *> Args)
void Profile(FoldingSetNodeID &ID) const
Opcode{0} - Represent access to one bit of a variable or field.
'Opcode' - Represent a reference to an entire variable object.
void Profile(FoldingSetNodeID &ID) const
std::string getAsString() const override
Convert this value to a string form.
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 getAsString() const override
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
'bit' - Represent a single bit
!op (X, Y, Z) - Combine two inits.
static void ProfileBitsInit(FoldingSetNodeID &ID, ArrayRef< Init *> Range)
raw_ostream & operator<<(raw_ostream &OS, const APInt &I)
static ListInit * get(ArrayRef< Init *> Range, RecTy *EltTy)
virtual bool keepUnsetBits() const
RecTyKind getRecTyKind() const
virtual bool typeIsConvertibleTo(const RecTy *RHS) const
Return true if all values of 'this' type can be converted to the specified type.
StringRef getValue() const
'dag' - Represent a dag fragment
Record * getDef(StringRef Name) const
static LLVM_ATTRIBUTE_ALWAYS_INLINE bool CheckType(const unsigned char *MatcherTable, unsigned &MatcherIndex, SDValue N, const TargetLowering *TLI, const DataLayout &DL)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Init * getBit(unsigned Bit) const override
This method is used to return the initializer for the specified bit.
LLVM Value Representation.
(v a, b) - Represent a DAG tree value.
virtual std::string getAsString() const =0
Convert this value to a string form.
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations? Unset values are concrete.
static void ProfileListInit(FoldingSetNodeID &ID, ArrayRef< Init *> Range, RecTy *EltTy)
This class implements an extremely fast bulk output stream that can only output to a stream...
StringRef - Represent a constant reference to a string, i.e.
void Profile(FoldingSetNodeID &ID) const
static void ProfileRecordRecTy(FoldingSetNodeID &ID, ArrayRef< Record *> Classes)
std::string getAsString() const override
Convert this value to a string form.
virtual std::string getAsString() const =0
Init * convertInitializerTo(RecTy *Ty) const override
Convert to an initializer whose type is-a Ty, or return nullptr if this is not possible (this can hap...
ListRecTy * getListTy()
Returns the type representing list<this>.
Init * getNewAnonymousName()
GetNewAnonymousName - Generate a unique anonymous name that can be used as an identifier.
for(unsigned i=Desc.getNumOperands(), e=OldMI.getNumOperands();i !=e;++i)
const RecordMap & getDefs() const
std::string getAsString() const override
Convert this value to a string form.
Init * Fold(Record *CurRec) const
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
std::string getAsString() const override
Convert this value to a string form.
bool empty() const
empty - Check if the array is empty.
RecordVal(Init *N, RecTy *T, bool P)