LLVM 22.0.0git
llvm::TypedInit Class Reference

This is the common superclass of types that have a specific, explicit type, stored in ValueTy. More...

#include "llvm/TableGen/Record.h"

Inheritance diagram for llvm::TypedInit:
[legend]

Public Member Functions

 TypedInit (const TypedInit &)=delete
TypedInitoperator= (const TypedInit &)=delete
const RecTygetType () const
 Get the type of the Init as a RecTy.
RecordKeepergetRecordKeeper () const
 Get the record keeper that initialized this Init.
const InitgetCastTo (const RecTy *Ty) const override
 If this value is convertible to type Ty, return a value whose type is Ty, generating a !cast operation if required.
const InitconvertInitializerTo (const RecTy *Ty) const override
 Convert to a value whose type is Ty, or return null if this is not possible.
const InitconvertInitializerBitRange (ArrayRef< unsigned > Bits) const override
 This function is used to implement the bit range selection operator.
const RecTygetFieldType (const StringInit *FieldName) const override
 This method is used to implement the FieldInit class.
Public Member Functions inherited from llvm::Init
InitKind getKind () const
 Get the kind (type) of the value.
RecordKeepergetRecordKeeper () const
 Get the record keeper that initialized this Init.
 Init (const Init &)=delete
Initoperator= (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 InitresolveReferences (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 InitgetBit (unsigned Bit) const =0
 Get the Init value of the specified bit.

Static Public Member Functions

static bool classof (const Init *I)

Protected Member Functions

 TypedInit (InitKind K, const RecTy *T, uint8_t Opc=0)
Protected Member Functions inherited from llvm::Init
 Init (InitKind K, uint8_t Opc=0)

Additional Inherited Members

Protected Types inherited from llvm::Init
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 Attributes inherited from llvm::Init
uint8_t Opc

Detailed Description

This is the common superclass of types that have a specific, explicit type, stored in ValueTy.

Definition at line 418 of file Record.h.

Constructor & Destructor Documentation

◆ TypedInit() [1/2]

llvm::TypedInit::TypedInit ( InitKind K,
const RecTy * T,
uint8_t Opc = 0 )
inlineexplicitprotected

Definition at line 422 of file Record.h.

References llvm::Init::Init(), llvm::Init::Opc, and T.

Referenced by llvm::VarBitInit::get(), operator=(), llvm::OpInit::OpInit(), and TypedInit().

◆ TypedInit() [2/2]

llvm::TypedInit::TypedInit ( const TypedInit & )
delete

References TypedInit().

Member Function Documentation

◆ classof()

bool llvm::TypedInit::classof ( const Init * I)
inlinestatic

◆ convertInitializerBitRange()

const Init * TypedInit::convertInitializerBitRange ( ArrayRef< unsigned > Bits) const
overridevirtual

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 from llvm::Init.

Definition at line 2343 of file Record.cpp.

References llvm::dyn_cast(), llvm::BitsInit::get(), llvm::VarBitInit::get(), getRecordKeeper(), getType(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::SmallVectorImpl< T >::reserve(), and T.

◆ convertInitializerTo()

const Init * TypedInit::convertInitializerTo ( const RecTy * Ty) const
overridevirtual

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.

Implements llvm::Init.

Definition at line 2331 of file Record.cpp.

References llvm::cast(), llvm::BitsInit::get(), getRecordKeeper(), getType(), llvm::Init::Init(), and llvm::isa().

Referenced by getCastTo().

◆ getCastTo()

const Init * TypedInit::getCastTo ( const RecTy * Ty) const
overridevirtual

If this value is convertible to type Ty, return a value whose type is Ty, generating a !cast operation if required.

Otherwise, return null.

Implements llvm::Init.

Definition at line 2359 of file Record.cpp.

References assert(), llvm::UnOpInit::CAST, llvm::cast(), convertInitializerTo(), llvm::UnOpInit::Fold(), llvm::UnOpInit::get(), getType(), llvm::Init::Init(), and llvm::isa().

◆ getFieldType()

const RecTy * TypedInit::getFieldType ( const StringInit * FieldName) const
overridevirtual

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 type record.

Reimplemented from llvm::Init.

Definition at line 2321 of file Record.cpp.

References llvm::dyn_cast(), and getType().

◆ getRecordKeeper()

◆ getType()

◆ operator=()

TypedInit & llvm::TypedInit::operator= ( const TypedInit & )
delete

References TypedInit().


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