LLVM  7.0.0svn
Public Member Functions | Static Public Member Functions | List of all members
llvm::Record Class Reference

#include "llvm/TableGen/Record.h"

Public Member Functions

 Record (Init *N, ArrayRef< SMLoc > locs, RecordKeeper &records, bool Anonymous=false)
 
 Record (StringRef N, ArrayRef< SMLoc > locs, RecordKeeper &records)
 
 Record (const Record &O)
 
unsigned getID () const
 
StringRef getName () const
 
InitgetNameInit () const
 
const std::string getNameInitAsString () const
 
void setName (Init *Name)
 
ArrayRef< SMLocgetLoc () const
 
void appendLoc (SMLoc Loc)
 
RecordRecTygetType ()
 
DefInitgetDefInit ()
 get the corresponding DefInit. More...
 
ArrayRef< Init * > getTemplateArgs () const
 
ArrayRef< RecordValgetValues () const
 
ArrayRef< std::pair< Record *, SMRange > > getSuperClasses () const
 
void getDirectSuperClasses (SmallVectorImpl< Record *> &Classes) const
 Append the direct super classes of this record to Classes. More...
 
bool isTemplateArg (Init *Name) const
 
const RecordValgetValue (const Init *Name) const
 
const RecordValgetValue (StringRef Name) const
 
RecordValgetValue (const Init *Name)
 
RecordValgetValue (StringRef Name)
 
void addTemplateArg (Init *Name)
 
void addValue (const RecordVal &RV)
 
void removeValue (Init *Name)
 
void removeValue (StringRef Name)
 
bool isSubClassOf (const Record *R) const
 
bool isSubClassOf (StringRef Name) const
 
void addSuperClass (Record *R, SMRange Range)
 
void resolveReferences ()
 If there are any field references that refer to fields that have been filled in, we can propagate the values now. More...
 
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. More...
 
void resolveReferencesTo (const RecordVal *RV)
 If anything in this record refers to RV, replace the reference to RV with the RHS of RV. More...
 
RecordKeepergetRecords () const
 
bool isAnonymous () const
 
void print (raw_ostream &OS) const
 
void dump () const
 
InitgetValueInit (StringRef FieldName) const
 Return the initializer for a value with the specified name, or throw an exception if the field does not exist. More...
 
bool isValueUnset (StringRef FieldName) const
 Return true if the named field is unset. More...
 
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. More...
 
BitsInitgetValueAsBitsInit (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. More...
 
ListInitgetValueAsListInit (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. More...
 
std::vector< 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. More...
 
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. More...
 
std::vector< StringRefgetValueAsListOfStrings (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. More...
 
RecordgetValueAsDef (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. More...
 
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. More...
 
bool getValueAsBitOrUnset (StringRef FieldName, bool &Unset) const
 This method looks up the specified field and returns its value as a bit. More...
 
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. More...
 
DagInitgetValueAsDag (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. More...
 

Static Public Member Functions

static unsigned getNewUID ()
 

Detailed Description

Definition at line 1337 of file Record.h.

Constructor & Destructor Documentation

◆ Record() [1/3]

llvm::Record::Record ( Init N,
ArrayRef< SMLoc locs,
RecordKeeper records,
bool  Anonymous = false 
)
inlineexplicit

Definition at line 1366 of file Record.h.

References llvm::cl::init().

◆ Record() [2/3]

llvm::Record::Record ( StringRef  N,
ArrayRef< SMLoc locs,
RecordKeeper records 
)
inlineexplicit

Definition at line 1373 of file Record.h.

◆ Record() [3/3]

llvm::Record::Record ( const Record O)
inline

Definition at line 1379 of file Record.h.

Member Function Documentation

◆ addSuperClass()

void llvm::Record::addSuperClass ( Record R,
SMRange  Range 
)
inline

◆ addTemplateArg()

void llvm::Record::addTemplateArg ( Init Name)
inline

◆ addValue()

void llvm::Record::addValue ( const RecordVal RV)
inline

◆ appendLoc()

void llvm::Record::appendLoc ( SMLoc  Loc)
inline

◆ dump()

LLVM_DUMP_METHOD void Record::dump ( ) const

Definition at line 1941 of file Record.cpp.

References llvm::errs().

◆ getDefInit()

DefInit * Record::getDefInit ( )

get the corresponding DefInit.

Definition at line 1867 of file Record.cpp.

References Allocator.

Referenced by checkConcrete(), llvm::DefInit::get(), and llvm::RecordKeeper::getGlobal().

◆ getDirectSuperClasses()

void Record::getDirectSuperClasses ( SmallVectorImpl< Record *> &  Classes) const

◆ getID()

unsigned llvm::Record::getID ( ) const
inline

Definition at line 1387 of file Record.h.

Referenced by llvm::LessRecordByID::operator()().

◆ getLoc()

ArrayRef<SMLoc> llvm::Record::getLoc ( ) const
inline

Definition at line 1401 of file Record.h.

Referenced by checkConcrete(), llvm::UnOpInit::Fold(), and llvm::FieldInit::Fold().

◆ getName()

StringRef llvm::Record::getName ( ) const
inline

◆ getNameInit()

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

Definition at line 1391 of file Record.h.

Referenced by checkConcrete(), llvm::UnOpInit::Fold(), isObjectStart(), and llvm::QualifyName().

◆ getNameInitAsString()

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

Definition at line 1395 of file Record.h.

Referenced by checkConcrete(), llvm::RecordRecTy::get(), isObjectStart(), and llvm::operator<<().

◆ getNewUID()

static unsigned llvm::Record::getNewUID ( )
inlinestatic

Definition at line 1385 of file Record.h.

◆ getRecords()

RecordKeeper& llvm::Record::getRecords ( ) const
inline

Definition at line 1521 of file Record.h.

Referenced by llvm::UnOpInit::Fold().

◆ getSuperClasses()

ArrayRef<std::pair<Record *, SMRange> > llvm::Record::getSuperClasses ( ) const
inline

◆ getTemplateArgs()

ArrayRef<Init *> llvm::Record::getTemplateArgs ( ) const
inline

Definition at line 1410 of file Record.h.

Referenced by checkConcrete(), isObjectStart(), and llvm::operator<<().

◆ getType()

RecordRecTy * Record::getType ( )

◆ getValue() [1/4]

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

◆ getValue() [2/4]

const RecordVal* llvm::Record::getValue ( StringRef  Name) const
inline

Definition at line 1435 of file Record.h.

References llvm::StringInit::get().

◆ getValue() [3/4]

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

Definition at line 1439 of file Record.h.

◆ getValue() [4/4]

RecordVal* llvm::Record::getValue ( StringRef  Name)
inline

Definition at line 1443 of file Record.h.

◆ getValueAsBit()

bool Record::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.

Definition at line 2099 of file Record.cpp.

References llvm::RecordVal::getName(), llvm::RecordVal::getValue(), and llvm::PrintFatalError().

◆ getValueAsBitOrUnset()

bool Record::getValueAsBitOrUnset ( StringRef  FieldName,
bool Unset 
) const

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 2111 of file Record.cpp.

References llvm::RecordVal::getName(), llvm::RecordVal::getValue(), llvm::PrintFatalError(), and llvm::StringRef::str().

◆ getValueAsBitsInit()

BitsInit * Record::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.

Definition at line 2003 of file Record.cpp.

References llvm::RecordVal::getName(), llvm::RecordVal::getValue(), and llvm::PrintFatalError().

◆ getValueAsDag()

DagInit * Record::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 2128 of file Record.cpp.

References llvm::RecordVal::getName(), llvm::RecordVal::getValue(), and llvm::PrintFatalError().

◆ getValueAsDef()

Record * 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.

Definition at line 2087 of file Record.cpp.

References llvm::RecordVal::getName(), llvm::RecordVal::getValue(), and llvm::PrintFatalError().

◆ getValueAsInt()

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 2041 of file Record.cpp.

References llvm::Init::getAsString(), llvm::RecordVal::getName(), llvm::RecordVal::getValue(), and llvm::PrintFatalError().

◆ getValueAsListInit()

ListInit * Record::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.

Definition at line 2015 of file Record.cpp.

References llvm::RecordVal::getName(), llvm::RecordVal::getValue(), and llvm::PrintFatalError().

◆ getValueAsListOfDefs()

std::vector< Record * > 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.

Definition at line 2028 of file Record.cpp.

References llvm::RecordVal::getName(), llvm::ListInit::getValues(), I, List, and llvm::PrintFatalError().

◆ getValueAsListOfInts()

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 2056 of file Record.cpp.

References llvm::RecordVal::getName(), llvm::ListInit::getValues(), I, List, and llvm::PrintFatalError().

◆ getValueAsListOfStrings()

std::vector< StringRef > Record::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.

Definition at line 2072 of file Record.cpp.

References llvm::RecordVal::getName(), llvm::ListInit::getValues(), I, List, llvm::PrintFatalError(), and SI.

◆ getValueAsString()

StringRef Record::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.

Definition at line 1988 of file Record.cpp.

References llvm::RecordVal::getName(), llvm::RecordVal::getValue(), llvm::PrintFatalError(), and SI.

Referenced by llvm::LessRecordFieldName::operator()().

◆ getValueInit()

Init * Record::getValueInit ( StringRef  FieldName) const

Return the initializer for a value with the specified name, or throw an exception if the field does not exist.

Definition at line 1980 of file Record.cpp.

References llvm::RecordVal::getName(), llvm::RecordVal::getValue(), and llvm::PrintFatalError().

◆ getValues()

ArrayRef<RecordVal> llvm::Record::getValues ( ) const
inline

Definition at line 1414 of file Record.h.

Referenced by checkConcrete(), isObjectStart(), and llvm::operator<<().

◆ isAnonymous()

bool llvm::Record::isAnonymous ( ) const
inline

Definition at line 1525 of file Record.h.

References llvm::RecTy::dump(), and llvm::RecTy::print().

Referenced by checkConcrete().

◆ isSubClassOf() [1/2]

bool llvm::Record::isSubClassOf ( const Record R) const
inline

◆ isSubClassOf() [2/2]

bool llvm::Record::isSubClassOf ( StringRef  Name) const
inline

Definition at line 1484 of file Record.h.

References SI.

◆ isTemplateArg()

bool llvm::Record::isTemplateArg ( Init Name) const
inline

Definition at line 1423 of file Record.h.

References llvm::X86II::TA.

Referenced by isObjectStart(), and llvm::operator<<().

◆ isValueUnset()

bool llvm::Record::isValueUnset ( StringRef  FieldName) const
inline

Return true if the named field is unset.

Definition at line 1541 of file Record.h.

References llvm::operator<<().

◆ print()

void llvm::Record::print ( raw_ostream OS) const

◆ removeValue() [1/2]

void llvm::Record::removeValue ( Init Name)
inline

◆ removeValue() [2/2]

void llvm::Record::removeValue ( StringRef  Name)
inline

Definition at line 1473 of file Record.h.

References llvm::StringInit::get().

◆ resolveReferences() [1/2]

void Record::resolveReferences ( )

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 1929 of file Record.cpp.

References llvm::Resolver::setFinal().

Referenced by checkConcrete(), and isObjectStart().

◆ resolveReferences() [2/2]

void Record::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.

The resolver should not resolve any of the fields itself, to avoid recursion / infinite loops.

Definition at line 1900 of file Record.cpp.

References llvm::Init::getAsUnquotedString(), llvm::RecordVal::getNameInit(), llvm::Value::getType(), llvm::PrintFatalError(), and llvm::Init::resolveReferences().

◆ resolveReferencesTo()

void Record::resolveReferencesTo ( const RecordVal RV)

If anything in this record refers to RV, replace the reference to RV with the RHS of RV.

If RV is null, we resolve all possible references.

Definition at line 1935 of file Record.cpp.

◆ setName()

void Record::setName ( Init Name)

Definition at line 1873 of file Record.cpp.

Referenced by checkConcrete(), and isObjectStart().


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