LLVM API Documentation

Public Member Functions | Static Public Member Functions
llvm::Record Class Reference

#include <Record.h>

List of all members.

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.
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
bool isResolveFirst () const
void setResolveFirst (bool b)
void dump () const
InitgetValueInit (StringRef FieldName) const
bool isValueUnset (StringRef FieldName) const
 Return true if the named field is unset.
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 1384 of file Record.h.


Constructor & Destructor Documentation

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

Definition at line 1421 of file Record.h.

llvm::Record::Record ( Init N,
ArrayRef< SMLoc locs,
RecordKeeper records,
bool  Anonymous = false 
) [inline, explicit]

Definition at line 1428 of file Record.h.

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

Definition at line 1438 of file Record.h.

llvm::Record::~Record ( ) [inline]

Definition at line 1445 of file Record.h.


Member Function Documentation

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

Definition at line 1547 of file Record.h.

References isSubClassOf().

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

Definition at line 1500 of file Record.h.

References isTemplateArg().

Referenced by addTemplateArg().

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

Definition at line 1504 of file Record.h.

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

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

Definition at line 1508 of file Record.h.

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

void Record::dump ( ) const

Definition at line 1756 of file Record.cpp.

References llvm::errs().

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

get the corresponding DefInit.

Definition at line 1698 of file Record.cpp.

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

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

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

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

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

static unsigned llvm::Record::getNewUID ( ) [inline, static]

Definition at line 1447 of file Record.h.

Definition at line 1563 of file Record.h.

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

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

Definition at line 1472 of file Record.h.

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

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

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

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

Definition at line 1491 of file Record.h.

References getNameInit().

Definition at line 1496 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 1946 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 1958 of file Record.cpp.

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

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

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

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

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

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

References getLoc(), getName(), llvm::RecordVal::getValue(), getValue(), LI, 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 1858 of file Record.cpp.

References llvm::ListInit::getElement(), getLoc(), getName(), llvm::ListInit::getSize(), getValueAsListInit(), 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 1893 of file Record.cpp.

References llvm::ListInit::getElement(), getLoc(), getName(), llvm::ListInit::getSize(), getValueAsListInit(), 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 1912 of file Record.cpp.

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

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

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

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

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

Referenced by isValueUnset().

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

Definition at line 1470 of file Record.h.

Referenced by llvm::operator<<().

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

Definition at line 1567 of file Record.h.

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

Definition at line 1571 of file Record.h.

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

Definition at line 1540 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 1479 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 1591 of file Record.h.

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

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

Definition at line 1520 of file Record.h.

References getNameInit(), and llvm_unreachable.

Referenced by removeValue().

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

Definition at line 1529 of file Record.h.

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

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 1556 of file Record.h.

References resolveReferencesTo().

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

Referenced by resolveReferencesTo(), and setName().

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

Definition at line 1726 of file Record.cpp.

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

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

Definition at line 1575 of file Record.h.


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