LLVM
15.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 (Init *N, RecTy *T, FieldKind K) | |
RecordVal (Init *N, SMLoc Loc, RecTy *T, FieldKind K) | |
RecordKeeper & | getRecordKeeper () const |
Get the record keeper used to unique this value. More... | |
StringRef | getName () const |
Get the name of the field as a StringRef. More... | |
Init * | getNameInit () const |
Get the name of the field as an Init. More... | |
std::string | getNameInitAsString () const |
Get the name of the field as a std::string. More... | |
const SMLoc & | getLoc () const |
Get the source location of the point where the field was defined. More... | |
bool | isNonconcreteOK () const |
Is this a field where nonconcrete values are okay? More... | |
bool | isTemplateArg () const |
Is this a template argument? More... | |
RecTy * | getType () const |
Get the type of the field value as a RecTy. More... | |
std::string | getPrintType () const |
Get the type of the field for printing purposes. More... | |
Init * | getValue () const |
Get the value of the field as an Init. More... | |
bool | setValue (Init *V) |
Set the value of the field from an Init. More... | |
bool | setValue (Init *V, SMLoc NewLoc) |
Set the value and source location of the field. More... | |
void | setUsed (bool Used) |
Whether this value is used. More... | |
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. More... | |
Friends | |
class | Record |
This class represents a field in a record, including its name, type, value, and source location.
Definition at line 2257 of file Record.cpp.
References assert(), llvm::UnsetInit::get(), N, setValue(), and T.
Definition at line 2265 of file Record.cpp.
References assert(), llvm::UnsetInit::get(), N, setValue(), and T.
LLVM_DUMP_METHOD void RecordVal::dump | ( | ) | const |
Definition at line 2339 of file Record.cpp.
References llvm::errs().
Get the source location of the point where the field was defined.
Definition at line 1465 of file Record.h.
Referenced by llvm::PrintError(), llvm::PrintFatalError(), and llvm::PrintFatalNote().
StringRef RecordVal::getName | ( | ) | const |
Get the name of the field as a StringRef.
Definition at line 2271 of file Record.cpp.
References getNameInit().
|
inline |
Get the name of the field as an Init.
Definition at line 1457 of file Record.h.
Referenced by llvm::Record::addValue(), getName(), and getNameInitAsString().
|
inline |
Get the name of the field as a std::string.
Definition at line 1460 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 2275 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 1451 of file Record.h.
Referenced by getPrintType(), and setValue().
|
inline |
Get the type of the field value as a RecTy.
Definition at line 1478 of file Record.h.
References llvm::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::getPointer().
Referenced by getPrintType(), and setValue().
|
inline |
Get the value of the field as an Init.
Definition at line 1484 of file Record.h.
Referenced by checkBitsConcrete(), and print().
|
inline |
Is this a field where nonconcrete values are okay?
Definition at line 1468 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 1473 of file Record.h.
References FK_TemplateArg, and llvm::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::getInt().
void RecordVal::print | ( | raw_ostream & | OS, |
bool | PrintSem = true |
||
) | const |
Print the value to an output stream, possibly with a semicolon.
Definition at line 2342 of file Record.cpp.
References getNameInitAsString(), getPrintType(), getValue(), and isNonconcreteOK().
Referenced by llvm::operator<<().
|
inline |
bool RecordVal::setValue | ( | Init * | V | ) |
Set the value of the field from an Init.
Definition at line 2290 of file Record.cpp.
References assert(), llvm::tgtok::Bits, E, llvm::BitsInit::get(), llvm::Init::getCastTo(), llvm::Init::getRecordKeeper(), getType(), and I.
Referenced by RecordVal().
Set the value and source location of the field.
Definition at line 2314 of file Record.cpp.
References assert(), llvm::tgtok::Bits, E, llvm::BitsInit::get(), llvm::Init::getCastTo(), getRecordKeeper(), getType(), and I.