15 #ifndef LLVM_TABLEGEN_RECORD_H
16 #define LLVM_TABLEGEN_RECORD_H
71 virtual ~RecTy() =
default;
295 virtual void anchor();
306 virtual ~Init() =
default;
367 return const_cast<Init *
>(
this);
384 I.
print(OS);
return OS;
422 unsigned Elt)
const = 0;
470 assert(Bit < 1 &&
"Bit index out of range!");
471 return const_cast<BitInit*
>(
this);
491 void operator delete(
void *p) { ::operator
delete(p); }
524 unsigned Elt)
const override {
531 assert(Bit < NumBits &&
"Bit index out of range!");
532 return getTrailingObjects<Init *>()[Bit];
551 static IntInit *
get(int64_t V);
564 unsigned Elt)
const override {
602 unsigned Elt)
const override {
633 return "[{" +
Value.str() +
"}]";
642 unsigned Elt)
const override {
669 void operator delete(
void *p) { ::operator
delete(p); }
679 assert(i < NumValues &&
"List element index out of range!");
680 return getTrailingObjects<Init *>()[i];
699 return makeArrayRef(getTrailingObjects<Init *>(), NumValues);
705 size_t size ()
const {
return NumValues; }
706 bool empty()
const {
return NumValues == 0; }
712 unsigned Elt)
const override;
746 unsigned Elt)
const override;
764 UnOpInit(
const UnOpInit &) =
delete;
765 UnOpInit &
operator=(
const UnOpInit &) =
delete;
778 "Wrong number of operands for unary operation");
785 assert(i == 0 &&
"Invalid operand id for unary operator");
814 BinOpInit(
const BinOpInit &) =
delete;
815 BinOpInit &
operator=(
const BinOpInit &) =
delete;
829 "Wrong number of operands for binary operation");
861 Init *LHS, *MHS, *RHS;
868 TernOpInit(
const TernOpInit &) =
delete;
869 TernOpInit &
operator=(
const TernOpInit &) =
delete;
884 "Wrong number of operands for ternary operation");
941 unsigned Elt)
const override;
966 (isa<IntRecTy>(T->
getType()) ||
967 (isa<BitsRecTy>(T->
getType()) &&
968 cast<BitsRecTy>(T->
getType())->getNumBits() >
B)) &&
969 "Illegal VarBitInit expression!");
991 assert(B < 1 &&
"Bit index out of range!");
1004 cast<ListRecTy>(T->
getType())->getElementType()),
1007 "Illegal VarBitInit expression!");
1027 unsigned Elt)
const override;
1073 unsigned Elt)
const override {
1101 unsigned Elt)
const override;
1120 unsigned NumArgNames;
1124 NumArgs(NumArgs), NumArgNames(NumArgNames) {}
1126 size_t numTrailingObjects(OverloadToken<Init *>)
const {
return NumArgs; }
1156 assert(Num < NumArgs &&
"Arg number out of range!");
1157 return getTrailingObjects<Init *>()[Num];
1161 assert(Num < NumArgNames &&
"Arg number out of range!");
1162 return getTrailingObjects<StringInit *>()[Num];
1171 return makeArrayRef(getTrailingObjects<Init *>(), NumArgs);
1175 return makeArrayRef(getTrailingObjects<StringInit *>(), NumArgNames);
1202 unsigned Elt)
const override {
1235 return Value ==
nullptr;
1246 RV.
print(OS <<
" ");
1251 static unsigned LastID;
1281 bool ResolveFirst =
false;
1289 bool Anonymous =
false) :
1290 Name(N), Locs(locs.
begin(), locs.
end()), TrackedRecords(records),
1291 ID(LastID++), IsAnonymous(Anonymous) {
1296 bool Anonymous =
false)
1303 Name(O.Name), Locs(O.Locs), TemplateArgs(O.TemplateArgs),
1304 Values(O.Values), SuperClasses(O.SuperClasses),
1305 TrackedRecords(O.TrackedRecords), ID(LastID++),
1306 IsAnonymous(O.IsAnonymous), ResolveFirst(O.ResolveFirst) { }
1330 return TemplateArgs;
1336 return SuperClasses;
1340 for (
Init *
TA : TemplateArgs)
1341 if (
TA == Name)
return true;
1347 if (Val.Name == Name)
return &Val;
1365 TemplateArgs.push_back(Name);
1370 Values.push_back(RV);
1371 if (Values.size() > 1)
1377 std::swap(Values[Values.size() - 2], Values[Values.size() - 1]);
1381 for (
unsigned i = 0, e = Values.size(); i != e; ++i)
1383 Values.erase(Values.begin()+i);
1394 for (
const auto &SCPair : SuperClasses)
1395 if (SCPair.first == R)
1401 for (
const auto &SCPair : SuperClasses) {
1402 if (
const auto *
SI = dyn_cast<StringInit>(SCPair.first->getNameInit())) {
1403 if (
SI->getValue() == Name)
1405 }
else if (SCPair.first->getNameInitAsString() == Name) {
1414 SuperClasses.push_back(std::make_pair(R, Range));
1427 return TrackedRecords;
1435 return ResolveFirst;
1514 raw_ostream &
operator<<(raw_ostream &OS,
const Record &R);
1524 Rec(Name, Loc, Records) {}
1528 using RecordMap = std::map<std::string, std::unique_ptr<Record>>;
1529 RecordMap Classes, Defs;
1536 auto I = Classes.find(Name);
1537 return I == Classes.end() ?
nullptr :
I->second.get();
1541 auto I = Defs.find(Name);
1542 return I == Defs.end() ?
nullptr :
I->second.get();
1546 bool Ins = Classes.insert(std::make_pair(R->getName(),
1547 std::move(R))).second;
1549 assert(Ins &&
"Class already exists");
1553 bool Ins = Defs.insert(std::make_pair(R->getName(),
1554 std::move(R))).second;
1556 assert(Ins &&
"Record already exists");
1606 const char *Start = Rec.
data();
1607 const char *Curr = Start;
1609 for (
size_t I = 0,
E = Rec.
size();
I !=
E; ++
I, ++Len) {
1611 if (isDigit != isDigitPart) {
1612 Parts.push_back(std::make_pair(isDigitPart,
StringRef(Start, Len)));
1619 Parts.push_back(std::make_pair(isDigitPart,
StringRef(Start, Len)));
1634 size_t LHSNumParts = LHSParts.
size();
1635 size_t RHSNumParts = RHSParts.
size();
1636 assert (LHSNumParts && RHSNumParts &&
"Expected at least one part!");
1638 if (LHSNumParts != RHSNumParts)
1639 return LHSNumParts < RHSNumParts;
1642 for (
size_t I = 0,
E = LHSNumParts;
I <
E;
I+=2) {
1643 std::pair<bool, StringRef> LHSPart = LHSParts.
getPart(
I);
1644 std::pair<bool, StringRef> RHSPart = RHSParts.
getPart(
I);
1646 assert (LHSPart.first ==
false && RHSPart.first ==
false &&
1647 "Expected both parts to be alpha.");
1648 if (
int Res = LHSPart.second.compare(RHSPart.second))
1651 for (
size_t I = 1, E = LHSNumParts;
I <
E;
I+=2) {
1652 std::pair<bool, StringRef> LHSPart = LHSParts.
getPart(
I);
1653 std::pair<bool, StringRef> RHSPart = RHSParts.
getPart(
I);
1655 assert (LHSPart.first ==
true && RHSPart.first ==
true &&
1656 "Expected both parts to be numeric.");
1657 if (LHSPart.second.size() != RHSPart.second.size())
1658 return LHSPart.second.size() < RHSPart.second.size();
1660 unsigned LHSVal, RHSVal;
1662 bool LHSFailed = LHSPart.second.getAsInteger(10, LHSVal); (void)LHSFailed;
1663 assert(!LHSFailed &&
"Unable to convert LHS to integer.");
1664 bool RHSFailed = RHSPart.second.getAsInteger(10, RHSVal); (void)RHSFailed;
1665 assert(!RHSFailed &&
"Unable to convert RHS to integer.");
1667 if (LHSVal != RHSVal)
1668 return LHSVal < RHSVal;
1670 return LHSNumParts < RHSNumParts;
1674 raw_ostream &
operator<<(raw_ostream &OS,
const RecordKeeper &RK);
1679 Init *
Name, StringRef Scoper);
1683 #endif // LLVM_TABLEGEN_RECORD_H
Init * resolveReferences(Record &R, const RecordVal *RV) const override
This method is used by classes that refer to other variables which may not be defined at the time the...
static BinOpInit * get(BinaryOp opc, Init *lhs, Init *rhs, RecTy *Type)
RecordVal * getValue(const Init *Name)
Represents a range in source code.
Init * convertInitializerTo(RecTy *Ty) const override
This virtual function converts to the appropriate Init based on the passed in type.
void print(raw_ostream &OS) const
static bool classof(const Init *I)
Init * resolveListElementReference(Record &R, const RecordVal *RV, unsigned Elt) const override
This method is used to implement VarListElementInit::resolveReferences.
std::string getAsString() const override
const_iterator end(StringRef path)
Get end iterator over path.
Init * resolveReferences(Record &R, const RecordVal *RV) const override
This method is used by classes that refer to other variables which may not be defined at the time the...
Init * resolveReferences(Record &R, const RecordVal *RV) const override
This method is used by classes that refer to other variables which may not be defined at the time the...
bool operator()(const Record *Rec1, const Record *Rec2) const
RecTyKind
Subclass discriminator (for dyn_cast<> et al.)
ArrayRef< StringInit * > getArgNames() const
virtual bool isComplete() const
This virtual method should be overridden by values that may not be completely specified yet...
StringRef getValueAsString(StringRef FieldName) const
This method looks up the specified field and returns its value as a string, throwing an exception if ...
void Profile(FoldingSetNodeID &ID) const
unsigned getNumBits() const
const_iterator begin(StringRef path, Style style=Style::native)
Get begin iterator over path.
unsigned getNumArgs() const
typename SuperClass::const_iterator const_iterator
TypedInit & operator=(const TypedInit &)=delete
bool getValueAsBit(StringRef FieldName) const
This method looks up the specified field and returns its value as a bit, throwing an exception if the...
UnOpInit & operator=(const UnOpInit &)=delete
Sorting predicate to sort record pointers by name.
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.
[AL, AH, CL] - Represent a list of defs
'7' - Represent an initialization by a literal integer value.
static bool classof(const RecTy *RT)
'list<Ty>' - Represent a list of values, all of which must be of the specified type.
!op (X, Y) - Combine two inits.
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.
Record * getElementAsRecord(unsigned i) const
virtual bool typeIsConvertibleTo(const RecTy *RHS) const
Return true if all values of 'this' type can be converted to the specified type.
Init * resolveListElementReference(Record &R, const RecordVal *RV, unsigned Elt) const override
resolveListElementReference - This method is used to implement VarListElementInit::resolveReferences...
Init * resolveReferences(Record &R, const RecordVal *RV) const override
This method is used by classes that refer to other variables which may not be defined at the time the...
Init * resolveListElementReference(Record &R, const RecordVal *RV, unsigned Elt) const override
This method is used to implement VarListElementInit::resolveReferences.
const RecordVal * getValue(StringRef Name) const
Sorting predicate to sort record pointers by their name field.
Init * convertInitializerTo(RecTy *Ty) const override
This virtual function converts to the appropriate Init based on the passed in type.
AL - Represent a reference to a 'def' in the description.
static bool classof(const Init *I)
StringRef getName() const
std::string getNameInitAsString() const
static UnOpInit * get(UnaryOp opc, Init *lhs, RecTy *Type)
static bool classof(const Init *I)
void addDef(std::unique_ptr< Record > R)
BinOpInit & operator=(const BinOpInit &)=delete
Init * resolveListElementReference(Record &R, const RecordVal *RV, unsigned Elt) const override
This method is used to implement VarListElementInit::resolveReferences.
Init * convertInitializerBitRange(ArrayRef< unsigned > Bits) const override
This method is used to implement the bitrange selection operator.
Init * getValueInit(StringRef FieldName) const
Return the initializer for a value with the specified name, or throw an exception if the field does n...
RecTy * getFieldType(StringInit *FieldName) const override
This method is used to implement the FieldInit class.
Init * resolveListElementReference(Record &R, const RecordVal *RV, unsigned Elt) const override
This method is used to implement VarListElementInit::resolveReferences.
Init * getOperand(unsigned i) const override
Init * resolveListElementReference(Record &R, const RecordVal *RV, unsigned Elt) const override
This method is used to implement VarListElementInit::resolveReferences.
Init * resolveReferences(Record &R, const RecordVal *RV) const override
This method is used by classes that refer to other variables which may not be defined at the time the...
StringInit * getArgName(unsigned Num) const
static bool classof(const RecTy *RT)
std::string getAsString() const override
Convert this value to a string form.
std::string getAsString() const override
virtual Init * convertInitListSlice(ArrayRef< unsigned > Elements) const
This method is used to implement the list slice selection operator.
Init * Fold(Record *CurRec, MultiClass *CurMultiClass) const override
void Profile(FoldingSetNodeID &ID) const
StringInit & operator=(const StringInit &)=delete
BinaryOp getOpcode() const
Record * getValueAsDef(StringRef FieldName) const
This method looks up the specified field and returns its value as a Record, throwing an exception if ...
Init * getElement(unsigned i) const
bool allInComplete() const
DefInit & operator=(const DefInit &)=delete
void setResolveFirst(bool b)
ListInit & operator=(const ListInit &)=delete
static bool classof(const Init *I)
void removeValue(StringRef Name)
Init * getOperator() const
'{ a, b, c }' - Represents an initializer for a BitsRecTy value.
std::pair< bool, StringRef > getPart(size_t i)
std::string getAsString() const override
virtual std::string getAsUnquotedString() const
Convert this value to a string form, without adding quote markers.
ArrayRef< Init * > getTemplateArgs() const
void print(raw_ostream &OS) const
Print out this value.
static bool classof(const Init *I)
VarInit & operator=(const VarInit &)=delete
Sorting predicate to sort record pointers by their unique ID.
static bool classof(const Init *I)
'?' - 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.
Init * convertInitializerBitRange(ArrayRef< unsigned > Bits) const override
This method is used to implement the bitrange selection operator.
StringRef getName() const
static bool classof(const Init *I)
static BitsRecTy * get(unsigned Sz)
static bool classof(const RecTy *RT)
Init * getBit(unsigned Bit) const override
This method is used to return the initializer for the specified bit.
static bool classof(const Init *I)
virtual Init * resolveListElementReference(Record &R, const RecordVal *RV, unsigned Elt) const =0
This method is used to implement VarListElementInit::resolveReferences.
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.
bool typeIsConvertibleTo(const RecTy *RHS) const override
Return true if all values of 'this' type can be converted to the specified type.
Init * getBit(unsigned Bit) const override
This method is used to return the initializer for the specified bit.
void addClass(std::unique_ptr< Record > R)
static StringRecTy * get()
Init * getOperand() const
std::string getAsString() const override
std::string getAsString() const override
List[4] - Represent access to one element of a var or field.
'[classname]' - Represent an instance of a class, such as: (R32 X = EAX).
Init * convertInitializerTo(RecTy *Ty) const override
This virtual function converts to the appropriate Init based on the passed in type.
const_name_iterator name_end() const
std::string getAsString() const override
Convert this value to a string form.
StringRef getName() const
Init * resolveReferences(Record &R, const RecordVal *RV) const override
This method is used by classes that refer to other variables which may not be defined at the time the...
virtual Init * getFieldInit(Record &R, const RecordVal *RV, StringInit *FieldName) const
This method complements getFieldType to return the initializer for the specified field.
std::string getAsString() const override
Convert this value to a string form.
virtual unsigned getNumOperands() const =0
void print(raw_ostream &OS, bool PrintSem=true) const
BitsInit * getValueAsBitsInit(StringRef FieldName) const
This method looks up the specified field and returns its value as a BitsInit, throwing an exception i...
const_iterator begin() const
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.
SmallVectorImpl< Init * >::const_iterator const_arg_iterator
'bits<n>' - Represent a fixed number of bits
ListInit * getValueAsListInit(StringRef FieldName) const
This method looks up the specified field and returns its value as a ListInit, throwing an exception i...
Init * resolveReferences(Record &R, const RecordVal *RV) const override
This method is used by classes that refer to other variables which may not be defined at the time the...
const std::string getNameInitAsString() const
BitInit & operator=(BitInit &)=delete
void resolveReferences()
If there are any field references that refer to fields that have been filled in, we can propagate the...
const_arg_iterator arg_end() const
static bool classof(const RecTy *RT)
Record(Init *N, ArrayRef< SMLoc > locs, RecordKeeper &records, bool Anonymous=false)
Init * getArg(unsigned Num) const
OpInit(InitKind K, RecTy *Type, uint8_t Opc)
static bool classof(const Init *I)
void Profile(FoldingSetNodeID &ID) const
std::string getAsString() const override
Convert this value to a string form.
OpInit * clone(ArrayRef< Init * > Operands) const override
static bool classof(const RecTy *RT)
static bool classof(const RecTy *RT)
static bool classof(const Init *I)
Record * getDef(StringRef Name) const
virtual unsigned getBitNum() const
This method is used to retrieve the bit number of a bit reference.
bool isResolveFirst() const
Init * Fold(Record *CurRec, MultiClass *CurMultiClass) const override
virtual Init * getBit(unsigned Bit) const =0
This method is used to return the initializer for the specified bit.
DagInit * getValueAsDag(StringRef FieldName) const
This method looks up the specified field and returns its value as an Dag, throwing an exception if th...
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t size() const
size - Get the string size.
Init * resolveListElementReference(Record &R, const RecordVal *RV, unsigned Elt) const override
This method is used to implement VarListElementInit::resolveReferences.
virtual Init * getOperand(unsigned i) const =0
size_t size() const
size - Get the array size.
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...
std::string getNameInitAsString() const
Init * convertInitializerTo(RecTy *Ty) const override
This virtual function converts to the appropriate Init based on the passed in type.
SmallVectorImpl< StringInit * >::const_iterator const_name_iterator
std::vector< Record * > getAllDerivedDefinitions(StringRef ClassName) const
This method returns all concrete definitions that derive from the specified class name...
virtual Init * convertInitializerTo(RecTy *Ty) const =0
This virtual function converts to the appropriate Init based on the passed in type.
Init * convertInitializerTo(RecTy *Ty) const override
This virtual function converts to the appropriate Init based on the passed in type.
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.
std::string getAsString() const override
Convert this value to a string form.
void dump() const
Debugging method that may be called through a debugger, just invokes print on stderr.
bool operator()(const Record *Rec1, const Record *Rec2) const
Base class for operators.
MultiClass(StringRef Name, SMLoc Loc, RecordKeeper &Records)
Init * getBit(unsigned Bit) const override
This method is used to return the initializer for the specified bit.
TernOpInit & operator=(const TernOpInit &)=delete
Init * convertInitializerTo(RecTy *Ty) const override
This virtual function converts to the appropriate Init based on the passed in type.
void Profile(FoldingSetNodeID &ID) const
ArrayRef< Init * > getArgs() const
Init * resolveListElementReference(Record &R, const RecordVal *RV, unsigned Elt) const override
This method is used to implement VarListElementInit::resolveReferences.
bool typeIsConvertibleTo(const RecTy *RHS) const override
Return true if all values of 'this' type can be converted to the specified type.
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 isComplete() const override
This virtual method should be overridden by values that may not be completely specified yet...
IntInit & operator=(const IntInit &)=delete
virtual OpInit * clone(ArrayRef< Init * > Operands) const =0
Init * resolveListElementReference(Record &R, const RecordVal *RV, unsigned Elt) const override
This method is used to implement VarListElementInit::resolveReferences.
"foo" - Represent an initialization by a string value.
RecTy * getFieldType(StringInit *FieldName) const override
This method is used to implement the FieldInit class.
RecordVector DefPrototypes
unsigned getNumOperands() const override
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
void Profile(FoldingSetNodeID &ID) const
!op (X) - Transform an init.
TypedInit * getVariable() const
Init * getOperand(unsigned i) const override
Init * convertInitializerTo(RecTy *Ty) const override
This virtual function converts to the appropriate Init based on the passed in type.
SmallVector< std::pair< bool, StringRef >, 4 > Parts
std::vector< std::unique_ptr< Record >> RecordVector
See the file comment for details on the usage of the TrailingObjects type.
const RecordVal * getValue(const Init *Name) const
static bool classof(const Init *I)
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.
'string' - Represent an string value
RecTyKind getRecTyKind() const
static BitInit * get(bool V)
std::string getAsString() const override
Convert this value to a string form.
std::string getAsString() const override
Convert this value to a string form.
virtual Init * convertInitializerBitRange(ArrayRef< unsigned > Bits) const
This method is used to implement the bitrange selection operator.
static bool classof(const Init *I)
bool isValueUnset(StringRef FieldName) const
Return true if the named field is unset.
ArrayRef< Init * > getValues() const
LLVM_NODISCARD std::string str() const
str - Get the contents as an std::string.
DefInit * getDefInit()
get the corresponding DefInit.
std::string getAsUnquotedString() const override
Convert this value to a string form, without adding quote markers.
UnsetInit & operator=(const UnsetInit &)=delete
bool isComplete() const override
This virtual method should be overridden by values that may not be completely specified yet...
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.
std::string getAsString() const override
Convert this value to a string form.
virtual Init * resolveReferences(Record &R, const RecordVal *RV) const
This method is used by classes that refer to other variables which may not be defined at the time the...
static bool classof(const Init *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...
const RecordMap & getClasses() const
Init * convertInitializerTo(RecTy *Ty) const override
This virtual function converts to the appropriate Init based on the passed in type.
virtual Init * Fold(Record *CurRec, MultiClass *CurMultiClass) const =0
Record(StringRef N, ArrayRef< SMLoc > locs, RecordKeeper &records, bool Anonymous=false)
void addTemplateArg(Init *Name)
std::string getAsString() const override
Init * convertInitListSlice(ArrayRef< unsigned > Elements) const override
This method is used to implement the list slice selection operator.
bool operator()(const Record *Rec1, const Record *Rec2) const
static bool classof(const Init *I)
Init & operator=(const Init &)=delete
ArrayRef< SMLoc > getLoc() const
StringRef getNameStr() const
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)
Init * QualifyName(Record &CurRec, MultiClass *CurMultiClass, Init *Name, StringRef Scoper)
Return an Init with a qualifier prefix referring to CurRec's name.
static bool classof(const RecTy *RT)
std::string getAsString() const override
Convert this value to a string form.
Init * convertInitializerTo(RecTy *Ty) const override
This virtual function converts to the appropriate Init based on the passed in type.
Init * getNameInit() const
const_iterator end() const
FieldInit & operator=(const FieldInit &)=delete
Init * getNameInit() const
Record * getClass(StringRef Name) const
Init * convertInitializerTo(RecTy *Ty) const override
This virtual function converts to the appropriate Init based on the passed in type.
Init * getBit(unsigned Bit) const override
This method is used to return the initializer for the specified bit.
Init * getFieldInit(Record &R, const RecordVal *RV, StringInit *FieldName) const override
This method complements getFieldType to return the initializer for the specified field.
Init * resolveReferences(Record &R, const RecordVal *RV) const override
This method is used by classes that refer to other variables which may not be defined at the time the...
Init * resolveListElementReference(Record &R, const RecordVal *RV, unsigned Elt) const override
This method is used to implement VarListElementInit::resolveReferences.
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
static unsigned getNewUID()
unsigned getElementNum() const
bool isTemplateArg(Init *Name) const
const_arg_iterator arg_begin() const
bool isSubClassOf(StringRef Name) const
Init * getBitVar() const override
This method is used to retrieve the initializer for bit reference.
void removeValue(Init *Name)
const RecordMap & getDefs() const
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool empty() const
empty - Check if the string is empty.
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.
llvm_unreachable("Unknown RegBank!")
ArrayRef< RecordVal > getValues() const
static bool ascii_isdigit(char x)
Init * resolveListElementReference(Record &R, const RecordVal *RV, unsigned Elt) const override
This method is used to implement VarListElementInit::resolveReferences.
VarBitInit & operator=(const VarBitInit &)=delete
RecTy * getElementType() const
Init * getBit(unsigned Bit) const override
This method is used to return the initializer for the specified bit.
RecordKeeper & getRecords() const
OpInit * clone(ArrayRef< Init * > Operands) const override
std::string getAsString() const override
Convert this value to a string form.
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
virtual Init * getBitVar() const
This method is used to retrieve the initializer for bit reference.
std::string getAsString() const override
Node - This class is used to maintain the singly linked bucket list in a folding set.
bool isSubClassOf(const Record *R) const
bool typeIsConvertibleTo(const RecTy *RHS) const override
Return true if all values of 'this' type can be converted to the specified type.
TypedInit(InitKind K, RecTy *T, uint8_t Opc=0)
CodeInit & operator=(const StringInit &)=delete
virtual RecTy * getFieldType(StringInit *FieldName) const
This method is used to implement the FieldInit class.
Init * getBit(unsigned B) const override
This method is used to return the initializer for the specified bit.
void addValue(const RecordVal &RV)
static TernOpInit * get(TernaryOp opc, Init *lhs, Init *mhs, Init *rhs, RecTy *Type)
OpInit * clone(ArrayRef< Init * > Operands) const override
void print(raw_ostream &OS) 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.
static ListInit * get(ArrayRef< Init * > Range, RecTy *EltTy)
std::string getAsString() const override
Convert this value to a string form.
std::string getAsString() const override
Init(InitKind K, uint8_t Opc=0)
UnaryOp getOpcode() const
'bit' - Represent a single bit
!op (X, Y, Z) - Combine two inits.
Init * Fold(Record *CurRec, MultiClass *CurMultiClass) const override
raw_ostream & operator<<(raw_ostream &OS, const APInt &I)
Init * getOperand(unsigned i) const override
Record * getRecord() const
bool getValueAsBitOrUnset(StringRef FieldName, bool &Unset) const
This method looks up the specified field and returns its value as a bit.
Init * resolveReferences(Record &R, const RecordVal *RV) const override
This method is used by classes that refer to other variables which may not be defined at the time the...
RecordParts(StringRef Rec)
'dag' - Represent a dag fragment
unsigned getNumOperands() const override
Init * resolveReferences(Record &R, const RecordVal *RV) const override
This method is used by classes that refer to other variables which may not be defined at the time the...
VarListElementInit & operator=(const VarListElementInit &)=delete
Init * getFieldInit(Record &R, const RecordVal *RV, StringInit *FieldName) const override
This method complements getFieldType to return the initializer for the specified field.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
OpInit & operator=(OpInit &)=delete
StringInit * getName() const
Init * getBit(unsigned Bit) const override
This method is used to return the initializer for the specified bit.
Init * getBit(unsigned Bit) const override
This method is used to return the initializer for the specified bit.
DagInit & operator=(const DagInit &)=delete
StringRef getValue() const
Init * getNameInit() const
LLVM Value Representation.
(v a, b) - Represent a DAG tree value.
virtual std::string getAsString() const =0
Convert this value to a string form.
BitsInit & operator=(const BitsInit &)=delete
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.
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...
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
TernaryOp getOpcode() const
InitKind
Discriminator enum (for isa<>, dyn_cast<>, et al.)
Init *const * const_iterator
StringRef getArgNameStr(unsigned Num) const
StringRef - Represent a constant reference to a string, i.e.
unsigned getBitNum() const override
This method is used to retrieve the bit number of a bit reference.
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.
void Profile(FoldingSetNodeID &ID) const
virtual std::string getAsString() const =0
Init * convertInitializerTo(RecTy *Ty) const override
This virtual function converts to the appropriate Init based on the passed in type.
Represents a location in source code.
ListRecTy * getListTy()
Returns the type representing list<this>.
StringRef getValue() const
const_name_iterator name_begin() const
ArrayRef< std::pair< Record *, SMRange > > getSuperClasses() const
bool operator()(const Record *LHS, const Record *RHS) const
RecTy * getFieldType(StringInit *FieldName) const override
This method is used to implement the FieldInit class.
std::string getAsString() const override
Convert this value to a string form.
static bool classof(const Init *I)
RecordVal(Init *N, RecTy *T, bool P)