LLVM  14.0.0git
Public Types | Public Member Functions | Friends | List of all members
llvm::RecordVal Class Reference

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)
 
StringRef getName () const
 Get the name of the field as a StringRef. More...
 
InitgetNameInit () 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 SMLocgetLoc () 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...
 
RecTygetType () 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...
 
InitgetValue () 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 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
 

Detailed Description

This class represents a field in a record, including its name, type, value, and source location.

Definition at line 1402 of file Record.h.

Member Enumeration Documentation

◆ FieldKind

Enumerator
FK_Normal 
FK_NonconcreteOK 
FK_TemplateArg 

Definition at line 1406 of file Record.h.

Constructor & Destructor Documentation

◆ RecordVal() [1/2]

RecordVal::RecordVal ( Init N,
RecTy T,
FieldKind  K 
)

Definition at line 2209 of file Record.cpp.

References assert(), llvm::UnsetInit::get(), and setValue().

◆ RecordVal() [2/2]

RecordVal::RecordVal ( Init N,
SMLoc  Loc,
RecTy T,
FieldKind  K 
)

Definition at line 2217 of file Record.cpp.

References assert(), llvm::UnsetInit::get(), and setValue().

Member Function Documentation

◆ dump()

LLVM_DUMP_METHOD void RecordVal::dump ( ) const

Definition at line 2291 of file Record.cpp.

References llvm::errs().

◆ getLoc()

const SMLoc& llvm::RecordVal::getLoc ( ) const
inline

Get the source location of the point where the field was defined.

Definition at line 1434 of file Record.h.

Referenced by llvm::PrintError(), llvm::PrintFatalError(), and llvm::PrintFatalNote().

◆ getName()

StringRef RecordVal::getName ( ) const

Get the name of the field as a StringRef.

Definition at line 2223 of file Record.cpp.

References getNameInit().

◆ getNameInit()

Init* llvm::RecordVal::getNameInit ( ) const
inline

Get the name of the field as an Init.

Definition at line 1426 of file Record.h.

Referenced by llvm::Record::addValue(), getName(), and getNameInitAsString().

◆ getNameInitAsString()

std::string llvm::RecordVal::getNameInitAsString ( ) const
inline

Get the name of the field as a std::string.

Definition at line 1429 of file Record.h.

References llvm::Init::getAsUnquotedString(), and getNameInit().

Referenced by print().

◆ getPrintType()

std::string RecordVal::getPrintType ( ) const

Get the type of the field for printing purposes.

Definition at line 2227 of file Record.cpp.

References llvm::StringRecTy::get(), and getType().

Referenced by print().

◆ getType()

RecTy* llvm::RecordVal::getType ( ) const
inline

Get the type of the field value as a RecTy.

Definition at line 1447 of file Record.h.

References llvm::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::getPointer().

Referenced by getPrintType(), and setValue().

◆ getValue()

Init* llvm::RecordVal::getValue ( ) const
inline

Get the value of the field as an Init.

Definition at line 1453 of file Record.h.

Referenced by checkBitsConcrete(), and print().

◆ isNonconcreteOK()

bool llvm::RecordVal::isNonconcreteOK ( ) const
inline

Is this a field where nonconcrete values are okay?

Definition at line 1437 of file Record.h.

References FK_NonconcreteOK, and llvm::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::getInt().

Referenced by print().

◆ isTemplateArg()

bool llvm::RecordVal::isTemplateArg ( ) const
inline

Is this a template argument?

Definition at line 1442 of file Record.h.

References FK_TemplateArg, and llvm::PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info >::getInt().

◆ print()

void RecordVal::print ( raw_ostream OS,
bool  PrintSem = true 
) const

Print the value to an output stream, possibly with a semicolon.

Definition at line 2294 of file Record.cpp.

References getNameInitAsString(), getPrintType(), getValue(), and isNonconcreteOK().

Referenced by llvm::operator<<().

◆ setValue() [1/2]

bool RecordVal::setValue ( Init V)

Set the value of the field from an Init.

Definition at line 2242 of file Record.cpp.

References assert(), llvm::tgtok::Bits, E, llvm::BitsInit::get(), llvm::Init::getCastTo(), getType(), and I.

Referenced by RecordVal().

◆ setValue() [2/2]

bool RecordVal::setValue ( Init V,
SMLoc  NewLoc 
)

Set the value and source location of the field.

Definition at line 2266 of file Record.cpp.

References assert(), llvm::tgtok::Bits, E, llvm::BitsInit::get(), llvm::Init::getCastTo(), getType(), and I.

Friends And Related Function Documentation

◆ Record

friend class Record
friend

Definition at line 1403 of file Record.h.


The documentation for this class was generated from the following files: