15 #ifndef LLVM_TABLEGEN_RECORD_H
16 #define LLVM_TABLEGEN_RECORD_H
71 virtual ~RecTy() =
default;
304 virtual void anchor();
315 virtual ~Init() =
default;
381 return const_cast<Init *
>(
this);
398 I.
print(OS);
return OS;
437 unsigned Elt)
const = 0;
487 assert(Bit < 1 &&
"Bit index out of range!");
488 return const_cast<BitInit*
>(
this);
509 void operator delete(
void *p) { ::operator
delete(p); }
542 unsigned Elt)
const override {
549 assert(Bit < NumBits &&
"Bit index out of range!");
550 return getTrailingObjects<Init *>()[Bit];
570 static IntInit *
get(int64_t V);
583 unsigned Elt)
const override {
622 unsigned Elt)
const override {
653 return "[{" +
Value.str() +
"}]";
662 unsigned Elt)
const override {
689 void operator delete(
void *p) { ::operator
delete(p); }
699 assert(i < NumValues &&
"List element index out of range!");
700 return getTrailingObjects<Init *>()[i];
719 return makeArrayRef(getTrailingObjects<Init *>(), NumValues);
725 size_t size ()
const {
return NumValues; }
726 bool empty()
const {
return NumValues == 0; }
732 unsigned Elt)
const override;
766 unsigned Elt)
const override;
784 UnOpInit(
const UnOpInit &Other) =
delete;
785 UnOpInit &
operator=(
const UnOpInit &Other) =
delete;
798 "Wrong number of operands for unary operation");
805 assert(i == 0 &&
"Invalid operand id for unary operator");
835 BinOpInit(
const BinOpInit &Other) =
delete;
836 BinOpInit &
operator=(
const BinOpInit &Other) =
delete;
850 "Wrong number of operands for binary operation");
883 Init *LHS, *MHS, *RHS;
890 TernOpInit(
const TernOpInit &Other) =
delete;
891 TernOpInit &
operator=(
const TernOpInit &Other) =
delete;
906 "Wrong number of operands for ternary operation");
964 unsigned Elt)
const override;
990 (isa<IntRecTy>(T->
getType()) ||
991 (isa<BitsRecTy>(T->
getType()) &&
992 cast<BitsRecTy>(T->
getType())->getNumBits() >
B)) &&
993 "Illegal VarBitInit expression!");
1015 assert(B < 1 &&
"Bit index out of range!");
1028 cast<ListRecTy>(T->
getType())->getElementType()),
1031 "Illegal VarBitInit expression!");
1051 unsigned Elt)
const override;
1098 unsigned Elt)
const override {
1127 unsigned Elt)
const override;
1149 Args(ArgRange.
begin(), ArgRange.
end()),
1150 ArgNames(NameRange.
begin(), NameRange.
end()) {}
1178 assert(Num < Args.size() &&
"Arg number out of range!");
1182 assert(Num < ArgNames.size() &&
"Arg number out of range!");
1183 return ArgNames[Num];
1200 inline size_t arg_size ()
const {
return Args.size(); }
1206 inline size_t name_size ()
const {
return ArgNames.size(); }
1214 unsigned Elt)
const override {
1247 return Value ==
nullptr;
1258 RV.
print(OS <<
" ");
1263 static unsigned LastID;
1301 bool Anonymous =
false) :
1302 Name(N), Locs(locs.
begin(), locs.
end()), TrackedRecords(records),
1303 ID(LastID++), IsAnonymous(Anonymous), ResolveFirst(
false) {
1308 bool Anonymous =
false)
1315 Name(O.Name), Locs(O.Locs), TemplateArgs(O.TemplateArgs),
1316 Values(O.Values), SuperClasses(O.SuperClasses),
1317 TrackedRecords(O.TrackedRecords), ID(LastID++),
1318 IsAnonymous(O.IsAnonymous), ResolveFirst(O.ResolveFirst) { }
1342 return TemplateArgs;
1348 return SuperClasses;
1352 for (
Init *
TA : TemplateArgs)
1353 if (
TA == Name)
return true;
1363 if (Val.Name == Name)
return &Val;
1373 if (Val.Name == Name)
return &Val;
1383 TemplateArgs.push_back(Name);
1392 Values.push_back(RV);
1393 if (Values.size() > 1)
1399 std::swap(Values[Values.size() - 2], Values[Values.size() - 1]);
1403 for (
unsigned i = 0, e = Values.size();
i != e; ++
i)
1405 Values.erase(Values.begin()+
i);
1416 for (
const auto &SCPair : SuperClasses)
1417 if (SCPair.first == R)
1423 for (
const auto &SCPair : SuperClasses) {
1424 if (
const auto *
SI = dyn_cast<StringInit>(SCPair.first->getNameInit())) {
1425 if (
SI->getValue() == Name)
1427 }
else if (SCPair.first->getNameInitAsString() == Name) {
1436 SuperClasses.push_back(std::make_pair(R, Range));
1450 return TrackedRecords;
1458 return ResolveFirst;
1548 raw_ostream &
operator<<(raw_ostream &OS,
const Record &R);
1558 Rec(Name, Loc, Records) {}
1562 typedef std::map<std::string, std::unique_ptr<Record>> RecordMap;
1563 RecordMap Classes, Defs;
1570 auto I = Classes.find(Name);
1571 return I == Classes.end() ?
nullptr :
I->second.get();
1575 auto I = Defs.find(Name);
1576 return I == Defs.end() ?
nullptr :
I->second.get();
1580 bool Ins = Classes.insert(std::make_pair(R->getName(),
1581 std::move(R))).second;
1583 assert(Ins &&
"Class already exists");
1587 bool Ins = Defs.insert(std::make_pair(R->getName(),
1588 std::move(R))).second;
1590 assert(Ins &&
"Record already exists");
1642 const char *Start = Rec.
data();
1643 const char *Curr = Start;
1645 for (
size_t I = 0,
E = Rec.
size();
I !=
E; ++
I, ++Len) {
1647 if (isDigit != isDigitPart) {
1648 Parts.push_back(std::make_pair(isDigitPart,
StringRef(Start, Len)));
1655 Parts.push_back(std::make_pair(isDigitPart,
StringRef(Start, Len)));
1670 size_t LHSNumParts = LHSParts.
size();
1671 size_t RHSNumParts = RHSParts.
size();
1672 assert (LHSNumParts && RHSNumParts &&
"Expected at least one part!");
1674 if (LHSNumParts != RHSNumParts)
1675 return LHSNumParts < RHSNumParts;
1678 for (
size_t I = 0,
E = LHSNumParts;
I <
E;
I+=2) {
1679 std::pair<bool, StringRef> LHSPart = LHSParts.
getPart(
I);
1680 std::pair<bool, StringRef> RHSPart = RHSParts.
getPart(
I);
1682 assert (LHSPart.first ==
false && RHSPart.first ==
false &&
1683 "Expected both parts to be alpha.");
1684 if (
int Res = LHSPart.second.compare(RHSPart.second))
1687 for (
size_t I = 1, E = LHSNumParts;
I <
E;
I+=2) {
1688 std::pair<bool, StringRef> LHSPart = LHSParts.
getPart(
I);
1689 std::pair<bool, StringRef> RHSPart = RHSParts.
getPart(
I);
1691 assert (LHSPart.first ==
true && RHSPart.first ==
true &&
1692 "Expected both parts to be numeric.");
1693 if (LHSPart.second.size() != RHSPart.second.size())
1694 return LHSPart.second.size() < RHSPart.second.size();
1696 unsigned LHSVal, RHSVal;
1698 bool LHSFailed = LHSPart.second.getAsInteger(10, LHSVal); (void)LHSFailed;
1699 assert(!LHSFailed &&
"Unable to convert LHS to integer.");
1700 bool RHSFailed = RHSPart.second.getAsInteger(10, RHSVal); (void)RHSFailed;
1701 assert(!RHSFailed &&
"Unable to convert RHS to integer.");
1703 if (LHSVal != RHSVal)
1704 return LHSVal < RHSVal;
1706 return LHSNumParts < RHSNumParts;
1710 raw_ostream &
operator<<(raw_ostream &OS,
const RecordKeeper &RK);
1715 Init *
Name, StringRef Scoper);
1719 #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...
void addTemplateArg(StringRef Name)
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...
void operator=(const VarListElementInit &Other)=delete
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
UnsetInit & operator=(const UnsetInit &Other)=delete
RecTyKind
Subclass discriminator (for dyn_cast<> et al.)
virtual bool isComplete() const
This virtual method should be overridden by values that may not be completely specified yet...
void Profile(FoldingSetNodeID &ID) const
unsigned getNumBits() const
unsigned getNumArgs() const
bool getValueAsBit(StringRef FieldName) const
This method looks up the specified field and returns its value as a bit, throwing an exception if the...
OpInit & operator=(OpInit &Other)=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)
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
const_iterator begin(StringRef path)
Get begin iterator over path.
TernOpInit & operator=(const TernOpInit &Other)=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
SmallVectorImpl< StringInit * >::const_iterator const_name_iterator
void setResolveFirst(bool b)
static bool classof(const Init *I)
void removeValue(StringRef Name)
std::string getValueAsString(StringRef FieldName) const
This method looks up the specified field and returns its value as a string, throwing an exception if ...
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.
FieldInit & operator=(const FieldInit &Other)=delete
SmallVectorImpl< Init * >::const_iterator const_arg_iterator
ArrayRef< Init * > getTemplateArgs() const
void print(raw_ostream &OS) const
Print out this value.
VarBitInit & operator=(const VarBitInit &Other)=delete
static bool classof(const Init *I)
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
static GCRegistry::Add< StatepointGC > D("statepoint-example","an example strategy for statepoint")
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
VarInit & operator=(const VarInit &Other)=delete
std::string getAsString() const override
Convert this value to a string form.
StringRef getName() const
std::vector< std::unique_ptr< Record > > RecordVector
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
'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
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)
Function Alias Analysis false
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)
UnOpInit & operator=(const UnOpInit &Other)=delete
static GCRegistry::Add< OcamlGC > B("ocaml","ocaml 3.10-compatible GC")
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.
std::vector< std::string > 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.
BinOpInit & operator=(const BinOpInit &Other)=delete
Init * convertInitListSlice(ArrayRef< unsigned > Elements) const override
This method is used to implement the list slice selection operator.
IntInit & operator=(const IntInit &Other)=delete
'code' - Represent a code fragment
static GCRegistry::Add< CoreCLRGC > E("coreclr","CoreCLR-compatible GC")
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.
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.
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
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...
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
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
See the file comment for details on the usage of the TrailingObjects type.
const RecordVal * getValue(const Init *Name) const
StringInit & operator=(const StringInit &Other)=delete
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.
bool isTemplateArg(StringRef Name) const
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.
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.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
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
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.
Node - This class is used to maintain the singly linked bucket list in a folding set.
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.
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.
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
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)
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)
DagInit & operator=(const DagInit &Other)=delete
static TernOpInit * get(TernaryOp opc, Init *lhs, Init *mhs, Init *rhs, RecTy *Type)
OpInit * clone(ArrayRef< Init * > Operands) const override
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.
BitsInit & operator=(const BitsInit &Other)=delete
BitInit & operator=(BitInit &Other)=delete
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...
DefInit & operator=(const DefInit &Other)=delete
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...
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())
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.
StringRef getValue() const
ListInit & operator=(const ListInit &Other)=delete
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.
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.)
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.
Init *const * const_iterator
Represents a location in source code.
ListRecTy * getListTy()
Returns the type representing list<this>.
StringRef getValue() const
const_name_iterator name_begin() const
TypedInit & operator=(const TypedInit &Other)=delete
CodeInit & operator=(const StringInit &Other)=delete
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)