LLVM
8.0.1
|
#include "llvm/TableGen/Record.h"
Public Member Functions | |
InitKind | getKind () const |
Init (const Init &)=delete | |
Init & | operator= (const Init &)=delete |
virtual | ~Init ()=default |
virtual bool | isComplete () const |
This virtual method should be overridden by values that may not be completely specified yet. More... | |
virtual bool | isConcrete () const |
Is this a concrete and fully resolved value without any references or stuck operations? Unset values are concrete. More... | |
void | print (raw_ostream &OS) const |
Print out this value. More... | |
virtual std::string | getAsString () const =0 |
Convert this value to a string form. More... | |
virtual std::string | getAsUnquotedString () const |
Convert this value to a string form, without adding quote markers. More... | |
void | dump () const |
Debugging method that may be called through a debugger, just invokes print on stderr. More... | |
virtual Init * | getCastTo (RecTy *Ty) const =0 |
If this initializer is convertible to Ty, return an initializer whose type is-a Ty, generating a !cast operation if required. More... | |
virtual Init * | convertInitializerTo (RecTy *Ty) const =0 |
Convert to an initializer whose type is-a Ty, or return nullptr if this is not possible (this can happen if the initializer's type is convertible to Ty, but there are unresolved references). More... | |
virtual Init * | convertInitializerBitRange (ArrayRef< unsigned > Bits) const |
This method is used to implement the bitrange selection operator. More... | |
virtual Init * | convertInitListSlice (ArrayRef< unsigned > Elements) const |
This method is used to implement the list slice selection operator. More... | |
virtual RecTy * | getFieldType (StringInit *FieldName) const |
This method is used to implement the FieldInit class. More... | |
virtual Init * | resolveReferences (Resolver &R) const |
This method is used by classes that refer to other variables which may not be defined at the time the expression is formed. More... | |
virtual Init * | getBit (unsigned Bit) const =0 |
This method is used to return the initializer for the specified bit. More... | |
Protected Types | |
enum | InitKind : uint8_t { IK_First, IK_FirstTypedInit, IK_BitInit, IK_BitsInit, IK_CodeInit, IK_DagInit, IK_DefInit, IK_FieldInit, IK_IntInit, IK_ListInit, IK_FirstOpInit, IK_BinOpInit, IK_TernOpInit, IK_UnOpInit, IK_LastOpInit, IK_FoldOpInit, IK_IsAOpInit, IK_StringInit, IK_VarInit, IK_VarListElementInit, IK_VarBitInit, IK_VarDefInit, IK_LastTypedInit, IK_UnsetInit } |
Discriminator enum (for isa<>, dyn_cast<>, et al.) More... | |
Protected Member Functions | |
Init (InitKind K, uint8_t Opc=0) | |
Protected Attributes | |
uint8_t | Opc |
|
protected |
Discriminator enum (for isa<>, dyn_cast<>, et al.)
This enum is laid out by a preorder traversal of the inheritance hierarchy, and does not contain an entry for abstract classes, as per the recommendation in docs/HowToSetUpLLVMStyleRTTI.rst.
We also explicitly include "first" and "last" values for each interior node of the inheritance tree, to make it easier to read the corresponding classof().
We could pack these a bit tighter by not having the IK_FirstXXXInit and IK_LastXXXInit be their own values, but that would degrade readability for really no benefit.
|
inlineexplicitprotected |
|
virtualdefault |
|
inlinevirtual |
This method is used to implement the bitrange selection operator.
Given an initializer, it selects the specified bits out, returning them as a new init of bits type. If it is not legal to use the bit subscript operator on this initializer, return null.
Reimplemented in llvm::IntInit, llvm::BitsInit, and llvm::TypedInit.
Convert to an initializer whose type is-a Ty, or return nullptr if this is not possible (this can happen if the initializer's type is convertible to Ty, but there are unresolved references).
Implemented in llvm::DefInit, llvm::ListInit, llvm::CodeInit, llvm::StringInit, llvm::IntInit, llvm::BitsInit, llvm::BitInit, llvm::UnsetInit, and llvm::TypedInit.
Referenced by llvm::UnOpInit::Fold(), and llvm::TernOpInit::resolveReferences().
This method is used to implement the list slice selection operator.
Given an initializer, it selects the specified list elements, returning them as a new init of list type. If it is not legal to take a slice of this, return null.
Reimplemented in llvm::ListInit, and llvm::TypedInit.
LLVM_DUMP_METHOD void Init::dump | ( | ) | const |
Debugging method that may be called through a debugger, just invokes print on stderr.
Definition at line 288 of file Record.cpp.
References llvm::errs(), and llvm::RecTy::print().
|
pure virtual |
Convert this value to a string form.
Implemented in llvm::DagInit, llvm::FieldInit, llvm::VarDefInit, llvm::DefInit, llvm::VarListElementInit, llvm::VarBitInit, llvm::VarInit, llvm::IsAOpInit, llvm::FoldOpInit, llvm::TernOpInit, llvm::BinOpInit, llvm::UnOpInit, llvm::ListInit, llvm::CodeInit, llvm::StringInit, llvm::IntInit, llvm::BitsInit, llvm::BitInit, and llvm::UnsetInit.
Referenced by llvm::SetTheory::evaluate(), llvm::ListInit::getAsString(), llvm::FieldInit::getAsString(), llvm::Record::getValueAsInt(), llvm::RecordVal::print(), and QualifiedNameOfImplicitName().
|
inlinevirtual |
Convert this value to a string form, without adding quote markers.
This primaruly affects StringInits where we will not surround the string value with quotes.
Reimplemented in llvm::CodeInit, and llvm::StringInit.
Definition at line 367 of file Record.h.
References llvm::RecTy::dump(), and llvm::RecTy::getAsString().
Referenced by QualifiedNameOfImplicitName(), and llvm::Record::resolveReferences().
This method is used to return the initializer for the specified bit.
Implemented in llvm::DagInit, llvm::FieldInit, llvm::VarDefInit, llvm::DefInit, llvm::VarListElementInit, llvm::VarBitInit, llvm::VarInit, llvm::IsAOpInit, llvm::FoldOpInit, llvm::OpInit, llvm::ListInit, llvm::CodeInit, llvm::StringInit, llvm::IntInit, llvm::BitsInit, llvm::BitInit, and llvm::UnsetInit.
Referenced by llvm::BitsInit::resolveReferences(), and llvm::VarBitInit::resolveReferences().
If this initializer is convertible to Ty, return an initializer whose type is-a Ty, generating a !cast operation if required.
Otherwise, return nullptr.
Implemented in llvm::UnsetInit, and llvm::TypedInit.
Referenced by QualifiedNameOfImplicitName(), and llvm::RecordVal::setValue().
|
inlinevirtual |
This method is used to implement the FieldInit class.
Implementors of this method should return the type of the named field if they are of record type.
Reimplemented in llvm::DefInit, and llvm::TypedInit.
|
inline |
Definition at line 340 of file Record.h.
Referenced by llvm::TypedInit::classof(), llvm::UnsetInit::classof(), llvm::BitInit::classof(), llvm::BitsInit::classof(), llvm::IntInit::classof(), llvm::StringInit::classof(), llvm::CodeInit::classof(), llvm::ListInit::classof(), llvm::OpInit::classof(), llvm::UnOpInit::classof(), llvm::BinOpInit::classof(), llvm::TernOpInit::classof(), llvm::FoldOpInit::classof(), llvm::IsAOpInit::classof(), llvm::VarInit::classof(), llvm::VarBitInit::classof(), llvm::VarListElementInit::classof(), llvm::DefInit::classof(), llvm::VarDefInit::classof(), llvm::FieldInit::classof(), and llvm::DagInit::classof().
|
inlinevirtual |
This virtual method should be overridden by values that may not be completely specified yet.
Reimplemented in llvm::IsAOpInit, llvm::FoldOpInit, llvm::TernOpInit, llvm::BitsInit, and llvm::UnsetInit.
Definition at line 352 of file Record.h.
Referenced by llvm::TernOpInit::isComplete(), and QualifiedNameOfImplicitName().
|
inlinevirtual |
Is this a concrete and fully resolved value without any references or stuck operations? Unset values are concrete.
Reimplemented in llvm::DagInit, llvm::DefInit, llvm::ListInit, llvm::CodeInit, llvm::StringInit, llvm::IntInit, llvm::BitsInit, llvm::BitInit, and llvm::UnsetInit.
Definition at line 356 of file Record.h.
Referenced by checkBitsConcrete(), and llvm::ListInit::isConcrete().
|
inline |
Print out this value.
Definition at line 359 of file Record.h.
References llvm::RecTy::getAsString().
Referenced by llvm::operator<<().
This method is used by classes that refer to other variables which may not be defined at the time the expression is formed.
If a value is set for the variable later, this method will be called on users of the value to allow the value to propagate out.
Reimplemented in llvm::DagInit, llvm::FieldInit, llvm::VarDefInit, llvm::VarListElementInit, llvm::VarBitInit, llvm::VarInit, llvm::IsAOpInit, llvm::FoldOpInit, llvm::TernOpInit, llvm::BinOpInit, llvm::UnOpInit, llvm::ListInit, and llvm::BitsInit.
Definition at line 410 of file Record.h.
References llvm::tgtok::Bit.
Referenced by ForeachApply(), isObjectStart(), QualifiedNameOfImplicitName(), llvm::MapResolver::resolve(), llvm::RecordResolver::resolve(), llvm::TrackUnresolvedResolver::resolve(), llvm::BitsInit::resolveReferences(), llvm::UnOpInit::resolveReferences(), llvm::BinOpInit::resolveReferences(), llvm::TernOpInit::resolveReferences(), llvm::IsAOpInit::resolveReferences(), llvm::VarListElementInit::resolveReferences(), llvm::FieldInit::resolveReferences(), and llvm::Record::resolveReferences().