LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Types | Protected Member Functions | List of all members
llvm::Init Class Referenceabstract

#include <Record.h>

Inheritance diagram for llvm::Init:
Inheritance graph
[legend]

Public Member Functions

InitKind getKind () const
 
virtual ~Init ()
 
virtual bool isComplete () const
 
void print (raw_ostream &OS) const
 print - Print out this value. More...
 
virtual std::string getAsString () const =0
 getAsString - Convert this value to a string form. More...
 
virtual std::string getAsUnquotedString () const
 
void dump () const
 
virtual InitconvertInitializerTo (RecTy *Ty) const =0
 
virtual InitconvertInitializerBitRange (const std::vector< unsigned > &Bits) const
 
virtual InitconvertInitListSlice (const std::vector< unsigned > &Elements) const
 
virtual RecTygetFieldType (const std::string &FieldName) const
 
virtual InitgetFieldInit (Record &R, const RecordVal *RV, const std::string &FieldName) const
 
virtual InitresolveReferences (Record &R, const RecordVal *RV) const
 
virtual InitgetBit (unsigned Bit) const =0
 
virtual InitgetBitVar () const
 
virtual unsigned getBitNum () const
 

Protected Types

enum  InitKind {
  IK_BitInit, IK_BitsInit, IK_FirstTypedInit, IK_DagInit,
  IK_DefInit, IK_FieldInit, IK_IntInit, IK_ListInit,
  IK_FirstOpInit, IK_BinOpInit, IK_TernOpInit, IK_UnOpInit,
  IK_LastOpInit, IK_StringInit, IK_VarInit, IK_VarListElementInit,
  IK_LastTypedInit, IK_UnsetInit, IK_VarBitInit
}
 Discriminator enum (for isa<>, dyn_cast<>, et al.) More...
 

Protected Member Functions

 Init (InitKind K)
 

Detailed Description

Definition at line 415 of file Record.h.

Member Enumeration Documentation

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

Enumerator
IK_BitInit 
IK_BitsInit 
IK_FirstTypedInit 
IK_DagInit 
IK_DefInit 
IK_FieldInit 
IK_IntInit 
IK_ListInit 
IK_FirstOpInit 
IK_BinOpInit 
IK_TernOpInit 
IK_UnOpInit 
IK_LastOpInit 
IK_StringInit 
IK_VarInit 
IK_VarListElementInit 
IK_LastTypedInit 
IK_UnsetInit 
IK_VarBitInit 

Definition at line 430 of file Record.h.

Constructor & Destructor Documentation

llvm::Init::Init ( InitKind  K)
inlineexplicitprotected

Definition at line 462 of file Record.h.

virtual llvm::Init::~Init ( )
inlinevirtual

Definition at line 465 of file Record.h.

Member Function Documentation

virtual Init* llvm::Init::convertInitializerBitRange ( const std::vector< unsigned > &  Bits) const
inlinevirtual

convertInitializerBitRange - 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.

Definition at line 498 of file Record.h.

virtual Init* llvm::Init::convertInitializerTo ( RecTy Ty) const
pure virtual
virtual Init* llvm::Init::convertInitListSlice ( const std::vector< unsigned > &  Elements) const
inlinevirtual

convertInitListSlice - 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.

Definition at line 508 of file Record.h.

void Init::dump ( ) const

dump - Debugging method that may be called through a debugger, just invokes print on stderr.

Definition at line 429 of file Record.cpp.

References llvm::errs(), and print().

virtual std::string llvm::Init::getAsString ( ) const
pure virtual
virtual std::string llvm::Init::getAsUnquotedString ( ) const
inlinevirtual

getAsUnquotedString - 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::StringInit.

Definition at line 480 of file Record.h.

References getAsString().

Referenced by llvm::VarInit::getNameInitAsString(), llvm::RecordVal::getNameInitAsString(), llvm::Record::getNameInitAsString(), llvm::Record::resolveReferencesTo(), and llvm::Record::setName().

virtual Init* llvm::Init::getBit ( unsigned  Bit) const
pure virtual
virtual unsigned llvm::Init::getBitNum ( ) const
inlinevirtual

getBitNum - This method is used to retrieve the bit number of a bit reference. For non-VarBitInit, it simply returns 0.

Reimplemented in llvm::VarBitInit.

Definition at line 546 of file Record.h.

Referenced by llvm::BitsInit::resolveReferences().

virtual Init* llvm::Init::getBitVar ( ) const
inlinevirtual

getBitVar - This method is used to retrieve the initializer for bit reference. For non-VarBitInit, it simply returns itself.

Reimplemented in llvm::VarBitInit.

Definition at line 542 of file Record.h.

Referenced by llvm::BitsInit::resolveReferences().

virtual Init* llvm::Init::getFieldInit ( Record R,
const RecordVal RV,
const std::string &  FieldName 
) const
inlinevirtual

getFieldInit - This method complements getFieldType to return the initializer for the specified field. If getFieldType returns non-null this method should return non-null, otherwise it returns null.

Reimplemented in llvm::DefInit, and llvm::VarInit.

Definition at line 522 of file Record.h.

Referenced by llvm::VarInit::getFieldInit(), llvm::FieldInit::resolveListElementReference(), and llvm::FieldInit::resolveReferences().

virtual RecTy* llvm::Init::getFieldType ( const std::string &  FieldName) const
inlinevirtual

getFieldType - 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, llvm::VarInit, and llvm::TypedInit.

Definition at line 516 of file Record.h.

InitKind llvm::Init::getKind ( ) const
inline
virtual bool llvm::Init::isComplete ( ) const
inlinevirtual

isComplete - This virtual method should be overridden by values that may not be completely specified yet.

Reimplemented in llvm::TernOpInit, llvm::BitsInit, and llvm::UnsetInit.

Definition at line 469 of file Record.h.

Referenced by llvm::BitsInit::allInComplete(), llvm::BitsInit::isComplete(), and llvm::FieldInit::resolveReferences().

void llvm::Init::print ( raw_ostream OS) const
inline

print - Print out this value.

Definition at line 472 of file Record.h.

References getAsString().

Referenced by dump(), and llvm::operator<<().

virtual Init* llvm::Init::resolveReferences ( Record R,
const RecordVal RV 
) const
inlinevirtual

resolveReferences - 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::VarListElementInit, llvm::VarBitInit, llvm::VarInit, llvm::TernOpInit, llvm::BinOpInit, llvm::UnOpInit, llvm::ListInit, and llvm::BitsInit.

Definition at line 532 of file Record.h.

Referenced by llvm::OpInit::resolveListElementReference(), llvm::BitsInit::resolveReferences(), llvm::ListInit::resolveReferences(), llvm::UnOpInit::resolveReferences(), llvm::BinOpInit::resolveReferences(), llvm::TernOpInit::resolveReferences(), llvm::VarBitInit::resolveReferences(), llvm::FieldInit::resolveReferences(), llvm::DagInit::resolveReferences(), and llvm::Record::resolveReferencesTo().


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