LLVM 20.0.0git
|
This class represents a field in a record, including its name, type, value, and source location. More...
#include "llvm/TableGen/Record.h"
Public Types | |
enum | FieldKind { FK_Normal , FK_NonconcreteOK , FK_TemplateArg } |
Public Member Functions | |
RecordVal (const Init *N, const RecTy *T, FieldKind K) | |
RecordVal (const Init *N, SMLoc Loc, const RecTy *T, FieldKind K) | |
RecordKeeper & | getRecordKeeper () const |
Get the record keeper used to unique this value. | |
StringRef | getName () const |
Get the name of the field as a StringRef. | |
const Init * | getNameInit () const |
Get the name of the field as an Init. | |
std::string | getNameInitAsString () const |
Get the name of the field as a std::string. | |
const SMLoc & | getLoc () const |
Get the source location of the point where the field was defined. | |
bool | isNonconcreteOK () const |
Is this a field where nonconcrete values are okay? | |
bool | isTemplateArg () const |
Is this a template argument? | |
const RecTy * | getType () const |
Get the type of the field value as a RecTy. | |
std::string | getPrintType () const |
Get the type of the field for printing purposes. | |
const Init * | getValue () const |
Get the value of the field as an Init. | |
bool | setValue (const Init *V) |
Set the value of the field from an Init. | |
bool | setValue (const Init *V, SMLoc NewLoc) |
Set the value and source location of the field. | |
void | addReferenceLoc (SMRange Loc) |
Add a reference to this record value. | |
ArrayRef< SMRange > | getReferenceLocs () const |
Return the references of this record value. | |
void | setUsed (bool Used) |
Whether this value is used. | |
bool | isUsed () const |
void | dump () const |
void | print (raw_ostream &OS, bool PrintSem=true) const |
Print the value to an output stream, possibly with a semicolon. | |
Friends | |
class | Record |
This class represents a field in a record, including its name, type, value, and source location.
Definition at line 2764 of file Record.cpp.
References assert(), llvm::UnsetInit::get(), N, and setValue().
Definition at line 2772 of file Record.cpp.
References assert(), llvm::UnsetInit::get(), N, and setValue().
|
inline |
Add a reference to this record value.
Definition at line 1629 of file Record.h.
References llvm::SmallVectorTemplateBase< T, bool >::push_back().
Referenced by llvm::TGVarScope::getVar().
LLVM_DUMP_METHOD void RecordVal::dump | ( | ) | const |
Definition at line 2846 of file Record.cpp.
References llvm::errs().
Get the source location of the point where the field was defined.
Definition at line 1601 of file Record.h.
Referenced by llvm::Record::checkUnusedTemplateArgs(), llvm::PrintError(), llvm::PrintFatalError(), and llvm::PrintFatalNote().
StringRef RecordVal::getName | ( | ) | const |
Get the name of the field as a StringRef.
Definition at line 2778 of file Record.cpp.
References getNameInit().
Referenced by llvm::Record::checkUnusedTemplateArgs().
Get the name of the field as an Init.
Definition at line 1593 of file Record.h.
References Name.
Referenced by llvm::Record::addValue(), getName(), and getNameInitAsString().
|
inline |
Get the name of the field as a std::string.
Definition at line 1596 of file Record.h.
References llvm::Init::getAsUnquotedString(), and getNameInit().
Referenced by print().
std::string RecordVal::getPrintType | ( | ) | const |
Get the type of the field for printing purposes.
Definition at line 2782 of file Record.cpp.
References llvm::StringRecTy::get(), getRecordKeeper(), and getType().
Referenced by print().
|
inline |
Get the record keeper used to unique this value.
Definition at line 1587 of file Record.h.
References Name.
Referenced by getPrintType(), and setValue().
Get the type of the field value as a RecTy.
Definition at line 1614 of file Record.h.
References llvm::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::getPointer().
Referenced by getPrintType(), llvm::TGVarScope::getVar(), and setValue().
Get the value of the field as an Init.
Definition at line 1620 of file Record.h.
Referenced by checkBitsConcrete(), and print().
|
inline |
Is this a field where nonconcrete values are okay?
Definition at line 1604 of file Record.h.
References FK_NonconcreteOK, and llvm::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::getInt().
Referenced by print().
|
inline |
Is this a template argument?
Definition at line 1609 of file Record.h.
References FK_TemplateArg, and llvm::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::getInt().
|
inline |
Definition at line 1637 of file Record.h.
Referenced by llvm::Record::checkUnusedTemplateArgs().
void RecordVal::print | ( | raw_ostream & | OS, |
bool | PrintSem = true |
||
) | const |
Print the value to an output stream, possibly with a semicolon.
Definition at line 2849 of file Record.cpp.
References getNameInitAsString(), getPrintType(), getValue(), isNonconcreteOK(), and OS.
Referenced by llvm::operator<<().
|
inline |
Whether this value is used.
Useful for reporting warnings, for example when a template argument is unused.
Definition at line 1636 of file Record.h.
Referenced by llvm::TGVarScope::getVar().
Set the value of the field from an Init.
Definition at line 2797 of file Record.cpp.
References assert(), llvm::BitsInit::get(), getType(), and I.
Referenced by RecordVal().
Set the value and source location of the field.
Definition at line 2821 of file Record.cpp.
References assert(), llvm::BitsInit::get(), getRecordKeeper(), getType(), and I.