|
LLVM 24.0.0git
|
#include "llvm/TableGen/Record.h"
Classes | |
| struct | AssertionInfo |
| struct | DumpInfo |
Public Types | |
| enum | RecordKind { RK_Def , RK_AnonymousDef , RK_Class , RK_MultiClass } |
Public Member Functions | |
| Record (const Init *N, ArrayRef< SMLoc > locs, RecordKeeper &records, RecordKind Kind=RK_Def) | |
| Record (StringRef N, ArrayRef< SMLoc > locs, RecordKeeper &records, RecordKind Kind=RK_Def) | |
| Record (const Record &O) | |
| unsigned | getID () const |
| StringRef | getName () const |
| const Init * | getNameInit () const |
| std::string | getNameInitAsString () const |
| void | setName (const Init *Name) |
| ArrayRef< SMLoc > | getLoc () const |
| void | appendLoc (SMLoc Loc) |
| ArrayRef< SMLoc > | getForwardDeclarationLocs () const |
| void | appendReferenceLoc (SMRange Loc) const |
| Add a reference to this record value. | |
| ArrayRef< SMRange > | getReferenceLocs () const |
| Return the references of this record value. | |
| void | appendValueReferenceLoc (const Init *Name, SMRange Loc) const |
Add a reference to the value named Name. | |
| void | appendValueReferenceLocs (const Record &From, const Init *Name) const |
Add the references to the value named Name in From. | |
| ArrayRef< SMRange > | getValueReferenceLocs (const Init *Name) const |
Return the references to the value named Name. | |
| void | updateClassLoc (SMLoc Loc) |
| const RecordRecTy * | getType () const |
| DefInit * | getDefInit () const |
| get the corresponding DefInit. | |
| bool | isClass () const |
| bool | isMultiClass () const |
| bool | isAnonymous () const |
| ArrayRef< const Init * > | getTemplateArgs () const |
| ArrayRef< RecordVal > | getValues () const |
| ArrayRef< AssertionInfo > | getAssertions () const |
| ArrayRef< DumpInfo > | getDumps () const |
| void | getSuperClasses (std::vector< const Record * > &Classes) const |
Append all superclasses in post-order to Classes. | |
| std::vector< const Record * > | getSuperClasses () const |
| Return all superclasses in post-order. | |
| bool | hasDirectSuperClass (const Record *SuperClass) const |
| Determine whether this record has the specified direct superclass. | |
| ArrayRef< std::pair< const Record *, SMRange > > | getDirectSuperClasses () const |
| Return the direct superclasses of this record. | |
| bool | isTemplateArg (const Init *Name) const |
| const RecordVal * | getValue (const Init *Name) const |
| const RecordVal * | getValue (StringRef Name) const |
| RecordVal * | getValue (const Init *Name) |
| RecordVal * | getValue (StringRef Name) |
| void | addTemplateArg (const Init *Name) |
| void | addValue (const RecordVal &RV) |
| void | removeValue (const Init *Name) |
| void | removeValue (StringRef Name) |
| void | addAssertion (SMLoc Loc, const Init *Condition, const Init *Message) |
| void | addDump (SMLoc Loc, const Init *Message) |
| void | appendAssertions (const Record *Rec) |
| void | appendDumps (const Record *Rec) |
| void | checkRecordAssertions () |
| void | emitRecordDumps () |
| void | checkUnusedTemplateArgs () |
| bool | isSubClassOf (const Record *R) const |
| bool | isSubClassOf (StringRef Name) const |
| void | addDirectSuperClass (const Record *R, SMRange Range) |
| 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 values now. | |
| void | resolveReferences (Resolver &R, const RecordVal *SkipVal=nullptr) |
| Apply the resolver to the name of the record as well as to the initializers of all fields of the record except SkipVal. | |
| RecordKeeper & | getRecords () const |
| void | dump () const |
| SMLoc | getFieldLoc (StringRef FieldName) const |
| Return the source location for the named field. | |
| const Init * | getValueInit (StringRef FieldName) const |
| Return the initializer for a value with the specified name, or throw an exception if the field does not exist. | |
| bool | isValueUnset (StringRef FieldName) const |
| Return true if the named field is unset. | |
| StringRef | getValueAsString (StringRef FieldName) const |
| This method looks up the specified field and returns its value as a string, throwing an exception if the field does not exist or if the value is not a string. | |
| 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 the value is not a string and std::nullopt if the field does not exist. | |
| const BitsInit * | getValueAsBitsInit (StringRef FieldName) const |
| This method looks up the specified field and returns its value as a BitsInit, throwing an exception if the field does not exist or if the value is not the right type. | |
| const ListInit * | getValueAsListInit (StringRef FieldName) const |
| This method looks up the specified field and returns its value as a ListInit, throwing an exception if the field does not exist or if the value is not the right type. | |
| std::vector< const Record * > | getValueAsListOfDefs (StringRef FieldName) const |
| This method looks up the specified field and returns its value as a vector of records, throwing an exception if the field does not exist or if the value is not the right type. | |
| std::vector< int64_t > | getValueAsListOfInts (StringRef FieldName) const |
| This method looks up the specified field and returns its value as a vector of integers, throwing an exception if the field does not exist or if the value is not the right type. | |
| std::vector< StringRef > | getValueAsListOfStrings (StringRef FieldName) const |
| This method looks up the specified field and returns its value as a vector of strings, throwing an exception if the field does not exist or if the value is not the right type. | |
| const Record * | getValueAsDef (StringRef FieldName) const |
| This method looks up the specified field and returns its value as a Record, throwing an exception if the field does not exist or if the value is not the right type. | |
| const Record * | getValueAsOptionalDef (StringRef FieldName) const |
| This method looks up the specified field and returns its value as a Record, returning null if the field exists but is "uninitialized" (i.e. | |
| bool | getValueAsBit (StringRef FieldName) const |
| This method looks up the specified field and returns its value as a bit, throwing an exception if the field does not exist or if the value is not the right type. | |
| bool | getValueAsBitOrUnset (StringRef FieldName, bool &Unset) const |
| This method looks up the specified field and returns its value as a bit. | |
| int64_t | getValueAsInt (StringRef FieldName) const |
| This method looks up the specified field and returns its value as an int64_t, throwing an exception if the field does not exist or if the value is not the right type. | |
| const DagInit * | getValueAsDag (StringRef FieldName) const |
| This method looks up the specified field and returns its value as an Dag, throwing an exception if the field does not exist or if the value is not the right type. | |
Static Public Member Functions | |
| static unsigned | getNewUID (RecordKeeper &RK) |
|
inlineexplicit |
Definition at line 1734 of file Record.h.
References getNewUID(), N, and RK_Def.
Referenced by addDirectSuperClass(), appendAssertions(), appendDumps(), appendValueReferenceLocs(), getSuperClasses(), getValue(), getValue(), getValueAsDef(), getValueAsOptionalDef(), hasDirectSuperClass(), isSubClassOf(), isSubClassOf(), Record(), and Record().
|
inlineexplicit |
Definition at line 1748 of file Record.h.
References getNewUID(), getRecords(), and Record().
Definition at line 1873 of file Record.h.
References assert(), and isTemplateArg().
Definition at line 1878 of file Record.h.
References assert(), llvm::RecordVal::getNameInit(), and getValue().
|
inline |
Add a reference to the value named Name.
Definition at line 1783 of file Record.h.
Referenced by llvm::TGVarScope::getVar().
Add the references to the value named Name in From.
Definition at line 1788 of file Record.h.
References llvm::append_range(), and Record().
| void Record::checkRecordAssertions | ( | ) |
Definition at line 3117 of file Record.cpp.
References llvm::CheckAssert(), getAssertions(), llvm::PrintError(), and llvm::Init::resolveReferences().
| void Record::checkUnusedTemplateArgs | ( | ) |
Definition at line 3147 of file Record.cpp.
References llvm::RecordVal::getLoc(), llvm::RecordVal::getName(), getTemplateArgs(), getValue(), llvm::RecordVal::isUsed(), and llvm::PrintWarning().
| LLVM_DUMP_METHOD void Record::dump | ( | ) | const |
Definition at line 2915 of file Record.cpp.
References llvm::errs(), and LLVM_DUMP_METHOD.
| void Record::emitRecordDumps | ( | ) |
Definition at line 3136 of file Record.cpp.
References llvm::dumpMessage(), and getDumps().
|
inline |
Definition at line 1821 of file Record.h.
Referenced by checkRecordAssertions().
| DefInit * Record::getDefInit | ( | ) | const |
get the corresponding DefInit.
Definition at line 2835 of file Record.cpp.
Referenced by llvm::TernOpInit::Fold().
Definition at line 1822 of file Record.h.
Referenced by emitRecordDumps().
Return the source location for the named field.
Definition at line 2953 of file Record.cpp.
References getLoc(), getName(), getValue(), and llvm::PrintFatalError().
Definition at line 1769 of file Record.h.
Referenced by llvm::BinOpInit::Fold(), llvm::CondOpInit::Fold(), llvm::FieldInit::Fold(), llvm::TernOpInit::Fold(), llvm::UnOpInit::Fold(), getFieldLoc(), getValueAsBit(), getValueAsBitOrUnset(), getValueAsBitsInit(), getValueAsDag(), getValueAsDef(), getValueAsInt(), getValueAsListInit(), getValueAsListOfDefs(), getValueAsListOfInts(), getValueAsListOfStrings(), getValueAsOptionalDef(), getValueAsOptionalString(), getValueAsString(), getValueInit(), llvm::PrintError(), llvm::PrintFatalError(), llvm::PrintFatalNote(), and resolveReferences().
|
inline |
Definition at line 1759 of file Record.h.
References llvm::cast().
Referenced by getFieldLoc(), llvm::logicalview::getRecordName(), getValueAsBit(), getValueAsBitOrUnset(), getValueAsBitsInit(), getValueAsDag(), getValueAsDef(), getValueAsInt(), getValueAsListInit(), getValueAsListOfDefs(), getValueAsListOfInts(), getValueAsListOfStrings(), getValueAsOptionalDef(), getValueAsOptionalString(), getValueAsString(), getValueInit(), llvm::LessRecord::operator()(), and llvm::LessRecordRegister::operator()().
Definition at line 1761 of file Record.h.
Referenced by llvm::ExistsOpInit::Fold(), llvm::UnOpInit::Fold(), getNameInitAsString(), QualifyName(), and resolveReferences().
|
inline |
Definition at line 1763 of file Record.h.
References llvm::Init::getAsUnquotedString(), and getNameInit().
Referenced by llvm::CondOpInit::Fold().
|
static |
Definition at line 2843 of file Record.cpp.
References llvm::RecordKeeper::getImpl(), and detail::RecordKeeperImpl::LastRecordID.
|
inline |
Definition at line 1956 of file Record.h.
Referenced by getValue(), QualifiedNameOfImplicitName(), QualifyName(), Record(), and removeValue().
Return all superclasses in post-order.
Definition at line 1833 of file Record.h.
References getSuperClasses().
Referenced by getSuperClasses().
Append all superclasses in post-order to Classes.
Definition at line 1825 of file Record.h.
References llvm::make_first_range(), and Record().
Definition at line 1817 of file Record.h.
Referenced by checkUnusedTemplateArgs().
| const RecordRecTy * Record::getType | ( | ) | const |
Definition at line 2829 of file Record.cpp.
References llvm::RecordRecTy::get(), getDirectSuperClasses(), and llvm::make_first_range().
Referenced by llvm::codeview::computeTypeName(), and llvm::ExistsOpInit::Fold().
Definition at line 1853 of file Record.h.
Referenced by addValue(), checkUnusedTemplateArgs(), getFieldLoc(), getValue(), getValueAsOptionalString(), getValueInit(), and llvm::TGVarScope::getVar().
Definition at line 1859 of file Record.h.
References llvm::StringInit::get(), getRecords(), and getValue().
This method looks up the specified field and returns its value as a bit, throwing an exception if the field does not exist or if the value is not the right type.
Definition at line 3084 of file Record.cpp.
References llvm::dyn_cast(), getLoc(), getName(), getValueInit(), I, and llvm::PrintFatalError().
This method looks up the specified field and returns its value as a bit.
If the field is unset, sets Unset to true and returns false.
Definition at line 3092 of file Record.cpp.
References llvm::dyn_cast(), getLoc(), getName(), getValueInit(), I, llvm::isa(), llvm::PrintFatalError(), and llvm::Unset.
This method looks up the specified field and returns its value as a BitsInit, throwing an exception if the field does not exist or if the value is not the right type.
Definition at line 2993 of file Record.cpp.
References llvm::dyn_cast(), getLoc(), getName(), getValueInit(), I, and llvm::PrintFatalError().
This method looks up the specified field and returns its value as an Dag, throwing an exception if the field does not exist or if the value is not the right type.
Definition at line 3105 of file Record.cpp.
References llvm::dyn_cast(), getLoc(), getName(), getValueInit(), I, and llvm::PrintFatalError().
This method looks up the specified field and returns its value as a Record, throwing an exception if the field does not exist or if the value is not the right type.
Definition at line 3066 of file Record.cpp.
References llvm::dyn_cast(), getLoc(), getName(), getValueInit(), I, llvm::PrintFatalError(), and Record().
| int64_t Record::getValueAsInt | ( | StringRef | FieldName | ) | const |
This method looks up the specified field and returns its value as an int64_t, throwing an exception if the field does not exist or if the value is not the right type.
Definition at line 3024 of file Record.cpp.
References llvm::dyn_cast(), getLoc(), getName(), getValueInit(), I, II, and llvm::PrintFatalError().
Referenced by llvm::LessRecordRegister::operator()().
This method looks up the specified field and returns its value as a ListInit, throwing an exception if the field does not exist or if the value is not the right type.
Definition at line 3001 of file Record.cpp.
References llvm::dyn_cast(), getLoc(), getName(), getValueInit(), I, and llvm::PrintFatalError().
Referenced by getValueAsListOfDefs(), getValueAsListOfInts(), and getValueAsListOfStrings().
This method looks up the specified field and returns its value as a vector of records, throwing an exception if the field does not exist or if the value is not the right type.
Definition at line 3010 of file Record.cpp.
References llvm::dyn_cast(), getLoc(), getName(), getValueAsListInit(), I, llvm::List, and llvm::PrintFatalError().
| std::vector< int64_t > Record::getValueAsListOfInts | ( | StringRef | FieldName | ) | const |
This method looks up the specified field and returns its value as a vector of integers, throwing an exception if the field does not exist or if the value is not the right type.
Definition at line 3035 of file Record.cpp.
References llvm::dyn_cast(), getLoc(), getName(), getValueAsListInit(), I, II, llvm::List, and llvm::PrintFatalError().
This method looks up the specified field and returns its value as a vector of strings, throwing an exception if the field does not exist or if the value is not the right type.
Definition at line 3051 of file Record.cpp.
References llvm::dyn_cast(), getLoc(), getName(), getValueAsListInit(), I, llvm::List, and llvm::PrintFatalError().
This method looks up the specified field and returns its value as a Record, returning null if the field exists but is "uninitialized" (i.e.
set to ?), and throwing an exception if the field does not exist or if its value is not the right type.
Definition at line 3074 of file Record.cpp.
References llvm::dyn_cast(), getLoc(), getName(), getValueInit(), I, llvm::isa(), llvm::PrintFatalError(), and Record().
This method looks up the specified field and returns its value as a string, throwing an exception if the value is not a string and std::nullopt if the field does not exist.
Definition at line 2978 of file Record.cpp.
References llvm::dyn_cast(), getLoc(), getName(), getValue(), llvm::isa(), and llvm::PrintFatalError().
This method looks up the specified field and returns its value as a string, throwing an exception if the field does not exist or if the value is not a string.
Definition at line 2969 of file Record.cpp.
References llvm::dyn_cast(), getLoc(), getName(), getValueInit(), I, and llvm::PrintFatalError().
Referenced by llvm::LessRecordFieldName::operator()().
Return the initializer for a value with the specified name, or throw an exception if the field does not exist.
Definition at line 2961 of file Record.cpp.
References getLoc(), getName(), getValue(), and llvm::PrintFatalError().
Referenced by getValueAsBit(), getValueAsBitOrUnset(), getValueAsBitsInit(), getValueAsDag(), getValueAsDef(), getValueAsInt(), getValueAsListInit(), getValueAsOptionalDef(), getValueAsString(), and isValueUnset().
Determine whether this record has the specified direct superclass.
Definition at line 1840 of file Record.h.
References llvm::is_contained(), llvm::make_first_range(), and Record().
|
inline |
Definition at line 1815 of file Record.h.
References RK_AnonymousDef.
|
inline |
|
inline |
Definition at line 1913 of file Record.h.
References llvm::make_first_range(), and Record().
Referenced by addDirectSuperClass(), and llvm::RecordRecTy::isSubClassOf().
Definition at line 1921 of file Record.h.
References llvm::dyn_cast(), llvm::make_first_range(), and Record().
Definition at line 1849 of file Record.h.
References llvm::is_contained().
Referenced by addTemplateArg(), and llvm::TGVarScope::getVar().
Return true if the named field is unset.
Definition at line 1974 of file Record.h.
References getValueInit(), and llvm::isa().
Definition at line 1883 of file Record.h.
References llvm::find_if(), and llvm_unreachable.
Referenced by removeValue().
|
inline |
Definition at line 1891 of file Record.h.
References llvm::StringInit::get(), getRecords(), and removeValue().
If there are any field references that refer to fields that have been filled in, we can propagate the values now.
This is a final resolve: any error messages, e.g. due to undefined !cast references, are generated now.
Definition at line 2907 of file Record.cpp.
References resolveReferences().
Referenced by llvm::FieldInit::resolveReferences(), and resolveReferences().
Apply the resolver to the name of the record as well as to the initializers of all fields of the record except SkipVal.
The resolver should not resolve any of the fields itself, to avoid recursion / infinite loops.
Definition at line 2863 of file Record.cpp.
References llvm::dyn_cast(), llvm::Init::getAsUnquotedString(), getLoc(), getNameInit(), llvm::Value::getType(), llvm::PrintFatalError(), llvm::Init::resolveReferences(), and setName().
Definition at line 2847 of file Record.cpp.
Referenced by resolveReferences(), and llvm::logicalview::LVLogicalVisitor::visitKnownRecord().
| void Record::updateClassLoc | ( | SMLoc | Loc | ) |
Definition at line 2813 of file Record.cpp.
References assert().