14#ifndef LLVM_TABLEGEN_RECORD_H
15#define LLVM_TABLEGEN_RECORD_H
48struct RecordKeeperImpl;
83 mutable const ListRecTy *ListTy =
nullptr;
195 const RecTy *ElementTy;
197 explicit ListRecTy(
const RecTy *
T)
205 static const ListRecTy *
get(
const RecTy *
T) {
return T->getListTy(); }
235class RecordRecTy final :
public RecTy,
237 private TrailingObjects<RecordRecTy, const Record *> {
238 friend TrailingObjects;
251 void operator delete(
void *Ptr) { ::operator
delete(Ptr); }
344 virtual void anchor();
430 I.print(OS);
return OS;
436 const RecTy *ValueTy;
470class UnsetInit final :
public Init {
495 const Init *
getBit(
unsigned Bit)
const override {
return this; }
541 return std::get<Positional>(Aux);
545 return std::get<Named>(Aux);
548 return get(Value, Aux);
551 std::pair<const Init *, ArgAuxType>
getKey()
const {
return {Value, Aux}; }
580 explicit BitInit(
bool V,
const RecTy *
T)
598 assert(Bit < 1 &&
"Bit index out of range!");
603 std::string
getAsString()
const override {
return Value ?
"1" :
"0"; }
610 private TrailingObjects<BitsInit, const Init *> {
611 friend TrailingObjects;
621 void operator delete(
void *Ptr) { ::operator
delete(Ptr); }
688 explicit AnonymousNameInit(
RecordKeeper &RK,
unsigned V)
693 AnonymousNameInit &
operator=(
const AnonymousNameInit &) =
delete;
754 return "\"" + Value.str() +
"\"";
756 return "[{" + Value.str() +
"}]";
770 private TrailingObjects<ListInit, const Init *> {
771 friend TrailingObjects;
772 unsigned NumElements;
785 void operator delete(
void *Ptr) { ::operator
delete(Ptr); }
824 size_t size()
const {
return NumElements; }
825 bool empty()
const {
return NumElements == 0; }
891 std::tuple<UnaryOp, const Init *, const RecTy *>
getKey()
const {
897 const Init *
Fold(
const Record *CurRec,
bool IsFinal =
false)
const;
963 std::tuple<BinaryOp, const Init *, const Init *, const RecTy *>
1020 std::tuple<TernaryOp, const Init *, const Init *, const Init *, const RecTy *>
1030 return LHS->isComplete() && MHS->isComplete() && RHS->isComplete();
1043 private TrailingObjects<CondOpInit, const Init *> {
1044 friend TrailingObjects;
1046 const RecTy *ValType;
1109 const Init *
getBit(
unsigned Bit)
const override;
1115 const Init *Start, *List, *A, *B, *Expr;
1117 FoldOpInit(
const Init *Start,
const Init *List,
const Init *A,
const Init *B,
1135 return {Start, List, A, B, Expr,
getType()};
1146 const Init *
getBit(
unsigned Bit)
const override;
1154 const RecTy *CheckType;
1157 IsAOpInit(
const RecTy *CheckType,
const Init *Expr)
1159 CheckType(CheckType), Expr(Expr) {}
1169 std::pair<const RecTy *, const Init *>
getKey()
const {
1170 return {CheckType, Expr};
1181 const Init *
getBit(
unsigned Bit)
const override;
1190 const RecTy *CheckType;
1193 ExistsOpInit(
const RecTy *CheckType,
const Init *Expr)
1195 CheckType(CheckType), Expr(Expr) {}
1205 std::pair<const RecTy *, const Init *>
getKey()
const {
1206 return {CheckType, Expr};
1211 const Init *
Fold(
const Record *CurRec,
bool IsFinal =
false)
const;
1217 const Init *
getBit(
unsigned Bit)
const override;
1230 InstancesOpInit(
const RecTy *Type,
const Init *Regex)
1236 InstancesOpInit &
operator=(
const InstancesOpInit &) =
delete;
1244 std::pair<const RecTy *, const Init *>
getKey()
const {
1245 return {Type, Regex};
1248 const Init *
Fold(
const Record *CurRec,
bool IsFinal =
false)
const;
1263 const Init *VarName;
1265 explicit VarInit(
const Init *VN,
const RecTy *
T)
1293 const Init *
getBit(
unsigned Bit)
const override;
1310 "Illegal VarBitInit expression!");
1330 assert(
B < 1 &&
"Bit index out of range!");
1341 explicit DefInit(
const Record *
D);
1367class VarDefInit final
1370 private TrailingObjects<VarDefInit, const ArgumentInit *> {
1371 friend TrailingObjects;
1377 explicit VarDefInit(
SMLoc Loc,
const Record *Class,
1387 void operator delete(
void *Ptr) { ::operator
delete(Ptr); }
1395 std::pair<const Record *, ArrayRef<const ArgumentInit *>>
getKey()
const {
1396 return {Class,
args()};
1432 llvm::errs() <<
"In Record = " << Rec->getAsString()
1433 <<
", got FieldName = " << *FieldName
1434 <<
" with non-record type!\n";
1453 const Init *
getBit(
unsigned Bit)
const override;
1460 return Rec->getAsString() +
"." + FieldName->getValue().str();
1470 private TrailingObjects<DagInit, const Init *, const StringInit *> {
1471 friend TrailingObjects;
1480 size_t numTrailingObjects(OverloadToken<const Init *>)
const {
1503 ArrayRef<std::pair<const Init *, const StringInit *>> ArgAndNames);
1507 ArrayRef<std::pair<const Init *, const StringInit *>> ArgAndNames) {
1511 std::tuple<const Init *, const StringInit *, ArrayRef<const Init *>,
1523 return ValName ? ValName->getValue() :
StringRef();
1554 using EltTy =
decltype(*
adl_begin(Zip));
1556 return std::make_pair(std::get<0>(
E), std::get<1>(
E));
1605 static constexpr unsigned KindMask = 3;
1606 static constexpr unsigned UsedBit = 4;
1658 unsigned Flags = TyAndFlags.getInt() & ~UsedBit;
1659 TyAndFlags.setInt(Used ? Flags | UsedBit : Flags);
1661 bool isUsed()
const {
return TyAndFlags.getInt() & UsedBit; }
1670 RV.
print(OS <<
" ");
1720 mutable DefInit *CorrespondingDefInit =
nullptr;
1733 : Name(
N), Locs(locs), TrackedRecords(records),
1734 ID(
getNewUID(
N->getRecordKeeper())), Kind(Kind) {
1746 : Name(O.Name), Locs(O.Locs), ValueReferenceLocs(O.ValueReferenceLocs),
1747 TemplateArgs(O.TemplateArgs), Values(O.Values),
1748 Assertions(O.Assertions), DirectSuperClasses(O.DirectSuperClasses),
1770 return ForwardDeclarationLocs;
1781 ValueReferenceLocs[Name].push_back(
Loc);
1786 auto It = From.ValueReferenceLocs.find(Name);
1787 if (It != From.ValueReferenceLocs.end())
1793 auto It = ValueReferenceLocs.find(Name);
1794 if (It == ValueReferenceLocs.end())
1824 SC->getSuperClasses(Classes);
1825 Classes.push_back(SC);
1831 std::vector<const Record *> Classes;
1843 return DirectSuperClasses;
1852 if (Val.Name == Name)
return &Val;
1862 static_cast<const Record *
>(
this)->getValue(Name));
1867 static_cast<const Record *
>(
this)->getValue(Name));
1872 TemplateArgs.push_back(Name);
1877 Values.push_back(RV);
1882 Values, [Name](
const RecordVal &V) {
return V.getNameInit() == Name; });
1883 if (It == Values.end())
1901 Assertions.append(Rec->Assertions);
1912 if (SC == R || SC->isSubClassOf(R))
1921 if (
SI->getValue() == Name)
1923 }
else if (SC->getNameInitAsString() == Name) {
1926 if (SC->isSubClassOf(Name))
1933 assert(!CorrespondingDefInit &&
1934 "changing type of record after it has been referenced");
1936 DirectSuperClasses.emplace_back(R,
Range);
1954 return TrackedRecords;
2041raw_ostream &
operator<<(raw_ostream &OS,
const Record &R);
2045 using GlobalMap = std::map<std::string, const Init *, std::less<>>;
2068 auto It = Classes.find(Name);
2069 return It == Classes.end() ? nullptr : It->second.get();
2074 auto It = Defs.find(Name);
2075 return It == Defs.end() ? nullptr : It->second.get();
2081 return R->getDefInit();
2082 auto It = ExtraGlobals.find(Name);
2083 return It == ExtraGlobals.end() ? nullptr : It->second;
2087 InputFilename = std::move(
Filename);
2091 bool Ins = Classes.try_emplace(R->getName(), std::move(R)).second;
2093 assert(Ins &&
"Class already exists");
2098 DefsByDirectSuperClass[SC].push_back(R.get());
2099 bool Ins = Defs.try_emplace(R->getName(), std::move(R)).second;
2101 assert(Ins &&
"Record already exists");
2108 bool Ins = ExtraGlobals.try_emplace(std::string(Name),
I).second;
2111 assert(Ins &&
"Global already exists");
2127 std::vector<const Record *>
2146 RecordMap Classes, Defs;
2148 mutable std::vector<const Record *> SortedClasses, SortedDefs;
2149 mutable std::map<std::string, std::vector<const Record *>> Cache;
2152 DefsByDirectSuperClass;
2153 GlobalMap ExtraGlobals;
2156 std::unique_ptr<detail::RecordKeeperImpl> Impl;
2157 std::unique_ptr<TGTimer>
Timer;
2173 return LHS->getID() <
RHS->getID();
2193 const char *Start = Rec.
data();
2194 const char *Curr = Start;
2195 bool IsDigitPart =
isDigit(Curr[0]);
2196 for (
size_t I = 0,
E = Rec.
size();
I !=
E; ++
I, ++Len) {
2198 if (IsDigit != IsDigitPart) {
2215 int64_t LHSPositionOrder = Rec1->
getValueAsInt(
"PositionOrder");
2216 int64_t RHSPositionOrder = Rec2->
getValueAsInt(
"PositionOrder");
2217 if (LHSPositionOrder != RHSPositionOrder)
2218 return LHSPositionOrder < RHSPositionOrder;
2223 size_t LHSNumParts = LHSParts.
size();
2224 size_t RHSNumParts = RHSParts.
size();
2225 assert (LHSNumParts && RHSNumParts &&
"Expected at least one part!");
2227 if (LHSNumParts != RHSNumParts)
2228 return LHSNumParts < RHSNumParts;
2231 for (
size_t I = 0,
E = LHSNumParts;
I <
E;
I+=2) {
2232 std::pair<bool, StringRef> LHSPart = LHSParts.
getPart(
I);
2233 std::pair<bool, StringRef> RHSPart = RHSParts.
getPart(
I);
2235 assert (LHSPart.first ==
false && RHSPart.first ==
false &&
2236 "Expected both parts to be alpha.");
2237 if (
int Res = LHSPart.second.compare(RHSPart.second))
2240 for (
size_t I = 1,
E = LHSNumParts;
I <
E;
I+=2) {
2241 std::pair<bool, StringRef> LHSPart = LHSParts.
getPart(
I);
2242 std::pair<bool, StringRef> RHSPart = RHSParts.
getPart(
I);
2244 assert (LHSPart.first ==
true && RHSPart.first ==
true &&
2245 "Expected both parts to be numeric.");
2246 if (LHSPart.second.size() != RHSPart.second.size())
2247 return LHSPart.second.size() < RHSPart.second.size();
2249 unsigned LHSVal, RHSVal;
2251 bool LHSFailed = LHSPart.second.getAsInteger(10, LHSVal); (void)LHSFailed;
2252 assert(!LHSFailed &&
"Unable to convert LHS to integer.");
2253 bool RHSFailed = RHSPart.second.getAsInteger(10, RHSVal); (void)RHSFailed;
2254 assert(!RHSFailed &&
"Unable to convert RHS to integer.");
2256 if (LHSVal != RHSVal)
2257 return LHSVal < RHSVal;
2259 return LHSNumParts < RHSNumParts;
2263raw_ostream &
operator<<(raw_ostream &OS,
const RecordKeeper &RK);
2273 bool IsFinal =
false;
2303 bool &FoundUnresolved)
const {
2309 bool FoundUnresolved) {}
2320 struct MappedValue {
2324 MappedValue() : V(
nullptr), Resolved(
false) {}
2325 MappedValue(
const Init *V,
bool Resolved) : V(V), Resolved(Resolved) {}
2333 unsigned NumInProgress = 0;
2344 auto It = Map.find(VarName);
2345 assert(It != Map.end() &&
"key must be present in map");
2346 return It->second.V->isComplete();
2352 bool &FoundUnresolved)
const override {
2355 auto [Result, Unresolved] = ResultCache.lookup(
I);
2356 FoundUnresolved = Unresolved;
2361 bool FoundUnresolved)
override {
2363 ResultCache[
I] = {Result, FoundUnresolved};
2375 const Init *Name =
nullptr;
2392 bool &FoundUnresolved)
const override {
2395 auto [Result, Unresolved] = ResultCache.lookup(
I);
2396 FoundUnresolved = Unresolved;
2401 bool FoundUnresolved)
override {
2403 ResultCache[
I] = {Result, FoundUnresolved};
2424 if (Shadowed.count(VarName))
2426 return R.resolve(VarName);
2434 bool FoundUnresolved =
false;
2446 return R ? R->getCachedResult(
I, Unresolved) :
nullptr;
2450 bool Unresolved)
override {
2452 R->cacheResult(
I, Result, Unresolved);
2456 FoundUnresolved =
true;
2458 R->noteUnresolved();
2465 const Init *VarNameToTrack;
2470 :
Resolver(nullptr), VarNameToTrack(VarNameToTrack) {}
2478void EmitJSON(
const RecordKeeper &RK, raw_ostream &OS);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file defines the StringMap class.
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
This file defines DenseMapInfo traits for DenseMap<std::variant<Ts...>>.
This file defines the DenseMap class.
This file defines the DenseSet and SmallDenseSet classes.
This file defines a hash set that can be used to remove duplication of nodes in a graph.
static cl::opt< std::string > InputFilename(cl::Positional, cl::desc("<input file>"), cl::init("-"))
ConstantRange Range(APInt(BitWidth, Low), APInt(BitWidth, High))
static constexpr StringLiteral Filename
This file defines the PointerIntPair class.
This file defines the SmallVector class.
This header defines support for implementing classes that have some trailing object (or arrays of obj...
"anonymous_n" - Represent an anonymous record name
unsigned getValue() const
const Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
static AnonymousNameInit * get(RecordKeeper &RK, unsigned)
const StringInit * getNameInit() const
AnonymousNameInit(const AnonymousNameInit &)=delete
static bool classof(const Init *I)
const Init * resolveReferences(Resolver &R) const override
This function is used by classes that refer to other variables which may not be defined at the time t...
std::string getAsString() const override
Convert this value to a literal form.
AnonymousNameInit & operator=(const AnonymousNameInit &)=delete
static bool classof(const Init *I)
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations?
const Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
const ArgumentInit * cloneWithValue(const Init *Value) const
const Init * convertInitializerTo(const RecTy *Ty) const override
Convert to a value whose type is Ty, or return null if this is not possible.
bool isPositional() const
ArgumentInit(const ArgumentInit &)=delete
static const ArgumentInit * get(const Init *Value, ArgAuxType Aux)
const Init * getCastTo(const RecTy *Ty) const override
If this value is convertible to type Ty, return a value whose type is Ty, generating a !...
const Init * getName() const
ArgumentInit & operator=(const ArgumentInit &)=delete
ArgumentInit(const Init *Value, ArgAuxType Aux)
RecordKeeper & getRecordKeeper() const
const Init * getValue() const
std::pair< const Init *, ArgAuxType > getKey() const
bool isComplete() const override
Is this a complete value with no unset (uninitialized) subvalues?
unsigned getIndex() const
const Init * resolveReferences(Resolver &R) const override
This function is used by classes that refer to other variables which may not be defined at the time t...
std::string getAsString() const override
Convert this value to a literal form.
Represent a constant reference to an array (0 or more elements consecutively in memory),...
!op (X, Y) - Combine two inits.
static const BinOpInit * get(BinaryOp opc, const Init *lhs, const Init *rhs, const RecTy *Type)
std::tuple< BinaryOp, const Init *, const Init *, const RecTy * > getKey() const
const Init * resolveReferences(Resolver &R) const override
This function is used by classes that refer to other variables which may not be defined at the time t...
static const Init * getStrConcat(const Init *lhs, const Init *rhs)
std::string getAsString() const override
Convert this value to a literal form.
BinaryOp getOpcode() const
BinOpInit & operator=(const BinOpInit &)=delete
const Init * getRHS() const
std::optional< bool > CompareInit(unsigned Opc, const Init *LHS, const Init *RHS) const
const Init * getLHS() const
static bool classof(const Init *I)
static const Init * getListConcat(const TypedInit *lhs, const Init *rhs)
BinOpInit(const BinOpInit &)=delete
const Init * Fold(const Record *CurRec) const
'true'/'false' - Represent a concrete initializer for a bit.
BitInit(const BitInit &)=delete
static BitInit * get(RecordKeeper &RK, bool V)
std::string getAsString() const override
Convert this value to a literal form.
BitInit & operator=(BitInit &)=delete
const Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
static bool classof(const Init *I)
const Init * convertInitializerTo(const RecTy *Ty) const override
Convert to a value whose type is Ty, or return null if this is not possible.
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations?
'bit' - Represent a single bit
static const BitRecTy * get(RecordKeeper &RK)
static bool classof(const RecTy *RT)
std::string getAsString() const override
bool typeIsConvertibleTo(const RecTy *RHS) const override
Return true if all values of 'this' type can be converted to the specified type.
'{ a, b, c }' - Represents an initializer for a BitsRecTy value.
std::string getAsString() const override
Convert this value to a literal form.
static bool classof(const Init *I)
bool isComplete() const override
Is this a complete value with no unset (uninitialized) subvalues?
unsigned getNumBits() const
std::optional< int64_t > convertInitializerToInt() const
BitsInit & operator=(const BitsInit &)=delete
const Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
const Init * convertInitializerBitRange(ArrayRef< unsigned > Bits) const override
This function is used to implement the bit range selection operator.
const Init * resolveReferences(Resolver &R) const override
This function is used by classes that refer to other variables which may not be defined at the time t...
const Init * convertInitializerTo(const RecTy *Ty) const override
Convert to a value whose type is Ty, or return null if this is not possible.
ArrayRef< const Init * > getBits() const
uint64_t convertKnownBitsToInt() const
bool allInComplete() const
static BitsInit * get(RecordKeeper &RK, ArrayRef< const Init * > Range)
ArrayRef< const Init * > getKey() const
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations?
BitsInit(const BitsInit &)=delete
'bits<n>' - Represent a fixed number of bits
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
static bool classof(const RecTy *RT)
static const BitsRecTy * get(RecordKeeper &RK, unsigned Sz)
std::string getAsString() const override
!cond(condition_1: value1, ... , condition_n: value) Selects the first value for which condition is t...
CondOpInit & operator=(const CondOpInit &)=delete
SmallVectorImpl< const Init * >::const_iterator const_case_iterator
const Init * Fold(const Record *CurRec) const
SmallVectorImpl< const Init * >::const_iterator const_val_iterator
auto getCondAndVals() const
const_val_iterator name_end() const
const_case_iterator arg_end() const
ArrayRef< const Init * > getVals() const
CondOpInit(const CondOpInit &)=delete
const Init * resolveReferences(Resolver &R) const override
This function is used by classes that refer to other variables which may not be defined at the time t...
const Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
const Init * getCond(unsigned Num) const
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations?
const_val_iterator name_begin() const
std::string getAsString() const override
Convert this value to a literal form.
static const CondOpInit * get(ArrayRef< const Init * > Conds, ArrayRef< const Init * > Values, const RecTy *Type)
std::tuple< const RecTy *, ArrayRef< const Init * >, ArrayRef< const Init * > > getKey() const
unsigned getNumConds() const
const RecTy * getValType() const
bool isComplete() const override
Is this a complete value with no unset (uninitialized) subvalues?
static bool classof(const Init *I)
const Init * getVal(unsigned Num) const
const_case_iterator arg_begin() const
ArrayRef< const Init * > getConds() const
(v a, b) - Represent a DAG tree value.
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations?
static const DagInit * get(const Init *V, ArrayRef< std::pair< const Init *, const StringInit * > > ArgAndNames)
unsigned getNumArgs() const
const StringInit * getArgName(unsigned Num) const
std::optional< unsigned > getArgNo(StringRef Name) const
This method looks up the specified argument name and returns its argument number or std::nullopt if t...
std::tuple< const Init *, const StringInit *, ArrayRef< const Init * >, ArrayRef< const StringInit * > > getKey() const
DagInit(const DagInit &)=delete
StringRef getArgNameStr(unsigned Num) const
const_arg_iterator arg_begin() const
const_arg_iterator arg_end() const
const StringInit * getName() const
const Init * getOperator() const
SmallVectorImpl< const StringInit * >::const_iterator const_name_iterator
SmallVectorImpl< const Init * >::const_iterator const_arg_iterator
static bool classof(const Init *I)
const Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
const Init * resolveReferences(Resolver &R) const override
This function is used by classes that refer to other variables which may not be defined at the time t...
static const DagInit * get(const Init *V, ArrayRef< const Init * > Args, ArrayRef< const StringInit * > ArgNames)
ArrayRef< const StringInit * > getArgNames() const
const_name_iterator name_end() const
static const DagInit * get(const Init *V, const StringInit *VN, ArrayRef< const Init * > Args, ArrayRef< const StringInit * > ArgNames)
const_name_iterator name_begin() const
const Record * getOperatorAsDef(ArrayRef< SMLoc > Loc) const
const Init * getArg(unsigned Num) const
StringRef getNameStr() const
DagInit & operator=(const DagInit &)=delete
auto getArgAndNames() const
ArrayRef< const Init * > getArgs() const
std::string getAsString() const override
Convert this value to a literal form.
'dag' - Represent a dag fragment
std::string getAsString() const override
static bool classof(const RecTy *RT)
static const DagRecTy * get(RecordKeeper &RK)
AL - Represent a reference to a 'def' in the description.
DefInit & operator=(const DefInit &)=delete
std::string getAsString() const override
Convert this value to a literal form.
const RecTy * getFieldType(const StringInit *FieldName) const override
This function is used to implement the FieldInit class.
const Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
const Init * convertInitializerTo(const RecTy *Ty) const override
Convert to a value whose type is Ty, or return null if this is not possible.
DefInit(const DefInit &)=delete
static bool classof(const Init *I)
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations?
const Record * getDef() const
Implements a dense probed hash-table based set.
!exists<type>(expr) - Dynamically determine if a record of type named expr exists.
std::pair< const RecTy *, const Init * > getKey() const
static bool classof(const Init *I)
ExistsOpInit(const ExistsOpInit &)=delete
bool isComplete() const override
Is this a complete value with no unset (uninitialized) subvalues?
static const ExistsOpInit * get(const RecTy *CheckType, const Init *Expr)
std::string getAsString() const override
Convert this value to a literal form.
ExistsOpInit & operator=(const ExistsOpInit &)=delete
const Init * resolveReferences(Resolver &R) const override
This function is used by classes that refer to other variables which may not be defined at the time t...
const Init * Fold(const Record *CurRec, bool IsFinal=false) const
const Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
X.Y - Represent a reference to a subfield of a variable.
static bool classof(const Init *I)
std::string getAsString() const override
Convert this value to a literal form.
const Init * Fold(const Record *CurRec) const
const StringInit * getFieldName() const
const Init * getRecord() const
const Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
static const FieldInit * get(const Init *R, const StringInit *FN)
FieldInit & operator=(const FieldInit &)=delete
const Init * resolveReferences(Resolver &R) const override
This function is used by classes that refer to other variables which may not be defined at the time t...
FieldInit(const FieldInit &)=delete
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations?
!foldl (a, b, expr, start, lst) - Fold over a list.
const Init * Fold(const Record *CurRec) const
static bool classof(const Init *I)
FoldOpInit & operator=(const FoldOpInit &)=delete
std::string getAsString() const override
Convert this value to a literal form.
FoldOpInit(const FoldOpInit &)=delete
static const FoldOpInit * get(const Init *Start, const Init *List, const Init *A, const Init *B, const Init *Expr, const RecTy *Type)
std::tuple< const Init *, const Init *, const Init *, const Init *, const Init *, const RecTy * > getKey() const
const Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
bool isComplete() const override
Is this a complete value with no unset (uninitialized) subvalues?
const Init * resolveReferences(Resolver &R) const override
This function is used by classes that refer to other variables which may not be defined at the time t...
HasReferenceResolver(const Init *VarNameToTrack)
const Init * resolve(const Init *VarName) override
Return the initializer for the given variable name (should normally be a StringInit),...
virtual const Init * resolveReferences(Resolver &R) const
This function is used by classes that refer to other variables which may not be defined at the time t...
bool isTriviallyResolved() const
Return true if resolveReferences returns this value unchanged with any resolver.
virtual const Init * convertInitializerBitRange(ArrayRef< unsigned > Bits) const
This function is used to implement the bit range selection operator.
virtual std::string getAsUnquotedString() const
Convert this value to a literal form, without adding quotes around a string.
void dump() const
Debugging method that may be called through a debugger; just invokes print on stderr.
void print(raw_ostream &OS) const
Print this value.
virtual std::string getAsString() const =0
Convert this value to a literal form.
InitKind
Discriminator enum (for isa<>, dyn_cast<>, et al.)
InitKind getKind() const
Get the kind (type) of the value.
virtual bool isConcrete() const
Is this a concrete and fully resolved value without any references or stuck operations?
virtual bool isComplete() const
Is this a complete value with no unset (uninitialized) subvalues?
virtual const Init * getBit(unsigned Bit) const =0
Get the Init value of the specified bit.
virtual const RecTy * getFieldType(const StringInit *FieldName) const
This function is used to implement the FieldInit class.
static bool isLeafKind(InitKind K)
Return true if K is a value kind that cannot contain references.
Init(const Init &)=delete
virtual const Init * convertInitializerTo(const RecTy *Ty) const =0
Convert to a value whose type is Ty, or return null if this is not possible.
Init & operator=(const Init &)=delete
bool TriviallyResolved
Set if resolveReferences returns this value unchanged with any resolver.
virtual const Init * getCastTo(const RecTy *Ty) const =0
If this value is convertible to type Ty, return a value whose type is Ty, generating a !...
RecordKeeper & getRecordKeeper() const
Get the record keeper that initialized this Init.
Init(InitKind K, uint8_t Opc=0)
!instances<type>([regex]) - Produces a list of records whose type is type.
const Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
std::pair< const RecTy *, const Init * > getKey() const
const Init * Fold(const Record *CurRec, bool IsFinal=false) const
const Init * resolveReferences(Resolver &R) const override
This function is used by classes that refer to other variables which may not be defined at the time t...
std::string getAsString() const override
Convert this value to a literal form.
static bool classof(const Init *I)
InstancesOpInit(const InstancesOpInit &)=delete
bool isComplete() const override
Is this a complete value with no unset (uninitialized) subvalues?
static const InstancesOpInit * get(const RecTy *Type, const Init *Regex)
InstancesOpInit & operator=(const InstancesOpInit &)=delete
'7' - Represent an initialization by a literal integer value.
IntInit(const IntInit &)=delete
static IntInit * get(RecordKeeper &RK, int64_t V)
const Init * convertInitializerBitRange(ArrayRef< unsigned > Bits) const override
This function is used to implement the bit range selection operator.
const Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
static bool classof(const Init *I)
IntInit & operator=(const IntInit &)=delete
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations?
std::string getAsString() const override
Convert this value to a literal form.
const Init * convertInitializerTo(const RecTy *Ty) const override
Convert to a value whose type is Ty, or return null if this is not possible.
'int' - Represent an integer value of no particular size
static const IntRecTy * get(RecordKeeper &RK)
bool typeIsConvertibleTo(const RecTy *RHS) const override
Return true if all values of 'this' type can be converted to the specified type.
std::string getAsString() const override
static bool classof(const RecTy *RT)
!isa<type>(expr) - Dynamically determine the type of an expression.
IsAOpInit(const IsAOpInit &)=delete
IsAOpInit & operator=(const IsAOpInit &)=delete
std::pair< const RecTy *, const Init * > getKey() const
static bool classof(const Init *I)
static const IsAOpInit * get(const RecTy *CheckType, const Init *Expr)
const Init * resolveReferences(Resolver &R) const override
This function is used by classes that refer to other variables which may not be defined at the time t...
bool isComplete() const override
Is this a complete value with no unset (uninitialized) subvalues?
std::string getAsString() const override
Convert this value to a literal form.
const Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
const Init * Fold() const
[AL, AH, CL] - Represent a list of defs
std::string getAsString() const override
Convert this value to a literal form.
ListInit & operator=(const ListInit &)=delete
const RecTy * getElementType() const
const Init *const * const_iterator
static const ListInit * get(ArrayRef< const Init * > Range, const RecTy *EltTy)
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations?
ListInit(const ListInit &)=delete
bool isComplete() const override
Is this a complete value with no unset (uninitialized) subvalues?
const Init * resolveReferences(Resolver &R) const override
This method is used by classes that refer to other variables which may not be defined at the time the...
const Init * convertInitializerTo(const RecTy *Ty) const override
Convert to a value whose type is Ty, or return null if this is not possible.
const Record * getElementAsRecord(unsigned Idx) const
const_iterator begin() const
const_iterator end() const
ArrayRef< const Init * > getElements() const
std::pair< ArrayRef< const Init * >, const RecTy * > getKey() const
const Init * getElement(unsigned Idx) const
const Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
static bool classof(const Init *I)
'list<Ty>' - Represent a list of element values, all of which must be of the specified type.
const RecTy * getElementType() const
static bool classof(const RecTy *RT)
bool typeIsA(const RecTy *RHS) const override
Return true if 'this' type is equal to or a subtype of RHS.
static const ListRecTy * get(const RecTy *T)
std::string getAsString() const override
bool typeIsConvertibleTo(const RecTy *RHS) const override
Return true if all values of 'this' type can be converted to the specified type.
void clearCachedResults() override
const Init * getCachedResult(const Init *I, bool &FoundUnresolved) const override
Return the cached result of resolving I, or nullptr.
void cacheResult(const Init *I, const Init *Result, bool FoundUnresolved) override
Cache the result of resolving I.
void set(const Init *Key, const Init *Value)
bool isComplete(Init *VarName) const
MapResolver(const Record *CurRec=nullptr)
const Init * resolve(const Init *VarName) override
Return the initializer for the given variable name (should normally be a StringInit),...
Base class for operators.
OpInit & operator=(OpInit &)=delete
static bool classof(const Init *I)
OpInit(const OpInit &)=delete
const Init * getBit(unsigned Bit) const final
Get the Init value of the specified bit.
OpInit(InitKind K, const RecTy *Type, uint8_t Opc)
PointerIntPair - This class implements a pair of a pointer and small integer.
RecordKeeper & getRecordKeeper() const
Return the RecordKeeper that uniqued this Type.
virtual bool typeIsA(const RecTy *RHS) const
Return true if 'this' type is equal to or a subtype of RHS.
virtual bool typeIsConvertibleTo(const RecTy *RHS) const
Return true if all values of 'this' type can be converted to the specified type.
RecTyKind
Subclass discriminator (for dyn_cast<> et al.)
RecTy(RecTyKind K, RecordKeeper &RK)
virtual std::string getAsString() const =0
RecTyKind getRecTyKind() const
const ListRecTy * getListTy() const
Returns the type representing list<thistype>.
void print(raw_ostream &OS) const
void addDef(std::unique_ptr< Record > R)
void addClass(std::unique_ptr< Record > R)
TGTimer & getTimer() const
const Record * getClass(StringRef Name) const
Get the class with the specified name.
ArrayRef< const Record * > getClasses() const
Get all classes, sorted by name.
const Init * getNewAnonymousName()
GetNewAnonymousName - Generate a unique anonymous name that can be used as an identifier.
StringRef getInputFilename() const
Get the main TableGen input file's name.
detail::RecordKeeperImpl & getImpl()
Return the internal implementation of the RecordKeeper.
void saveInputFilename(std::string Filename)
const GlobalMap & getGlobals() const
Get the map of global variables.
const Init * getGlobal(StringRef Name) const
Get the Init value of the specified global variable.
ArrayRef< const Record * > getDefs() const
Get all records (defs), sorted by name.
void dumpAllocationStats(raw_ostream &OS) const
ArrayRef< const Record * > getAllDerivedDefinitionsIfDefined(StringRef ClassName) const
Get all the concrete records that inherit from specified class, if the class is defined.
void addExtraGlobal(StringRef Name, const Init *I)
const Record * getDef(StringRef Name) const
Get the concrete record with the specified name.
ArrayRef< const Record * > getAllDerivedDefinitions(StringRef ClassName) const
Get all the concrete records that inherit from the one specified class.
'[classname]' - Type of record values that have zero or more superclasses.
bool typeIsConvertibleTo(const RecTy *RHS) const override
Return true if all values of 'this' type can be converted to the specified type.
RecordRecTy & operator=(const RecordRecTy &)=delete
bool isSubClassOf(const Record *Class) const
const Record *const * const_record_iterator
ArrayRef< const Record * > getClasses() const
ArrayRef< const Record * > getKey() const
const_record_iterator classes_begin() const
const_record_iterator classes_end() const
std::string getAsString() const override
RecordRecTy(const RecordRecTy &)=delete
bool typeIsA(const RecTy *RHS) const override
Return true if 'this' type is equal to or a subtype of RHS.
static bool classof(const RecTy *RT)
static const RecordRecTy * get(RecordKeeper &RK, ArrayRef< const Record * > Classes)
Get the record type with the given non-redundant list of superclasses.
void clearCachedResults() override
bool keepUnsetBits() const override
void cacheResult(const Init *I, const Init *Result, bool FoundUnresolved) override
Cache the result of resolving I.
RecordResolver(const Record &R)
const Init * resolve(const Init *VarName) override
Return the initializer for the given variable name (should normally be a StringInit),...
void setName(const Init *NewName)
const Init * getCachedResult(const Init *I, bool &FoundUnresolved) const override
Return the cached result of resolving I, or nullptr.
This class represents a field in a record, including its name, type, value, and source location.
bool isTemplateArg() const
Is this a template argument?
std::string getNameInitAsString() const
Get the name of the field as a std::string.
void setUsed(bool Used)
Whether this value is used.
bool isNonconcreteOK() const
Is this a field where nonconcrete values are okay?
bool setValue(const Init *V)
Set the value of the field from an Init.
RecordKeeper & getRecordKeeper() const
Get the record keeper used to unique this value.
SMLoc getLoc() const
Get the source location of the point where the field was defined.
const Init * getValue() const
Get the value of the field as an Init.
StringRef getName() const
Get the name of the field as a StringRef.
void print(raw_ostream &OS, bool PrintSem=true) const
Print the value to an output stream, possibly with a semicolon.
RecordVal(const Init *N, const RecTy *T, FieldKind K)
const Init * getNameInit() const
Get the name of the field as an Init.
std::string getPrintType() const
Get the type of the field for printing purposes.
const RecTy * getType() const
Get the type of the field value as a RecTy.
std::vector< int64_t > getValueAsListOfInts(StringRef FieldName) const
This method looks up the specified field and returns its value as a vector of integers,...
const RecordRecTy * getType() const
const Init * getValueInit(StringRef FieldName) const
Return the initializer for a value with the specified name, or throw an exception if the field does n...
bool getValueAsBitOrUnset(StringRef FieldName, bool &Unset) const
This method looks up the specified field and returns its value as a bit.
bool getValueAsBit(StringRef FieldName) const
This method looks up the specified field and returns its value as a bit, throwing an exception if the...
static unsigned getNewUID(RecordKeeper &RK)
ArrayRef< SMLoc > getLoc() const
void addDump(SMLoc Loc, const Init *Message)
void checkUnusedTemplateArgs()
ArrayRef< DumpInfo > getDumps() const
std::vector< const Record * > getValueAsListOfDefs(StringRef FieldName) const
This method looks up the specified field and returns its value as a vector of records,...
ArrayRef< AssertionInfo > getAssertions() const
void appendValueReferenceLoc(const Init *Name, SMRange Loc) const
Add a reference to the value named Name.
std::string getNameInitAsString() const
void removeValue(StringRef Name)
void appendValueReferenceLocs(const Record &From, const Init *Name) const
Add the references to the value named Name in From.
const Record * getValueAsDef(StringRef FieldName) const
This method looks up the specified field and returns its value as a Record, throwing an exception if ...
RecordKeeper & getRecords() const
const DagInit * getValueAsDag(StringRef FieldName) const
This method looks up the specified field and returns its value as an Dag, throwing an exception if th...
std::vector< StringRef > getValueAsListOfStrings(StringRef FieldName) const
This method looks up the specified field and returns its value as a vector of strings,...
const RecordVal * getValue(const Init *Name) const
void addTemplateArg(const Init *Name)
void appendLoc(SMLoc Loc)
bool isValueUnset(StringRef FieldName) const
Return true if the named field is unset.
std::vector< const Record * > getSuperClasses() const
Return all superclasses in post-order.
bool isMultiClass() const
bool hasDirectSuperClass(const Record *SuperClass) const
Determine whether this record has the specified direct superclass.
void addValue(const RecordVal &RV)
const Record * getValueAsOptionalDef(StringRef FieldName) const
This method looks up the specified field and returns its value as a Record, returning null if the fie...
void addAssertion(SMLoc Loc, const Init *Condition, const Init *Message)
Record(StringRef N, ArrayRef< SMLoc > locs, RecordKeeper &records, RecordKind Kind=RK_Def)
ArrayRef< std::pair< const Record *, SMRange > > getDirectSuperClasses() const
Return the direct superclasses of this record.
StringRef getName() const
Record(const Init *N, ArrayRef< SMLoc > locs, RecordKeeper &records, RecordKind Kind=RK_Def)
bool isTemplateArg(const Init *Name) const
void setName(const Init *Name)
bool isSubClassOf(StringRef Name) const
const ListInit * getValueAsListInit(StringRef FieldName) const
This method looks up the specified field and returns its value as a ListInit, throwing an exception i...
void appendDumps(const Record *Rec)
bool isSubClassOf(const Record *R) const
DefInit * getDefInit() const
get the corresponding DefInit.
ArrayRef< RecordVal > getValues() const
SMLoc getFieldLoc(StringRef FieldName) const
Return the source location for the named field.
ArrayRef< SMLoc > getForwardDeclarationLocs() const
const RecordVal * getValue(StringRef Name) const
void resolveReferences(const Init *NewName=nullptr)
If there are any field references that refer to fields that have been filled in, we can propagate the...
std::optional< StringRef > getValueAsOptionalString(StringRef FieldName) const
This method looks up the specified field and returns its value as a string, throwing an exception if ...
void removeValue(const Init *Name)
ArrayRef< const Init * > getTemplateArgs() const
ArrayRef< SMRange > getReferenceLocs() const
Return the references of this record value.
void updateClassLoc(SMLoc Loc)
RecordVal * getValue(const Init *Name)
const BitsInit * getValueAsBitsInit(StringRef FieldName) const
This method looks up the specified field and returns its value as a BitsInit, throwing an exception i...
void addDirectSuperClass(const Record *R, SMRange Range)
ArrayRef< SMRange > getValueReferenceLocs(const Init *Name) const
Return the references to the value named Name.
void appendAssertions(const Record *Rec)
const Init * getNameInit() const
void getSuperClasses(std::vector< const Record * > &Classes) const
Append all superclasses in post-order to Classes.
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...
RecordVal * getValue(StringRef Name)
void checkRecordAssertions()
void appendReferenceLoc(SMRange Loc) const
Add a reference to this record value.
StringRef getValueAsString(StringRef FieldName) const
This method looks up the specified field and returns its value as a string, throwing an exception if ...
Interface for looking up the initializer for a variable name, used by Init::resolveReferences.
virtual ~Resolver()=default
virtual void noteUnresolved()
Called when a cached result has unresolved references.
virtual const Init * getCachedResult(const Init *I, bool &FoundUnresolved) const
Return the cached result of resolving I, or nullptr.
virtual void cacheResult(const Init *I, const Init *Result, bool FoundUnresolved)
Cache the result of resolving I.
Resolver(const Record *CurRec)
const Record * getCurrentRecord() const
virtual void clearCachedResults()
void setFinal(bool Final)
virtual bool keepUnsetBits() const
virtual const Init * resolve(const Init *VarName)=0
Return the initializer for the given variable name (should normally be a StringInit),...
Represents a location in source code.
Represents a range in source code.
ShadowResolver(Resolver &R)
const Init * resolve(const Init *VarName) override
Return the initializer for the given variable name (should normally be a StringInit),...
void addShadow(const Init *Key)
typename SuperClass::const_iterator const_iterator
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
"foo" - Represent an initialization by a string value.
StringInit(const StringInit &)=delete
std::string getAsString() const override
Convert this value to a literal form.
StringInit & operator=(const StringInit &)=delete
static const StringInit * get(RecordKeeper &RK, StringRef, StringFormat Fmt=SF_String)
StringFormat getFormat() const
bool hasCodeFormat() const
StringRef getValue() const
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations?
static StringFormat determineFormat(StringFormat Fmt1, StringFormat Fmt2)
static bool classof(const Init *I)
std::string getAsUnquotedString() const override
Convert this value to a literal form, without adding quotes around a string.
const Init * convertInitializerTo(const RecTy *Ty) const override
Convert to a value whose type is Ty, or return null if this is not possible.
const Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
'string' - Represent an string value
static bool classof(const RecTy *RT)
std::string getAsString() const override
static const StringRecTy * get(RecordKeeper &RK)
bool typeIsConvertibleTo(const RecTy *RHS) const override
Return true if all values of 'this' type can be converted to the specified type.
Represent a constant reference to a string, i.e.
constexpr bool empty() const
Check if the string is empty.
constexpr size_t size() const
Get the string size.
constexpr const char * data() const
Get a pointer to the start of the string (which may not be null terminated).
LLVM_ABI int compare_numeric(StringRef RHS) const
Compare two strings, treating sequences of digits as numbers.
!op (X, Y, Z) - Combine two inits.
TernOpInit(const TernOpInit &)=delete
const Init * Fold(const Record *CurRec) const
const Init * getLHS() const
bool isComplete() const override
Is this a complete value with no unset (uninitialized) subvalues?
static bool classof(const Init *I)
std::tuple< TernaryOp, const Init *, const Init *, const Init *, const RecTy * > getKey() const
const Init * getMHS() const
const Init * getRHS() const
static const TernOpInit * get(TernaryOp opc, const Init *lhs, const Init *mhs, const Init *rhs, const RecTy *Type)
std::string getAsString() const override
Convert this value to a literal form.
const Init * resolveReferences(Resolver &R) const override
This function is used by classes that refer to other variables which may not be defined at the time t...
TernOpInit & operator=(const TernOpInit &)=delete
TernaryOp getOpcode() const
This class is used to track the amount of time spent between invocations of its startTimer()/stopTime...
const Init * getCachedResult(const Init *I, bool &Unresolved) const override
Return the cached result of resolving I, or nullptr.
const Init * resolve(const Init *VarName) override
Return the initializer for the given variable name (should normally be a StringInit),...
bool foundUnresolved() const
void noteUnresolved() override
Called when a cached result has unresolved references.
TrackUnresolvedResolver(Resolver *R=nullptr)
void cacheResult(const Init *I, const Init *Result, bool Unresolved) override
Cache the result of resolving I.
const T * getTrailingObjects() const
The instances of the Type class are immutable: once they are created, they are never changed.
This is the common superclass of types that have a specific, explicit type, stored in ValueTy.
const RecTy * getFieldType(const StringInit *FieldName) const override
This method is used to implement the FieldInit class.
static bool classof(const Init *I)
TypedInit(InitKind K, const RecTy *T, uint8_t Opc=0)
const Init * convertInitializerBitRange(ArrayRef< unsigned > Bits) const override
This function is used to implement the bit range selection operator.
RecordKeeper & getRecordKeeper() const
Get the record keeper that initialized this Init.
TypedInit(const TypedInit &)=delete
TypedInit & operator=(const TypedInit &)=delete
const Init * getCastTo(const RecTy *Ty) const override
If this value is convertible to type Ty, return a value whose type is Ty, generating a !...
const Init * convertInitializerTo(const RecTy *Ty) const override
Convert to a value whose type is Ty, or return null if this is not possible.
const RecTy * getType() const
Get the type of the Init as a RecTy.
!op (X) - Transform an init.
const Init * getOperand() const
UnOpInit & operator=(const UnOpInit &)=delete
static bool classof(const Init *I)
UnaryOp getOpcode() const
static const UnOpInit * get(UnaryOp opc, const Init *lhs, const RecTy *Type)
UnOpInit(const UnOpInit &)=delete
const Init * resolveReferences(Resolver &R) const override
This function is used by classes that refer to other variables which may not be defined at the time t...
std::string getAsString() const override
Convert this value to a literal form.
std::tuple< UnaryOp, const Init *, const RecTy * > getKey() const
const Init * Fold(const Record *CurRec, bool IsFinal=false) const
'?' - Represents an uninitialized value.
UnsetInit & operator=(const UnsetInit &)=delete
bool isComplete() const override
Is this a complete value with no unset (uninitialized) subvalues?
const Init * getCastTo(const RecTy *Ty) const override
If this value is convertible to type Ty, return a value whose type is Ty, generating a !...
UnsetInit(const UnsetInit &)=delete
bool isConcrete() const override
Is this a concrete and fully resolved value without any references or stuck operations?
const Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
const Init * convertInitializerTo(const RecTy *Ty) const override
Convert to a value whose type is Ty, or return null if this is not possible.
static UnsetInit * get(RecordKeeper &RK)
Get the singleton unset Init.
static bool classof(const Init *I)
std::string getAsString() const override
Get the string representation of the Init.
RecordKeeper & getRecordKeeper() const
Get the record keeper that initialized this Init.
LLVM Value Representation.
Opcode{0} - Represent access to one bit of a variable or field.
static const VarBitInit * get(const TypedInit *T, unsigned B)
unsigned getBitNum() const
VarBitInit(const VarBitInit &)=delete
std::string getAsString() const override
Convert this value to a literal form.
const Init * getBitVar() const
static bool classof(const Init *I)
const Init * getBit(unsigned B) const override
Get the Init value of the specified bit.
VarBitInit & operator=(const VarBitInit &)=delete
const Init * resolveReferences(Resolver &R) const override
This function is used by classes that refer to other variables which may not be defined at the time t...
classname<targs...> - Represent an uninstantiated anonymous class instantiation.
ArrayRef< const ArgumentInit * > args() const
const ArgumentInit * getArg(unsigned i) const
std::pair< const Record *, ArrayRef< const ArgumentInit * > > getKey() const
const_iterator args_end() const
static const VarDefInit * get(SMLoc Loc, const Record *Class, ArrayRef< const ArgumentInit * > Args)
const_iterator args_begin() const
const Init * resolveReferences(Resolver &R) const override
This function is used by classes that refer to other variables which may not be defined at the time t...
const Init * Fold() const
VarDefInit & operator=(const VarDefInit &)=delete
const Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
const ArgumentInit *const * const_iterator
static bool classof(const Init *I)
VarDefInit(const VarDefInit &)=delete
std::string getAsString() const override
Convert this value to a literal form.
'Opcode' - Represent a reference to an entire variable object.
static const VarInit * get(StringRef VN, const RecTy *T)
VarInit & operator=(const VarInit &)=delete
static bool classof(const Init *I)
const Init * getBit(unsigned Bit) const override
Get the Init value of the specified bit.
StringRef getName() const
std::string getAsString() const override
Convert this value to a literal form.
VarInit(const VarInit &)=delete
const Init * getNameInit() const
const Init * resolveReferences(Resolver &R) const override
This method is used by classes that refer to other variables which may not be defined at the time the...
std::string getNameInitAsString() const
This class implements an extremely fast bulk output stream that can only output to a stream.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
A self-contained host- and target-independent arbitrary-precision floating-point software implementat...
This is an optimization pass for GlobalISel generic memory operations.
detail::zippy< detail::zip_first, T, U, Args... > zip_equal(T &&t, U &&u, Args &&...args)
zip iterator that assumes that all iteratees have the same length.
RelativeUniformCounterPtr Values
constexpr auto adl_begin(RangeT &&range) -> decltype(adl_detail::begin_impl(std::forward< RangeT >(range)))
Returns the begin iterator to range using std::begin and function found through Argument-Dependent Lo...
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
@ BinaryOp
One of the operands is a binary op.
void append_range(Container &C, Range &&R)
Wrapper function to append range R to container C.
std::string utostr(uint64_t X, bool isNeg=false)
auto map_range(ContainerTy &&C, FuncTy F)
Return a range that applies F to the elements of C.
RelativeUniformCounterPtr ValuesPtrExpr VTableAddr Value
decltype(auto) get(const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &Pair)
auto make_first_range(ContainerTy &&c)
Given a container of pairs, return a range over the first elements.
bool isDigit(char C)
Checks if character C is one of the 10 decimal digits.
bool isa(const From &Val)
isa<X> - Return true if the parameter to the template is an instance of one of the template type argu...
LLVM_ATTRIBUTE_VISIBILITY_DEFAULT AnalysisKey InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key
LLVM_ABI raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
void EmitJSON(const RecordKeeper &RK, raw_ostream &OS)
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
ArrayRef(const T &OneElt) -> ArrayRef< T >
void EmitDetailedRecords(const RecordKeeper &RK, raw_ostream &OS)
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
auto find_if(R &&Range, UnaryPredicate P)
Provide wrappers to std::find_if which take ranges instead of having to pass begin/end explicitly.
bool is_contained(R &&Range, const E &Element)
Returns true if Element is found in Range.
const RecTy * resolveTypes(const RecTy *T1, const RecTy *T2)
Find a common type that T1 and T2 convert to.
std::variant< unsigned, const Init * > ArgAuxType
This class represents the internal implementation of the RecordKeeper.
Sorting predicate to sort record pointers by their unique ID.
bool operator()(const Record *LHS, const Record *RHS) const
Sorting predicate to sort record pointers by their Name field.
bool operator()(const Record *Rec1, const Record *Rec2) const
std::pair< bool, StringRef > getPart(size_t Idx)
SmallVector< std::pair< bool, StringRef >, 4 > Parts
RecordParts(StringRef Rec)
bool operator()(const Record *Rec1, const Record *Rec2) const
Sorting predicate to sort record pointers by name.
bool operator()(const Record *Rec1, const Record *Rec2) const
AssertionInfo(SMLoc Loc, const Init *Condition, const Init *Message)
DumpInfo(SMLoc Loc, const Init *Message)