LLVM: llvm::Init Class Reference (original) (raw)
#include "[llvm/TableGen/Record.h](TableGen%5F2Record%5F8h%5Fsource.html)"
| Public Member Functions | |
|---|---|
| InitKind | getKind () const |
| Get the kind (type) of the value. | |
| RecordKeeper & | getRecordKeeper () const |
| Get the record keeper that initialized this Init. | |
| Init (const Init &)=delete | |
| Init & | operator= (const Init &)=delete |
| virtual | ~Init ()=default |
| virtual bool | isComplete () const |
| Is this a complete value with no unset (uninitialized) subvalues? | |
| virtual bool | isConcrete () const |
| Is this a concrete and fully resolved value without any references or stuck operations? | |
| void | print (raw_ostream &OS) const |
| Print this value. | |
| virtual std::string | getAsString () const =0 |
| Convert this value to a literal form. | |
| virtual std::string | getAsUnquotedString () const |
| Convert this value to a literal form, without adding quotes around a string. | |
| void | dump () const |
| Debugging method that may be called through a debugger; just invokes print on stderr. | |
| virtual const Init * | getCastTo (const RecTy *Ty) const =0 |
| If this value is convertible to type Ty, return a value whose type is Ty, generating a !cast operation if required. | |
| virtual const Init * | convertInitializerTo (const RecTy *Ty) const =0 |
| Convert to a value whose type is Ty, or return null if this is not possible. | |
| virtual const Init * | convertInitializerBitRange (ArrayRef< unsigned > Bits) const |
| This function is used to implement the bit range selection operator. | |
| virtual const RecTy * | getFieldType (const StringInit *FieldName) const |
| This function is used to implement the FieldInit class. | |
| virtual const Init * | resolveReferences (Resolver &R) const |
| This function is used by classes that refer to other variables which may not be defined at the time the expression is formed. | |
| virtual const Init * | getBit (unsigned Bit) const =0 |
| Get the Init value of the specified bit. |
| Protected Types | |
|---|---|
| enum | InitKind : uint8_t { IK_First, IK_FirstTypedInit, IK_BitInit, IK_BitsInit, IK_DagInit, IK_DefInit, IK_FieldInit, IK_IntInit, IK_ListInit, IK_FirstOpInit, IK_BinOpInit, IK_TernOpInit, IK_UnOpInit, IK_LastOpInit, IK_CondOpInit, IK_FoldOpInit, IK_IsAOpInit, IK_ExistsOpInit, IK_InstancesOpInit, IK_AnonymousNameInit, IK_StringInit, IK_VarInit, IK_VarBitInit, IK_VarDefInit, IK_LastTypedInit, IK_UnsetInit, IK_ArgumentInit } |
| Discriminator enum (for isa<>, dyn_cast<>, et al.) More... |
| Protected Member Functions |
|---|
Definition at line 286 of file Record.h.
◆ InitKind
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.
| Enumerator |
|---|
| IK_First |
| IK_FirstTypedInit |
| IK_BitInit |
| IK_BitsInit |
| IK_DagInit |
| IK_DefInit |
| IK_FieldInit |
| IK_IntInit |
| IK_ListInit |
| IK_FirstOpInit |
| IK_BinOpInit |
| IK_TernOpInit |
| IK_UnOpInit |
| IK_LastOpInit |
| IK_CondOpInit |
| IK_FoldOpInit |
| IK_IsAOpInit |
| IK_ExistsOpInit |
| IK_InstancesOpInit |
| IK_AnonymousNameInit |
| IK_StringInit |
| IK_VarInit |
| IK_VarBitInit |
| IK_VarDefInit |
| IK_LastTypedInit |
| IK_UnsetInit |
| IK_ArgumentInit |
Definition at line 301 of file Record.h.
◆ Init() [1/2]
| llvm::Init::Init ( InitKind K, uint8_t Opc = 0 ) | inlineexplicitprotected |
|---|
Definition at line 348 of file Record.h.
References Opc.
Referenced by llvm::ArgumentInit::ArgumentInit(), llvm::ArgumentInit::classof(), llvm::TypedInit::classof(), llvm::UnsetInit::classof(), llvm::ArgumentInit::cloneWithValue(), llvm::ArgumentInit::convertInitializerTo(), convertInitializerTo(), llvm::TypedInit::convertInitializerTo(), llvm::UnsetInit::convertInitializerTo(), llvm::ArgumentInit::get(), llvm::ArgumentInit::getBit(), getBit(), llvm::UnsetInit::getBit(), llvm::ArgumentInit::getCastTo(), getCastTo(), llvm::TypedInit::getCastTo(), llvm::UnsetInit::getCastTo(), llvm::ArgumentInit::getName(), llvm::ArgumentInit::getValue(), Init(), operator=(), llvm::ArgumentInit::resolveReferences(), resolveReferences(), and llvm::TypedInit::TypedInit().
◆ Init() [2/2]
| virtual llvm::Init::~Init ( ) | virtualdefault |
|---|
◆ convertInitializerBitRange()
This function is used to implement the bit range selection operator.
Given a value, it selects the specified bits, returning them as a new [Init](classllvm%5F1%5F1Init.html) of type bits. If it is not legal to use the bit selection operator on this value, null is returned.
Reimplemented in llvm::BitsInit, llvm::IntInit, and llvm::TypedInit.
Definition at line 391 of file Record.h.
◆ convertInitializerTo()
Convert to a value whose type is Ty, or return null if this is not possible.
This can happen if the value's type is convertible to Ty, but there are unresolved references.
Implemented in llvm::ArgumentInit, llvm::BitInit, llvm::BitsInit, llvm::DefInit, llvm::IntInit, llvm::ListInit, llvm::StringInit, llvm::TypedInit, and llvm::UnsetInit.
References Init().
Referenced by llvm::CheckAssert(), llvm::ArgumentInit::convertInitializerTo(), llvm::UnOpInit::Fold(), llvm::BinOpInit::resolveReferences(), and llvm::TernOpInit::resolveReferences().
◆ dump()
◆ getAsString()
| virtual std::string llvm::Init::getAsString ( ) const | pure virtual |
|---|
Convert this value to a literal form.
Implemented in llvm::AnonymousNameInit, llvm::ArgumentInit, llvm::BinOpInit, llvm::BitInit, llvm::BitsInit, llvm::CondOpInit, llvm::DagInit, llvm::DefInit, llvm::ExistsOpInit, llvm::FieldInit, llvm::FoldOpInit, llvm::InstancesOpInit, llvm::IntInit, llvm::IsAOpInit, llvm::ListInit, llvm::StringInit, llvm::TernOpInit, llvm::UnOpInit, llvm::UnsetInit, llvm::VarBitInit, llvm::VarDefInit, and llvm::VarInit.
Referenced by llvm::SetTheory::evaluate(), llvm::ArgumentInit::getAsString(), llvm::ListInit::getAsString(), getAsUnquotedString(), and print().
◆ getAsUnquotedString()
| virtual std::string llvm::Init::getAsUnquotedString ( ) const | inlinevirtual |
|---|
◆ getBit()
Get the [Init](classllvm%5F1%5F1Init.html) value of the specified bit.
Implemented in llvm::AnonymousNameInit, llvm::ArgumentInit, llvm::BitInit, llvm::BitsInit, llvm::CondOpInit, llvm::DagInit, llvm::DefInit, llvm::ExistsOpInit, llvm::FieldInit, llvm::FoldOpInit, llvm::InstancesOpInit, llvm::IntInit, llvm::IsAOpInit, llvm::ListInit, llvm::OpInit, llvm::StringInit, llvm::UnsetInit, llvm::VarBitInit, llvm::VarDefInit, and llvm::VarInit.
References Init().
Referenced by llvm::ArgumentInit::getBit(), and llvm::BitsInit::resolveReferences().
◆ getCastTo()
◆ getFieldType()
This function is used to implement the FieldInit class.
Implementors of this method should return the type of the named field if they are of type record.
Reimplemented in llvm::DefInit, and llvm::TypedInit.
Definition at line 398 of file Record.h.
◆ getKind()
| InitKind llvm::Init::getKind ( ) const | inline |
|---|
Get the kind (type) of the value.
Definition at line 342 of file Record.h.
◆ getRecordKeeper()
◆ isComplete()
| virtual bool llvm::Init::isComplete ( ) const | inlinevirtual |
|---|
◆ isConcrete()
| virtual bool llvm::Init::isConcrete ( ) const | inlinevirtual |
|---|
Is this a concrete and fully resolved value without any references or stuck operations?
Unset values are concrete.
Reimplemented in llvm::ArgumentInit, llvm::BitInit, llvm::BitsInit, llvm::CondOpInit, llvm::DagInit, llvm::DefInit, llvm::FieldInit, llvm::IntInit, llvm::ListInit, llvm::StringInit, and llvm::UnsetInit.
Definition at line 360 of file Record.h.
Referenced by llvm::FieldInit::Fold(), llvm::DagInit::isConcrete(), llvm::FieldInit::isConcrete(), and llvm::ListInit::isConcrete().
◆ operator=()
◆ print()
| void llvm::Init::print ( raw_ostream & OS) const | inline |
|---|
Print this value.
Definition at line 363 of file Record.h.
References getAsString().
Referenced by dump().
◆ resolveReferences()
| virtual const Init * llvm::Init::resolveReferences ( Resolver & R) const | inlinevirtual |
|---|
This function 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::AnonymousNameInit, llvm::ArgumentInit, llvm::BinOpInit, llvm::BitsInit, llvm::CondOpInit, llvm::DagInit, llvm::ExistsOpInit, llvm::FieldInit, llvm::FoldOpInit, llvm::InstancesOpInit, llvm::IsAOpInit, llvm::ListInit, llvm::TernOpInit, llvm::UnOpInit, llvm::VarBitInit, llvm::VarDefInit, and llvm::VarInit.
Definition at line 406 of file Record.h.
References Init().
Referenced by llvm::Record::checkRecordAssertions(), llvm::FoldOpInit::Fold(), llvm::RecordResolver::resolve(), llvm::BinOpInit::resolveReferences(), llvm::BitsInit::resolveReferences(), llvm::CondOpInit::resolveReferences(), llvm::DagInit::resolveReferences(), llvm::FoldOpInit::resolveReferences(), llvm::InstancesOpInit::resolveReferences(), llvm::ListInit::resolveReferences(), llvm::Record::resolveReferences(), llvm::TernOpInit::resolveReferences(), and llvm::UnOpInit::resolveReferences().
◆ Opc
Definition at line 335 of file Record.h.
Referenced by llvm::BinOpInit::CompareInit(), llvm::BinOpInit::get(), llvm::TernOpInit::get(), llvm::UnOpInit::get(), llvm::BinOpInit::getOpcode(), llvm::TernOpInit::getOpcode(), llvm::UnOpInit::getOpcode(), Init(), llvm::OpInit::OpInit(), llvm::BinOpInit::resolveReferences(), and llvm::TypedInit::TypedInit().
The documentation for this class was generated from the following files:
- include/llvm/TableGen/Record.h
- lib/TableGen/Record.cpp