LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | List of all members
llvm::Record Class Reference

#include <Record.h>

Public Member Functions

 Record (const std::string &N, ArrayRef< SMLoc > locs, RecordKeeper &records, bool Anonymous=false)
 
 Record (Init *N, ArrayRef< SMLoc > locs, RecordKeeper &records, bool Anonymous=false)
 
 Record (const Record &O)
 
 ~Record ()
 
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...
 
const std::vector< Init * > & getTemplateArgs () const
 
const std::vector< RecordVal > & getValues () const
 
const std::vector< 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 ()
 
void resolveReferencesTo (const RecordVal *RV)
 
RecordKeepergetRecords () const
 
bool isAnonymous () const
 
void dump () const
 
InitgetValueInit (StringRef FieldName) const
 
bool isValueUnset (StringRef FieldName) const
 Return true if the named field is unset. More...
 
std::string getValueAsString (StringRef FieldName) const
 
BitsInitgetValueAsBitsInit (StringRef FieldName) const
 
ListInitgetValueAsListInit (StringRef FieldName) const
 
std::vector< Record * > getValueAsListOfDefs (StringRef FieldName) const
 
std::vector< int64_t > getValueAsListOfInts (StringRef FieldName) const
 
std::vector< std::string > getValueAsListOfStrings (StringRef FieldName) const
 
RecordgetValueAsDef (StringRef FieldName) const
 
bool getValueAsBit (StringRef FieldName) const
 
bool getValueAsBitOrUnset (StringRef FieldName, bool &Unset) const
 
int64_t getValueAsInt (StringRef FieldName) const
 
DagInitgetValueAsDag (StringRef FieldName) const
 

Static Public Member Functions

static unsigned getNewUID ()
 

Detailed Description

Definition at line 1376 of file Record.h.

Constructor & Destructor Documentation

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

Definition at line 1402 of file Record.h.

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

Definition at line 1408 of file Record.h.

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

Definition at line 1417 of file Record.h.

llvm::Record::~Record ( )
inline

Definition at line 1423 of file Record.h.

Member Function Documentation

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

Definition at line 1527 of file Record.h.

References isSubClassOf().

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

Definition at line 1480 of file Record.h.

References isTemplateArg().

Referenced by addTemplateArg().

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

Definition at line 1484 of file Record.h.

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

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

Definition at line 1488 of file Record.h.

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

void Record::dump ( ) const

Definition at line 1745 of file Record.cpp.

References llvm::errs().

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

DefInit * Record::getDefInit ( )

get the corresponding DefInit.

Definition at line 1680 of file Record.cpp.

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

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

Definition at line 1429 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 1435 of file Record.h.

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

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

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

Definition at line 1426 of file Record.h.

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

Definition at line 1543 of file Record.h.

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

const std::vector<Record*>& llvm::Record::getSuperClasses ( ) const
inline

Definition at line 1451 of file Record.h.

Referenced by llvm::RecordRecTy::baseClassOf(), and llvm::operator<<().

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

Definition at line 1452 of file Record.h.

const std::vector<Init *>& llvm::Record::getTemplateArgs ( ) const
inline

Definition at line 1447 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 1468 of file Record.h.

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

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

Definition at line 1471 of file Record.h.

References getNameInit().

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

Definition at line 1476 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 1935 of file Record.cpp.

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

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 retunrs false.

Definition at line 1947 of file Record.cpp.

References llvm::UnsetInit::get(), 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 1814 of file Record.cpp.

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

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

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

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

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

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

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

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

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

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

References llvm::ListInit::getElement(), getLoc(), getName(), llvm::ListInit::getSize(), getValueAsListInit(), llvm::tgtok::List, llvm::PrintFatalError(), and llvm::StringRef::str().

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

References llvm::ListInit::getElement(), getLoc(), getName(), llvm::ListInit::getSize(), getValueAsListInit(), llvm::tgtok::List, llvm::PrintFatalError(), and llvm::StringRef::str().

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

References llvm::ListInit::getElement(), getLoc(), getName(), llvm::ListInit::getSize(), getValueAsListInit(), llvm::tgtok::List, llvm::PrintFatalError(), and llvm::StringRef::str().

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

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

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

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

Referenced by isValueUnset().

const std::vector<RecordVal>& llvm::Record::getValues ( ) const
inline

Definition at line 1450 of file Record.h.

Referenced by llvm::operator<<().

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

Definition at line 1547 of file Record.h.

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

Definition at line 1520 of file Record.h.

References getNameInitAsString().

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

Definition at line 1459 of file Record.h.

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

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

Return true if the named field is unset.

Definition at line 1563 of file Record.h.

References llvm::UnsetInit::get(), and getValueInit().

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

Definition at line 1500 of file Record.h.

References getNameInit(), and llvm_unreachable.

Referenced by removeValue().

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

Definition at line 1509 of file Record.h.

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

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 1536 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 1722 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)
void Record::setName ( const std::string &  Name)

Definition at line 1715 of file Record.cpp.

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


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