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

#include <Record.h>

Public Member Functions

 Record (Init *N, ArrayRef< SMLoc > locs, RecordKeeper &records, bool Anonymous=false)
 
 Record (const std::string &N, ArrayRef< SMLoc > locs, RecordKeeper &records, bool Anonymous=false)
 
 Record (const Record &O)
 
unsigned getID () const
 
const std::string & getName () const
 
InitgetNameInit () const
 
const std::string getNameInitAsString () const
 
void setName (Init *Name)
 
void setName (const std::string &Name)
 
ArrayRef< SMLocgetLoc () const
 
DefInitgetDefInit ()
 get the corresponding DefInit. More...
 
ArrayRef< Init * > getTemplateArgs () const
 
ArrayRef< RecordValgetValues () const
 
ArrayRef< Record * > getSuperClasses () const
 
ArrayRef< SMRangegetSuperClassRanges () const
 
bool isTemplateArg (Init *Name) const
 
bool isTemplateArg (StringRef 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 addTemplateArg (StringRef 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 ()
 resolveReferences - If there are any field references that refer to fields that have been filled in, we can propagate the values now. More...
 
void resolveReferencesTo (const RecordVal *RV)
 resolveReferencesTo - If anything in this record refers to RV, replace the reference to RV with the RHS of RV. More...
 
RecordKeepergetRecords () const
 
bool isAnonymous () const
 
bool isResolveFirst () const
 
void setResolveFirst (bool b)
 
void dump () const
 
InitgetValueInit (StringRef FieldName) const
 getValueInit - 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...
 
std::string getValueAsString (StringRef FieldName) const
 getValueAsString - 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
 getValueAsBitsInit - 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
 getValueAsListInit - 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
 getValueAsListOfDefs - 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
 getValueAsListOfInts - 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< std::string > getValueAsListOfStrings (StringRef FieldName) const
 getValueAsListOfStrings - 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
 getValueAsDef - 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
 getValueAsBit - 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
 getValueAsBitOrUnset - This method looks up the specified field and returns its value as a bit. More...
 
int64_t getValueAsInt (StringRef FieldName) const
 getValueAsInt - 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
 getValueAsDag - 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 1147 of file Record.h.

Constructor & Destructor Documentation

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

Definition at line 1184 of file Record.h.

llvm::Record::Record ( const std::string &  N,
ArrayRef< SMLoc locs,
RecordKeeper records,
bool  Anonymous = false 
)
inlineexplicit

Definition at line 1190 of file Record.h.

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

Definition at line 1198 of file Record.h.

Member Function Documentation

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

Definition at line 1305 of file Record.h.

References isSubClassOf().

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

Definition at line 1258 of file Record.h.

References isTemplateArg().

Referenced by addTemplateArg().

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

Definition at line 1262 of file Record.h.

References addTemplateArg(), and llvm::StringInit::get().

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

Definition at line 1266 of file Record.h.

References llvm::RecordVal::getNameInit(), getValue(), and std::swap().

void Record::dump ( ) const

Definition at line 1631 of file Record.cpp.

References llvm::errs().

Referenced by llvm::MultiClass::dump().

DefInit * Record::getDefInit ( )

get the corresponding DefInit.

Definition at line 1576 of file Record.cpp.

Referenced by llvm::RecordRecTy::get(), and llvm::DefInit::get().

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

Definition at line 1207 of file Record.h.

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

ArrayRef<SMLoc> llvm::Record::getLoc ( ) const
inline
const std::string & Record::getName ( ) const
Init* llvm::Record::getNameInit ( ) const
inline
const std::string llvm::Record::getNameInitAsString ( ) const
inline

Definition at line 1213 of file Record.h.

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

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

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

Definition at line 1205 of file Record.h.

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

Definition at line 1321 of file Record.h.

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

ArrayRef<Record *> llvm::Record::getSuperClasses ( ) const
inline
ArrayRef<SMRange> llvm::Record::getSuperClassRanges ( ) const
inline

Definition at line 1230 of file Record.h.

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

Definition at line 1225 of file Record.h.

Referenced by llvm::operator<<().

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

Definition at line 1246 of file Record.h.

References llvm::StringInit::get(), and getValue().

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

Definition at line 1249 of file Record.h.

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

Definition at line 1254 of file Record.h.

References llvm::StringInit::get(), and getValue().

bool Record::getValueAsBit ( StringRef  FieldName) const

getValueAsBit - 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.

getValueAsBit - This method looks up the specified field and returns its value as a bit, aborting if the field does not exist or if the value is not the right type.

Definition at line 1819 of file Record.cpp.

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

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

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

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

BitsInit * Record::getValueAsBitsInit ( StringRef  FieldName) const

getValueAsBitsInit - 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.

getValueAsBitsInit - This method looks up the specified field and returns its value as a BitsInit, aborts if the field does not exist or if the value is not the right type.

Definition at line 1701 of file Record.cpp.

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

DagInit * Record::getValueAsDag ( StringRef  FieldName) const

getValueAsDag - 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.

getValueAsDag - This method looks up the specified field and returns its value as an Dag, aborting if the field does not exist or if the value is not the right type.

Definition at line 1852 of file Record.cpp.

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

Record * Record::getValueAsDef ( StringRef  FieldName) const

getValueAsDef - 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.

getValueAsDef - This method looks up the specified field and returns its value as a Record, aborting if the field does not exist or if the value is not the right type.

Definition at line 1803 of file Record.cpp.

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

int64_t Record::getValueAsInt ( StringRef  FieldName) const

getValueAsInt - 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.

getValueAsInt - This method looks up the specified field and returns its value as an int64_t, aborting if the field does not exist or if the value is not the right type.

Definition at line 1751 of file Record.cpp.

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

ListInit * Record::getValueAsListInit ( StringRef  FieldName) const

getValueAsListInit - 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.

getValueAsListInit - This method looks up the specified field and returns its value as a ListInit, aborting if the field does not exist or if the value is not the right type.

Definition at line 1717 of file Record.cpp.

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

Referenced by getValueAsListOfDefs(), getValueAsListOfInts(), and getValueAsListOfStrings().

std::vector< Record * > Record::getValueAsListOfDefs ( StringRef  FieldName) const

getValueAsListOfDefs - 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.

getValueAsListOfDefs - This method looks up the specified field and returns its value as a vector of records, aborting if the field does not exist or if the value is not the right type.

Definition at line 1734 of file Record.cpp.

References llvm::DI, getLoc(), getName(), getValueAsListInit(), llvm::ListInit::getValues(), I, llvm::tgtok::List, and llvm::PrintFatalError().

std::vector< int64_t > Record::getValueAsListOfInts ( StringRef  FieldName) const

getValueAsListOfInts - 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.

getValueAsListOfInts - This method looks up the specified field and returns its value as a vector of integers, aborting if the field does not exist or if the value is not the right type.

Definition at line 1768 of file Record.cpp.

References getLoc(), getName(), getValueAsListInit(), llvm::ListInit::getValues(), I, llvm::tgtok::List, and llvm::PrintFatalError().

std::vector< std::string > Record::getValueAsListOfStrings ( StringRef  FieldName) const

getValueAsListOfStrings - 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.

getValueAsListOfStrings - This method looks up the specified field and returns its value as a vector of strings, aborting if the field does not exist or if the value is not the right type.

Definition at line 1786 of file Record.cpp.

References getLoc(), getName(), getValueAsListInit(), llvm::ListInit::getValues(), I, llvm::tgtok::List, llvm::PrintFatalError(), and llvm::SI.

std::string Record::getValueAsString ( StringRef  FieldName) const

getValueAsString - 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.

getValueAsString - This method looks up the specified field and returns its value as a string, aborts if the field does not exist or if the value is not a string.

Definition at line 1685 of file Record.cpp.

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

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

Init * Record::getValueInit ( StringRef  FieldName) const

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

getValueInit - Return the initializer for a value with the specified name, or abort if the field does not exist.

Definition at line 1672 of file Record.cpp.

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

Referenced by isValueUnset().

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

Definition at line 1228 of file Record.h.

Referenced by llvm::operator<<().

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

Definition at line 1325 of file Record.h.

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

Definition at line 1329 of file Record.h.

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

Definition at line 1291 of file Record.h.

References llvm::PPCISD::SC.

Referenced by addSuperClass(), and llvm::RecordRecTy::typeIsConvertibleTo().

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

Definition at line 1298 of file Record.h.

References llvm::PPCISD::SC.

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

Definition at line 1237 of file Record.h.

References llvm::StringInit::get(), and isTemplateArg().

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

Return true if the named field is unset.

Definition at line 1349 of file Record.h.

References getValueInit().

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

Definition at line 1278 of file Record.h.

References getNameInit(), and llvm_unreachable.

Referenced by removeValue().

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

Definition at line 1287 of file Record.h.

References llvm::StringInit::get(), and removeValue().

void llvm::Record::resolveReferences ( )
inline

resolveReferences - If there are any field references that refer to fields that have been filled in, we can propagate the values now.

Definition at line 1314 of file Record.h.

References resolveReferencesTo().

void Record::resolveReferencesTo ( const RecordVal RV)

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

References llvm::Init::getAsUnquotedString(), getLoc(), getNameInit(), llvm::RecordVal::getNameInitAsString(), getNameInitAsString(), llvm::RecordVal::getValue(), getValue(), llvm::PrintFatalError(), llvm::Init::resolveReferences(), and setName().

Referenced by resolveReferences().

void Record::setName ( Init Name)

Definition at line 1586 of file Record.cpp.

Referenced by resolveReferencesTo(), and setName().

void Record::setName ( const std::string &  Name)

Definition at line 1602 of file Record.cpp.

References llvm::StringInit::get(), and setName().

void llvm::Record::setResolveFirst ( bool  b)
inline

Definition at line 1333 of file Record.h.


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