15 #ifndef LLVM_TABLEGEN_RECORD_H
16 #define LLVM_TABLEGEN_RECORD_H
22 #include "llvm/Support/DataTypes.h"
55 std::unique_ptr<ListRecTy> ListTy;
260 Init &operator=(
const Init &) =
delete;
261 virtual void anchor();
328 const std::string &FieldName)
const {
338 return const_cast<Init *
>(
this);
355 I.
print(OS);
return OS;
399 unsigned Elt)
const = 0;
445 assert(Bit < 1 &&
"Bit index out of range!");
446 return const_cast<BitInit*
>(
this);
456 std::vector<Init*> Bits;
495 unsigned Elt)
const override {
502 assert(Bit < Bits.size() &&
"Bit index out of range!");
522 static IntInit *
get(int64_t V);
536 unsigned Elt)
const override {
573 unsigned Elt)
const override {
585 std::vector<Init*> Values;
593 Values(Range.
begin(), Range.
end()) {}
607 assert(i < Values.size() &&
"List element index out of range!");
632 size_t size ()
const {
return Values.size(); }
633 bool empty()
const {
return Values.empty(); }
639 unsigned Elt)
const override;
671 unsigned Elt)
const override;
689 UnOpInit(
const UnOpInit &
Other) =
delete;
690 UnOpInit &operator=(
const UnOpInit &
Other) =
delete;
700 assert(Operands.size() == 1 &&
701 "Wrong number of operands for unary operation");
707 assert(i == 0 &&
"Invalid operand id for unary operator");
736 BinOpInit(
const BinOpInit &
Other) =
delete;
737 BinOpInit &operator=(
const BinOpInit &
Other) =
delete;
748 assert(Operands.size() == 2 &&
749 "Wrong number of operands for binary operation");
783 Init *LHS, *MHS, *RHS;
789 TernOpInit(
const TernOpInit &
Other) =
delete;
790 TernOpInit &operator=(
const TernOpInit &
Other) =
delete;
802 assert(Operands.size() == 3 &&
803 "Wrong number of operands for ternary operation");
854 const std::string &
getName()
const;
861 unsigned Elt)
const override;
865 const std::string &FieldName)
const override;
887 (isa<IntRecTy>(T->
getType()) ||
888 (isa<BitsRecTy>(T->
getType()) &&
889 cast<BitsRecTy>(T->
getType())->getNumBits() > B)) &&
890 "Illegal VarBitInit expression!");
911 assert(B < 1 &&
"Bit index out of range!");
924 cast<ListRecTy>(T->
getType())->getElementType()),
927 "Illegal VarBitInit expression!");
946 unsigned Elt)
const override;
979 const std::string &FieldName)
const override;
991 unsigned Elt)
const override {
1000 std::string FieldName;
1004 assert(
getType() &&
"FieldInit with non-record type!");
1019 unsigned Elt)
const override;
1034 std::string ValName;
1035 std::vector<Init*> Args;
1036 std::vector<std::string> ArgNames;
1042 Args(ArgRange.
begin(), ArgRange.
end()),
1043 ArgNames(NameRange.
begin(), NameRange.
end()) {}
1052 static DagInit *
get(
Init *V,
const std::string &VN,
1055 static DagInit *
get(
Init *V,
const std::string &VN,
1057 std::pair<Init*, std::string> > &args);
1065 const std::string &
getName()
const {
return ValName; }
1069 assert(Num < Args.size() &&
"Arg number out of range!");
1073 assert(Num < ArgNames.size() &&
"Arg number out of range!");
1074 return ArgNames[Num];
1087 inline size_t arg_size ()
const {
return Args.size(); }
1093 inline size_t name_size ()
const {
return ArgNames.size(); }
1101 unsigned Elt)
const override {
1119 const std::string &
getName()
const;
1132 return Value ==
nullptr;
1143 RV.
print(OS <<
" ");
1148 static unsigned LastID;
1156 std::vector<Init *> TemplateArgs;
1157 std::vector<RecordVal> Values;
1158 std::vector<Record *> SuperClasses;
1159 std::vector<SMRange> SuperClassRanges;
1164 std::unique_ptr<DefInit> TheInit;
1185 bool Anonymous =
false) :
1186 ID(LastID++), Name(N), Locs(locs.
begin(), locs.
end()),
1187 TrackedRecords(records), IsAnonymous(Anonymous), ResolveFirst(
false) {
1199 ID(LastID++), Name(O.Name), Locs(O.Locs), TemplateArgs(O.TemplateArgs),
1200 Values(O.Values), SuperClasses(O.SuperClasses),
1201 SuperClassRanges(O.SuperClassRanges), TrackedRecords(O.TrackedRecords),
1202 IsAnonymous(O.IsAnonymous),
1203 ResolveFirst(O.ResolveFirst) { }
1209 const std::string &
getName()
const;
1218 void setName(
const std::string &Name);
1226 return TemplateArgs;
1233 for (
Init *
TA : TemplateArgs)
1234 if (
TA == Name)
return true;
1243 if (Val.getNameInit() == Name)
return &Val;
1251 if (Val.getNameInit() == Name)
return &Val;
1259 assert(!
isTemplateArg(Name) &&
"Template arg already defined!");
1260 TemplateArgs.push_back(Name);
1268 Values.push_back(RV);
1269 if (Values.size() > 1)
1275 std::swap(Values[Values.size() - 2], Values[Values.size() - 1]);
1279 for (
unsigned i = 0, e = Values.size(); i != e; ++i)
1281 Values.erase(Values.begin()+i);
1292 for (
const Record *
SC : SuperClasses)
1299 for (
const Record *
SC : SuperClasses)
1300 if (
SC->getNameInitAsString() == Name)
1306 assert(!
isSubClassOf(R) &&
"Already subclassing record!");
1307 SuperClasses.push_back(R);
1308 SuperClassRanges.push_back(Range);
1322 return TrackedRecords;
1330 return ResolveFirst;
1420 raw_ostream &
operator<<(raw_ostream &OS,
const Record &R);
1430 Rec(Name, Loc, Records) {}
1434 typedef std::map<std::string, std::unique_ptr<Record>> RecordMap;
1435 RecordMap Classes, Defs;
1442 auto I = Classes.find(Name);
1443 return I == Classes.end() ?
nullptr :
I->second.get();
1446 auto I = Defs.find(Name);
1447 return I == Defs.end() ?
nullptr :
I->second.get();
1450 bool Ins = Classes.insert(std::make_pair(R->getName(),
1451 std::move(R))).second;
1453 assert(Ins &&
"Class already exists");
1456 bool Ins = Defs.insert(std::make_pair(R->getName(),
1457 std::move(R))).second;
1459 assert(Ins &&
"Record already exists");
1468 std::vector<Record*>
1512 const char *Start = Rec.
data();
1513 const char *Curr = Start;
1515 for (
size_t I = 0, E = Rec.
size();
I != E; ++
I, ++Len) {
1517 if (isDigit != isDigitPart) {
1518 Parts.push_back(std::make_pair(isDigitPart,
StringRef(Start, Len)));
1525 Parts.push_back(std::make_pair(isDigitPart,
StringRef(Start, Len)));
1531 assert (i <
Parts.size() &&
"Invalid idx!");
1540 size_t LHSNumParts = LHSParts.
size();
1541 size_t RHSNumParts = RHSParts.
size();
1542 assert (LHSNumParts && RHSNumParts &&
"Expected at least one part!");
1544 if (LHSNumParts != RHSNumParts)
1545 return LHSNumParts < RHSNumParts;
1548 for (
size_t I = 0, E = LHSNumParts;
I < E;
I+=2) {
1549 std::pair<bool, StringRef> LHSPart = LHSParts.
getPart(
I);
1550 std::pair<bool, StringRef> RHSPart = RHSParts.
getPart(
I);
1552 assert (LHSPart.first ==
false && RHSPart.first ==
false &&
1553 "Expected both parts to be alpha.");
1554 if (
int Res = LHSPart.second.compare(RHSPart.second))
1557 for (
size_t I = 1, E = LHSNumParts;
I < E;
I+=2) {
1558 std::pair<bool, StringRef> LHSPart = LHSParts.
getPart(
I);
1559 std::pair<bool, StringRef> RHSPart = RHSParts.
getPart(
I);
1561 assert (LHSPart.first ==
true && RHSPart.first ==
true &&
1562 "Expected both parts to be numeric.");
1563 if (LHSPart.second.size() != RHSPart.second.size())
1564 return LHSPart.second.size() < RHSPart.second.size();
1566 unsigned LHSVal, RHSVal;
1568 bool LHSFailed = LHSPart.second.getAsInteger(10, LHSVal); (void)LHSFailed;
1569 assert(!LHSFailed &&
"Unable to convert LHS to integer.");
1570 bool RHSFailed = RHSPart.second.getAsInteger(10, RHSVal); (void)RHSFailed;
1571 assert(!RHSFailed &&
"Unable to convert RHS to integer.");
1573 if (LHSVal != RHSVal)
1574 return LHSVal < RHSVal;
1576 return LHSNumParts < RHSNumParts;
1580 raw_ostream &
operator<<(raw_ostream &OS,
const RecordKeeper &RK);
1585 Init *
Name,
const std::string &Scoper);
1590 const std::string &
Name,
const std::string &Scoper);
Init * resolveReferences(Record &R, const RecordVal *RV) const override
resolveReferences - This method is used by classes that refer to other variables which may not be def...
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
convertInitializerTo - This virtual function converts to the appropriate Init based on the passed in ...
void print(raw_ostream &OS) const
static bool classof(const Init *I)
Init * resolveListElementReference(Record &R, const RecordVal *RV, unsigned Elt) const override
resolveListElementReference - This method is used to implement VarListElementInit::resolveReferences...
const_iterator end(StringRef path)
Get end iterator over path.
Init * resolveReferences(Record &R, const RecordVal *RV) const override
resolveReferences - This method is used by classes that refer to other variables which may not be def...
Init * resolveReferences(Record &R, const RecordVal *RV) const override
resolveReferences - This method is used by classes that refer to other variables which may not be def...
bool operator()(const Record *Rec1, const Record *Rec2) const
RecTyKind
Subclass discriminator (for dyn_cast<> et al.)
virtual bool isComplete() const
isComplete - This virtual method should be overridden by values that may not be completely specified ...
RecTy * getFieldType(const std::string &FieldName) const override
getFieldType - This method is used to implement the FieldInit class.
MultiClass(const std::string &Name, SMLoc Loc, RecordKeeper &Records)
const std::string & getValue() const
void Profile(FoldingSetNodeID &ID) const
unsigned getNumBits() const
unsigned getNumArgs() const
bool getValueAsBit(StringRef FieldName) const
getValueAsBit - This method looks up the specified field and returns its value as a bit...
TypedInit(InitKind K, RecTy *T)
const std::string & getArgName(unsigned Num) const
LessRecord - Sorting predicate to sort record pointers by name.
size_t size() const
size - Get the string size.
FieldInit - X.Y - Represent a reference to a subfield of a variable.
Init * getFieldInit(Record &R, const RecordVal *RV, const std::string &FieldName) const override
getFieldInit - This method complements getFieldType to return the initializer for the specified field...
ListInit - [AL, AH, CL] - Represent a list of defs.
IntInit - 7 - Represent an initialization by a literal integer value.
static bool classof(const RecTy *RT)
ListRecTy - 'list<Ty>' - Represent a list of values, all of which must be of the specified type...
BinOpInit - !op (X, Y) - Combine two inits.
Init * getBit(unsigned Bit) const override
getBit - This method is used to return the initializer for the specified bit.
std::string getAsString() const override
getAsString - Convert this value to a string form.
Record * getElementAsRecord(unsigned i) const
virtual bool typeIsConvertibleTo(const RecTy *RHS) const
typeIsConvertibleTo - 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
resolveReferences - This method is used by classes that refer to other variables which may not be def...
Init * resolveListElementReference(Record &R, const RecordVal *RV, unsigned Elt) const override
resolveListElementReference - This method is used to implement VarListElementInit::resolveReferences...
const RecordVal * getValue(StringRef Name) const
LessRecordFieldName - Sorting predicate to sort record pointers by their name field.
Init * convertInitializerTo(RecTy *Ty) const override
convertInitializerTo - This virtual function converts to the appropriate Init based on the passed in ...
DefInit - AL - Represent a reference to a 'def' in the description.
static bool classof(const Init *I)
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
resolveListElementReference - This method is used to implement VarListElementInit::resolveReferences...
Init * getValueInit(StringRef FieldName) const
getValueInit - Return the initializer for a value with the specified name, or throw an exception if t...
Init * resolveListElementReference(Record &R, const RecordVal *RV, unsigned Elt) const override
resolveListElementReference - This method is used to implement VarListElementInit::resolveReferences...
RecTy * getFieldType(const std::string &FieldName) const override
getFieldType - This method is used to implement the FieldInit class.
Init * getOperand(unsigned i) const override
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
resolveReferences - This method is used by classes that refer to other variables which may not be def...
static bool classof(const RecTy *RT)
std::string getAsString() const override
getAsString - Convert this value to a string form.
std::string getAsString() const override
virtual RecTy * getFieldType(const std::string &FieldName) const
getFieldType - This method is used to implement the FieldInit class.
Init * Fold(Record *CurRec, MultiClass *CurMultiClass) const override
virtual Init * getFieldInit(Record &R, const RecordVal *RV, const std::string &FieldName) const
getFieldInit - This method complements getFieldType to return the initializer for the specified field...
void Profile(FoldingSetNodeID &ID) const
const_iterator begin(StringRef path)
Get begin iterator over path.
BinaryOp getOpcode() const
Record * getValueAsDef(StringRef FieldName) const
getValueAsDef - This method looks up the specified field and returns its value as a Record...
Init * getElement(unsigned i) const
bool allInComplete() const
void setResolveFirst(bool b)
Init * convertInitListSlice(const std::vector< unsigned > &Elements) const override
convertInitListSlice - This method is used to implement the list slice selection operator.
static bool classof(const Init *I)
void removeValue(StringRef Name)
std::string getValueAsString(StringRef FieldName) const
getValueAsString - This method looks up the specified field and returns its value as a string...
Init * getOperator() const
BitsInit - { 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
getAsUnquotedString - Convert this value to a string form, without adding quote markers.
ArrayRef< Init * > getTemplateArgs() const
void print(raw_ostream &OS) const
print - Print out this value.
const std::string & getName() const
static bool classof(const Init *I)
LessRecordByID - Sorting predicate to sort record pointers by their unique ID.
UnsetInit - ? - Represents an uninitialized value.
static bool classof(const Init *I)
void addSuperClass(Record *R, SMRange Range)
Init * getBit(unsigned Bit) const override
getBit - This method is used to return the initializer for the specified bit.
BitInit - true/false - Represent a concrete initializer for a bit.
Init * getBit(unsigned Bit) const override
getBit - This method is used to return the initializer for the specified bit.
static bool classof(const Init *I)
static BitsRecTy * get(unsigned Sz)
static bool classof(const RecTy *RT)
Init * getBit(unsigned Bit) const override
getBit - 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
resolveListElementReference - This method is used to implement VarListElementInit::resolveReferences...
TypedInit - This is the common super-class of types that have a specific, explicit, type.
bool typeIsConvertibleTo(const RecTy *RHS) const override
typeIsConvertibleTo - Return true if all values of 'this' type can be converted to the specified type...
InitKind
Discriminator enum (for isa<>, dyn_cast<>, et al.)
Init * getBit(unsigned Bit) const override
getBit - This method is used to return the initializer for the specified bit.
ArrayRef< SMRange > getSuperClassRanges() const
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
std::vector< std::string >::const_iterator const_name_iterator
void addClass(std::unique_ptr< Record > R)
static StringRecTy * get()
Init * getOperand() const
std::string getAsString() const override
std::string getAsString() const override
VarListElementInit - List[4] - Represent access to one element of a var or field. ...
RecordRecTy - '[classname]' - Represent an instance of a class, such as: (R32 X = EAX)...
Init * convertInitializerTo(RecTy *Ty) const override
convertInitializerTo - This virtual function converts to the appropriate Init based on the passed in ...
const_name_iterator name_end() const
std::string getAsString() const override
getAsString - Convert this value to a string form.
std::vector< std::unique_ptr< Record > > RecordVector
Record * getClass(const std::string &Name) const
Init * resolveReferences(Record &R, const RecordVal *RV) const override
resolveReferences - This method is used by classes that refer to other variables which may not be def...
OpInit * clone(std::vector< Init * > &Operands) const override
std::string getAsString() const override
getAsString - 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
getValueAsBitsInit - This method looks up the specified field and returns its value as a BitsInit...
const_iterator begin() const
BitsRecTy - 'bits<n>' - Represent a fixed number of bits.
ListInit * getValueAsListInit(StringRef FieldName) const
getValueAsListInit - This method looks up the specified field and returns its value as a ListInit...
virtual OpInit * clone(std::vector< Init * > &Operands) const =0
const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
Init * resolveReferences(Record &R, const RecordVal *RV) const override
resolveReferences - This method is used by classes that refer to other variables which may not be def...
const std::string getNameInitAsString() const
void resolveReferences()
resolveReferences - If there are any field references that refer to fields that have been filled in...
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
static bool classof(const Init *I)
void Profile(FoldingSetNodeID &ID) const
std::string getAsString() const override
getAsString - Convert this value to a string form.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
static bool classof(const RecTy *RT)
static bool classof(const RecTy *RT)
static bool classof(const Init *I)
virtual unsigned getBitNum() const
getBitNum - This method is used to retrieve the bit number of a bit reference.
bool isResolveFirst() const
Init * convertInitializerBitRange(const std::vector< unsigned > &Bits) const override
convertInitializerBitRange - This method is used to implement the bitrange selection operator...
const std::string & getName() const
Init * Fold(Record *CurRec, MultiClass *CurMultiClass) const override
virtual Init * getBit(unsigned Bit) const =0
getBit - This method is used to return the initializer for the specified bit.
DagInit * getValueAsDag(StringRef FieldName) const
getValueAsDag - This method looks up the specified field and returns its value as an Dag...
Init * resolveListElementReference(Record &R, const RecordVal *RV, unsigned Elt) const override
resolveListElementReference - 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
getValueAsListOfStrings - This method looks up the specified field and returns its value as a vector ...
const std::string & getName() const
void resolveReferencesTo(const RecordVal *RV)
resolveReferencesTo - If anything in this record refers to RV, replace the reference to RV with the R...
std::string getNameInitAsString() const
virtual Init * convertInitializerTo(RecTy *Ty) const =0
convertInitializerTo - This virtual function converts to the appropriate Init based on the passed in ...
Init * convertInitializerTo(RecTy *Ty) const override
convertInitializerTo - This virtual function converts to the appropriate Init based on the passed in ...
bool typeIsConvertibleTo(const RecTy *RHS) const override
typeIsConvertibleTo - 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.
Record * getDef(const std::string &Name) const
std::string getAsString() const override
getAsString - Convert this value to a string form.
bool operator()(const Record *Rec1, const Record *Rec2) const
OpInit - Base class for operators.
Init * getBit(unsigned Bit) const override
getBit - This method is used to return the initializer for the specified bit.
Init * convertInitializerTo(RecTy *Ty) const override
convertInitializerTo - This virtual function converts to the appropriate Init based on the passed in ...
bool typeIsConvertibleTo(const RecTy *RHS) const override
typeIsConvertibleTo - Return true if all values of 'this' type can be converted to the specified type...
std::vector< Record * > getAllDerivedDefinitions(const std::string &ClassName) const
getAllDerivedDefinitions - This method returns all concrete definitions that derive from the specifie...
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
isComplete - This virtual method should be overridden by values that may not be completely specified ...
Init * getFieldInit(Record &R, const RecordVal *RV, const std::string &FieldName) const override
getFieldInit - This method complements getFieldType to return the initializer for the specified field...
Init * resolveListElementReference(Record &R, const RecordVal *RV, unsigned Elt) const override
resolveListElementReference - This method is used to implement VarListElementInit::resolveReferences...
StringInit - "foo" - Represent an initialization by a string value.
RecordVector DefPrototypes
unsigned getNumOperands() const override
UnOpInit - !op (X) - Transform an init.
TypedInit * getVariable() const
Init * getOperand(unsigned i) const override
Init * convertInitializerTo(RecTy *Ty) const override
convertInitializerTo - This virtual function converts to the appropriate Init based on the passed in ...
SmallVector< std::pair< bool, StringRef >, 4 > Parts
const RecordVal * getValue(const Init *Name) const
static bool classof(const Init *I)
std::vector< int64_t > getValueAsListOfInts(StringRef FieldName) const
getValueAsListOfInts - This method looks up the specified field and returns its value as a vector of ...
StringRecTy - 'string' - Represent an string value.
RecTyKind getRecTyKind() const
static BitInit * get(bool V)
std::string getAsString() const override
getAsString - Convert this value to a string form.
bool isTemplateArg(StringRef Name) const
std::string getAsString() const override
getAsString - Convert this value to a string form.
static bool classof(const Init *I)
bool isValueUnset(StringRef FieldName) const
Return true if the named field is unset.
ArrayRef< Init * > getValues() const
DefInit * getDefInit()
get the corresponding DefInit.
bool isComplete() const override
isComplete - This virtual method should be overridden by values that may not be completely specified ...
std::vector< Record * > getValueAsListOfDefs(StringRef FieldName) const
getValueAsListOfDefs - This method looks up the specified field and returns its value as a vector of ...
std::string getAsString() const override
getAsString - Convert this value to a string form.
virtual Init * resolveReferences(Record &R, const RecordVal *RV) const
resolveReferences - This method is used by classes that refer to other variables which may not be def...
Init * QualifyName(Record &CurRec, MultiClass *CurMultiClass, Init *Name, const std::string &Scoper)
QualifyName - Return an Init with a qualifier prefix referring to CurRec's name.
const Init * getNameInit() const
static bool classof(const Init *I)
int64_t getValueAsInt(StringRef FieldName) const
getValueAsInt - This method looks up the specified field and returns its value as an int64_t...
const RecordMap & getClasses() const
Init * convertInitListSlice(const std::vector< unsigned > &Elements) const override
convertInitListSlice - This method is used to implement the list slice selection operator.
Init * convertInitializerTo(RecTy *Ty) const override
convertInitializerTo - This virtual function converts to the appropriate Init based on the passed in ...
virtual Init * Fold(Record *CurRec, MultiClass *CurMultiClass) const =0
Init * convertInitializerBitRange(const std::vector< unsigned > &Bits) const override
convertInitializerBitRange - This method is used to implement the bitrange selection operator...
void addTemplateArg(Init *Name)
std::string getAsString() const override
bool operator()(const Record *Rec1, const Record *Rec2) const
static bool classof(const Init *I)
RecTy * getFieldType(const std::string &FieldName) const override
getFieldType - This method is used to implement the FieldInit class.
ArrayRef< SMLoc > getLoc() 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)
std::string getAsString() const override
getAsString - Convert this value to a string form.
CHAIN = SC CHAIN, Imm128 - System call.
Init * convertInitializerTo(RecTy *Ty) const override
convertInitializerTo - This virtual function converts to the appropriate Init based on the passed in ...
Init * getNameInit() const
const_iterator end() const
Init * convertInitializerTo(RecTy *Ty) const override
convertInitializerTo - This virtual function converts to the appropriate Init based on the passed in ...
Init * getBit(unsigned Bit) const override
getBit - This method is used to return the initializer for the specified bit.
Init * resolveReferences(Record &R, const RecordVal *RV) const override
resolveReferences - This method is used by classes that refer to other variables which may not be def...
Init * resolveListElementReference(Record &R, const RecordVal *RV, unsigned Elt) const override
resolveListElementReference - 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
ArrayRef< Record * > getSuperClasses() const
bool isTemplateArg(Init *Name) const
const_arg_iterator arg_begin() const
bool isSubClassOf(StringRef Name) const
Init * getBitVar() const override
getBitVar - This method is used to retrieve the initializer for bit reference.
void removeValue(Init *Name)
const RecordMap & getDefs() const
static bool classof(const Init *I)
Init * getBit(unsigned Bit) const override
getBit - This method is used to return the initializer for the specified bit.
IntRecTy - 'int' - Represent an integer value of no particular size.
ArrayRef< RecordVal > getValues() const
virtual Init * convertInitListSlice(const std::vector< unsigned > &Elements) const
convertInitListSlice - This method is used to implement the list slice selection operator.
static bool ascii_isdigit(char x)
Init * resolveListElementReference(Record &R, const RecordVal *RV, unsigned Elt) const override
resolveListElementReference - This method is used to implement VarListElementInit::resolveReferences...
RecTy * getElementType() const
Init * getBit(unsigned Bit) const override
getBit - This method is used to return the initializer for the specified bit.
RecordKeeper & getRecords() const
std::string getAsString() const override
getAsString - Convert this value to a string form.
bool typeIsConvertibleTo(const RecTy *RHS) const override
typeIsConvertibleTo - Return true if all values of 'this' type can be converted to the specified type...
unsigned getNumBits() const
virtual Init * getBitVar() const
getBitVar - 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
typeIsConvertibleTo - Return true if all values of 'this' type can be converted to the specified type...
std::vector< Init * >::const_iterator const_iterator
virtual Init * convertInitializerBitRange(const std::vector< unsigned > &Bits) const
convertInitializerBitRange - This method is used to implement the bitrange selection operator...
Init * getBit(unsigned B) const override
getBit - 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)
RecTy * resolveTypes(RecTy *T1, RecTy *T2)
resolveTypes - Find a common type that T1 and T2 convert to.
VarBitInit - Opcode{0} - Represent access to one bit of a variable or field.
bool isComplete() const override
isComplete - This virtual method should be overridden by values that may not be completely specified ...
VarInit - 'Opcode' - Represent a reference to an entire variable object.
static ListInit * get(ArrayRef< Init * > Range, RecTy *EltTy)
std::string getAsString() const override
getAsString - Convert this value to a string form.
std::string getAsString() const override
UnaryOp getOpcode() const
BitRecTy - 'bit' - Represent a single bit.
TernOpInit - !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
getValueAsBitOrUnset - This method looks up the specified field and returns its value as a bit...
Init * resolveReferences(Record &R, const RecordVal *RV) const override
resolveReferences - This method is used by classes that refer to other variables which may not be def...
RecordParts(StringRef Rec)
DagRecTy - 'dag' - Represent a dag fragment.
unsigned getNumOperands() const override
Init * resolveReferences(Record &R, const RecordVal *RV) const override
resolveReferences - This method is used by classes that refer to other variables which may not be def...
OpInit(InitKind K, RecTy *Type)
Init * getBit(unsigned Bit) const override
getBit - This method is used to return the initializer for the specified bit.
const std::string & getName() const
Init * getNameInit() const
LLVM Value Representation.
Record(const std::string &N, ArrayRef< SMLoc > locs, RecordKeeper &records, bool Anonymous=false)
OpInit * clone(std::vector< Init * > &Operands) const override
DagInit - (v a, b) - Represent a DAG tree value.
virtual std::string getAsString() const =0
getAsString - Convert this value to a string form.
unsigned getNumOperands() const override
OpInit * clone(std::vector< Init * > &Operands) const override
Init * getBit(unsigned Bit) const override
getBit - This method is used to return the initializer for the specified bit.
std::string getAsString() const override
getAsString - Convert this value to a string form.
This class implements an extremely fast bulk output stream that can only output to a stream...
TernaryOp getOpcode() const
void dump() const
dump - Debugging method that may be called through a debugger, just invokes print on stderr...
StringRef - Represent a constant reference to a string, i.e.
unsigned getBitNum() const override
getBitNum - This method is used to retrieve the bit number of a bit reference.
std::string getAsUnquotedString() const override
getAsUnquotedString - Convert this value to a string form, without adding quote markers.
static bool classof(const Init *I)
Init * getBit(unsigned Bit) const override
getBit - This method is used to return the initializer for the specified bit.
std::string getAsString() const override
getAsString - Convert this value to a string form.
virtual std::string getAsString() const =0
Init * convertInitializerTo(RecTy *Ty) const override
convertInitializerTo - This virtual function converts to the appropriate Init based on the passed in ...
Represents a location in source code.
ListRecTy * getListTy()
getListTy - Returns the type representing list<this>.
Init * convertInitializerBitRange(const std::vector< unsigned > &Bits) const override
convertInitializerBitRange - This method is used to implement the bitrange selection operator...
const_name_iterator name_begin() const
bool operator()(const Record *LHS, const Record *RHS) const
std::string getAsString() const override
getAsString - Convert this value to a string form.
static bool classof(const Init *I)
std::vector< Init * >::const_iterator const_arg_iterator
RecordVal(Init *N, RecTy *T, bool P)
bool empty() const
empty - Check if the string is empty.