LLVM 20.0.0git
|
#include "llvm/TableGen/Record.h"
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? Unset values are concrete. | |
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 Init * | getCastTo (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 Init * | convertInitializerTo (RecTy *Ty) const =0 |
Convert to a value whose type is Ty , or return null if this is not possible. | |
virtual Init * | convertInitializerBitRange (ArrayRef< unsigned > Bits) const |
This function is used to implement the bit range selection operator. | |
virtual RecTy * | getFieldType (StringInit *FieldName) const |
This function is used to implement the FieldInit class. | |
virtual 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 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_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 | |
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 function is used to implement the bit range selection operator.
Given a value, it selects the specified bits, returning them as a new Init
of type bits
. If it is not legal to use the bit selection operator on this value, null is returned.
Reimplemented in llvm::TypedInit, llvm::BitsInit, and llvm::IntInit.
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::TypedInit, llvm::UnsetInit, llvm::ArgumentInit, llvm::BitInit, llvm::BitsInit, llvm::IntInit, llvm::StringInit, llvm::ListInit, and llvm::DefInit.
Referenced by llvm::CheckAssert(), llvm::BinOpInit::Fold(), llvm::TernOpInit::Fold(), llvm::CondOpInit::Fold(), llvm::UnOpInit::Fold(), and llvm::TernOpInit::resolveReferences().
LLVM_DUMP_METHOD void Init::dump | ( | ) | const |
Debugging method that may be called through a debugger; just invokes print on stderr.
Definition at line 346 of file Record.cpp.
References llvm::errs(), and print().
Referenced by llvm::ExecutionEngine::InitializeMemory().
|
pure virtual |
Convert this value to a literal form.
Implemented in llvm::UnsetInit, llvm::ArgumentInit, llvm::BitInit, llvm::BitsInit, llvm::IntInit, llvm::AnonymousNameInit, llvm::StringInit, llvm::ListInit, llvm::UnOpInit, llvm::BinOpInit, llvm::TernOpInit, llvm::CondOpInit, llvm::FoldOpInit, llvm::IsAOpInit, llvm::ExistsOpInit, llvm::VarInit, llvm::VarBitInit, llvm::DefInit, llvm::VarDefInit, llvm::FieldInit, and llvm::DagInit.
Referenced by llvm::ForeachLoop::dump(), llvm::SetTheory::evaluate(), llvm::FieldInit::Fold(), llvm::UnOpInit::Fold(), llvm::ArgumentInit::getAsString(), llvm::ListInit::getAsString(), llvm::UnOpInit::getAsString(), llvm::BinOpInit::getAsString(), llvm::TernOpInit::getAsString(), llvm::CondOpInit::getAsString(), llvm::FoldOpInit::getAsString(), llvm::IsAOpInit::getAsString(), llvm::ExistsOpInit::getAsString(), llvm::VarBitInit::getAsString(), llvm::FieldInit::getAsString(), llvm::DagInit::getAsString(), getAsUnquotedString(), and print().
|
inlinevirtual |
Convert this value to a literal form, without adding quotes around a string.
Reimplemented in llvm::StringInit.
Definition at line 364 of file Record.h.
References getAsString().
Referenced by llvm::TernOpInit::getAsString(), llvm::FoldOpInit::getAsString(), llvm::VarInit::getNameInitAsString(), llvm::RecordVal::getNameInitAsString(), llvm::Record::getNameInitAsString(), and llvm::Record::resolveReferences().
Get the Init
value of the specified bit.
Implemented in llvm::VarBitInit, llvm::UnsetInit, llvm::ArgumentInit, llvm::BitInit, llvm::BitsInit, llvm::IntInit, llvm::AnonymousNameInit, llvm::StringInit, llvm::ListInit, llvm::OpInit, llvm::CondOpInit, llvm::FoldOpInit, llvm::IsAOpInit, llvm::ExistsOpInit, llvm::VarInit, llvm::DefInit, llvm::VarDefInit, llvm::FieldInit, and llvm::DagInit.
Referenced by llvm::BitsInit::resolveReferences().
If this value is convertible to type Ty
, return a value whose type is Ty
, generating a !cast operation if required.
Otherwise, return null.
Implemented in llvm::TypedInit, llvm::UnsetInit, and llvm::ArgumentInit.
|
inlinevirtual |
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::TypedInit, and llvm::DefInit.
|
inline |
RecordKeeper & Init::getRecordKeeper | ( | ) | const |
Get the record keeper that initialized this Init.
Definition at line 349 of file Record.cpp.
Referenced by llvm::CheckAssert(), llvm::IsAOpInit::get(), llvm::ExistsOpInit::get(), and llvm::BinOpInit::getStrConcat().
|
inlinevirtual |
Is this a complete value with no unset (uninitialized) subvalues?
Reimplemented in llvm::UnsetInit, llvm::ArgumentInit, llvm::BitsInit, llvm::ListInit, llvm::TernOpInit, llvm::CondOpInit, llvm::FoldOpInit, llvm::IsAOpInit, and llvm::ExistsOpInit.
Definition at line 350 of file Record.h.
Referenced by llvm::BitsInit::allInComplete(), llvm::BitsInit::isComplete(), llvm::ListInit::isComplete(), and llvm::TernOpInit::isComplete().
|
inlinevirtual |
Is this a concrete and fully resolved value without any references or stuck operations? Unset values are concrete.
Reimplemented in llvm::UnsetInit, llvm::ArgumentInit, llvm::BitInit, llvm::BitsInit, llvm::IntInit, llvm::StringInit, llvm::ListInit, llvm::CondOpInit, llvm::DefInit, llvm::FieldInit, and llvm::DagInit.
Definition at line 354 of file Record.h.
Referenced by llvm::FieldInit::Fold(), llvm::UnOpInit::Fold(), llvm::ListInit::isConcrete(), llvm::FieldInit::isConcrete(), and llvm::DagInit::isConcrete().
|
inline |
Print this value.
Definition at line 357 of file Record.h.
References getAsString(), and OS.
Referenced by dump().
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::ArgumentInit, llvm::BitsInit, llvm::AnonymousNameInit, llvm::ListInit, llvm::UnOpInit, llvm::BinOpInit, llvm::TernOpInit, llvm::CondOpInit, llvm::FoldOpInit, llvm::IsAOpInit, llvm::ExistsOpInit, llvm::VarInit, llvm::VarBitInit, llvm::VarDefInit, llvm::FieldInit, and llvm::DagInit.
Definition at line 399 of file Record.h.
Referenced by llvm::Record::checkRecordAssertions(), llvm::FoldOpInit::Fold(), llvm::RecordResolver::resolve(), llvm::BitsInit::resolveReferences(), llvm::ListInit::resolveReferences(), llvm::UnOpInit::resolveReferences(), llvm::BinOpInit::resolveReferences(), llvm::TernOpInit::resolveReferences(), llvm::CondOpInit::resolveReferences(), llvm::FoldOpInit::resolveReferences(), llvm::IsAOpInit::resolveReferences(), llvm::ExistsOpInit::resolveReferences(), llvm::VarBitInit::resolveReferences(), llvm::FieldInit::resolveReferences(), llvm::DagInit::resolveReferences(), and llvm::Record::resolveReferences().
|
protected |
Definition at line 329 of file Record.h.
Referenced by llvm::BinOpInit::CompareInit(), llvm::BinOpInit::get(), llvm::TernOpInit::get(), llvm::UnOpInit::get(), llvm::UnOpInit::getOpcode(), llvm::BinOpInit::getOpcode(), and llvm::TernOpInit::getOpcode().