14 #ifndef LLVM_TABLEGEN_RECORD_H 15 #define LLVM_TABLEGEN_RECORD_H 74 virtual ~RecTy() =
default;
251 void operator delete(
void *p) { ::operator
delete(p); }
263 return makeArrayRef(getTrailingObjects<Record *>(), NumClasses);
337 virtual void anchor();
347 Init &operator=(
const Init &) =
delete;
348 virtual ~
Init() =
default;
376 virtual Init *getCastTo(
RecTy *Ty)
const = 0;
381 virtual Init *convertInitializerTo(
RecTy *Ty)
const = 0;
411 return const_cast<Init *
>(
this);
416 virtual Init *getBit(
unsigned Bit)
const = 0;
420 I.
print(OS);
return OS;
430 :
Init(K, Opc), Ty(T) {}
437 return I->
getKind() >= IK_FirstTypedInit &&
438 I->
getKind() <= IK_LastTypedInit;
443 Init *getCastTo(
RecTy *Ty)
const override;
444 Init *convertInitializerTo(
RecTy *Ty)
const override;
465 return I->
getKind() == IK_UnsetInit;
470 Init *getCastTo(
RecTy *Ty)
const override;
471 Init *convertInitializerTo(
RecTy *Ty)
const override;
493 return I->
getKind() == IK_BitInit;
500 Init *convertInitializerTo(
RecTy *Ty)
const override;
503 assert(Bit < 1 &&
"Bit index out of range!");
504 return const_cast<BitInit*
>(
this);
508 std::string
getAsString()
const override {
return Value ?
"1" :
"0"; }
525 void operator delete(
void *p) { ::operator
delete(p); }
528 return I->
getKind() == IK_BitsInit;
537 Init *convertInitializerTo(
RecTy *Ty)
const override;
541 for (
unsigned i = 0; i != getNumBits(); ++i)
542 if (!getBit(i)->isComplete())
return false;
547 for (
unsigned i = 0; i != getNumBits(); ++i)
548 if (getBit(i)->isComplete())
return false;
552 bool isConcrete()
const override;
558 assert(Bit < NumBits &&
"Bit index out of range!");
559 return getTrailingObjects<Init *>()[Bit];
575 return I->
getKind() == IK_IntInit;
578 static IntInit *
get(int64_t V);
582 Init *convertInitializerTo(
RecTy *Ty)
const override;
605 return I->
getKind() == IK_StringInit;
612 Init *convertInitializerTo(
RecTy *Ty)
const override;
630 Value(V), Loc(Loc) {}
637 return I->
getKind() == IK_CodeInit;
645 Init *convertInitializerTo(
RecTy *Ty)
const override;
649 return "[{" + Value.
str() +
"}]";
677 void operator delete(
void *p) { ::operator
delete(p); }
680 return I->
getKind() == IK_ListInit;
687 assert(i < NumValues &&
"List element index out of range!");
688 return getTrailingObjects<Init *>()[i];
691 return cast<ListRecTy>(
getType())->getElementType();
694 Record *getElementAsRecord(
unsigned i)
const;
698 Init *convertInitializerTo(
RecTy *Ty)
const override;
707 bool isConcrete()
const override;
711 return makeArrayRef(getTrailingObjects<Init *>(), NumValues);
717 size_t size ()
const {
return NumValues; }
718 bool empty()
const {
return NumValues == 0; }
737 return I->
getKind() >= IK_FirstOpInit &&
744 virtual unsigned getNumOperands()
const = 0;
745 virtual Init *getOperand(
unsigned i)
const = 0;
747 Init *getBit(
unsigned Bit)
const override;
760 :
OpInit(IK_UnOpInit, Type, opc), LHS(lhs) {}
767 return I->
getKind() == IK_UnOpInit;
777 "Wrong number of operands for unary operation");
784 assert(i == 0 &&
"Invalid operand id for unary operator");
793 Init *Fold(
Record *CurRec,
bool IsFinal =
false)
const;
811 OpInit(IK_BinOpInit, Type, opc), LHS(lhs), RHS(rhs) {}
818 return I->
getKind() == IK_BinOpInit;
832 "Wrong number of operands for binary operation");
840 case 0:
return getLHS();
841 case 1:
return getRHS();
864 Init *LHS, *MHS, *RHS;
868 OpInit(IK_TernOpInit, Type, opc), LHS(lhs), MHS(mhs), RHS(rhs) {}
875 return I->
getKind() == IK_TernOpInit;
887 "Wrong number of operands for ternary operation");
896 case 0:
return getLHS();
897 case 1:
return getMHS();
898 case 2:
return getRHS();
932 size_t numTrailingObjects(OverloadToken<Init *>)
const {
941 return I->
getKind() == IK_CondOpInit;
954 assert(Num < NumConds &&
"Condition number out of range!");
955 return getTrailingObjects<Init *>()[Num];
959 assert(Num < NumConds &&
"Val number out of range!");
960 return getTrailingObjects<Init *>()[Num+NumConds];
964 return makeArrayRef(getTrailingObjects<Init *>(), NumConds);
968 return makeArrayRef(getTrailingObjects<Init *>()+NumConds, NumConds);
975 bool isConcrete()
const override;
976 bool isComplete()
const override;
991 inline size_t val_size ()
const {
return NumConds; }
994 Init *getBit(
unsigned Bit)
const override;
1007 :
TypedInit(IK_FoldOpInit, Type), Start(Start),
List(List), A(A),
B(B),
1029 Init *getBit(
unsigned Bit)
const override;
1062 Init *getBit(
unsigned Bit)
const override;
1079 return I->
getKind() == IK_VarInit;
1089 return getNameInit()->getAsUnquotedString();
1099 Init *getBit(
unsigned Bit)
const override;
1112 (isa<IntRecTy>(T->
getType()) ||
1113 (isa<BitsRecTy>(T->
getType()) &&
1114 cast<BitsRecTy>(T->
getType())->getNumBits() >
B)) &&
1115 "Illegal VarBitInit expression!");
1123 return I->
getKind() == IK_VarBitInit;
1135 assert(B < 1 &&
"Bit index out of range!");
1148 cast<ListRecTy>(T->
getType())->getElementType()),
1151 "Illegal VarBitInit expression!");
1159 return I->
getKind() == IK_VarListElementInit;
1170 Init *getBit(
unsigned Bit)
const override;
1186 return I->
getKind() == IK_DefInit;
1191 Init *convertInitializerTo(
RecTy *Ty)
const override;
1225 void operator delete(
void *p) { ::operator
delete(p); }
1228 return I->
getKind() == IK_VarDefInit;
1240 assert(i < NumArgs &&
"Argument index out of range!");
1241 return getTrailingObjects<Init *>()[i];
1269 <<
", got FieldName = " << *FieldName
1270 <<
" with non-record type!\n";
1281 return I->
getKind() == IK_FieldInit;
1289 Init *getBit(
unsigned Bit)
const override;
1309 unsigned NumArgNames;
1313 NumArgs(NumArgs), NumArgNames(NumArgNames) {}
1315 size_t numTrailingObjects(OverloadToken<Init *>)
const {
return NumArgs; }
1322 return I->
getKind() == IK_DagInit;
1344 assert(Num < NumArgs &&
"Arg number out of range!");
1345 return getTrailingObjects<Init *>()[Num];
1349 assert(Num < NumArgNames &&
"Arg number out of range!");
1350 return getTrailingObjects<StringInit *>()[Num];
1359 return makeArrayRef(getTrailingObjects<Init *>(), NumArgs);
1363 return makeArrayRef(getTrailingObjects<StringInit *>(), NumArgNames);
1368 bool isConcrete()
const override;
1409 return getNameInit()->getAsUnquotedString();
1416 bool setValue(
Init *V);
1423 RV.
print(OS <<
" ");
1428 static unsigned LastID;
1457 bool Anonymous =
false,
bool Class =
false)
1458 : Name(N), Locs(locs.
begin(), locs.
end()), TrackedRecords(records),
1459 ID(LastID++), IsAnonymous(Anonymous), IsClass(Class) {
1471 : Name(O.Name), Locs(O.Locs), TemplateArgs(O.TemplateArgs),
1472 Values(O.Values), SuperClasses(O.SuperClasses),
1473 TrackedRecords(O.TrackedRecords), ID(LastID++),
1474 IsAnonymous(O.IsAnonymous), IsClass(O.IsClass) { }
1487 return getNameInit()->getAsUnquotedString();
1490 void setName(
Init *Name);
1504 return TemplateArgs;
1510 return SuperClasses;
1517 for (
Init *
TA : TemplateArgs)
1518 if (
TA == Name)
return true;
1524 if (Val.Name == Name)
return &Val;
1533 return const_cast<RecordVal *
>(
static_cast<const Record *
>(
this)->getValue(Name));
1537 return const_cast<RecordVal *
>(
static_cast<const Record *
>(
this)->getValue(Name));
1541 assert(!isTemplateArg(Name) &&
"Template arg already defined!");
1551 for (
unsigned i = 0,
e = Values.
size(); i !=
e; ++i)
1552 if (Values[i].getNameInit() ==
Name) {
1564 for (
const auto &SCPair : SuperClasses)
1565 if (SCPair.first == R)
1571 for (
const auto &SCPair : SuperClasses) {
1572 if (
const auto *
SI = dyn_cast<StringInit>(SCPair.first->getNameInit())) {
1573 if (
SI->getValue() ==
Name)
1575 }
else if (SCPair.first->getNameInitAsString() ==
Name) {
1583 assert(!TheInit &&
"changing type of record after it has been referenced");
1584 assert(!isSubClassOf(R) &&
"Already subclassing record!");
1585 SuperClasses.
push_back(std::make_pair(R, Range));
1593 void resolveReferences();
1605 void resolveReferencesTo(
const RecordVal *RV);
1608 return TrackedRecords;
1628 return isa<UnsetInit>(getValueInit(FieldName));
1649 std::vector<Record*> getValueAsListOfDefs(
StringRef FieldName)
const;
1654 std::vector<int64_t> getValueAsListOfInts(
StringRef FieldName)
const;
1659 std::vector<StringRef> getValueAsListOfStrings(
StringRef FieldName)
const;
1675 bool getValueAsBit(
StringRef FieldName)
const;
1680 bool getValueAsBitOrUnset(
StringRef FieldName,
bool &Unset)
const;
1685 int64_t getValueAsInt(
StringRef FieldName)
const;
1697 using RecordMap = std::map<std::string, std::unique_ptr<Record>, std::less<>>;
1698 RecordMap Classes, Defs;
1700 std::map<std::string, Init *, std::less<>> ExtraGlobals;
1701 unsigned AnonCounter = 0;
1708 auto I = Classes.find(Name);
1709 return I == Classes.end() ? nullptr :
I->second.get();
1713 auto I = Defs.find(Name);
1714 return I == Defs.end() ? nullptr :
I->second.get();
1718 if (
Record *R = getDef(Name))
1720 auto It = ExtraGlobals.find(Name);
1721 return It == ExtraGlobals.end() ? nullptr : It->second;
1725 bool Ins = Classes.insert(std::make_pair(R->getName(),
1726 std::move(R))).second;
1728 assert(Ins &&
"Class already exists");
1732 bool Ins = Defs.insert(std::make_pair(R->getName(),
1733 std::move(R))).second;
1735 assert(Ins &&
"Record already exists");
1739 bool Ins = ExtraGlobals.insert(std::make_pair(Name, I)).second;
1742 assert(Ins &&
"Global already exists");
1745 Init *getNewAnonymousName();
1753 std::vector<Record *> getAllDerivedDefinitions(
StringRef ClassName)
const;
1794 const char *Start = Rec.
data();
1795 const char *Curr = Start;
1796 bool isDigitPart = ascii_isdigit(Curr[0]);
1797 for (
size_t I = 0,
E = Rec.
size();
I !=
E; ++
I, ++Len) {
1798 bool isDigit = ascii_isdigit(Curr[
I]);
1799 if (isDigit != isDigitPart) {
1803 isDigitPart = ascii_isdigit(Curr[I]);
1822 size_t LHSNumParts = LHSParts.
size();
1823 size_t RHSNumParts = RHSParts.
size();
1824 assert (LHSNumParts && RHSNumParts &&
"Expected at least one part!");
1826 if (LHSNumParts != RHSNumParts)
1827 return LHSNumParts < RHSNumParts;
1830 for (
size_t I = 0,
E = LHSNumParts;
I <
E;
I+=2) {
1831 std::pair<bool, StringRef> LHSPart = LHSParts.
getPart(
I);
1832 std::pair<bool, StringRef> RHSPart = RHSParts.
getPart(
I);
1834 assert (LHSPart.first ==
false && RHSPart.first ==
false &&
1835 "Expected both parts to be alpha.");
1836 if (
int Res = LHSPart.second.compare(RHSPart.second))
1839 for (
size_t I = 1, E = LHSNumParts;
I <
E;
I+=2) {
1840 std::pair<bool, StringRef> LHSPart = LHSParts.
getPart(
I);
1841 std::pair<bool, StringRef> RHSPart = RHSParts.
getPart(
I);
1843 assert (LHSPart.first ==
true && RHSPart.first ==
true &&
1844 "Expected both parts to be numeric.");
1845 if (LHSPart.second.size() != RHSPart.second.size())
1846 return LHSPart.second.size() < RHSPart.second.size();
1848 unsigned LHSVal, RHSVal;
1850 bool LHSFailed = LHSPart.second.getAsInteger(10, LHSVal); (void)LHSFailed;
1851 assert(!LHSFailed &&
"Unable to convert LHS to integer.");
1852 bool RHSFailed = RHSPart.second.getAsInteger(10, RHSVal); (void)RHSFailed;
1853 assert(!RHSFailed &&
"Unable to convert RHS to integer.");
1855 if (LHSVal != RHSVal)
1856 return LHSVal < RHSVal;
1858 return LHSNumParts < RHSNumParts;
1872 bool IsFinal =
false;
1899 struct MappedValue {
1903 MappedValue() : V(
nullptr), Resolved(
false) {}
1904 MappedValue(
Init *V,
bool Resolved) : V(V), Resolved(Resolved) {}
1943 if (VarName == RV->getNameInit())
1944 return RV->getValue();
1956 :
Resolver(R.getCurrentRecord()), R(R) {
1963 if (Shadowed.
count(VarName))
1965 return R.resolve(VarName);
1973 bool FoundUnresolved =
false;
1977 :
Resolver(R ? R->getCurrentRecord() : nullptr), R(R) {}
1987 Init *VarNameToTrack;
1992 :
Resolver(nullptr), VarNameToTrack(VarNameToTrack) {}
2003 #endif // LLVM_TABLEGEN_RECORD_H Init * getOperand() const
static BinOpInit * get(BinaryOp opc, Init *lhs, Init *rhs, RecTy *Type)
Init * getCond(unsigned Num) const
unsigned getNumBits() const
RecordVal * getValue(const Init *Name)
Represents a range in source code.
unsigned getNumConds() const
static bool classof(const Init *I)
std::string getAsString() const override
const_iterator end(StringRef path)
Get end iterator over path.
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations? Unset values are concrete.
RecTyKind
Subclass discriminator (for dyn_cast<> et al.)
void print(raw_ostream &OS) const
raw_ostream & errs()
This returns a reference to a raw_ostream for standard error.
const_name_iterator name_end() const
LLVM_NODISCARD std::string str() const
str - Get the contents as an std::string.
const_iterator begin(StringRef path, Style style=Style::native)
Get begin iterator over path.
bool allInComplete() const
const_case_iterator arg_end() const
typename SuperClass::const_iterator const_iterator
Sorting predicate to sort record pointers by name.
This class represents lattice values for constants.
X.Y - Represent a reference to a subfield of a variable.
PointerTy getPointer() const
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.
StringRef getNameStr() const
virtual RecTy * getFieldType(StringInit *FieldName) const
This method is used to implement the FieldInit class.
static bool classof(const RecTy *RT)
'list<Ty>' - Represent a list of values, all of which must be of the specified type.
amdgpu Simplify well known AMD library false FunctionCallee Value const Twine & Name
!op (X, Y) - Combine two inits.
std::string getAsString() const override
Convert this value to a string form.
Implements a dense probed hash-table based set.
Sorting predicate to sort record pointers by their name field.
void push_back(const T &Elt)
AL - Represent a reference to a 'def' in the description.
static bool classof(const Init *I)
static UnOpInit * get(UnaryOp opc, Init *lhs, RecTy *Type)
static bool classof(const Init *I)
void addDef(std::unique_ptr< Record > R)
static bool classof(const Init *I)
Init * getOperand(unsigned i) const override
static bool classof(const RecTy *RT)
std::string getAsString() const override
HasReferenceResolver(Init *VarNameToTrack)
Resolve all references to a specific RecordVal.
const_record_iterator classes_begin() const
static bool classof(const Init *I)
void removeValue(StringRef Name)
Resolve all variables from a record except for unset variables.
'{ a, b, c }' - Represents an initializer for a BitsRecTy value.
Init * getArg(unsigned i) const
std::pair< bool, StringRef > getPart(size_t i)
std::string getNameInitAsString() const
static bool classof(const Init *I)
(Optionally) delegate resolving to a sub-resolver, and keep track whether there were unresolved refer...
Sorting predicate to sort record pointers by their unique ID.
static bool classof(const Init *I)
Init * getArg(unsigned Num) const
ArrayRef< std::pair< Record *, SMRange > > getSuperClasses() const
'?' - Represents an uninitialized value
static bool classof(const Init *I)
void addSuperClass(Record *R, SMRange Range)
Init * getBit(unsigned Bit) const override
This method is used to return the initializer for the specified bit.
'true'/'false' - Represent a concrete initializer for a bit.
Init * getBit(unsigned Bit) const override
This method is used to return the initializer for the specified bit.
TypedInit * getVariable() const
SmallVectorImpl< Init * >::const_iterator const_val_iterator
static bool classof(const Init *I)
static BitsRecTy * get(unsigned Sz)
static bool classof(const RecTy *RT)
const_val_iterator name_end() const
Init * getBit(unsigned Bit) const override
This method is used to return the initializer for the specified bit.
static bool classof(const Init *I)
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.
Shift and rotation operations.
Init *const * const_iterator
void addClass(std::unique_ptr< Record > R)
RecTy * getElementType() const
static StringRecTy * get()
static Optional< unsigned > getOpcode(ArrayRef< VPValue *> Values)
Returns the opcode of Values or ~0 if they do not all agree.
ArrayRef< Init * > getTemplateArgs() const
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
List[4] - Represent access to one element of a var or field.
'[classname]' - Type of record values that have zero or more superclasses.
virtual bool isComplete() const
This virtual method should be overridden by values that may not be completely specified yet...
const_iterator args_begin() const
static StringRef getName(Value *V)
!foldl (a, b, expr, start, lst) - Fold over a list.
const_iterator args_end() const
bool operator()(const Record *Rec1, const Record *Rec2) const
RecordResolver(Record &R)
mir Rename Register Operands
LLVM_NODISCARD bool empty() const
empty - Check if the string is empty.
!cond(condition_1: value1, ...
void print(raw_ostream &OS, bool PrintSem=true) const
unsigned getBitNum() const
const_iterator end() const
StringInit * getArgName(unsigned Num) const
virtual Init * convertInitializerBitRange(ArrayRef< unsigned > Bits) const
This method is used to implement the bitrange selection operator.
bool operator()(const Record *LHS, const Record *RHS) const
Record * getClass(StringRef Name) const
SmallVectorImpl< Init * >::const_iterator const_arg_iterator
ArrayRef< SMLoc > getLoc() const
'bits<n>' - Represent a fixed number of bits
ArrayRef< Record * > getClasses() const
bool isComplete() const override
This virtual method should be overridden by values that may not be completely specified yet...
bool isTemplateArg(Init *Name) const
StringRef getValue() const
Simple integer binary arithmetic operators.
bool isSubClassOf(const Record *R) const
static bool classof(const RecTy *RT)
ArrayRef< Init * > getValues() const
ArrayRef< Init * > getArgs() const
OpInit(InitKind K, RecTy *Type, uint8_t Opc)
static bool classof(const Init *I)
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
static bool classof(const RecTy *RT)
LLVM_NODISCARD size_t size() const
size - Get the string size.
bool operator()(const Record *Rec1, const Record *Rec2) const
static bool classof(const RecTy *RT)
bool isComplete() const override
This virtual method should be overridden by values that may not be completely specified yet...
static bool classof(const Init *I)
unsigned getNumBits() const
void print(raw_ostream &OS) const
Print out this value.
Init * getBit(unsigned Bit) const override
This method is used to return the initializer for the specified bit.
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations? Unset values are concrete.
virtual Init * convertInitListSlice(ArrayRef< unsigned > Elements) const
This method is used to implement the list slice selection operator.
ArrayRef< RecordVal > getValues() const
const_record_iterator classes_end() const
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations? Unset values are concrete.
'code' - Represent a code fragment
ArrayRef< Init * > getVals() const
SmallVectorImpl< StringInit * >::const_iterator const_name_iterator
void addShadow(Init *Key)
FoldingSetNodeID - This class is used to gather all the unique data bits of a node.
std::string getAsString() const override
Convert this value to a string form.
unsigned getElementNum() const
Base class for operators.
static bool classof(const Init *I)
OpInit * clone(ArrayRef< Init *> Operands) const override
Init * getBit(unsigned Bit) const override
This method is used to return the initializer for the specified bit.
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations? Unset values are concrete.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
Init * getElement(unsigned i) const
Resolve arbitrary mappings.
Init * getNameInit() const
PointerIntPair - This class implements a pair of a pointer and small integer.
The instances of the Type class are immutable: once they are created, they are never changed...
bool keepUnsetBits() const override
bool isComplete() const override
This virtual method should be overridden by values that may not be completely specified yet...
virtual bool isConcrete() const
Is this a concrete and fully resolved value without any references or stuck operations? Unset values are concrete.
size_t size() const
size - Get the array size.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
"foo" - Represent an initialization by a string value.
unsigned getNumOperands() const override
void addExtraGlobal(StringRef Name, Init *I)
Interface for looking up the initializer for a variable name, used by Init::resolveReferences.
std::pair< iterator, bool > insert(const ValueT &V)
ArrayRef< Init * > args() const
!op (X) - Transform an init.
Init * getOperand(unsigned i) const override
StringInit * getFieldName() const
const std::string getNameInitAsString() const
SmallVector< std::pair< bool, StringRef >, 4 > Parts
See the file comment for details on the usage of the TrailingObjects type.
StringRef getValueAsString(StringRef FieldName) const
This method looks up the specified field and returns its value as a string, throwing an exception if ...
OpInit * clone(ArrayRef< Init *> Operands) const override
UnaryOp getOpcode() const
static bool classof(const Init *I)
void EmitJSON(RecordKeeper &RK, raw_ostream &OS)
'string' - Represent an string value
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations? Unset values are concrete.
static BitInit * get(bool V)
std::string getAsString() const override
Convert this value to a string form.
const RecordVal * getValue(StringRef Name) const
static bool classof(const Init *I)
DefInit * getDefInit()
get the corresponding DefInit.
std::string getAsUnquotedString() const override
Convert this value to a string form, without adding quote markers.
iterator erase(const_iterator CI)
StringInit * getName() const
static wasm::ValType getType(const TargetRegisterClass *RC)
bool isComplete() const override
This virtual method should be overridden by values that may not be completely specified yet...
FoldingSet - This template class is used to instantiate a specialized implementation of the folding s...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
static bool classof(const Init *I)
static RecordRecTy * get(ArrayRef< Record *> Classes)
Get the record type with the given non-redundant list of superclasses.
Record(Init *N, ArrayRef< SMLoc > locs, RecordKeeper &records, bool Anonymous=false, bool Class=false)
Delegate resolving to a sub-resolver, but shadow some variable names.
void setFinal(bool Final)
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...
void addTemplateArg(Init *Name)
static bool classof(const Init *I)
virtual bool typeIsA(const RecTy *RHS) const
Return true if 'this' type is equal to or a subtype of RHS.
const RecordVal * getValue(const Init *Name) const
SmallVectorImpl< Init * >::const_iterator const_case_iterator
const RecordMap & getClasses() const
Init * getOperator() const
TrackUnresolvedResolver(Resolver *R=nullptr)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
RecordVal * getValue(StringRef Name)
static StringInit * get(StringRef)
static bool classof(const RecTy *RT)
static bool classof(const RecTy *RT)
RecordKeeper & getRecords() const
const_case_iterator arg_begin() const
unsigned getNumArgs() const
bool isSubClassOf(StringRef Name) const
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
RecTy * getElementType() const
classname<targs...> - Represent an uninstantiated anonymous class instantiation.
Init * getBit(unsigned Bit) const override
This method is used to return the initializer for the specified bit.
static unsigned getNewUID()
!isa<type>(expr) - Dynamically determine the type of an expression.
Record(StringRef N, ArrayRef< SMLoc > locs, RecordKeeper &records, bool Class=false)
void removeValue(Init *Name)
const SMLoc & getLoc() const
bool operator()(const Record *Rec1, const Record *Rec2) const
static bool classof(const Init *I)
Init * getBit(unsigned Bit) const override
This method is used to return the initializer for the specified bit.
'int' - Represent an integer value of no particular size
std::string getAsString() const override
Convert this value to a string form.
OpInit * clone(ArrayRef< Init *> Operands) const override
static bool ascii_isdigit(char x)
void appendLoc(SMLoc Loc)
RecTy * getValType() const
bool isDigit(char C)
Checks if character C is one of the 10 decimal digits.
Bitwise operators - logical and, logical or, logical xor.
std::string getNameInitAsString() const
std::string getAsString() const override
Init * getNameInit() const
Node - This class is used to maintain the singly linked bucket list in a folding set.
TypedInit(InitKind K, RecTy *T, uint8_t Opc=0)
Do not resolve anything, but keep track of whether a given variable was referenced.
Init * getGlobal(StringRef Name) const
Init * getBit(unsigned B) const override
This method is used to return the initializer for the specified bit.
Record *const * const_record_iterator
void addValue(const RecordVal &RV)
ArrayRef< Init * > getConds() const
static TernOpInit * get(TernaryOp opc, Init *lhs, Init *mhs, Init *rhs, RecTy *Type)
const_iterator begin() const
RecTy * resolveTypes(RecTy *T1, RecTy *T2)
Find a common type that T1 and T2 convert to.
Opcode{0} - Represent access to one bit of a variable or field.
bool isComplete() const override
This virtual method should be overridden by values that may not be completely specified yet...
'Opcode' - Represent a reference to an entire variable object.
Init(InitKind K, uint8_t Opc=0)
'bit' - Represent a single bit
!op (X, Y, Z) - Combine two inits.
size_type count(const_arg_type_t< ValueT > V) const
Return 1 if the specified key is in the set, 0 otherwise.
static bool classof(const Init *I)
RecordValResolver(Record &R, const RecordVal *RV)
raw_ostream & operator<<(raw_ostream &OS, const APInt &I)
Init * getOperand(unsigned i) const override
const_name_iterator name_begin() const
virtual bool keepUnsetBits() const
RecTyKind getRecTyKind() const
RecordParts(StringRef Rec)
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
unsigned getNumOperands() const override
Record * getDef(StringRef Name) const
ArrayRef< StringInit * > getArgNames() const
static LLVM_ATTRIBUTE_ALWAYS_INLINE bool CheckType(const unsigned char *MatcherTable, unsigned &MatcherIndex, SDValue N, const TargetLowering *TLI, const DataLayout &DL)
StringRef getName() const
MapResolver(Record *CurRec=nullptr)
LLVM_NODISCARD const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
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.
BinaryOp getOpcode() const
TernaryOp getOpcode() const
(v a, b) - Represent a DAG tree value.
virtual std::string getAsString() const =0
Convert this value to a string form.
This header defines support for implementing classes that have some trailing object (or arrays of obj...
unsigned getNumOperands() const override
Init * getBit(unsigned Bit) const override
This method is used to return the initializer for the specified bit.
const_val_iterator name_begin() const
std::string getAsString() const override
Convert this value to a string form.
This class implements an extremely fast bulk output stream that can only output to a stream...
InitKind
Discriminator enum (for isa<>, dyn_cast<>, et al.)
Init * getVal(unsigned Num) const
Init *const * const_iterator
StringRef - Represent a constant reference to a string, i.e.
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations? Unset values are concrete.
std::string getAsUnquotedString() const override
Convert this value to a string form, without adding quote markers.
static bool classof(const Init *I)
Init * getBit(unsigned Bit) const override
This method is used to return the initializer for the specified bit.
std::string getAsString() const override
Convert this value to a string form.
virtual std::string getAsString() const =0
Represents a location in source code.
ListRecTy * getListTy()
Returns the type representing list<this>.
Init * getNameInit() const
const_arg_iterator arg_begin() const
StringRef getArgNameStr(unsigned Num) const
bool isValueUnset(StringRef FieldName) const
Return true if the named field is unset.
const RecordMap & getDefs() const
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
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.
static bool classof(const Init *I)
const_arg_iterator arg_end() const
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.
static bool classof(const Init *I)
ShadowResolver(Resolver &R)