15 #ifndef LLVM_TABLEGEN_RECORD_H 16 #define LLVM_TABLEGEN_RECORD_H 75 virtual ~RecTy() =
default;
252 void operator delete(
void *p) { ::operator
delete(p); }
264 return makeArrayRef(getTrailingObjects<Record *>(), NumClasses);
337 virtual void anchor();
347 Init &operator=(
const Init &) =
delete;
348 virtual ~
Init() =
default;
376 virtual Init *getCastTo(
RecTy *Ty)
const = 0;
381 virtual Init *convertInitializerTo(
RecTy *Ty)
const = 0;
411 return const_cast<Init *
>(
this);
416 virtual Init *getBit(
unsigned Bit)
const = 0;
420 I.
print(OS);
return OS;
430 :
Init(K, Opc), Ty(T) {}
437 return I->
getKind() >= IK_FirstTypedInit &&
438 I->
getKind() <= IK_LastTypedInit;
443 Init *getCastTo(
RecTy *Ty)
const override;
444 Init *convertInitializerTo(
RecTy *Ty)
const override;
465 return I->
getKind() == IK_UnsetInit;
470 Init *getCastTo(
RecTy *Ty)
const override;
471 Init *convertInitializerTo(
RecTy *Ty)
const override;
493 return I->
getKind() == IK_BitInit;
500 Init *convertInitializerTo(
RecTy *Ty)
const override;
503 assert(Bit < 1 &&
"Bit index out of range!");
504 return const_cast<BitInit*
>(
this);
508 std::string
getAsString()
const override {
return Value ?
"1" :
"0"; }
525 void operator delete(
void *p) { ::operator
delete(p); }
528 return I->
getKind() == IK_BitsInit;
537 Init *convertInitializerTo(
RecTy *Ty)
const override;
541 for (
unsigned i = 0; i != getNumBits(); ++i)
542 if (!getBit(i)->isComplete())
return false;
547 for (
unsigned i = 0; i != getNumBits(); ++i)
548 if (getBit(i)->isComplete())
return false;
552 bool isConcrete()
const override;
558 assert(Bit < NumBits &&
"Bit index out of range!");
559 return getTrailingObjects<Init *>()[Bit];
575 return I->
getKind() == IK_IntInit;
578 static IntInit *
get(int64_t V);
582 Init *convertInitializerTo(
RecTy *Ty)
const override;
605 return I->
getKind() == IK_StringInit;
612 Init *convertInitializerTo(
RecTy *Ty)
const override;
636 return I->
getKind() == IK_CodeInit;
643 Init *convertInitializerTo(
RecTy *Ty)
const override;
647 return "[{" + Value.
str() +
"}]";
675 void operator delete(
void *p) { ::operator
delete(p); }
678 return I->
getKind() == IK_ListInit;
685 assert(i < NumValues &&
"List element index out of range!");
686 return getTrailingObjects<Init *>()[i];
689 return cast<ListRecTy>(
getType())->getElementType();
692 Record *getElementAsRecord(
unsigned i)
const;
696 Init *convertInitializerTo(
RecTy *Ty)
const override;
705 bool isConcrete()
const override;
709 return makeArrayRef(getTrailingObjects<Init *>(), NumValues);
715 size_t size ()
const {
return NumValues; }
716 bool empty()
const {
return NumValues == 0; }
735 return I->
getKind() >= IK_FirstOpInit &&
742 virtual unsigned getNumOperands()
const = 0;
743 virtual Init *getOperand(
unsigned i)
const = 0;
745 Init *getBit(
unsigned Bit)
const override;
758 :
OpInit(IK_UnOpInit, Type, opc), LHS(lhs) {}
765 return I->
getKind() == IK_UnOpInit;
775 "Wrong number of operands for unary operation");
782 assert(i == 0 &&
"Invalid operand id for unary operator");
791 Init *Fold(
Record *CurRec,
bool IsFinal =
false)
const;
808 OpInit(IK_BinOpInit, Type, opc), LHS(lhs), RHS(rhs) {}
815 return I->
getKind() == IK_BinOpInit;
827 "Wrong number of operands for binary operation");
835 case 0:
return getLHS();
836 case 1:
return getRHS();
859 Init *LHS, *MHS, *RHS;
863 OpInit(IK_TernOpInit, Type, opc), LHS(lhs), MHS(mhs), RHS(rhs) {}
870 return I->
getKind() == IK_TernOpInit;
882 "Wrong number of operands for ternary operation");
891 case 0:
return getLHS();
892 case 1:
return getMHS();
893 case 2:
return getRHS();
925 :
TypedInit(IK_FoldOpInit, Type), Start(Start),
List(List), A(A),
B(B),
947 Init *getBit(
unsigned Bit)
const override;
980 Init *getBit(
unsigned Bit)
const override;
997 return I->
getKind() == IK_VarInit;
1007 return getNameInit()->getAsUnquotedString();
1017 Init *getBit(
unsigned Bit)
const override;
1030 (isa<IntRecTy>(T->
getType()) ||
1031 (isa<BitsRecTy>(T->
getType()) &&
1032 cast<BitsRecTy>(T->
getType())->getNumBits() >
B)) &&
1033 "Illegal VarBitInit expression!");
1041 return I->
getKind() == IK_VarBitInit;
1053 assert(B < 1 &&
"Bit index out of range!");
1066 cast<ListRecTy>(T->
getType())->getElementType()),
1069 "Illegal VarBitInit expression!");
1077 return I->
getKind() == IK_VarListElementInit;
1088 Init *getBit(
unsigned Bit)
const override;
1104 return I->
getKind() == IK_DefInit;
1109 Init *convertInitializerTo(
RecTy *Ty)
const override;
1143 void operator delete(
void *p) { ::operator
delete(p); }
1146 return I->
getKind() == IK_VarDefInit;
1158 assert(i < NumArgs &&
"Argument index out of range!");
1159 return getTrailingObjects<Init *>()[i];
1192 return I->
getKind() == IK_FieldInit;
1200 Init *getBit(
unsigned Bit)
const override;
1220 unsigned NumArgNames;
1224 NumArgs(NumArgs), NumArgNames(NumArgNames) {}
1226 size_t numTrailingObjects(OverloadToken<Init *>)
const {
return NumArgs; }
1233 return I->
getKind() == IK_DagInit;
1254 assert(Num < NumArgs &&
"Arg number out of range!");
1255 return getTrailingObjects<Init *>()[Num];
1259 assert(Num < NumArgNames &&
"Arg number out of range!");
1260 return getTrailingObjects<StringInit *>()[Num];
1269 return makeArrayRef(getTrailingObjects<Init *>(), NumArgs);
1273 return makeArrayRef(getTrailingObjects<StringInit *>(), NumArgNames);
1278 bool isConcrete()
const override;
1319 return getNameInit()->getAsUnquotedString();
1326 bool setValue(
Init *V);
1333 RV.
print(OS <<
" ");
1338 static unsigned LastID;
1367 bool Anonymous =
false,
bool Class =
false)
1368 : Name(N), Locs(locs.
begin(), locs.
end()), TrackedRecords(records),
1369 ID(LastID++), IsAnonymous(Anonymous), IsClass(Class) {
1381 : Name(O.Name), Locs(O.Locs), TemplateArgs(O.TemplateArgs),
1382 Values(O.Values), SuperClasses(O.SuperClasses),
1383 TrackedRecords(O.TrackedRecords), ID(LastID++),
1384 IsAnonymous(O.IsAnonymous), IsClass(O.IsClass) { }
1397 return getNameInit()->getAsUnquotedString();
1400 void setName(
Init *Name);
1414 return TemplateArgs;
1420 return SuperClasses;
1427 for (
Init *
TA : TemplateArgs)
1428 if (
TA == Name)
return true;
1434 if (Val.Name == Name)
return &Val;
1443 return const_cast<RecordVal *
>(
static_cast<const Record *
>(
this)->getValue(Name));
1447 return const_cast<RecordVal *
>(
static_cast<const Record *
>(
this)->getValue(Name));
1451 assert(!isTemplateArg(Name) &&
"Template arg already defined!");
1461 for (
unsigned i = 0, e = Values.
size(); i != e; ++i)
1462 if (Values[i].getNameInit() ==
Name) {
1474 for (
const auto &SCPair : SuperClasses)
1475 if (SCPair.first == R)
1481 for (
const auto &SCPair : SuperClasses) {
1482 if (
const auto *
SI = dyn_cast<StringInit>(SCPair.first->getNameInit())) {
1483 if (
SI->getValue() ==
Name)
1485 }
else if (SCPair.first->getNameInitAsString() ==
Name) {
1493 assert(!TheInit &&
"changing type of record after it has been referenced");
1494 assert(!isSubClassOf(R) &&
"Already subclassing record!");
1495 SuperClasses.
push_back(std::make_pair(R, Range));
1503 void resolveReferences();
1515 void resolveReferencesTo(
const RecordVal *RV);
1518 return TrackedRecords;
1538 return isa<UnsetInit>(getValueInit(FieldName));
1559 std::vector<Record*> getValueAsListOfDefs(
StringRef FieldName)
const;
1564 std::vector<int64_t> getValueAsListOfInts(
StringRef FieldName)
const;
1569 std::vector<StringRef> getValueAsListOfStrings(
StringRef FieldName)
const;
1579 bool getValueAsBit(
StringRef FieldName)
const;
1584 bool getValueAsBitOrUnset(
StringRef FieldName,
bool &Unset)
const;
1589 int64_t getValueAsInt(
StringRef FieldName)
const;
1601 using RecordMap = std::map<std::string, std::unique_ptr<Record>>;
1602 RecordMap Classes, Defs;
1604 std::map<std::string, Init *> ExtraGlobals;
1605 unsigned AnonCounter = 0;
1612 auto I = Classes.find(Name);
1613 return I == Classes.end() ? nullptr :
I->second.get();
1617 auto I = Defs.find(Name);
1618 return I == Defs.end() ? nullptr :
I->second.get();
1622 if (
Record *R = getDef(Name))
1624 auto It = ExtraGlobals.find(Name);
1625 return It == ExtraGlobals.end() ? nullptr : It->second;
1629 bool Ins = Classes.insert(std::make_pair(R->getName(),
1630 std::move(R))).second;
1632 assert(Ins &&
"Class already exists");
1636 bool Ins = Defs.insert(std::make_pair(R->getName(),
1637 std::move(R))).second;
1639 assert(Ins &&
"Record already exists");
1643 bool Ins = ExtraGlobals.insert(std::make_pair(Name, I)).second;
1646 assert(Ins &&
"Global already exists");
1649 Init *getNewAnonymousName();
1657 std::vector<Record *> getAllDerivedDefinitions(
StringRef ClassName)
const;
1698 const char *Start = Rec.
data();
1699 const char *Curr = Start;
1700 bool isDigitPart = ascii_isdigit(Curr[0]);
1701 for (
size_t I = 0,
E = Rec.
size();
I !=
E; ++
I, ++Len) {
1702 bool isDigit = ascii_isdigit(Curr[
I]);
1703 if (isDigit != isDigitPart) {
1707 isDigitPart = ascii_isdigit(Curr[I]);
1726 size_t LHSNumParts = LHSParts.
size();
1727 size_t RHSNumParts = RHSParts.
size();
1728 assert (LHSNumParts && RHSNumParts &&
"Expected at least one part!");
1730 if (LHSNumParts != RHSNumParts)
1731 return LHSNumParts < RHSNumParts;
1734 for (
size_t I = 0,
E = LHSNumParts;
I <
E;
I+=2) {
1735 std::pair<bool, StringRef> LHSPart = LHSParts.
getPart(
I);
1736 std::pair<bool, StringRef> RHSPart = RHSParts.
getPart(
I);
1738 assert (LHSPart.first ==
false && RHSPart.first ==
false &&
1739 "Expected both parts to be alpha.");
1740 if (
int Res = LHSPart.second.compare(RHSPart.second))
1743 for (
size_t I = 1, E = LHSNumParts;
I <
E;
I+=2) {
1744 std::pair<bool, StringRef> LHSPart = LHSParts.
getPart(
I);
1745 std::pair<bool, StringRef> RHSPart = RHSParts.
getPart(
I);
1747 assert (LHSPart.first ==
true && RHSPart.first ==
true &&
1748 "Expected both parts to be numeric.");
1749 if (LHSPart.second.size() != RHSPart.second.size())
1750 return LHSPart.second.size() < RHSPart.second.size();
1752 unsigned LHSVal, RHSVal;
1754 bool LHSFailed = LHSPart.second.getAsInteger(10, LHSVal); (void)LHSFailed;
1755 assert(!LHSFailed &&
"Unable to convert LHS to integer.");
1756 bool RHSFailed = RHSPart.second.getAsInteger(10, RHSVal); (void)RHSFailed;
1757 assert(!RHSFailed &&
"Unable to convert RHS to integer.");
1759 if (LHSVal != RHSVal)
1760 return LHSVal < RHSVal;
1762 return LHSNumParts < RHSNumParts;
1776 bool IsFinal =
false;
1803 struct MappedValue {
1807 MappedValue() : V(
nullptr), Resolved(
false) {}
1808 MappedValue(
Init *V,
bool Resolved) : V(V), Resolved(Resolved) {}
1847 if (VarName == RV->getNameInit())
1848 return RV->getValue();
1860 :
Resolver(R.getCurrentRecord()), R(R) {
1867 if (Shadowed.
count(VarName))
1869 return R.resolve(VarName);
1877 bool FoundUnresolved =
false;
1881 :
Resolver(R ? R->getCurrentRecord() : nullptr), R(R) {}
1891 Init *VarNameToTrack;
1896 :
Resolver(nullptr), VarNameToTrack(VarNameToTrack) {}
1907 #endif // LLVM_TABLEGEN_RECORD_H Init * getOperand() const
static BinOpInit * get(BinaryOp opc, Init *lhs, Init *rhs, RecTy *Type)
unsigned getNumBits() const
RecordVal * getValue(const Init *Name)
Represents a range in source code.
static bool classof(const Init *I)
std::string getAsString() const override
const_iterator end(StringRef path)
Get end iterator over path.
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations? Unset values are concrete.
RecTyKind
Subclass discriminator (for dyn_cast<> et al.)
void print(raw_ostream &OS) const
const_name_iterator name_end() const
LLVM_NODISCARD std::string str() const
str - Get the contents as an std::string.
const_iterator begin(StringRef path, Style style=Style::native)
Get begin iterator over path.
bool allInComplete() const
typename SuperClass::const_iterator const_iterator
Sorting predicate to sort record pointers by name.
This class represents lattice values for constants.
X.Y - Represent a reference to a subfield of a variable.
PointerTy getPointer() const
virtual std::string getAsUnquotedString() const
Convert this value to a string form, without adding quote markers.
Record * getCurrentRecord() const
bool foundUnresolved() const
[AL, AH, CL] - Represent a list of defs
'7' - Represent an initialization by a literal integer value.
StringRef getNameStr() const
virtual RecTy * getFieldType(StringInit *FieldName) const
This method is used to implement the FieldInit class.
static bool classof(const RecTy *RT)
'list<Ty>' - Represent a list of values, all of which must be of the specified type.
!op (X, Y) - Combine two inits.
std::string getAsString() const override
Convert this value to a string form.
Implements a dense probed hash-table based set.
Sorting predicate to sort record pointers by their name field.
void push_back(const T &Elt)
AL - Represent a reference to a 'def' in the description.
static bool classof(const Init *I)
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t size() const
size - Get the string size.
static UnOpInit * get(UnaryOp opc, Init *lhs, RecTy *Type)
static bool classof(const Init *I)
void addDef(std::unique_ptr< Record > R)
static bool classof(const Init *I)
Init * getOperand(unsigned i) const override
static bool classof(const RecTy *RT)
std::string getAsString() const override
HasReferenceResolver(Init *VarNameToTrack)
Resolve all references to a specific RecordVal.
const_record_iterator classes_begin() const
static bool classof(const Init *I)
void removeValue(StringRef Name)
Resolve all variables from a record except for unset variables.
'{ a, b, c }' - Represents an initializer for a BitsRecTy value.
Init * getArg(unsigned i) const
std::pair< bool, StringRef > getPart(size_t i)
std::string getNameInitAsString() const
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).
static bool classof(const Init *I)
(Optionally) delegate resolving to a sub-resolver, and keep track whether there were unresolved refer...
Sorting predicate to sort record pointers by their unique ID.
static bool classof(const Init *I)
Init * getArg(unsigned Num) const
ArrayRef< std::pair< Record *, SMRange > > getSuperClasses() const
'?' - Represents an uninitialized value
static bool classof(const Init *I)
void addSuperClass(Record *R, SMRange Range)
Init * getBit(unsigned Bit) const override
This method is used to return the initializer for the specified bit.
'true'/'false' - Represent a concrete initializer for a bit.
Init * getBit(unsigned Bit) const override
This method is used to return the initializer for the specified bit.
TypedInit * getVariable() const
amdgpu Simplify well known AMD library false Value Value const Twine & Name
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)
This is the common super-class of types that have a specific, explicit, type.
ArrayRef< T > makeArrayRef(const T &OneElt)
Construct an ArrayRef from a single element.
Shift and rotation operations.
Init *const * const_iterator
void addClass(std::unique_ptr< Record > R)
RecTy * getElementType() const
static StringRecTy * get()
static Optional< unsigned > getOpcode(ArrayRef< VPValue *> Values)
Returns the opcode of Values or ~0 if they do not all agree.
ArrayRef< Init * > getTemplateArgs() const
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
List[4] - Represent access to one element of a var or field.
'[classname]' - Type of record values that have zero or more superclasses.
virtual bool isComplete() const
This virtual method should be overridden by values that may not be completely specified yet...
const_iterator args_begin() const
static StringRef getName(Value *V)
!foldl (a, b, expr, start, lst) - Fold over a list.
const_iterator args_end() const
bool operator()(const Record *Rec1, const Record *Rec2) const
RecordResolver(Record &R)
void print(raw_ostream &OS, bool PrintSem=true) const
unsigned getBitNum() const
const_iterator end() const
StringInit * getArgName(unsigned Num) const
virtual Init * convertInitializerBitRange(ArrayRef< unsigned > Bits) const
This method is used to implement the bitrange selection operator.
bool operator()(const Record *LHS, const Record *RHS) const
Record * getClass(StringRef Name) const
SmallVectorImpl< Init * >::const_iterator const_arg_iterator
ArrayRef< SMLoc > getLoc() const
'bits<n>' - Represent a fixed number of bits
ArrayRef< Record * > getClasses() const
bool isComplete() const override
This virtual method should be overridden by values that may not be completely specified yet...
bool isTemplateArg(Init *Name) const
StringRef getValue() const
Simple integer binary arithmetic operators.
bool isSubClassOf(const Record *R) const
static bool classof(const RecTy *RT)
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool empty() const
empty - Check if the string is empty.
ArrayRef< Init * > getValues() const
ArrayRef< Init * > getArgs() const
OpInit(InitKind K, RecTy *Type, uint8_t Opc)
static bool classof(const Init *I)
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
static bool classof(const RecTy *RT)
bool operator()(const Record *Rec1, const Record *Rec2) const
static bool classof(const RecTy *RT)
bool isComplete() const override
This virtual method should be overridden by values that may not be completely specified yet...
static bool classof(const Init *I)
unsigned getNumBits() const
void print(raw_ostream &OS) const
Print out this value.
Init * getBit(unsigned Bit) const override
This method is used to return the initializer for the specified bit.
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations? Unset values are concrete.
virtual Init * convertInitListSlice(ArrayRef< unsigned > Elements) const
This method is used to implement the list slice selection operator.
ArrayRef< RecordVal > getValues() const
const_record_iterator classes_end() const
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations? Unset values are concrete.
'code' - Represent a code fragment
SmallVectorImpl< StringInit * >::const_iterator const_name_iterator
void addShadow(Init *Key)
FoldingSetNodeID - This class is used to gather all the unique data bits of a node.
std::string getAsString() const override
Convert this value to a string form.
unsigned getElementNum() const
Base class for operators.
static bool classof(const Init *I)
OpInit * clone(ArrayRef< Init *> Operands) const override
Init * getBit(unsigned Bit) const override
This method is used to return the initializer for the specified bit.
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations? Unset values are concrete.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
Init * getElement(unsigned i) const
Resolve arbitrary mappings.
Init * getNameInit() const
PointerIntPair - This class implements a pair of a pointer and small integer.
The instances of the Type class are immutable: once they are created, they are never changed...
bool keepUnsetBits() const override
bool isComplete() const override
This virtual method should be overridden by values that may not be completely specified yet...
virtual bool isConcrete() const
Is this a concrete and fully resolved value without any references or stuck operations? Unset values are concrete.
size_t size() const
size - Get the array size.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
"foo" - Represent an initialization by a string value.
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator begin()
unsigned getNumOperands() const override
void addExtraGlobal(StringRef Name, Init *I)
Interface for looking up the initializer for a variable name, used by Init::resolveReferences.
std::pair< iterator, bool > insert(const ValueT &V)
static ManagedStatic< OptionRegistry > OR
ArrayRef< Init * > args() const
!op (X) - Transform an init.
Init * getOperand(unsigned i) const override
StringInit * getFieldName() const
const std::string getNameInitAsString() const
SmallVector< std::pair< bool, StringRef >, 4 > Parts
See the file comment for details on the usage of the TrailingObjects type.
StringRef getValueAsString(StringRef FieldName) const
This method looks up the specified field and returns its value as a string, throwing an exception if ...
OpInit * clone(ArrayRef< Init *> Operands) const override
UnaryOp getOpcode() const
static bool classof(const Init *I)
void EmitJSON(RecordKeeper &RK, raw_ostream &OS)
'string' - Represent an string value
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations? Unset values are concrete.
static BitInit * get(bool V)
std::string getAsString() const override
Convert this value to a string form.
const RecordVal * getValue(StringRef Name) const
static bool classof(const Init *I)
DefInit * getDefInit()
get the corresponding DefInit.
std::string getAsUnquotedString() const override
Convert this value to a string form, without adding quote markers.
iterator erase(const_iterator CI)
StringInit * getName() const
static wasm::ValType getType(const TargetRegisterClass *RC)
bool isComplete() const override
This virtual method should be overridden by values that may not be completely specified yet...
FoldingSet - This template class is used to instantiate a specialized implementation of the folding s...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
static bool classof(const Init *I)
static RecordRecTy * get(ArrayRef< Record *> Classes)
Get the record type with the given non-redundant list of superclasses.
Record(Init *N, ArrayRef< SMLoc > locs, RecordKeeper &records, bool Anonymous=false, bool Class=false)
Delegate resolving to a sub-resolver, but shadow some variable names.
void setFinal(bool Final)
virtual Init * resolveReferences(Resolver &R) const
This method is used by classes that refer to other variables which may not be defined at the time the...
void addTemplateArg(Init *Name)
static bool classof(const Init *I)
virtual bool typeIsA(const RecTy *RHS) const
Return true if 'this' type is equal to or a subtype of RHS.
const RecordVal * getValue(const Init *Name) const
const RecordMap & getClasses() const
Init * getOperator() const
TrackUnresolvedResolver(Resolver *R=nullptr)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
RecordVal * getValue(StringRef Name)
static StringInit * get(StringRef)
static bool classof(const RecTy *RT)
static bool classof(const RecTy *RT)
RecordKeeper & getRecords() const
unsigned getNumArgs() const
bool isSubClassOf(StringRef Name) const
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
RecTy * getElementType() const
classname<targs...> - Represent an uninstantiated anonymous class instantiation.
Init * getBit(unsigned Bit) const override
This method is used to return the initializer for the specified bit.
static unsigned getNewUID()
!isa<type>(expr) - Dynamically determine the type of an expression.
Record(StringRef N, ArrayRef< SMLoc > locs, RecordKeeper &records, bool Class=false)
void removeValue(Init *Name)
bool operator()(const Record *Rec1, const Record *Rec2) const
static bool classof(const Init *I)
Init * getBit(unsigned Bit) const override
This method is used to return the initializer for the specified bit.
'int' - Represent an integer value of no particular size
std::string getAsString() const override
Convert this value to a string form.
OpInit * clone(ArrayRef< Init *> Operands) const override
static bool ascii_isdigit(char x)
void appendLoc(SMLoc Loc)
bool isDigit(char C)
Checks if character C is one of the 10 decimal digits.
Bitwise operators - logical and, logical or, logical xor.
std::string getNameInitAsString() const
std::string getAsString() const override
Init * getNameInit() const
Node - This class is used to maintain the singly linked bucket list in a folding set.
TypedInit(InitKind K, RecTy *T, uint8_t Opc=0)
Do not resolve anything, but keep track of whether a given variable was referenced.
Init * getGlobal(StringRef Name) const
Init * getBit(unsigned B) const override
This method is used to return the initializer for the specified bit.
Record *const * const_record_iterator
void addValue(const RecordVal &RV)
static TernOpInit * get(TernaryOp opc, Init *lhs, Init *mhs, Init *rhs, RecTy *Type)
const_iterator begin() const
RecTy * resolveTypes(RecTy *T1, RecTy *T2)
Find a common type that T1 and T2 convert to.
Opcode{0} - Represent access to one bit of a variable or field.
bool isComplete() const override
This virtual method should be overridden by values that may not be completely specified yet...
'Opcode' - Represent a reference to an entire variable object.
Init(InitKind K, uint8_t Opc=0)
'bit' - Represent a single bit
!op (X, Y, Z) - Combine two inits.
size_type count(const_arg_type_t< ValueT > V) const
Return 1 if the specified key is in the set, 0 otherwise.
RecordValResolver(Record &R, const RecordVal *RV)
raw_ostream & operator<<(raw_ostream &OS, const APInt &I)
Init * getOperand(unsigned i) const override
const_name_iterator name_begin() const
virtual bool keepUnsetBits() const
RecTyKind getRecTyKind() const
RecordParts(StringRef Rec)
virtual bool typeIsConvertibleTo(const RecTy *RHS) const
Return true if all values of 'this' type can be converted to the specified type.
StringRef getValue() const
'dag' - Represent a dag fragment
unsigned getNumOperands() const override
Record * getDef(StringRef Name) const
ArrayRef< StringInit * > getArgNames() const
static LLVM_ATTRIBUTE_ALWAYS_INLINE bool CheckType(const unsigned char *MatcherTable, unsigned &MatcherIndex, SDValue N, const TargetLowering *TLI, const DataLayout &DL)
StringRef getName() const
MapResolver(Record *CurRec=nullptr)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Init * getBit(unsigned Bit) const override
This method is used to return the initializer for the specified bit.
BinaryOp getOpcode() const
TernaryOp getOpcode() const
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...
InitKind
Discriminator enum (for isa<>, dyn_cast<>, et al.)
Init *const * const_iterator
StringRef - Represent a constant reference to a string, i.e.
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations? Unset values are concrete.
std::string getAsUnquotedString() const override
Convert this value to a string form, without adding quote markers.
static bool classof(const Init *I)
Init * getBit(unsigned Bit) const override
This method is used to return the initializer for the specified bit.
std::string getAsString() const override
Convert this value to a string form.
virtual std::string getAsString() const =0
Represents a location in source code.
ListRecTy * getListTy()
Returns the type representing list<this>.
Init * getNameInit() const
const_arg_iterator arg_begin() const
StringRef getArgNameStr(unsigned Num) const
bool isValueUnset(StringRef FieldName) const
Return true if the named field is unset.
const RecordMap & getDefs() const
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
Init * resolve(Init *VarName) override
Return the initializer for the given variable name (should normally be a StringInit), or nullptr if the name could not be resolved.
static bool classof(const Init *I)
const_arg_iterator arg_end() const
Init * resolve(Init *VarName) override
Return the initializer for the given variable name (should normally be a StringInit), or nullptr if the name could not be resolved.
static bool classof(const Init *I)
ShadowResolver(Resolver &R)