LLVM: llvm::Record Class Reference (original ) (raw )#include "[llvm/TableGen/Record.h](TableGen%5F2Record%5F8h%5Fsource.html)"
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
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.
Definition at line 1629 of file Record.h .
◆ RecordKind
Enumerator
RK_Def
RK_AnonymousDef
RK_Class
RK_MultiClass
Definition at line 1651 of file Record.h .
◆ Record() [1/3]Definition at line 1685 of file Record.h .
References getNewUID() , N , and RK_Def .
Referenced by addDirectSuperClass() , appendAssertions() , appendDumps() , getSuperClasses() , getValue() , getValue() , getValueAsDef() , getValueAsOptionalDef() , hasDirectSuperClass() , isSubClassOf() , isSubClassOf() , Record() , and Record() .
◆ Record() [2/3]◆ Record() [3/3]◆ addAssertion()◆ addDirectSuperClass()◆ addDump()◆ addTemplateArg()
void llvm::Record::addTemplateArg ( const Init * Name )
inline
◆ addValue()◆ appendAssertions()
void llvm::Record::appendAssertions ( const Record * Rec )
inline
◆ appendDumps()
void llvm::Record::appendDumps ( const Record * Rec )
inline
◆ appendLoc()
void llvm::Record::appendLoc ( SMLoc Loc )
inline
◆ appendReferenceLoc()
void llvm::Record::appendReferenceLoc ( SMRange Loc ) const
inline
Add a reference to this record value.
Definition at line 1728 of file Record.h .
◆ checkRecordAssertions()
void Record::checkRecordAssertions
(
)
◆ checkUnusedTemplateArgs()
void Record::checkUnusedTemplateArgs
(
)
◆ dump()◆ emitRecordDumps()
void Record::emitRecordDumps
(
)
◆ getAssertions()◆ getDefInit()
DefInit * Record::getDefInit
(
)
const
◆ getDirectSuperClasses()Return the direct superclasses of this record.
Definition at line 1776 of file Record.h .
Referenced by getType() .
◆ getDumps()◆ getFieldLoc()◆ getForwardDeclarationLocs()
ArrayRef < SMLoc > llvm::Record::getForwardDeclarationLocs ( ) const
inline
◆ getID()
unsigned llvm::Record::getID ( ) const
inline
◆ getLoc()Definition at line 1720 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() .
◆ getName()
StringRef llvm::Record::getName ( ) const
inline
Definition at line 1710 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()() .
◆ getNameInit()
const Init * llvm::Record::getNameInit ( ) const
inline
◆ getNameInitAsString()
std::string llvm::Record::getNameInitAsString ( ) const
inline
◆ getNewUID()◆ getRecords()◆ getReferenceLocs()Return the references of this record value.
Definition at line 1731 of file Record.h .
◆ getSuperClasses() [1/2]
std::vector< const Record * > llvm::Record::getSuperClasses ( ) const
inline
◆ getSuperClasses() [2/2]
void llvm::Record::getSuperClasses ( std::vector< const Record * > & Classes ) const
inline
◆ getTemplateArgs()◆ getType()◆ getValue() [1/4]◆ getValue() [2/4]◆ getValue() [3/4]◆ getValue() [4/4]◆ getValueAsBit()◆ getValueAsBitOrUnset()◆ getValueAsBitsInit()◆ getValueAsDag()◆ getValueAsDef()◆ getValueAsInt()
int64_t Record::getValueAsInt
(
StringRef
FieldName
)
const
◆ getValueAsListInit()◆ getValueAsListOfDefs()◆ getValueAsListOfInts()
std::vector< int64_t > Record::getValueAsListOfInts
(
StringRef
FieldName
)
const
◆ getValueAsListOfStrings()◆ getValueAsOptionalDef()◆ getValueAsOptionalString()◆ getValueAsString()◆ getValueInit()Return the initializer for a value with the specified name, or throw an exception if the field does not exist.
Definition at line 3080 of file Record.cpp .
References getLoc() , getName() , getValue() , and llvm::PrintFatalError() .
Referenced by getValueAsBit() , getValueAsBitOrUnset() , getValueAsBitsInit() , getValueAsDag() , getValueAsDef() , getValueAsInt() , getValueAsListInit() , getValueAsOptionalDef() , getValueAsString() , and isValueUnset() .
◆ getValues()◆ hasDirectSuperClass()
bool llvm::Record::hasDirectSuperClass ( const Record * SuperClass ) const
inline
◆ isAnonymous()
bool llvm::Record::isAnonymous ( ) const
inline
◆ isClass()
bool llvm::Record::isClass ( ) const
inline
◆ isMultiClass()
bool llvm::Record::isMultiClass ( ) const
inline
◆ isSubClassOf() [1/2]◆ isSubClassOf() [2/2]◆ isTemplateArg()
bool llvm::Record::isTemplateArg ( const Init * Name ) const
inline
◆ isValueUnset()
bool llvm::Record::isValueUnset ( StringRef FieldName ) const
inline
◆ removeValue() [1/2]
void llvm::Record::removeValue ( const Init * Name )
inline
◆ removeValue() [2/2]
void llvm::Record::removeValue ( StringRef Name )
inline
◆ resolveReferences() [1/2]
void Record::resolveReferences
(
const Init *
NewName = nullptr
)
◆ resolveReferences() [2/2]◆ setName()◆ updateClassLoc()
void Record::updateClassLoc
(
SMLoc
Loc
)
The documentation for this class was generated from the following files: