MLIR  18.0.0git
Classes | Public Member Functions | Protected Member Functions | List of all members
mlir::pdll::ast::Type Class Reference

#include "mlir/Tools/PDLL/AST/Types.h"

+ Inheritance diagram for mlir::pdll::ast::Type:

Classes

struct  Storage
 
class  TypeBase
 This class provides several utilities when defining derived type classes. More...
 

Public Member Functions

 Type (Storage *impl=nullptr)
 
bool operator== (const Type &other) const
 
bool operator!= (const Type &other) const
 
 operator bool () const
 
template<typename U >
bool isa () const
 Provide type casting support. More...
 
template<typename U , typename V , typename... Others>
bool isa () const
 
template<typename U >
dyn_cast () const
 
template<typename U >
dyn_cast_or_null () const
 
template<typename U >
cast () const
 
StoragegetImpl () const
 Return the internal storage instance of this type. More...
 
TypeID getTypeID () const
 Return the TypeID instance of this type. More...
 
void print (raw_ostream &os) const
 Print this type to the given stream. More...
 
Type refineWith (Type other) const
 Try to refine this type with the one provided. More...
 

Protected Member Functions

template<typename T >
const T * getImplAs () const
 Return the internal storage instance of this type reinterpreted as the given derived storage type. More...
 

Detailed Description

Definition at line 40 of file Types.h.

Constructor & Destructor Documentation

◆ Type()

mlir::pdll::ast::Type::Type ( Storage impl = nullptr)
inline

Definition at line 59 of file Types.h.

Member Function Documentation

◆ cast()

template<typename U >
U mlir::pdll::ast::Type::cast ( ) const
inline

◆ dyn_cast()

template<typename U >
U mlir::pdll::ast::Type::dyn_cast ( ) const
inline

◆ dyn_cast_or_null()

template<typename U >
U mlir::pdll::ast::Type::dyn_cast_or_null ( ) const
inline

Definition at line 80 of file Types.h.

◆ getImpl()

Storage* mlir::pdll::ast::Type::getImpl ( ) const
inline

Return the internal storage instance of this type.

Definition at line 90 of file Types.h.

Referenced by llvm::DenseMapInfo< mlir::pdll::ast::Type >::getHashValue(), and mlir::pdll::ast::hash_value().

◆ getImplAs()

template<typename T >
const T* mlir::pdll::ast::Type::getImplAs ( ) const
inlineprotected

Return the internal storage instance of this type reinterpreted as the given derived storage type.

Definition at line 109 of file Types.h.

◆ getTypeID()

TypeID Type::getTypeID ( ) const

Return the TypeID instance of this type.

Definition at line 31 of file Types.cpp.

Referenced by mlir::pdll::ast::Type::TypeBase< ImplT, BaseT >::classof().

◆ isa() [1/2]

template<typename U >
bool mlir::pdll::ast::Type::isa ( ) const
inline

Provide type casting support.

Definition at line 67 of file Types.h.

Referenced by mlir::pdll::ast::TypeRangeType::classof(), mlir::pdll::ast::ValueRangeType::classof(), and isa().

◆ isa() [2/2]

template<typename U , typename V , typename... Others>
bool mlir::pdll::ast::Type::isa ( ) const
inline

Definition at line 72 of file Types.h.

References isa().

◆ operator bool()

mlir::pdll::ast::Type::operator bool ( ) const
inlineexplicit

Definition at line 63 of file Types.h.

◆ operator!=()

bool mlir::pdll::ast::Type::operator!= ( const Type other) const
inline

Definition at line 62 of file Types.h.

◆ operator==()

bool mlir::pdll::ast::Type::operator== ( const Type other) const
inline

Definition at line 61 of file Types.h.

◆ print()

void mlir::pdll::ast::Type::print ( raw_ostream &  os) const

Print this type to the given stream.

Referenced by mlir::pdll::ast::operator<<().

◆ refineWith()

Type Type::refineWith ( Type  other) const

Try to refine this type with the one provided.

Given two compatible types, this will return a merged type contains as much detail from the two types. For example, if refining two operation types and one contains a name, while the other doesn't, the refined type contains the name. If the two types are incompatible, null is returned.

Definition at line 33 of file Types.cpp.

References dyn_cast().


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