MLIR 22.0.0git
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
StoragegetImpl () const
 Return the internal storage instance of this type.
TypeID getTypeID () const
 Return the TypeID instance of this type.
void print (raw_ostream &os) const
 Print this type to the given stream.
Type refineWith (Type other) const
 Try to refine this type with the one provided.

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.

Detailed Description

Definition at line 40 of file Types.h.

Constructor & Destructor Documentation

◆ Type()

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

Member Function Documentation

◆ getImpl()

◆ 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 85 of file Types.h.

Referenced by mlir::pdll::ast::TupleType::getElementNames(), mlir::pdll::ast::RangeType::getElementType(), mlir::pdll::ast::TupleType::getElementTypes(), mlir::pdll::ast::OperationType::getName(), and mlir::pdll::ast::OperationType::getODSOperation().

◆ getTypeID()

TypeID Type::getTypeID ( ) const

Return the TypeID instance of this type.

Definition at line 31 of file Types.cpp.

References getTypeID(), and Type().

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

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

References Type().

◆ operator==()

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

Definition at line 61 of file Types.h.

References Type().

◆ print()

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

Print this type to the given stream.

References Type().

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 refineWith(), and Type().

Referenced by refineWith().


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