#include "llvm/TableGen/Record.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/FoldingSet.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/Support/Allocator.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/SMLoc.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/TableGen/Error.h"
#include <cassert>
#include <cstdint>
#include <map>
#include <memory>
#include <string>
#include <utility>
#include <vector>
usingnamespacellvm;
#define DEBUG_TYPE …
namespace llvm {
namespace detail {
struct RecordKeeperImpl { … };
}
}
void detail::RecordKeeperImpl::dumpAllocationStats(raw_ostream &OS) const { … }
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
LLVM_DUMP_METHOD void RecTy::dump() const { print(errs()); }
#endif
ListRecTy *RecTy::getListTy() { … }
bool RecTy::typeIsConvertibleTo(const RecTy *RHS) const { … }
bool RecTy::typeIsA(const RecTy *RHS) const { … }
BitRecTy *BitRecTy::get(RecordKeeper &RK) { … }
bool BitRecTy::typeIsConvertibleTo(const RecTy *RHS) const{ … }
BitsRecTy *BitsRecTy::get(RecordKeeper &RK, unsigned Sz) { … }
std::string BitsRecTy::getAsString() const { … }
bool BitsRecTy::typeIsConvertibleTo(const RecTy *RHS) const { … }
IntRecTy *IntRecTy::get(RecordKeeper &RK) { … }
bool IntRecTy::typeIsConvertibleTo(const RecTy *RHS) const { … }
StringRecTy *StringRecTy::get(RecordKeeper &RK) { … }
std::string StringRecTy::getAsString() const { … }
bool StringRecTy::typeIsConvertibleTo(const RecTy *RHS) const { … }
std::string ListRecTy::getAsString() const { … }
bool ListRecTy::typeIsConvertibleTo(const RecTy *RHS) const { … }
bool ListRecTy::typeIsA(const RecTy *RHS) const { … }
DagRecTy *DagRecTy::get(RecordKeeper &RK) { … }
std::string DagRecTy::getAsString() const { … }
static void ProfileRecordRecTy(FoldingSetNodeID &ID,
ArrayRef<Record *> Classes) { … }
RecordRecTy *RecordRecTy::get(RecordKeeper &RK,
ArrayRef<Record *> UnsortedClasses) { … }
RecordRecTy *RecordRecTy::get(Record *Class) { … }
void RecordRecTy::Profile(FoldingSetNodeID &ID) const { … }
std::string RecordRecTy::getAsString() const { … }
bool RecordRecTy::isSubClassOf(Record *Class) const { … }
bool RecordRecTy::typeIsConvertibleTo(const RecTy *RHS) const { … }
bool RecordRecTy::typeIsA(const RecTy *RHS) const { … }
static RecordRecTy *resolveRecordTypes(RecordRecTy *T1, RecordRecTy *T2) { … }
RecTy *llvm::resolveTypes(RecTy *T1, RecTy *T2) { … }
void Init::anchor() { … }
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
LLVM_DUMP_METHOD void Init::dump() const { return print(errs()); }
#endif
RecordKeeper &Init::getRecordKeeper() const { … }
UnsetInit *UnsetInit::get(RecordKeeper &RK) { … }
Init *UnsetInit::getCastTo(RecTy *Ty) const { … }
Init *UnsetInit::convertInitializerTo(RecTy *Ty) const { … }
static void ProfileArgumentInit(FoldingSetNodeID &ID, Init *Value,
ArgAuxType Aux) { … }
void ArgumentInit::Profile(FoldingSetNodeID &ID) const { … }
ArgumentInit *ArgumentInit::get(Init *Value, ArgAuxType Aux) { … }
Init *ArgumentInit::resolveReferences(Resolver &R) const { … }
BitInit *BitInit::get(RecordKeeper &RK, bool V) { … }
Init *BitInit::convertInitializerTo(RecTy *Ty) const { … }
static void
ProfileBitsInit(FoldingSetNodeID &ID, ArrayRef<Init *> Range) { … }
BitsInit *BitsInit::get(RecordKeeper &RK, ArrayRef<Init *> Range) { … }
void BitsInit::Profile(FoldingSetNodeID &ID) const { … }
Init *BitsInit::convertInitializerTo(RecTy *Ty) const { … }
Init *
BitsInit::convertInitializerBitRange(ArrayRef<unsigned> Bits) const { … }
bool BitsInit::isConcrete() const { … }
std::string BitsInit::getAsString() const { … }
Init *BitsInit::resolveReferences(Resolver &R) const { … }
IntInit *IntInit::get(RecordKeeper &RK, int64_t V) { … }
std::string IntInit::getAsString() const { … }
static bool canFitInBitfield(int64_t Value, unsigned NumBits) { … }
Init *IntInit::convertInitializerTo(RecTy *Ty) const { … }
Init *
IntInit::convertInitializerBitRange(ArrayRef<unsigned> Bits) const { … }
AnonymousNameInit *AnonymousNameInit::get(RecordKeeper &RK, unsigned V) { … }
StringInit *AnonymousNameInit::getNameInit() const { … }
std::string AnonymousNameInit::getAsString() const { … }
Init *AnonymousNameInit::resolveReferences(Resolver &R) const { … }
StringInit *StringInit::get(RecordKeeper &RK, StringRef V, StringFormat Fmt) { … }
Init *StringInit::convertInitializerTo(RecTy *Ty) const { … }
static void ProfileListInit(FoldingSetNodeID &ID,
ArrayRef<Init *> Range,
RecTy *EltTy) { … }
ListInit *ListInit::get(ArrayRef<Init *> Range, RecTy *EltTy) { … }
void ListInit::Profile(FoldingSetNodeID &ID) const { … }
Init *ListInit::convertInitializerTo(RecTy *Ty) const { … }
Record *ListInit::getElementAsRecord(unsigned i) const { … }
Init *ListInit::resolveReferences(Resolver &R) const { … }
bool ListInit::isComplete() const { … }
bool ListInit::isConcrete() const { … }
std::string ListInit::getAsString() const { … }
Init *OpInit::getBit(unsigned Bit) const { … }
static void
ProfileUnOpInit(FoldingSetNodeID &ID, unsigned Opcode, Init *Op, RecTy *Type) { … }
UnOpInit *UnOpInit::get(UnaryOp Opc, Init *LHS, RecTy *Type) { … }
void UnOpInit::Profile(FoldingSetNodeID &ID) const { … }
Init *UnOpInit::Fold(Record *CurRec, bool IsFinal) const { … }
Init *UnOpInit::resolveReferences(Resolver &R) const { … }
std::string UnOpInit::getAsString() const { … }
static void
ProfileBinOpInit(FoldingSetNodeID &ID, unsigned Opcode, Init *LHS, Init *RHS,
RecTy *Type) { … }
BinOpInit *BinOpInit::get(BinaryOp Opc, Init *LHS, Init *RHS, RecTy *Type) { … }
void BinOpInit::Profile(FoldingSetNodeID &ID) const { … }
static StringInit *ConcatStringInits(const StringInit *I0,
const StringInit *I1) { … }
static StringInit *interleaveStringList(const ListInit *List,
const StringInit *Delim) { … }
static StringInit *interleaveIntList(const ListInit *List,
const StringInit *Delim) { … }
Init *BinOpInit::getStrConcat(Init *I0, Init *I1) { … }
static ListInit *ConcatListInits(const ListInit *LHS,
const ListInit *RHS) { … }
Init *BinOpInit::getListConcat(TypedInit *LHS, Init *RHS) { … }
std::optional<bool> BinOpInit::CompareInit(unsigned Opc, Init *LHS,
Init *RHS) const { … }
static std::optional<unsigned> getDagArgNoByKey(DagInit *Dag, Init *Key,
std::string &Error) { … }
Init *BinOpInit::Fold(Record *CurRec) const { … }
Init *BinOpInit::resolveReferences(Resolver &R) const { … }
std::string BinOpInit::getAsString() const { … }
static void
ProfileTernOpInit(FoldingSetNodeID &ID, unsigned Opcode, Init *LHS, Init *MHS,
Init *RHS, RecTy *Type) { … }
TernOpInit *TernOpInit::get(TernaryOp Opc, Init *LHS, Init *MHS, Init *RHS,
RecTy *Type) { … }
void TernOpInit::Profile(FoldingSetNodeID &ID) const { … }
static Init *ItemApply(Init *LHS, Init *MHSe, Init *RHS, Record *CurRec) { … }
static Init *ForeachDagApply(Init *LHS, DagInit *MHSd, Init *RHS,
Record *CurRec) { … }
static Init *ForeachHelper(Init *LHS, Init *MHS, Init *RHS, RecTy *Type,
Record *CurRec) { … }
static Init *FilterHelper(Init *LHS, Init *MHS, Init *RHS, RecTy *Type,
Record *CurRec) { … }
Init *TernOpInit::Fold(Record *CurRec) const { … }
Init *TernOpInit::resolveReferences(Resolver &R) const { … }
std::string TernOpInit::getAsString() const { … }
static void ProfileFoldOpInit(FoldingSetNodeID &ID, Init *Start, Init *List,
Init *A, Init *B, Init *Expr, RecTy *Type) { … }
FoldOpInit *FoldOpInit::get(Init *Start, Init *List, Init *A, Init *B,
Init *Expr, RecTy *Type) { … }
void FoldOpInit::Profile(FoldingSetNodeID &ID) const { … }
Init *FoldOpInit::Fold(Record *CurRec) const { … }
Init *FoldOpInit::resolveReferences(Resolver &R) const { … }
Init *FoldOpInit::getBit(unsigned Bit) const { … }
std::string FoldOpInit::getAsString() const { … }
static void ProfileIsAOpInit(FoldingSetNodeID &ID, RecTy *CheckType,
Init *Expr) { … }
IsAOpInit *IsAOpInit::get(RecTy *CheckType, Init *Expr) { … }
void IsAOpInit::Profile(FoldingSetNodeID &ID) const { … }
Init *IsAOpInit::Fold() const { … }
Init *IsAOpInit::resolveReferences(Resolver &R) const { … }
Init *IsAOpInit::getBit(unsigned Bit) const { … }
std::string IsAOpInit::getAsString() const { … }
static void ProfileExistsOpInit(FoldingSetNodeID &ID, RecTy *CheckType,
Init *Expr) { … }
ExistsOpInit *ExistsOpInit::get(RecTy *CheckType, Init *Expr) { … }
void ExistsOpInit::Profile(FoldingSetNodeID &ID) const { … }
Init *ExistsOpInit::Fold(Record *CurRec, bool IsFinal) const { … }
Init *ExistsOpInit::resolveReferences(Resolver &R) const { … }
Init *ExistsOpInit::getBit(unsigned Bit) const { … }
std::string ExistsOpInit::getAsString() const { … }
RecTy *TypedInit::getFieldType(StringInit *FieldName) const { … }
Init *
TypedInit::convertInitializerTo(RecTy *Ty) const { … }
Init *TypedInit::convertInitializerBitRange(ArrayRef<unsigned> Bits) const { … }
Init *TypedInit::getCastTo(RecTy *Ty) const { … }
VarInit *VarInit::get(StringRef VN, RecTy *T) { … }
VarInit *VarInit::get(Init *VN, RecTy *T) { … }
StringRef VarInit::getName() const { … }
Init *VarInit::getBit(unsigned Bit) const { … }
Init *VarInit::resolveReferences(Resolver &R) const { … }
VarBitInit *VarBitInit::get(TypedInit *T, unsigned B) { … }
std::string VarBitInit::getAsString() const { … }
Init *VarBitInit::resolveReferences(Resolver &R) const { … }
DefInit::DefInit(Record *D)
: … { … }
Init *DefInit::convertInitializerTo(RecTy *Ty) const { … }
RecTy *DefInit::getFieldType(StringInit *FieldName) const { … }
std::string DefInit::getAsString() const { … }
static void ProfileVarDefInit(FoldingSetNodeID &ID, Record *Class,
ArrayRef<ArgumentInit *> Args) { … }
VarDefInit::VarDefInit(Record *Class, unsigned N)
: … { … }
VarDefInit *VarDefInit::get(Record *Class, ArrayRef<ArgumentInit *> Args) { … }
void VarDefInit::Profile(FoldingSetNodeID &ID) const { … }
DefInit *VarDefInit::instantiate() { … }
Init *VarDefInit::resolveReferences(Resolver &R) const { … }
Init *VarDefInit::Fold() const { … }
std::string VarDefInit::getAsString() const { … }
FieldInit *FieldInit::get(Init *R, StringInit *FN) { … }
Init *FieldInit::getBit(unsigned Bit) const { … }
Init *FieldInit::resolveReferences(Resolver &R) const { … }
Init *FieldInit::Fold(Record *CurRec) const { … }
bool FieldInit::isConcrete() const { … }
static void ProfileCondOpInit(FoldingSetNodeID &ID,
ArrayRef<Init *> CondRange,
ArrayRef<Init *> ValRange,
const RecTy *ValType) { … }
void CondOpInit::Profile(FoldingSetNodeID &ID) const { … }
CondOpInit *CondOpInit::get(ArrayRef<Init *> CondRange,
ArrayRef<Init *> ValRange, RecTy *Ty) { … }
Init *CondOpInit::resolveReferences(Resolver &R) const { … }
Init *CondOpInit::Fold(Record *CurRec) const { … }
bool CondOpInit::isConcrete() const { … }
bool CondOpInit::isComplete() const { … }
std::string CondOpInit::getAsString() const { … }
Init *CondOpInit::getBit(unsigned Bit) const { … }
static void ProfileDagInit(FoldingSetNodeID &ID, Init *V, StringInit *VN,
ArrayRef<Init *> ArgRange,
ArrayRef<StringInit *> NameRange) { … }
DagInit *DagInit::get(Init *V, StringInit *VN, ArrayRef<Init *> ArgRange,
ArrayRef<StringInit *> NameRange) { … }
DagInit *
DagInit::get(Init *V, StringInit *VN,
ArrayRef<std::pair<Init*, StringInit*>> args) { … }
void DagInit::Profile(FoldingSetNodeID &ID) const { … }
Record *DagInit::getOperatorAsDef(ArrayRef<SMLoc> Loc) const { … }
std::optional<unsigned> DagInit::getArgNo(StringRef Name) const { … }
Init *DagInit::resolveReferences(Resolver &R) const { … }
bool DagInit::isConcrete() const { … }
std::string DagInit::getAsString() const { … }
RecordVal::RecordVal(Init *N, RecTy *T, FieldKind K)
: … { … }
RecordVal::RecordVal(Init *N, SMLoc Loc, RecTy *T, FieldKind K)
: … { … }
StringRef RecordVal::getName() const { … }
std::string RecordVal::getPrintType() const { … }
bool RecordVal::setValue(Init *V) { … }
bool RecordVal::setValue(Init *V, SMLoc NewLoc) { … }
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
#include "llvm/TableGen/Record.h"
LLVM_DUMP_METHOD void RecordVal::dump() const { errs() << *this; }
#endif
void RecordVal::print(raw_ostream &OS, bool PrintSem) const { … }
void Record::updateClassLoc(SMLoc Loc) { … }
void Record::checkName() { … }
RecordRecTy *Record::getType() const { … }
DefInit *Record::getDefInit() const { … }
unsigned Record::getNewUID(RecordKeeper &RK) { … }
void Record::setName(Init *NewName) { … }
bool Record::hasDirectSuperClass(const Record *Superclass) const { … }
void Record::getDirectSuperClasses(SmallVectorImpl<Record *> &Classes) const { … }
void Record::resolveReferences(Resolver &R, const RecordVal *SkipVal) { … }
void Record::resolveReferences(Init *NewName) { … }
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
LLVM_DUMP_METHOD void Record::dump() const { errs() << *this; }
#endif
raw_ostream &llvm::operator<<(raw_ostream &OS, const Record &R) { … }
SMLoc Record::getFieldLoc(StringRef FieldName) const { … }
Init *Record::getValueInit(StringRef FieldName) const { … }
StringRef Record::getValueAsString(StringRef FieldName) const { … }
std::optional<StringRef>
Record::getValueAsOptionalString(StringRef FieldName) const { … }
BitsInit *Record::getValueAsBitsInit(StringRef FieldName) const { … }
ListInit *Record::getValueAsListInit(StringRef FieldName) const { … }
std::vector<Record*>
Record::getValueAsListOfDefs(StringRef FieldName) const { … }
std::vector<const Record *>
Record::getValueAsListOfConstDefs(StringRef FieldName) const { … }
int64_t Record::getValueAsInt(StringRef FieldName) const { … }
std::vector<int64_t>
Record::getValueAsListOfInts(StringRef FieldName) const { … }
std::vector<StringRef>
Record::getValueAsListOfStrings(StringRef FieldName) const { … }
Record *Record::getValueAsDef(StringRef FieldName) const { … }
Record *Record::getValueAsOptionalDef(StringRef FieldName) const { … }
bool Record::getValueAsBit(StringRef FieldName) const { … }
bool Record::getValueAsBitOrUnset(StringRef FieldName, bool &Unset) const { … }
DagInit *Record::getValueAsDag(StringRef FieldName) const { … }
void Record::checkRecordAssertions() { … }
void Record::emitRecordDumps() { … }
void Record::checkUnusedTemplateArgs() { … }
RecordKeeper::RecordKeeper()
: … { … }
RecordKeeper::~RecordKeeper() = default;
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
LLVM_DUMP_METHOD void RecordKeeper::dump() const { errs() << *this; }
#endif
raw_ostream &llvm::operator<<(raw_ostream &OS, const RecordKeeper &RK) { … }
Init *RecordKeeper::getNewAnonymousName() { … }
void RecordKeeper::startTimer(StringRef Name) { … }
void RecordKeeper::stopTimer() { … }
void RecordKeeper::startBackendTimer(StringRef Name) { … }
void RecordKeeper::stopBackendTimer() { … }
template <typename VecTy>
const VecTy &RecordKeeper::getAllDerivedDefinitionsImpl(
StringRef ClassName, std::map<std::string, VecTy> &Cache) const { … }
template <typename VecTy>
VecTy RecordKeeper::getAllDerivedDefinitionsImpl(
ArrayRef<StringRef> ClassNames) const { … }
template <typename VecTy>
const VecTy &RecordKeeper::getAllDerivedDefinitionsIfDefinedImpl(
StringRef ClassName, std::map<std::string, VecTy> &Cache) const { … }
ArrayRef<const Record *>
RecordKeeper::getAllDerivedDefinitions(StringRef ClassName) const { … }
const std::vector<Record *> &
RecordKeeper::getAllDerivedDefinitions(StringRef ClassName) { … }
std::vector<const Record *>
RecordKeeper::getAllDerivedDefinitions(ArrayRef<StringRef> ClassNames) const { … }
std::vector<Record *>
RecordKeeper::getAllDerivedDefinitions(ArrayRef<StringRef> ClassNames) { … }
ArrayRef<const Record *>
RecordKeeper::getAllDerivedDefinitionsIfDefined(StringRef ClassName) const { … }
const std::vector<Record *> &
RecordKeeper::getAllDerivedDefinitionsIfDefined(StringRef ClassName) { … }
void RecordKeeper::dumpAllocationStats(raw_ostream &OS) const { … }
Init *MapResolver::resolve(Init *VarName) { … }
Init *RecordResolver::resolve(Init *VarName) { … }
Init *TrackUnresolvedResolver::resolve(Init *VarName) { … }
Init *HasReferenceResolver::resolve(Init *VarName)
{ … }